From b87fd00a62994d24a3708cec5f5613ed2e9a67ed Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 30 May 2006 21:26:29 +0000 Subject: merge from 3.0 branch till 1111. --- .gitattributes | 2 ++ HISTORY | 5 ++- demos/blog/index.php | 5 +++ demos/blog/protected/Common/BlogDataModule.php | 15 ++++++++- demos/blog/protected/Common/schema.sql | 6 ++++ demos/blog/protected/Data/Settings.xml | 1 + demos/blog/protected/Layouts/MainLayout.tpl | 2 ++ demos/blog/protected/Pages/Admin/ConfigMan.page | 10 ++++++ demos/blog/protected/Pages/Admin/ConfigMan.php | 2 ++ demos/blog/protected/Pages/Posts/ListPost.page | 6 ++++ demos/blog/protected/Pages/Posts/ViewPost.page | 1 + demos/blog/protected/Pages/Posts/ViewPost.php | 2 +- demos/blog/protected/Portlets/CommentPortlet.php | 39 ++++++++++++++++++++++ demos/blog/protected/Portlets/CommentPortlet.tpl | 15 +++++++++ demos/blog/themes/Fall/style.css | 2 +- demos/blog/themes/Spring/style.css | 2 +- demos/blog/themes/Summer/style.css | 2 +- demos/blog/themes/Winter/style.css | 2 +- framework/Security/TUserManager.php | 24 +++++++++++++ framework/Web/UI/WebControls/TCheckBox.php | 15 ++++++--- framework/Web/UI/WebControls/TDataGrid.php | 4 +-- .../Web/UI/WebControls/TListControlValidator.php | 4 +-- framework/Web/UI/WebControls/TRadioButton.php | 5 ++- index.html | 3 +- 24 files changed, 157 insertions(+), 17 deletions(-) create mode 100644 demos/blog/protected/Portlets/CommentPortlet.php create mode 100644 demos/blog/protected/Portlets/CommentPortlet.tpl diff --git a/.gitattributes b/.gitattributes index d046e8ab..08cd6622 100644 --- a/.gitattributes +++ b/.gitattributes @@ -78,6 +78,8 @@ demos/blog/protected/Portlets/ArchivePortlet.php -text demos/blog/protected/Portlets/ArchivePortlet.tpl -text demos/blog/protected/Portlets/CategoryPortlet.php -text demos/blog/protected/Portlets/CategoryPortlet.tpl -text +demos/blog/protected/Portlets/CommentPortlet.php -text +demos/blog/protected/Portlets/CommentPortlet.tpl -text demos/blog/protected/Portlets/LoginPortlet.php -text demos/blog/protected/Portlets/LoginPortlet.tpl -text demos/blog/protected/Portlets/Portlet.php -text diff --git a/HISTORY b/HISTORY index be5af858..5f4fc7d0 100644 --- a/HISTORY +++ b/HISTORY @@ -7,7 +7,7 @@ NEW: TQueue (Qiang) NEW: TSessionPageStatePersister (Qiang) NEW: SQLMap (Wei) -Version 3.0.1 June 1, 2006 +Version 3.0.1 June 4, 2006 ========================== BUG: Ticket#28 - OnClick does not work with Safari/KHTML (Wei) BUG: Ticket#37 - Changes of config files do not trigger cache update (Qiang) @@ -17,8 +17,11 @@ BUG: Ticket#167 - TSecurityManager issues warning when trying to encrypt/decrypt BUG: Ticket#169 - Validation of subclass of THtmlArea/TDatePicker fails (Wei) BUG: Ticket#179 - CGI incompatibility causing clientscripts.php failure (Qiang) BUG: Ticket#181 - Unable to change Content-Type in response header if charset is not set (Qiang) +BUG: Ticket#200 - onClick javascript event triggered twice on CheckBox label (Qiang) ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang) ENH: Ticket#152 - constituent parts of TWizard are exposed (Qiang) +ENH: Ticket#184 - added TUserManager.Users and Roles properties (Qiang) +ENH: Ticket#197 - sanity check for datagrid header and footer (Qiang) ENH: added sanity check to calling event handlers (Qiang) ENH: added search for quickstart tutorials (Wei) ENH: added support to property tags for template owner control (Qiang) diff --git a/demos/blog/index.php b/demos/blog/index.php index 43c0b436..88f798db 100644 --- a/demos/blog/index.php +++ b/demos/blog/index.php @@ -4,11 +4,16 @@ $basePath=dirname(__FILE__); $frameworkPath=$basePath.'/../../framework/prado.php'; $assetsPath=$basePath.'/assets'; $runtimePath=$basePath.'/protected/runtime'; +$dataPath=$basePath.'/protected/Data'; if(!is_writable($assetsPath)) die("Please make sure that the directory $assetsPath is writable by Web server process."); if(!is_writable($runtimePath)) die("Please make sure that the directory $runtimePath is writable by Web server process."); +if(!is_writable($dataPath)) + die("Please make sure that the directory $dataPath is writable by Web server process."); +if(!extension_loaded("sqlite")) + die("SQLite PHP extension is required."); require_once($frameworkPath); diff --git a/demos/blog/protected/Common/BlogDataModule.php b/demos/blog/protected/Common/BlogDataModule.php index a15701ab..3dc71989 100644 --- a/demos/blog/protected/Common/BlogDataModule.php +++ b/demos/blog/protected/Common/BlogDataModule.php @@ -341,9 +341,22 @@ class BlogDataModule extends TModule return $commentRecord; } + public function queryComments($filter,$orderBy,$limit) + { + if($filter!=='') + $filter='WHERE '.$filter; + $sql="SELECT * FROM tblComments $filter $orderBy $limit"; + $result=$this->query($sql); + $rows=sqlite_fetch_all($result,SQLITE_ASSOC); + $comments=array(); + foreach($rows as $row) + $comments[]=$this->populateCommentRecord($row); + return $comments; + } + public function queryCommentsByPostID($id) { - $sql="SELECT * FROM tblComments WHERE post_id=$id"; + $sql="SELECT * FROM tblComments WHERE post_id=$id ORDER BY create_time DESC"; $result=$this->query($sql); $rows=sqlite_fetch_all($result,SQLITE_ASSOC); $comments=array(); diff --git a/demos/blog/protected/Common/schema.sql b/demos/blog/protected/Common/schema.sql index a93512df..9c111f0c 100644 --- a/demos/blog/protected/Common/schema.sql +++ b/demos/blog/protected/Common/schema.sql @@ -66,5 +66,11 @@ INSERT INTO tblPosts (id,author_id,create_time,title,content,status) INSERT INTO tblCategories (name,description,post_count) VALUES ('Miscellaneous','This category holds posts on any topic.',1); +INSERT INTO tblCategories (name,description,post_count) + VALUES ('PRADO','Topics related with the PRADO framework.',0); + +INSERT INTO tblCategories (name,description,post_count) + VALUES ('PHP','Topics related with PHP.',0); + INSERT INTO tblPost2Category (post_id,category_id) VALUES (1,1); diff --git a/demos/blog/protected/Data/Settings.xml b/demos/blog/protected/Data/Settings.xml index b097f22f..69f55370 100644 --- a/demos/blog/protected/Data/Settings.xml +++ b/demos/blog/protected/Data/Settings.xml @@ -7,6 +7,7 @@ + \ No newline at end of file diff --git a/demos/blog/protected/Layouts/MainLayout.tpl b/demos/blog/protected/Layouts/MainLayout.tpl index 87313f38..f3a77adc 100644 --- a/demos/blog/protected/Layouts/MainLayout.tpl +++ b/demos/blog/protected/Layouts/MainLayout.tpl @@ -34,6 +34,8 @@ + +