summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/controls
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/controls')
-rw-r--r--demos/quickstart/protected/controls/RunBar.php23
-rw-r--r--demos/quickstart/protected/controls/RunBar.tpl4
2 files changed, 27 insertions, 0 deletions
diff --git a/demos/quickstart/protected/controls/RunBar.php b/demos/quickstart/protected/controls/RunBar.php
new file mode 100644
index 00000000..0d20e0d4
--- /dev/null
+++ b/demos/quickstart/protected/controls/RunBar.php
@@ -0,0 +1,23 @@
+<?php
+
+class RunBar extends TTemplateControl
+{
+ public function getPagePath()
+ {
+ return $this->getViewState('PagePath','');
+ }
+
+ public function setPagePath($value)
+ {
+ $this->setViewState('PagePath',$value,'');
+ }
+
+ protected function onPreRender($param)
+ {
+ $pagePath=$this->getPagePath();
+ $this->RunButton->NavigateUrl="?page=$pagePath";
+ $this->ViewSourceButton->NavigateUrl="?page=ViewSource&path=/".strtr($pagePath,'.','/').'.page';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/quickstart/protected/controls/RunBar.tpl b/demos/quickstart/protected/controls/RunBar.tpl
new file mode 100644
index 00000000..14e57fc3
--- /dev/null
+++ b/demos/quickstart/protected/controls/RunBar.tpl
@@ -0,0 +1,4 @@
+<div class="runbar">
+<com:THyperLink ID="RunButton" Target="_blank" Text="Run Sample" />
+<com:THyperLink ID="ViewSourceButton" Target="_blank" Text="View Source" />
+</div> \ No newline at end of file