12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
13 */ |
13 */ |
14 |
14 |
15 class template |
15 class template |
16 { |
16 { |
17 var $tpl_strings, $tpl_bool, $vars_assign_history, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list, $named_theme_list, $default_theme, $default_style, $plugin_blocks, $namespace_string, $style_list, $theme_loaded, $initted_to_page_id, $initted_to_namespace; |
17 var $tpl_strings, $tpl_bool, $vars_assign_history, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list, $named_theme_list, $default_theme, $default_style, $plugin_blocks, $plugin_blocks_content, $namespace_string, $style_list, $theme_loaded, $initted_to_page_id, $initted_to_namespace; |
18 |
18 |
19 var $initted_to_theme = array( |
19 var $initted_to_theme = array( |
20 'theme' => false, |
20 'theme' => false, |
21 'style' => false |
21 'style' => false |
22 ); |
22 ); |
342 // Make sure we're allowed to use this theme. |
344 // Make sure we're allowed to use this theme. |
343 if ( ( |
345 if ( ( |
344 // If it was removed, it's probably blocked by an ACL, or it was uninstalled |
346 // If it was removed, it's probably blocked by an ACL, or it was uninstalled |
345 !isset($this->named_theme_list[$this->theme]) || |
347 !isset($this->named_theme_list[$this->theme]) || |
346 // Check if the theme is disabled |
348 // Check if the theme is disabled |
347 ( isset($this->named_theme_list[$this->theme]) && $this->named_theme_list[$this->theme]['enabled'] == 0 ) ) |
349 ( isset($this->named_theme_list[$this->theme]) && isset($this->named_theme_list[$this->theme]['enabled']) && $this->named_theme_list[$this->theme]['enabled'] == 0 ) ) |
348 // Above all, if it's a system theme, don't inhibit the loading process. |
350 // Above all, if it's a system theme, don't inhibit the loading process. |
349 && !in_array($this->theme, $this->system_themes) |
351 && !in_array($this->theme, $this->system_themes) |
350 ) |
352 ) |
351 { |
353 { |
352 // No, something is preventing it - fall back to site default |
354 // No, something is preventing it - fall back to site default |
1103 'TEXT'=>$lang->get('sidebar_btn_administration'), |
1105 'TEXT'=>$lang->get('sidebar_btn_administration'), |
1104 )); |
1106 )); |
1105 |
1107 |
1106 $admin_link = $parser->run(); |
1108 $admin_link = $parser->run(); |
1107 |
1109 |
|
1110 $parser->assign_vars(Array( |
|
1111 'HREF'=>makeUrlNS('Special', 'EditSidebar'), |
|
1112 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { void(ajaxLoginNavTo(\'Special\', \'EditSidebar\', ' . USER_LEVEL_ADMIN . ')); return false; }"', |
|
1113 'TEXT'=>$lang->get('sidebar_btn_editsidebar'), |
|
1114 )); |
|
1115 |
|
1116 $sidebar_link = $parser->run(); |
|
1117 |
1108 $SID = ($session->sid_super) ? $session->sid_super : ''; |
1118 $SID = ($session->sid_super) ? $session->sid_super : ''; |
1109 |
1119 |
1110 $urlname_clean = str_replace('\'', '\\\'', str_replace('\\', '\\\\', dirtify_page_id($local_fullpage))); |
1120 $urlname_clean = str_replace('\'', '\\\'', str_replace('\\', '\\\\', dirtify_page_id($local_fullpage))); |
1111 $urlname_clean = strtr( $urlname_clean, array( '<' => '<', '>' => '>' ) ); |
1121 $urlname_clean = strtr( $urlname_clean, array( '<' => '<', '>' => '>' ) ); |
1112 |
1122 |
1126 $js_dynamic = ' <script type="text/javascript">// <![CDATA[ |
1136 $js_dynamic = ' <script type="text/javascript">// <![CDATA[ |
1127 // This section defines some basic and very important variables that are used later in the static Javascript library. |
1137 // This section defines some basic and very important variables that are used later in the static Javascript library. |
1128 // SKIN DEVELOPERS: The template variable for this code block is {JS_DYNAMIC_VARS}. This MUST be inserted BEFORE the tag that links to the main Javascript lib. |
1138 // SKIN DEVELOPERS: The template variable for this code block is {JS_DYNAMIC_VARS}. This MUST be inserted BEFORE the tag that links to the main Javascript lib. |
1129 var title = \''. $urlname_jssafe .'\'; |
1139 var title = \''. $urlname_jssafe .'\'; |
1130 var physical_title = \'' . $physical_urlname_jssafe . '\'; |
1140 var physical_title = \'' . $physical_urlname_jssafe . '\'; |
|
1141 var on_main_page = ' . ( $local_page == get_main_page() ? 'true' : 'false' ) . '; |
|
1142 var main_page_members = \'' . addslashes(get_main_page(true)) . '\'; |
1131 var page_exists = '. ( ( $local_page_exists) ? 'true' : 'false' ) .'; |
1143 var page_exists = '. ( ( $local_page_exists) ? 'true' : 'false' ) .'; |
1132 var scriptPath = \'' . addslashes(scriptPath) . '\'; |
1144 var scriptPath = \'' . addslashes(scriptPath) . '\'; |
1133 var contentPath = \'' . addslashes(contentPath) . '\'; |
1145 var contentPath = \'' . addslashes(contentPath) . '\'; |
1134 var cdnPath = \'' . addslashes(cdnPath) . '\'; |
1146 var cdnPath = \'' . addslashes(cdnPath) . '\'; |
1135 var ENANO_SID = \'' . $SID . '\'; |
1147 var ENANO_SID = \'' . $SID . '\'; |
1171 $js_dynamic .= "namespace_list['{$k}'] = '$c';"; |
1183 $js_dynamic .= "namespace_list['{$k}'] = '$c';"; |
1172 } |
1184 } |
1173 $js_dynamic .= "\n //]]>\n </script>"; |
1185 $js_dynamic .= "\n //]]>\n </script>"; |
1174 |
1186 |
1175 $tpl_strings = Array( |
1187 $tpl_strings = Array( |
1176 'PAGE_NAME'=>htmlspecialchars($local_cdata['name']), |
1188 'PAGE_NAME' => htmlspecialchars($local_cdata['name']), |
1177 'PAGE_URLNAME'=> $urlname_clean, |
1189 'PAGE_URLNAME' => $urlname_clean, |
1178 'SITE_NAME'=>htmlspecialchars(getConfig('site_name')), |
1190 'SITE_NAME' => htmlspecialchars(getConfig('site_name')), |
1179 'USERNAME'=>$session->username, |
1191 'USERNAME' => $session->username, |
1180 'SITE_DESC'=>htmlspecialchars(getConfig('site_desc')), |
1192 'SITE_DESC' => htmlspecialchars(getConfig('site_desc')), |
1181 'TOOLBAR'=>$tb, |
1193 'TOOLBAR' => $tb, |
1182 'SCRIPTPATH'=>scriptPath, |
1194 'SCRIPTPATH' => scriptPath, |
1183 'CONTENTPATH'=>contentPath, |
1195 'CONTENTPATH' => contentPath, |
1184 'CDNPATH' => cdnPath, |
1196 'CDNPATH' => cdnPath, |
1185 'ADMIN_SID_QUES'=>$asq, |
1197 'ADMIN_SID_QUES' => $asq, |
1186 'ADMIN_SID_AMP'=>$asa, |
1198 'ADMIN_SID_AMP' => $asa, |
1187 'ADMIN_SID_AMP_HTML'=>$ash, |
1199 'ADMIN_SID_AMP_HTML' => $ash, |
1188 'ADMIN_SID_AUTO'=>$as2, |
1200 'ADMIN_SID_AUTO' => $as2, |
1189 'ADMIN_SID_RAW'=> ( is_string($session->sid_super) ? $session->sid_super : '' ), |
1201 'ADMIN_SID_RAW' => ( is_string($session->sid_super) ? $session->sid_super : '' ), |
1190 'COPYRIGHT'=>RenderMan::parse_internal_links(getConfig('copyright_notice')), |
1202 'COPYRIGHT' => RenderMan::parse_internal_links(getConfig('copyright_notice')), |
1191 'TOOLBAR_EXTRAS'=>$this->toolbar_menu, |
1203 'TOOLBAR_EXTRAS' => $this->toolbar_menu, |
1192 'REQUEST_URI'=>( defined('ENANO_CLI') ? '' : $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ), |
1204 'REQUEST_URI' => ( defined('ENANO_CLI') ? '' : $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ), |
1193 'STYLE_LINK'=>makeUrlNS('Special', 'CSS'.$p, null, true), //contentPath.$paths->nslist['Special'].'CSS' . $p, |
1205 'STYLE_LINK' => makeUrlNS('Special', 'CSS'.$p, null, true), //contentPath.$paths->nslist['Special'].'CSS' . $p, |
1194 'LOGIN_LINK'=>$login_link, |
1206 'LOGIN_LINK' => $login_link, |
1195 'LOGOUT_LINK'=>$logout_link, |
1207 'LOGOUT_LINK' => $logout_link, |
1196 'ADMIN_LINK'=>$admin_link, |
1208 'ADMIN_LINK' => $admin_link, |
1197 'THEME_LINK'=>$theme_link, |
1209 'THEME_LINK' => $theme_link, |
1198 'SEARCH_ACTION'=>makeUrlNS('Special', 'Search'), |
1210 'SIDEBAR_LINK' => $sidebar_link, |
1199 'INPUT_TITLE'=>( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->nslist[$local_namespace] . $local_page_id ) . '" />' : ''), |
1211 'SEARCH_ACTION' => makeUrlNS('Special', 'Search'), |
1200 'INPUT_AUTH'=>( $session->sid_super ? '<input type="hidden" name="auth" value="' . $session->sid_super . '" />' : ''), |
1212 'INPUT_TITLE' => ( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->nslist[$local_namespace] . $local_page_id ) . '" />' : ''), |
1201 'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme, |
1213 'INPUT_AUTH' => ( $session->sid_super ? '<input type="hidden" name="auth" value="' . $session->sid_super . '" />' : ''), |
1202 'THEME_ID'=>$this->theme, |
1214 'TEMPLATE_DIR' => scriptPath.'/themes/'.$this->theme, |
1203 'STYLE_ID'=>$this->style, |
1215 'THEME_ID' => $this->theme, |
1204 'MAIN_PAGE' => getConfig('main_page'), |
1216 'STYLE_ID' => $this->style, |
|
1217 'MAIN_PAGE' => get_main_page(), |
1205 'JS_HEADER' => $js_head, |
1218 'JS_HEADER' => $js_head, |
1206 'JS_FOOTER' => $js_foot, |
1219 'JS_FOOTER' => $js_foot, |
1207 'JS_DYNAMIC_VARS'=>$js_dynamic, |
1220 'JS_DYNAMIC_VARS' => $js_dynamic, |
1208 'UNREAD_PMS'=>$session->unread_pms, |
1221 'UNREAD_PMS' => $session->unread_pms, |
1209 'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true), |
1222 'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true), |
1210 'REPORT_URI' => makeUrl($local_fullpage, 'do=sql_report', true) |
1223 'REPORT_URI' => makeUrl($local_fullpage, 'do=sql_report', true) |
1211 ); |
1224 ); |
1212 |
1225 |
1213 foreach ( $paths->nslist as $ns_id => $ns_prefix ) |
1226 foreach ( $paths->nslist as $ns_id => $ns_prefix ) |