diff options
author | xue <> | 2006-05-12 12:38:32 +0000 |
---|---|---|
committer | xue <> | 2006-05-12 12:38:32 +0000 |
commit | e2149e3d8b87b382563a9def6f376a5f289754d3 (patch) | |
tree | fd24e9c28d023a483cc632683e6e998d2e11bfce /demos/quickstart | |
parent | d84327e69e858d369ea0c78f6106cfaa54994032 (diff) |
Merge from 3.0 branch till 1054.
Diffstat (limited to 'demos/quickstart')
12 files changed, 66 insertions, 15 deletions
diff --git a/demos/quickstart/protected/application.xml b/demos/quickstart/protected/application.xml index abac1088..fed0ec22 100644 --- a/demos/quickstart/protected/application.xml +++ b/demos/quickstart/protected/application.xml @@ -10,9 +10,12 @@ <route class="TFileLogRoute" />
</module>
-->
- <module id="search"
+ <module id="quickstart_search"
class="Application.index.ZendSearch"
- IndexDataDirectory="Application.index.data" />
+ IndexDataDirectory="Application.index.quickstart" />
+ <module id="api_search"
+ class="Application.index.ZendSearch"
+ IndexDataDirectory="Application.index.api" />
</modules>
<paths>
<using namespace="Application.controls.*" />
diff --git a/demos/quickstart/protected/index/ZendSearch.php b/demos/quickstart/protected/index/ZendSearch.php index 136004de..ec15729c 100644 --- a/demos/quickstart/protected/index/ZendSearch.php +++ b/demos/quickstart/protected/index/ZendSearch.php @@ -26,10 +26,13 @@ class ZendSearch extends TModule protected function importZendNamespace()
{
- $zendBase = !is_null($this->_ZF) ? $this->_ZF.'.*' : 'Application.index.*';
- $path = !is_null($this->_ZF) ? $this->_ZF.'.Zend.*' : 'Application.index.Zend.*';
- Prado::using($zendBase);
- Prado::setPathOfAlias('Zend', Prado::getPathOfNamespace($path));
+ if(is_null(Prado::getPathOfAlias('Zend')))
+ {
+ $zendBase = !is_null($this->_ZF) ? $this->_ZF.'.*' : 'Application.index.*';
+ $path = !is_null($this->_ZF) ? $this->_ZF.'.Zend.*' : 'Application.index.Zend.*';
+ Prado::using($zendBase);
+ Prado::setPathOfAlias('Zend', Prado::getPathOfNamespace($path));
+ }
}
protected function getZendSearch()
diff --git a/demos/quickstart/protected/index/api/_0.cfs b/demos/quickstart/protected/index/api/_0.cfs Binary files differnew file mode 100644 index 00000000..b5eb219b --- /dev/null +++ b/demos/quickstart/protected/index/api/_0.cfs diff --git a/demos/quickstart/protected/index/data/deletable b/demos/quickstart/protected/index/api/deletable Binary files differindex 593f4708..593f4708 100644 --- a/demos/quickstart/protected/index/data/deletable +++ b/demos/quickstart/protected/index/api/deletable diff --git a/demos/quickstart/protected/index/api/segments b/demos/quickstart/protected/index/api/segments Binary files differnew file mode 100644 index 00000000..da225127 --- /dev/null +++ b/demos/quickstart/protected/index/api/segments diff --git a/demos/quickstart/protected/index/data/_0.cfs b/demos/quickstart/protected/index/quickstart/_0.cfs Binary files differindex f3cb1bfb..f3cb1bfb 100644 --- a/demos/quickstart/protected/index/data/_0.cfs +++ b/demos/quickstart/protected/index/quickstart/_0.cfs diff --git a/demos/quickstart/protected/index/quickstart/deletable b/demos/quickstart/protected/index/quickstart/deletable Binary files differnew file mode 100644 index 00000000..593f4708 --- /dev/null +++ b/demos/quickstart/protected/index/quickstart/deletable diff --git a/demos/quickstart/protected/index/data/segments b/demos/quickstart/protected/index/quickstart/segments Binary files differindex 5509e664..5509e664 100644 --- a/demos/quickstart/protected/index/data/segments +++ b/demos/quickstart/protected/index/quickstart/segments diff --git a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php index 5bbf4ce2..fc912003 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php +++ b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php @@ -5,7 +5,7 @@ class LabeledTextBox extends TCompositeControl private $_label;
private $_textbox;
- protected function createChildControls()
+ public function createChildControls()
{
$this->_label=new TLabel;
$this->_label->setID('Label');
diff --git a/demos/quickstart/protected/pages/Search.page b/demos/quickstart/protected/pages/Search.page index d2aee66e..d3391222 100644 --- a/demos/quickstart/protected/pages/Search.page +++ b/demos/quickstart/protected/pages/Search.page @@ -3,10 +3,29 @@ <div class="search">
<com:SearchBox ID="search" />
</div>
- <com:TRepeater id="results">
+
+ <com:TRepeater id="api_results">
<prop:HeaderTemplate>
<div class="searchHeader">
- Found <%# $this->Parent->Data->Count %> results.
+ Found <%# $this->Parent->Data->Count %> classes in API documentation.
+ </div>
+ </prop:HeaderTemplate>
+ <prop:ItemTemplate>
+ <div class="searchAPIItem">
+ <div class="searchItemLink">
+ <%# $this->ItemIndex + 1 %>.
+ <a href="http://www.pradosoft.com/docs/manual/<%# $this->DataItem->link %>">
+ <%# $this->DataItem->title %>
+ </a>
+ </div>
+ </div>
+ </prop:ItemTemplate>
+ </com:TRepeater>
+
+ <com:TRepeater id="quickstart_results">
+ <prop:HeaderTemplate>
+ <div class="searchHeader">
+ Found <%# $this->Parent->Data->Count %> results in quickstart tutorial.
</div>
</prop:HeaderTemplate>
<prop:ItemTemplate>
@@ -20,9 +39,9 @@ <p class="searchItemBody"><%# $this->Page->HighlightSearch($this->DataItem->text) %></p>
</div>
</prop:ItemTemplate>
- <prop:EmptyTemplate>
- Unable to find "<%= htmlentities($this->Page->search->Text) %>".
- </prop:EmptyTemplate>
</com:TRepeater>
+ <com:TPanel id="emptyResult" CssClass="empty_search_result" Visible="false">
+ No results available for "<%= htmlentities($this->Page->search->Text) %>".
+ </com:TPanel>
</div>
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Search.php b/demos/quickstart/protected/pages/Search.php index c7bdce89..297d2f50 100644 --- a/demos/quickstart/protected/pages/Search.php +++ b/demos/quickstart/protected/pages/Search.php @@ -9,9 +9,17 @@ class Search extends TPage {
if(!$this->IsPostBack && strlen($text = $this->search->getText()) > 0)
{
- $search = $this->getApplication()->getModule("search");
- $this->results->setDataSource($search->find($text));
- $this->results->dataBind();
+ $quickstart = $this->getApplication()->getModule("quickstart_search");
+ $hits_1 = $quickstart->find($text);
+ $this->quickstart_results->setDataSource($hits_1);
+ $this->quickstart_results->dataBind();
+
+ $api = $this->getApplication()->getModule("api_search");
+ $hits_2 = $api->find($text);
+ $this->api_results->setDataSource($hits_2);
+ $this->api_results->dataBind();
+
+ $this->emptyResult->setVisible(count($hits_1)+count($hits_2) == 0);
}
}
diff --git a/demos/quickstart/themes/PradoSoft/style.css b/demos/quickstart/themes/PradoSoft/style.css index 38ef5375..3bf73c80 100644 --- a/demos/quickstart/themes/PradoSoft/style.css +++ b/demos/quickstart/themes/PradoSoft/style.css @@ -364,4 +364,22 @@ dd .searchterm
{
font-weight: bold;
+}
+
+.searchAPIItem
+{
+ margin-top: 5px;
+ margin-left: 20px;
+ margin-right: 20px;
+}
+
+.searchHeader, .emptyResult
+{
+ margin-top: 30px;
+}
+
+.empty_search_result
+{
+ text-align: center;
+ margin: 30px;
}
\ No newline at end of file |