diff options
author | wei <> | 2006-07-17 23:19:39 +0000 |
---|---|---|
committer | wei <> | 2006-07-17 23:19:39 +0000 |
commit | 319df8f534520c8c926d0cdaa1f5577c7bd8a909 (patch) | |
tree | 743a3a2e3e7092e0f474baf8592b3ba3824fc506 /demos/time-tracker/protected/pages/TimeTracker/SiteMap.php | |
parent | b230beea20bc18f05d51b8e1f76c99c74a12fff4 (diff) |
Update time-tracker application
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/SiteMap.php')
-rw-r--r-- | demos/time-tracker/protected/pages/TimeTracker/SiteMap.php | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php index 0b71eb68..1f452894 100644 --- a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php +++ b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php @@ -1,8 +1,57 @@ <?php
+/**
+ * SiteMap template class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: $ $17/07/2006: $
+ * @package Demos
+ */
+/**
+ * SiteMap menu is rendered depending on user roles.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @version $Revision: $ $17/07/2006: $
+ * @package Demos
+ * @since 3.1
+ */
class SiteMap extends TTemplateControl
{
-
+ /**
+ * Sets the active menu item using css class.
+ */
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+
+ $page = explode('.',$this->Request->ServiceParameter);
+ $active = null;
+ switch($page[count($page)-1])
+ {
+ case 'ProjectList':
+ case 'ProjectDetails':
+ $active = $this->ProjectMenu;
+ break;
+ case 'UserList':
+ case 'UserCreate':
+ $active = $this->AdminMenu;
+ break;
+ case 'ReportProject':
+ case 'ReportResource':
+ $active = $this->ReportMenu;
+ break;
+ case 'TimeEntry':
+ $active = $this->LogMenu;
+ break;
+ }
+
+ //add 'active' string to place holder body.
+ if(!is_null($active))
+ $active->Controls[] = 'active';
+ }
}
?>
\ No newline at end of file |