includes/template.php
changeset 1066 bead71f28f63
parent 1053 bdbb49cf6f1b
child 1068 4bcefa85649c
equal deleted inserted replaced
1065:18d013f98fd0 1066:bead71f28f63
  1220       var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . ';
  1220       var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . ';
  1221       var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . ';
  1221       var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . ';
  1222       var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . ';
  1222       var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . ';
  1223       var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . ';
  1223       var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . ';
  1224       var csrf_token = "' . $session->csrf_token . '";
  1224       var csrf_token = "' . $session->csrf_token . '";
  1225       var editNotice = \'' . $this->get_wiki_edit_notice() . '\';
       
  1226       var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server
  1225       var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server
  1227       var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\';
  1226       var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\';
  1228       var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $this->page_id .'&namespace=' . $this->namespace . '\';
  1227       var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $this->page_id .'&namespace=' . $this->namespace . '\';
  1229       var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\';
  1228       var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\';
  1230       var namespace_list = new Array();
  1229       var namespace_list = new Array();
  1231       var msg_loading_component = \'' . addslashes($lang->get('ajax_msg_loading_component')) . '\';
  1230       var msg_loading_component = \'' . addslashes($lang->get('ajax_msg_loading_component')) . '\';
  1232       var AES_BITS = '.AES_BITS.';
  1231       var AES_BITS = '.AES_BITS.';
  1233       var AES_BLOCKSIZE = '.AES_BLOCKSIZE.';
  1232       var AES_BLOCKSIZE = '.AES_BLOCKSIZE.';
  1234       var pagepass = \''. ( ( isset($_REQUEST['pagepass']) ) ? sha1($_REQUEST['pagepass']) : '' ) .'\';
  1233       var pagepass = \''. ( ( isset($_REQUEST['pagepass']) ) ? sha1($_REQUEST['pagepass']) : '' ) .'\';
  1235       var ENANO_LANG_ID = ' . $lang->lang_id . ';
  1234       var ENANO_LANG_ID = ' . $lang->lang_id . ';
  1236       var ENANO_PAGE_TYPE = "' . addslashes($this->namespace_string) . '";';
  1235       var ENANO_PAGE_TYPE = "' . addslashes($this->namespace_string) . '";
       
  1236       var editNotice = \'' . $this->get_wiki_edit_notice() . '\';';
  1237     
  1237     
  1238     foreach($paths->nslist as $k => $c)
  1238     foreach($paths->nslist as $k => $c)
  1239     {
  1239     {
  1240       $js_dynamic .= "namespace_list['{$k}'] = '$c';";
  1240       $js_dynamic .= "namespace_list['{$k}'] = '$c';";
  1241     }
  1241     }
  2619       return '';
  2619       return '';
  2620     
  2620     
  2621     if ( $cached = $cache->fetch('wiki_edit_notice') )
  2621     if ( $cached = $cache->fetch('wiki_edit_notice') )
  2622       return $cached;
  2622       return $cached;
  2623     
  2623     
  2624     $notice = str_replace("\n", "\\\n", addslashes(RenderMan::render(getConfig('wiki_edit_notice_text'))));
  2624     $notice = RenderMan::render(getConfig('wiki_edit_notice_text'));
       
  2625     $notice = trim($notice);
       
  2626     $notice = addslashes($notice);
       
  2627     $notice = str_replace("\n\n", "\n", $notice);
       
  2628     $notice = str_replace("\n", "\\\n", $notice);
  2625     $cache->store('wiki_edit_notice', $notice, 60);
  2629     $cache->store('wiki_edit_notice', $notice, 60);
  2626     return $notice;
  2630     return $notice;
  2627   }
  2631   }
  2628   
  2632   
  2629 } // class template
  2633 } // class template