diff options
| author | xue <> | 2006-05-09 12:11:38 +0000 | 
|---|---|---|
| committer | xue <> | 2006-05-09 12:11:38 +0000 | 
| commit | f4de82bcdafba51e4eed9cae6b2d3e5375ffd115 (patch) | |
| tree | 08f98e1763e87f0639961c6da33224082345c7c3 /demos/quickstart/protected/controls | |
| parent | 92dca3315f083f00dcff610ea207af52284d0616 (diff) | |
Diffstat (limited to 'demos/quickstart/protected/controls')
| -rw-r--r-- | demos/quickstart/protected/controls/Layout.tpl | 3 | ||||
| -rw-r--r-- | demos/quickstart/protected/controls/SearchBox.php | 41 | ||||
| -rw-r--r-- | demos/quickstart/protected/controls/SearchBox.tpl | 3 | ||||
| -rw-r--r-- | demos/quickstart/protected/controls/TopicList.tpl | 10 | 
4 files changed, 57 insertions, 0 deletions
| diff --git a/demos/quickstart/protected/controls/Layout.tpl b/demos/quickstart/protected/controls/Layout.tpl index a69d8f50..6fbd1380 100644 --- a/demos/quickstart/protected/controls/Layout.tpl +++ b/demos/quickstart/protected/controls/Layout.tpl @@ -14,6 +14,9 @@  </div>
  <com:TPanel ID="MainMenu" CssClass="mainmenu">
 +<div style="float:left; color:black; margin-top:-5px">
 +	<com:SearchBox />
 +</div>
  <a href="?">Home</a> |
  <a href="http://www.pradosoft.com">PradoSoft.com</a> |
  <a href="prado3_quick_start.pdf">PDF Version</a> |
 diff --git a/demos/quickstart/protected/controls/SearchBox.php b/demos/quickstart/protected/controls/SearchBox.php new file mode 100644 index 00000000..b579cd91 --- /dev/null +++ b/demos/quickstart/protected/controls/SearchBox.php @@ -0,0 +1,41 @@ +<?php
 +
 +class SearchBox extends TTemplateControl 
 +{
 +	public function getText() 
 +	{
 +        $this->ensureChildControls();
 +        return $this->getRegisteredObject('search')->getText();
 +    }
 +    
 +    public function getTextBox()
 +    {
 +        $this->ensureChildControls();
 +        return $this->getRegisteredObject('search');
 +    }
 +	
 +	public function getButton()
 +	{
 +		$this->ensureChildControls();
 +        return $this->getRegisteredObject('find');
 +	}
 +	
 +	public function onInit($param)
 +	{
 +		parent::onInit($param);
 +		if(strlen($q = $this->Page->Request['q']) > 0)
 +			$this->search->setText($q);
 +	}
 +
 +	public function doSearch($sender, $param)
 +	{
 +		if(strlen($query = $this->search->getText()) >0)
 +		{
 +			$ps = $this->getApplication()->getPageService();
 +			$page = $ps->constructUrl('Search', array('q' => $query));			
 +			$this->getApplication()->getResponse()->redirect($page);
 +		}
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/controls/SearchBox.tpl b/demos/quickstart/protected/controls/SearchBox.tpl new file mode 100644 index 00000000..b3339d19 --- /dev/null +++ b/demos/quickstart/protected/controls/SearchBox.tpl @@ -0,0 +1,3 @@ +<com:TLabel ForControl="search" Text="Search:" CssClass="searchLabel"/>
 +<com:TTextBox ID="search" OnTextChanged="doSearch"  CssClass="searchBox"/>
 +<com:TButton ID="find" Text="Find" OnClick="doSearch" CssClass="searchButton"/>
\ No newline at end of file diff --git a/demos/quickstart/protected/controls/TopicList.tpl b/demos/quickstart/protected/controls/TopicList.tpl index d2cde711..5ffc7098 100644 --- a/demos/quickstart/protected/controls/TopicList.tpl +++ b/demos/quickstart/protected/controls/TopicList.tpl @@ -78,4 +78,14 @@  </ul>
  </div>
 +<div class="topic">
 +<div>Client-side Scripting</div>
 +<ul>
 +    <li><a href="?page=Advanced.Scripts">Introduction to Javascript</a></li>
 +    <li><a href="?page=Advanced.Scripts1">Prototype Library Part I</a></li>
 +    <li><a href="?page=Advanced.Scripts2">Prototype Library Part II</a></li>
 +    <li><a href="?page=Advanced.Scripts3">Javascript Cookbook</a></li>
 +</ul>
 +</div>
 +
  </div>
\ No newline at end of file | 
