diff options
37 files changed, 527 insertions, 166 deletions
diff --git a/.gitattributes b/.gitattributes index 7602ad76..fd6a4424 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,9 @@ /UPGRADE -text /build.xml -text buildscripts/.htaccess -text +buildscripts/index/api_index.php -text +buildscripts/index/build.php -text +buildscripts/index/quickstart_index.php -text buildscripts/jsbuilder/JavaScript[!!-~]Documentation[!!-~]Tool.html -text buildscripts/jsbuilder/build.php -text buildscripts/jsbuilder/jsmin.php -text @@ -19,7 +22,7 @@ buildscripts/phing/tasks/ZendCodeAnalyzerTask.php -text buildscripts/phpbuilder/build.php -text buildscripts/setup.php -text buildscripts/texbuilder/build.php -text -buildscripts/texbuilder/create_index.php -text +buildscripts/texbuilder/pages.php -text buildscripts/texbuilder/prado3_quick_start.tex -text demos/composer/index.php -text demos/composer/index2.php -text @@ -112,9 +115,12 @@ demos/quickstart/protected/index/Zend/Search/Lucene/Storage/File.php -text demos/quickstart/protected/index/Zend/Search/Lucene/Storage/File/Filesystem.php -text demos/quickstart/protected/index/Zend/Search/TODO.txt -text demos/quickstart/protected/index/ZendSearch.php -text -demos/quickstart/protected/index/data/_0.cfs -text -demos/quickstart/protected/index/data/deletable -text -demos/quickstart/protected/index/data/segments -text +demos/quickstart/protected/index/api/_0.cfs -text +demos/quickstart/protected/index/api/deletable -text +demos/quickstart/protected/index/api/segments -text +demos/quickstart/protected/index/quickstart/_0.cfs -text +demos/quickstart/protected/index/quickstart/deletable -text +demos/quickstart/protected/index/quickstart/segments -text demos/quickstart/protected/pages/Advanced/Assets.page -text demos/quickstart/protected/pages/Advanced/Auth.page -text demos/quickstart/protected/pages/Advanced/Error.page -text @@ -1080,8 +1086,10 @@ framework/interfaces.php -text framework/prado.php -text /index.html -text requirements/index.php -text +requirements/messages-bg.txt -text requirements/messages-zh.txt -text requirements/messages.txt -text +requirements/template-bg.html -text requirements/template-zh.html -text requirements/template.html -text tests/FunctionalTests/PradoTester.php -text @@ -12,8 +12,9 @@ Version 3.0.1 June 1, 2006 ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang)
ENH: Ticket#152 - constituent parts of TWizard are exposed (Qiang)
ENH: added sanity check to calling event handlers (Qiang)
-ENH: Added search for quickstart tutorials (Wei)
+ENH: added search for quickstart tutorials (Wei)
ENH: added support to property tags for template owner control (Qiang)
+ENH: added Bulgarian requirement checker messages (StanProg)
CHG: Ticket#151 - URL format is modified to handle empty GET values (Qiang)
CHG: Ticket#153 - TAssetManager now ignores .svn directories (Qiang)
NEW: TTableHeaderRow, TTableFooterRow and table section support (Qiang)
diff --git a/buildscripts/index/api_index.php b/buildscripts/index/api_index.php new file mode 100644 index 00000000..ac2e37a7 --- /dev/null +++ b/buildscripts/index/api_index.php @@ -0,0 +1,120 @@ +<?php
+/*
+ * Created on 10/05/2006
+ */
+
+class api_index
+{
+ const API_URL = '';
+
+ private $_index;
+ private $_api;
+
+ public function __construct($index_file, $api)
+ {
+ $this->_api = $api;
+ $this->_index = new Zend_Search_Lucene($index_file, true);
+
+
+ }
+
+ function create_index()
+ {
+ echo "Building search index...\n";
+ $files = $this->get_file_list($this->_api);
+ $count = 0;
+ foreach($files as $file)
+ {
+ $content = $this->get_details($file, $this->_api);
+
+ $doc = new Zend_Search_Lucene_Document();
+
+ $title = $content['namespace'].'.'.$content['class'];
+
+ echo " Adding ".$title."\n";
+
+ //unsearchable text
+ $doc->addField(Zend_Search_Lucene_Field::UnIndexed('link', $content['link']));
+ $doc->addField(Zend_Search_Lucene_Field::UnIndexed('title', $title));
+ //$doc->addField(Zend_Search_Lucene_Field::UnIndexed('text', $content['content']));
+
+ //searchable
+ $body = strtolower($this->sanitize($content['content'])).' '.strtolower($title);
+ $doc->addField(Zend_Search_Lucene_Field::Keyword('page', strtolower(str_replace('.',' ',$title))));
+ $doc->addField(Zend_Search_Lucene_Field::Unstored('contents',$body));
+ $this->_index->addDocument($doc);
+ $count++;
+ }
+ $this->_index->commit();
+ echo "\n {$count} files indexed.\n";
+ }
+
+ function sanitize($input)
+ {
+ return htmlentities(strip_tags( $input ));
+ }
+
+
+ function get_file_list($path)
+ {
+
+ $d = dir($path);
+
+ $files = array();
+ while (false !== ($entry = $d->read()))
+ {
+ $filepath = $path.'/'.$entry;
+
+ if(is_dir($filepath) && is_int(strpos($entry, 'System')))
+ {
+ $files = array_merge($files, $this->get_files($filepath));
+ }
+ }
+
+ $d->close();
+ return $files;
+ }
+
+ function get_files($path)
+ {
+ $d = dir($path);
+
+ $files = array();
+ while (false !== ($entry = $d->read()))
+ {
+ $filepath = $path.'/'.$entry;
+ if(is_file($filepath) && $entry[0] !== '_')
+ $files[] = realpath($filepath);
+ }
+ return $files;
+ $d->close();
+ }
+
+ function get_doc_content($file)
+ {
+ $content = file_get_contents($file);
+ $html = preg_replace('/<h1>/','~~~', $content);
+ $html = preg_replace('/<![^~]+/m', '', $html);
+ $html = preg_replace('/<div class="credit">[\s\w\W\S]+/m', '', $html);
+ $html = preg_replace('/ |~+|\s{2,}/',' ',$html);
+ $html = preg_replace('/\s{2,}/',' ',$html);
+ $text = strip_tags($html);
+ $text = str_replace(' , ',', ',$text);
+ return $text;
+ }
+
+ function get_details($file, $base)
+ {
+ $result['content'] = $this->get_doc_content($file);
+ $find = array($base, '.html', '-');
+ $replace = array('', '', '.');
+ $path = preg_split('/\/|\\\/', str_replace($find, $replace, $file));
+ $result['namespace'] = $path[1];
+ $result['class'] = $path[2];
+ $result['link'] = self::API_URL.$path[1].'/'.$path[2].'.html';
+ return $result;
+ }
+}
+
+
+?>
\ No newline at end of file diff --git a/buildscripts/index/build.php b/buildscripts/index/build.php new file mode 100644 index 00000000..9ec0d659 --- /dev/null +++ b/buildscripts/index/build.php @@ -0,0 +1,65 @@ +<?php
+/*
+ * Created on 10/05/2006
+ */
+
+/**
+ * Building search index for quickstart tutorials and the API documentation.
+ */
+
+
+//quickstart source and the index data target directories.
+$quickstart_source = realpath(dirname(__FILE__).'/../texbuilder/pages.php');
+$quickstart_base = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/pages/');
+$quickstart_target = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index/quickstart/');
+
+//API source and the index data target directories.
+$api_source = realpath(dirname(__FILE__).'/../../build/docs/manual/');
+$api_target = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index/api/');
+
+//get the ZEND framework
+$zend_path = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index');
+set_include_path(get_include_path().';'.$zend_path);
+require_once ('Zend/Search/Lucene.php');
+
+//get the indexers.
+include('quickstart_index.php');
+include('API_index.php');
+
+if(isset($argv[1]))
+{
+ if(strtolower($argv[1]) == "quickstart")
+ {
+ $quickstart = new quickstart_index($quickstart_target, $quickstart_base, $quickstart_source);
+ $quickstart->create_index();
+ }
+ else if(strtolower($argv[1]) == "api")
+ {
+ $api = new api_index($api_target, $api_source);
+ $api->create_index();
+ }
+ else
+ {
+ $q = new Zend_Search_Lucene($quickstart_target);
+ $query = $argv[1];
+ $hits = $q->find(strtolower($query));
+ echo "Found ".count($hits)." for ".$query." in quick start\n";
+ foreach($hits as $hit)
+ echo " ".$hit->title."\n";
+
+ $a = new Zend_Search_Lucene($api_target);
+ $query = $argv[1];
+ $hits = $a->find(strtolower($query));
+ echo "\nFound ".count($hits)." for ".$query." in API\n";
+ foreach($hits as $hit)
+ {
+ echo " ".$hit->link."\n";
+ }
+ }
+}
+else
+{
+ echo "Usage: 'php build.php quickstart' or 'php build.php api'\n";
+}
+
+?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/create_index.php b/buildscripts/index/quickstart_index.php index b451473d..565734ef 100644 --- a/buildscripts/texbuilder/create_index.php +++ b/buildscripts/index/quickstart_index.php @@ -1,21 +1,40 @@ <?php
-// Create quickstart search index
-$zend_path = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index');
-set_include_path(get_include_path().';'.$zend_path);
-require_once ('Zend/Search/Lucene.php');
-
-
class quickstart_index
{
private $_index;
private $_dir;
- public function __construct($index_file)
+ private $_base;
+ private $_source;
+
+ public function __construct($index_file, $base, $source)
{
$this->_index = new Zend_Search_Lucene($index_file, true);
$this->_dir = $index_file;
+ $this->_base = $base;
+ $this->_source = $source;
+ }
+
+ public function create_index()
+ {
echo "Building search index...\n";
+ $pages = include($this->_source);
+ $count = 0;
+ foreach($pages as $chapter => $sections)
+ {
+ foreach($sections as $section)
+ {
+ echo " Adding $section\n";
+ $page = $this->_base.'/'.$section;
+ $file_content = file_get_contents($page);
+ $this->add($file_content,$section, filemtime($page));
+ $count++;
+ }
+ }
+
+ $this->_index->commit();
+ echo "\n {$count} files indexed.\n";
}
public function add($content, $section, $mtime)
diff --git a/buildscripts/texbuilder/build.php b/buildscripts/texbuilder/build.php index f0556e3f..cbea9859 100644 --- a/buildscripts/texbuilder/build.php +++ b/buildscripts/texbuilder/build.php @@ -10,102 +10,9 @@ $mainTexFile = dirname(__FILE__).'/prado3_quick_start.tex'; //page root location
$base = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/pages/');
-//search index data directory
-$index_dir = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index/data/');
-
-
-//list page into chapters
-$pages['Getting Started'] = array(
- 'GettingStarted/Introduction.page',
- 'GettingStarted/AboutPrado.page',
- 'GettingStarted/Installation.page',
- 'GettingStarted/HelloWorld.page',
- 'GettingStarted/Upgrading.page'
- );
-
-$pages['Fundamentals'] = array(
- 'Fundamentals/Architecture.page',
- 'Fundamentals/Components.page',
- 'Fundamentals/Controls.page',
- 'Fundamentals/Pages.page',
- 'Fundamentals/Modules.page',
- 'Fundamentals/Services.page',
- 'Fundamentals/Applications.page',
- 'Fundamentals/Hangman.page');
-
-$pages['Configurations'] = array(
- 'Configurations/Overview.page',
- 'Configurations/Templates1.page',
- 'Configurations/Templates2.page',
- 'Configurations/Templates3.page',
- 'Configurations/AppConfig.page',
- 'Configurations/PageConfig.page');
-
-$pages['Control Reference : Standard Controls'] = array(
- 'Controls/Button.page',
- 'Controls/CheckBox.page',
- 'Controls/ColorPicker.page',
- 'Controls/DatePicker.page',
- 'Controls/Expression.page',
- 'Controls/FileUpload.page',
- 'Controls/Head.page',
- 'Controls/HiddenField.page',
- 'Controls/HtmlArea.page',
- 'Controls/HyperLink.page',
- 'Controls/ImageButton.page',
- 'Controls/ImageMap.page',
- 'Controls/Image.page',
- 'Controls/InlineFrame.page',
- 'Controls/JavascriptLogger.page',
- 'Controls/Label.page',
- 'Controls/LinkButton.page',
- 'Controls/Literal.page',
- 'Controls/MultiView.page',
- 'Controls/Panel.page',
- 'Controls/PlaceHolder.page',
- 'Controls/RadioButton.page',
- 'Controls/SafeHtml.page',
- 'Controls/Statements.page',
- 'Controls/Table.page',
- 'Controls/TextBox.page',
- 'Controls/TextHighlighter.page',
- 'Controls/Wizard.page');
-
-$pages['Control Reference : List Controls'] = array(
- 'Controls/List.page');
-
-$pages['Control Reference : Validation Controls'] = array(
- 'Controls/Validation.page');
-
-$pages['Control Reference : Data Controls'] = array(
- 'Controls/Data.page',
- 'Controls/DataList.page',
- 'Controls/DataGrid.page',
- 'Controls/Repeater.page');
-
-$pages['Write New Controls'] = array(
- 'Controls/NewControl.page');
-
-$pages['Advanced Topics'] = array(
- 'Advanced/Auth.page',
- 'Advanced/Security.page',
- 'Advanced/Assets.page',
- 'Advanced/MasterContent.page',
- 'Advanced/Themes.page',
- 'Advanced/State.page',
- 'Advanced/Logging.page',
- 'Advanced/I18N.page',
- 'Advanced/Error.page',
- 'Advanced/Performance.page');
-
-$pages['Client-side Scripting'] = array(
- 'Advanced/Scripts.page',
- 'Advanced/Scripts1.page',
- 'Advanced/Scripts2.page',
- 'Advanced/Scripts3.page');
-
//-------------- END CONFIG ------------------
+$pages = include('pages.php');
function escape_verbatim($matches)
{
@@ -259,9 +166,9 @@ function parse_html($page,$html) $html = preg_replace('/<\/li>/', '', $html);
//headings
- $html = preg_replace('/<h1>([^<]+)<\/h1>/', '\section{$1}', $html);
- $html = preg_replace('/<h2>([^<]+)<\/h2>/', '\subsection{$1}', $html);
- $html = preg_replace('/<h3>([^<]+)<\/h3>/', '\subsubsection{$1}', $html);
+ $html = preg_replace('/<h1\s+id="[^"]+">([^<]+)<\/h1>/', '\section{$1}', $html);
+ $html = preg_replace('/<h2\s+id="[^"]+">([^<]+)<\/h2>/', '\subsection{$1}', $html);
+ $html = preg_replace('/<h3\s+id="[^"]+">([^<]+)<\/h3>/', '\subsubsection{$1}', $html);
@@ -318,8 +225,8 @@ $header_count = 0; //--------------- Indexer -------------------
-require_once('create_index.php');
-$indexer = new quickstart_index($index_dir);
+//require_once('create_index.php');
+//$indexer = new quickstart_index($index_dir);
// ---------------- Create the Tex files ---------
$count = 1;
@@ -339,14 +246,13 @@ foreach($pages as $chapter => $sections) $current_path = $page;
//add id to <h1>, <h2>, <3>
- $content = set_header_id(file_get_contents($page),$j++);
- file_put_contents($page, $content);
+ $tmp_content = set_header_id(file_get_contents($page),$j++);
+ file_put_contents($page, $tmp_content);
$content .= get_section_label($section);
$file_content = file_get_contents($page);
- $tex = parse_html($page,$file_content);
- $content .= $tex;
- $indexer->add($file_content,$section, filemtime($page));
+ $tex =
+ $content .= parse_html($page,$file_content);
}
//var_dump($content);
@@ -355,7 +261,7 @@ foreach($pages as $chapter => $sections) echo "\n";
}
-$indexer->commit();
+//$indexer->commit();
if($argc <= 1 && $count > 1)
{
diff --git a/buildscripts/texbuilder/pages.php b/buildscripts/texbuilder/pages.php new file mode 100644 index 00000000..c55747c6 --- /dev/null +++ b/buildscripts/texbuilder/pages.php @@ -0,0 +1,100 @@ +<?php
+/*
+ * Created on 11/05/2006
+ */
+
+//list page into chapters
+$pages['Getting Started'] = array(
+ 'GettingStarted/Introduction.page',
+ 'GettingStarted/AboutPrado.page',
+ 'GettingStarted/Installation.page',
+ 'GettingStarted/HelloWorld.page',
+ 'GettingStarted/Upgrading.page'
+ );
+
+$pages['Fundamentals'] = array(
+ 'Fundamentals/Architecture.page',
+ 'Fundamentals/Components.page',
+ 'Fundamentals/Controls.page',
+ 'Fundamentals/Pages.page',
+ 'Fundamentals/Modules.page',
+ 'Fundamentals/Services.page',
+ 'Fundamentals/Applications.page',
+ 'Fundamentals/Hangman.page');
+
+$pages['Configurations'] = array(
+ 'Configurations/Overview.page',
+ 'Configurations/Templates1.page',
+ 'Configurations/Templates2.page',
+ 'Configurations/Templates3.page',
+ 'Configurations/AppConfig.page',
+ 'Configurations/PageConfig.page');
+
+$pages['Control Reference : Standard Controls'] = array(
+ 'Controls/Button.page',
+ 'Controls/CheckBox.page',
+ 'Controls/ColorPicker.page',
+ 'Controls/DatePicker.page',
+ 'Controls/Expression.page',
+ 'Controls/FileUpload.page',
+ 'Controls/Head.page',
+ 'Controls/HiddenField.page',
+ 'Controls/HtmlArea.page',
+ 'Controls/HyperLink.page',
+ 'Controls/ImageButton.page',
+ 'Controls/ImageMap.page',
+ 'Controls/Image.page',
+ 'Controls/InlineFrame.page',
+ 'Controls/JavascriptLogger.page',
+ 'Controls/Label.page',
+ 'Controls/LinkButton.page',
+ 'Controls/Literal.page',
+ 'Controls/MultiView.page',
+ 'Controls/Panel.page',
+ 'Controls/PlaceHolder.page',
+ 'Controls/RadioButton.page',
+ 'Controls/SafeHtml.page',
+ 'Controls/Statements.page',
+ 'Controls/Table.page',
+ 'Controls/TextBox.page',
+ 'Controls/TextHighlighter.page',
+ 'Controls/Wizard.page');
+
+$pages['Control Reference : List Controls'] = array(
+ 'Controls/List.page');
+
+$pages['Control Reference : Validation Controls'] = array(
+ 'Controls/Validation.page');
+
+$pages['Control Reference : Data Controls'] = array(
+ 'Controls/Data.page',
+ 'Controls/DataList.page',
+ 'Controls/DataGrid.page',
+ 'Controls/Repeater.page');
+
+$pages['Write New Controls'] = array(
+ 'Controls/NewControl.page');
+
+$pages['Advanced Topics'] = array(
+ 'Advanced/Auth.page',
+ 'Advanced/Security.page',
+ 'Advanced/Assets.page',
+ 'Advanced/MasterContent.page',
+ 'Advanced/Themes.page',
+ 'Advanced/State.page',
+ 'Advanced/Logging.page',
+ 'Advanced/I18N.page',
+ 'Advanced/Error.page',
+ 'Advanced/Performance.page');
+
+$pages['Client-side Scripting'] = array(
+ 'Advanced/Scripts.page',
+ 'Advanced/Scripts1.page',
+ 'Advanced/Scripts2.page',
+ 'Advanced/Scripts3.page');
+
+
+return $pages;
+//-------------- END CONFIG ----------------
+
+?>
\ No newline at end of file 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 diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index effc3636..ebdbaaea 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -161,7 +161,7 @@ templatecontrol_mastercontrol_invalid = Master control must be of type TTemplate templatecontrol_contentid_duplicated = TContent ID '{0}' is duplicated.
templatecontrol_placeholderid_duplicated= TContentPlaceHolder ID '{0}' is duplicated.
templatecontrol_directive_invalid = {0}.{1} can only accept a static text string through a template directive.
-templatecontrol_placeholder_inexistent = TContent '{0}' does not have a matching TPlaceHolder.
+templatecontrol_placeholder_inexistent = TContent '{0}' does not have a matching TContentPlaceHolder.
page_form_duplicated = A page can contain at most one TForm. Use regular HTML form tags for the rest forms.
page_isvalid_unknown = TPage.IsValid has not been evaluated yet.
diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php index 3d550a62..7393d79a 100644 --- a/framework/I18N/TGlobalizationAutoDetect.php +++ b/framework/I18N/TGlobalizationAutoDetect.php @@ -1,15 +1,27 @@ <?php
+/**
+ * TMultiView and TView class file.
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
+ * @package System.I18N
+ */
+/**
+ * Import the HTTPNeogtiator
+ */
Prado::using('System.I18N.core.HTTPNegotiator');
/**
- * ${classname}
- *
- * ${description}
+ * TGlobalizationAutoDetect class will automatically try to resolve the default
+ * culture using the user browser language settings.
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
- * @package ${package}
+ * @package System.I18N
*/
class TGlobalizationAutoDetect extends TGlobalization
{
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php index fe2c45e6..299a8b16 100644 --- a/framework/I18N/core/CultureInfo.php +++ b/framework/I18N/core/CultureInfo.php @@ -161,7 +161,7 @@ class CultureInfo * Initializes a new instance of the CultureInfo class based on the
* culture specified by name. E.g. <code>new CultureInfo('en_AU');</cdoe>
* The culture indentifier must be of the form
- * "<language>_(country/region/variant)".
+ * "language_(country/region/variant)".
* @param string a culture name, e.g. "en_AU".
* @return return new CultureInfo.
*/
diff --git a/framework/I18N/core/MessageSource.php b/framework/I18N/core/MessageSource.php index d69a13d9..6563f8c9 100644 --- a/framework/I18N/core/MessageSource.php +++ b/framework/I18N/core/MessageSource.php @@ -121,7 +121,7 @@ abstract class MessageSource implements IMessageSource * @param string the location of the resource.
* @param string the filename of the custom message source.
* @return MessageSource a new message source of the specified type.
- * @throw InvalidMessageSourceTypeException
+ * @throws InvalidMessageSourceTypeException
*/
static function &factory($type, $source='.', $filename='')
{
diff --git a/framework/TComponent.php b/framework/TComponent.php index 64854692..5501f137 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -397,7 +397,7 @@ class TComponent * Evaluates a list of PHP statements.
* @param string PHP statements
* @return string content echoed or printed by the PHP statements
- * @throw TInvalidOperationException if the statements are invalid
+ * @throws TInvalidOperationException if the statements are invalid
*/
public function evaluateStatements($statements)
{
diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php index 09512a28..6af972e9 100644 --- a/framework/Util/TDataFieldAccessor.php +++ b/framework/Util/TDataFieldAccessor.php @@ -46,7 +46,7 @@ class TDataFieldAccessor * @param mixed data containing the field value, can be an array, TMap, TList or object.
* @param mixed field value
* @return mixed value at the specified field
- * @throw TInvalidDataValueException if field or data is invalid
+ * @throws TInvalidDataValueException if field or data is invalid
*/
public static function getDataFieldValue($data,$field)
{
diff --git a/framework/Web/Javascripts/TJSON.php b/framework/Web/Javascripts/TJSON.php index e653264b..63f77b40 100644 --- a/framework/Web/Javascripts/TJSON.php +++ b/framework/Web/Javascripts/TJSON.php @@ -45,7 +45,6 @@ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
-* @category
* @package System.Web.Javascripts
* @author Michal Migurski <mike-json@teczno.com>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php index f3ebe7c3..f9fe156f 100644 --- a/framework/Web/TAssetManager.php +++ b/framework/Web/TAssetManager.php @@ -111,7 +111,7 @@ class TAssetManager extends TModule throw new TInvalidOperationException('assetmanager_basepath_unchangeable');
else
{
- $this->_basePath=Prado::getPathOfAlias($value);
+ $this->_basePath=Prado::getPathOfNamespace($value);
if($this->_basePath===null || !is_dir($this->_basePath) || !is_writable($this->_basePath))
throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value);
}
@@ -148,7 +148,8 @@ class TAssetManager extends TModule * @param boolean If true, file modification time will be checked even if the application
* is in performance mode.
* @return string an absolute URL to the published directory
- * @throw TInvalidDataValueException if the file path to be published is invalid
+ * @throws TInvalidDataValueException if the file path to be published is
+ * invalid
*/
public function publishFilePath($path,$checkTimestamp=false)
{
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index ce4bf4b1..582a3db3 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -129,7 +129,7 @@ class THttpResponse extends TModule implements ITextWriter }
/**
- * @string content type, default is text/html
+ * @return string content type, default is text/html
*/
public function setContentType($type)
{
diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index fa53022d..13526dd1 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -45,14 +45,16 @@ * request module. It can be accessed via {@link TApplication::getSession()}.
*
* THttpSession may be configured in application configuration file as follows,
+ * <code>
* <module id="session" class="THttpSession" SessionName="SSID" SavePath="/tmp"
* CookieMode="Allow" UseCustomStorage="false" AutoStart="true" GCProbability="1"
* UseTransparentSessionID="true" TimeOut="3600" />
+ * </code>
* where {@link getSessionName SessionName}, {@link getSavePath SavePath},
- * {@link getCookieMode CookieMode}, {@link getUseCustomStorage UseCustomStorage},
- * {@link getAutoStart AutoStart}, {@link getGCProbability GCProbability},
- * {@link getUseTransparentSessionID UseTransparentSessionID} and
- * {@link getTimeOut TimeOut} are configurable properties of THttpSession.
+ * {@link getCookieMode CookieMode}, {@link getUseCustomStorage
+ * UseCustomStorage}, {@link getAutoStart AutoStart}, {@link getGCProbability
+ * GCProbability}, {@link getUseTransparentSessionID UseTransparentSessionID}
+ * and {@link getTimeOut TimeOut} are configurable properties of THttpSession.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 83032684..7ae36556 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -104,7 +104,7 @@ class TThemeManager extends TModule throw new TInvalidOperationException('thememanager_basepath_unchangeable');
else
{
- $this->_basePath=Prado::getPathOfAlias($value);
+ $this->_basePath=Prado::getPathOfNamespace($value);
if($this->_basePath===null || !is_dir($this->_basePath))
throw new TInvalidDataValueException('thememanager_basepath_invalid',$value);
}
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index c39db85a..ffdfd057 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -414,7 +414,8 @@ abstract class TBaseValidator extends TLabel implements IValidator /** * @return TControl control to be validated. Null if no control is found. - * @throw TConfigurationException if {@link getControlToValidate ControlToValidate} is empty or does not point to a valid control + * @throws TConfigurationException if {@link getControlToValidate + * ControlToValidate} is empty or does not point to a valid control */ protected function getValidationTarget() { diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php index 6dd0d8f1..59b9f53d 100644 --- a/framework/Web/UI/WebControls/TMultiView.php +++ b/framework/Web/UI/WebControls/TMultiView.php @@ -369,7 +369,7 @@ class TView extends TControl /**
* @param boolean
- * @throw TInvalidOperationException whenever this method is invoked.
+ * @throws TInvalidOperationException whenever this method is invoked.
*/
public function setVisible($value)
{
diff --git a/requirements/index.php b/requirements/index.php index b28339b0..5c63912b 100644 --- a/requirements/index.php +++ b/requirements/index.php @@ -33,12 +33,12 @@ $requirements = array( array(true,'version_compare(PHP_VERSION,"5.0.4",">=")','PHP version check','PHP 5.0.4 or higher required'),
array(false,'version_compare(PHP_VERSION,"5.1.0",">=")','PHP version check','PHP 5.1.0 or higher preferred'),
array(true,'class_exists("DOMDocument",false)','DOM extension check','DOM extension required'),
- array(false,'function_exists("iconv")','ICONV function check','ICONV extension optional'),
- array(false,'extension_loaded("zlib")','Zlib check','Zlib extension optional'),
- array(false,'extension_loaded("sqlite")','SQLite check','SQLite extension optional'),
- array(false,'extension_loaded("memcache")','Memcache check','Memcache extension optional'),
- array(false,'extension_loaded("apc")','APC cache check','APC extension optional'),
- array(false,'extension_loaded("mcrypt")','Mcrypt check','Mcrypt extension optional'),
+ array(false,'function_exists("iconv")','ICONV extension check','ICONV extension optional'),
+ array(false,'extension_loaded("zlib")','Zlib extension check','Zlib extension optional'),
+ array(false,'extension_loaded("sqlite")','SQLite extension check','SQLite extension optional'),
+ array(false,'extension_loaded("memcache")','Memcache extension check','Memcache extension optional'),
+ array(false,'extension_loaded("apc")','APC extension check','APC extension optional'),
+ array(false,'extension_loaded("mcrypt")','Mcrypt extension check','Mcrypt extension optional'),
);
$results = "<table class=\"result\">\n";
diff --git a/requirements/messages-bg.txt b/requirements/messages-bg.txt new file mode 100644 index 00000000..62387ee8 --- /dev/null +++ b/requirements/messages-bg.txt @@ -0,0 +1,20 @@ +all passed = Поздравления! Конфигурацията на вашия сървър удовлетворява всички изисквания на PRADO.
+passed with warnings = Конфигурацията на вашия сървър удовлетворява минималните изисквания на PRADO. Моля, обърнете внимание на предупрежденията по-долу.
+failed = За съжаление, вашият сървър не удовлетворява изискванията на PRADO.
+PHP version check = Проверка за версията на PHP
+PHP 5.0.4 or higher required = Изисква се PHP 5.0.4 или по-висока версия.
+PHP 5.1.0 or higher preferred = Препоръчва се PHP 5.1.0 или по-висока версия. Това ще предотврати грешката предизвикана от рекурсивните __get/__set извиквания.
+SQLite extension check = Проверка за SQLite
+SQLite extension optional = SQLite разширението е незадължително. Ако не е заредено, няма да можете да ползвате TSqliteCache.
+Memcache extension check = Проверка за Memcache
+Memcache extension optional = Memcache разширението е незадължително. Ако не е заредено, няма да можете да ползвате TMemCache.
+APC extension check = Проверка за APC cache
+APC extension optional = APC разширението е незадължително. Ако не е заредено, няма да можете да ползвате TAPCCache.
+Zlib extension check = Проверка за Zlib
+Zlib extension optional = Zlib разширението е незадължително. Ако не е заредено, състоянието на страницата няма да бъде компресирано и размера на страницата може да се увеличи.
+DOM extension check = Проверка за DOM разширението
+DOM extension required = DOM разширението е задължително за PRADO. Използва се в TXmlDocument за анализ на XML-базирани конфигурации.
+ICONV extension check = Проверка за ICONV функцията
+ICONV extension optional = ICONV разширението е незадължително. Ако не е заредено, е възможно някои компоненти свързани с интернационализацията да не работят коректно.
+Mcrypt extension check = Проверка за Mcrypt
+Mcrypt extension optional = Mcrypt разширението е незадължително. Ако не е заредено, чувствителни данни като viewstate, няма да могат да бъдат криптирани.
\ No newline at end of file diff --git a/requirements/messages-zh.txt b/requirements/messages-zh.txt index 4b3f4acc..3527a1ce 100644 --- a/requirements/messages-zh.txt +++ b/requirements/messages-zh.txt @@ -4,14 +4,17 @@ failed = 对不起,您的服务器配置不符合PRADO的要求。 PHP version check = PHP版本检查
PHP 5.0.4 or higher required = PRADO需要PHP 5.0.4或更高版本。
PHP 5.1.0 or higher preferred = PRADO推荐使用PHP 5.1.0或更高版本。它将避免由于递归调用__get/__call引起的错误。
-SQLite check = SQLite模块检查
+SQLite extension check = SQLite模块检查
SQLite extension optional = SQLite模块是可选的。如果它不存在,您将无法使用TSQLiteCache。
-Memcache check = Memcache模块检查
+Memcache extension check = Memcache模块检查
Memcache extension optional = Memcache模块是可选的。如果它不存在,您将无法使用TMemCache。
-APC cache check = APC缓存模块检查
+APC extension check = APC缓存模块检查
APC extension optional = APC模块是可选的。如果它不存在,您将无法使用TAPCCache。
-Zlib check = Zlib模块检查
+Zlib extension check = Zlib模块检查
Zlib extension optional = Zlib模块是可选的。如果它不存在,页面的状态信息将无法压缩,由此可能导致您的页面传送数据量增大。
+DOM extension check = DOM模块检查
DOM extension required = DOM模块是必须的。如果它不存在,基于XML的各种配置文件将无法解析。
+ICONV extension check = ICONV模块检查
ICONV extension optional = ICONV模块是可选的。如果它不存在,某些国际化控件将无法正常工作。
+Mcrypt extension check = Mcrypt模块检查
Mcrypt extension optional = Mcrypt模块是可选的。如果它不存在,某些敏感数据,例如viewstate,将无法被加密。
\ No newline at end of file diff --git a/requirements/messages.txt b/requirements/messages.txt index 7abc3dbe..029806dc 100644 --- a/requirements/messages.txt +++ b/requirements/messages.txt @@ -4,14 +4,17 @@ failed = Sorry, your server configuration does not satisfy the requiremen PHP version check = PHP version check
PHP 5.0.4 or higher required = PHP version 5.0.4 or higher is required by PRADO.
PHP 5.1.0 or higher preferred = PHP version 5.1.0 or higher is preferred by PRADO. It eliminates the error caused by recursive __get/__set calls.
-SQLite check = SQLite check
+SQLite extension check = SQLite extension check
SQLite extension optional = SQLite extension is optional. If it is absent, you will not be able to use TSqliteCache.
-Memcache check = Memcache check
+Memcache extension check = Memcache extension check
Memcache extension optional = Memcache extension is optional. If it is absent, you will not be able to use TMemCache.
-APC cache check = APC cache check
+APC extension check = APC extension check
APC extension optional = APC extension is optional. If it is absent, you will not be able to use TAPCCache.
-Zlib check = Zlib check
+Zlib extension check = Zlib extension check
Zlib extension optional = Zlib extension is optional. If it is absent, page state will not be compressed and your page size may increase.
+DOM extension check = DOM extension check
DOM extension required = DOM extension is required by PRADO. It is used in TXmlDocument to parse all sorts of XML-based configurations.
+ICONV extension check = ICONV extension check
ICONV extension optional = ICONV extension is optional. If it is absent, some internationalization components may not work properly.
+Mcrypt extension check = Mcrypt extension check
Mcrypt extension optional = Mcrypt extension is optional. If it is absent, sensitive data, such as viewstate, cannot be encrypted.
\ No newline at end of file diff --git a/requirements/template-bg.html b/requirements/template-bg.html new file mode 100644 index 00000000..b6ac5889 --- /dev/null +++ b/requirements/template-bg.html @@ -0,0 +1,50 @@ +<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset="utf-8"/>
+<meta http-equiv="content-language" content="bg"/>
+<title>Проверка за изискванията на PRADO</title>
+<style>
+body {font-family:"Verdana";font-weight:normal;color:black;}
+h1 { font-family:"Verdana";font-weight:normal;font-size:18pt; }
+h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
+p, td {font-family:"Verdana";font-weight:normal;font-size:10pt;}
+table.result {border-collapse: collapse; width: 100%; font-size: 10pt; font-family:"Verdana";}
+td.passed {background-color: #60BF60;border: 1px solid silver; padding: 2px;}
+td.warning {background-color: #FFFFBF;border: 1px solid silver; padding: 2px;}
+td.error {background-color: #FF8080;border: 1px solid silver; padding: 2px;}
+.version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
+</style>
+</head>
+
+<body bgcolor="white">
+<h1>Проверка за изискванията на PRADO</h1>
+<h3>Описание</h3>
+<p>
+Този скрипт проверява дали конфигурацията на вашият сървър отговаря на изискванията
+за приложения базирани на <a href="http://www.pradosoft.com/">PRADO</a>.
+Проверява дали на сървъра е инсталирана подходяща версия на PHP,
+дали са заредени нужните разширения на PHP и дали има направени необходимите
+настройки в php.ini.
+</p>
+<h3>Заключение</h3>
+<p>
+%%Conclusion%%
+</p>
+<h3>Детайли</h3>
+</p>
+%%Details%%
+</p>
+<p>
+<table>
+<tr>
+<td class="passed"> </td><td>успешна</td>
+<td class="error"> </td><td>неуспешна</td>
+<td class="warning"> </td><td>предупреждение</td>
+</tr>
+</table>
+</p>
+<div class="version">
+%%Time%% %%Version%%
+</div>
+</body>
+</html>
\ No newline at end of file |