コード例 #1
0
ファイル: Layout.php プロジェクト: sysulsj/phpwebsite
 /**
  * Inserts the content data into the current theme
  */
 public static function loadTheme($theme, $template)
 {
     $tpl = new PHPWS_Template();
     $tpl->setRoot(PHPWS_SOURCE_DIR);
     $themeDir = Layout::getThemeDir();
     if (PHPWS_Error::isError($themeDir)) {
         PHPWS_Error::log($themeDir);
         PHPWS_Core::errorPage();
     }
     $result = $tpl->setFile($themeDir . 'theme.tpl', TRUE);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     if (!empty($GLOBALS['Layout_Collapse'])) {
         $template['COLLAPSE'] = 'id="layout-collapse"';
     }
     $template['THEME_DIRECTORY'] = Layout::getThemeDirRoot() . $theme . '/';
     $template['THEME_HTTP'] = Layout::getThemeHttpRoot() . $theme . '/';
     $template['SOURCE_THEME_HTTP'] = PHPWS_SOURCE_HTTP . 'themes/';
     $template['SOURCE_THEME_DIR'] = PHPWS_SOURCE_DIR . 'themes/';
     $tpl->setData($template);
     return $tpl;
 }