1210 $physical_urlname_jssafe = sanitize_page_id($paths->fullpage); |
1210 $physical_urlname_jssafe = sanitize_page_id($paths->fullpage); |
1211 |
1211 |
1212 $protected = is_object($this->page) ? $this->page->ns->cdata['really_protected'] : false; |
1212 $protected = is_object($this->page) ? $this->page->ns->cdata['really_protected'] : false; |
1213 |
1213 |
1214 // Generate the dynamic javascript vars |
1214 // Generate the dynamic javascript vars |
|
1215 // Sorry. I know. This block is a mess. |
1215 $js_dynamic = ' <script type="text/javascript">// <![CDATA[ |
1216 $js_dynamic = ' <script type="text/javascript">// <![CDATA[ |
1216 // This section defines some basic and very important variables that are used later in the static Javascript library. |
1217 // This section defines some basic and very important variables that are used later in the static Javascript library. |
1217 // 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. |
1218 // 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. |
1218 var title = \''. $urlname_jssafe .'\'; |
1219 var title = \''. $urlname_jssafe .'\'; |
1219 var physical_title = \'' . $physical_urlname_jssafe . '\'; |
1220 var physical_title = \'' . $physical_urlname_jssafe . '\'; |
1232 var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . '; |
1233 var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . '; |
1233 var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . '; |
1234 var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . '; |
1234 var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . '; |
1235 var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . '; |
1235 var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . '; |
1236 var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . '; |
1236 var csrf_token = "' . $session->csrf_token . '"; |
1237 var csrf_token = "' . $session->csrf_token . '"; |
1237 var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server |
1238 var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; |
1238 var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\'; |
1239 var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\'; |
1239 var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $this->page_id .'&namespace=' . $this->namespace . '\'; |
1240 var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $this->page_id .'&namespace=' . $this->namespace . '\'; |
1240 var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\'; |
1241 var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\'; |
1241 var namespace_list = new Array(); |
1242 var namespace_list = []; |
1242 var msg_loading_component = \'' . addslashes($lang->get('ajax_msg_loading_component')) . '\'; |
1243 var msg_loading_component = \'' . addslashes($lang->get('ajax_msg_loading_component')) . '\'; |
1243 var AES_BITS = '.AES_BITS.'; |
1244 var AES_BITS = '.AES_BITS.'; |
1244 var AES_BLOCKSIZE = '.AES_BLOCKSIZE.'; |
1245 var AES_BLOCKSIZE = '.AES_BLOCKSIZE.'; |
1245 var pagepass = \''. ( ( isset($_REQUEST['pagepass']) ) ? sha1($_REQUEST['pagepass']) : '' ) .'\'; |
1246 var pagepass = \''. ( ( isset($_REQUEST['pagepass']) ) ? sha1($_REQUEST['pagepass']) : '' ) .'\'; |
1246 var ENANO_LANG_ID = ' . $lang->lang_id . '; |
1247 var ENANO_LANG_ID = ' . $lang->lang_id . '; |
1247 var ENANO_PAGE_TYPE = "' . addslashes($this->namespace_string) . '";'; |
1248 var ENANO_PAGE_TYPE = "' . addslashes($this->namespace_string) . '";'; |
1248 |
1249 |
1249 foreach($paths->nslist as $k => $c) |
1250 foreach ( $paths->nslist as $k => $c ) |
1250 { |
1251 { |
1251 $js_dynamic .= "namespace_list['{$k}'] = '$c';"; |
1252 $js_dynamic .= "namespace_list['{$k}'] = '" . addslashes($c) . "';"; |
1252 } |
1253 } |
1253 $js_dynamic .= "\n //]]>\n </script>"; |
1254 $js_dynamic .= "\n //]]>\n </script>"; |
1254 |
1255 |
1255 $this->assign_vars(array( |
1256 $this->assign_vars(array( |
1256 'JS_DYNAMIC_VARS' => $js_dynamic, |
1257 'JS_DYNAMIC_VARS' => $js_dynamic, |