Guest User

cp_skin_global.php

a guest
May 11th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.87 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * <pre>
  5. * Invision Power Services
  6. * IP.Board v3.4.2
  7. * Admin CP global skin templates
  8. * Last Updated: $Date: 2012-12-26 17:58:56 -0500 (Wed, 26 Dec 2012) $
  9. * </pre>
  10. *
  11. * @author $Author: AndyMillne $
  12. * @copyright (c) 2001 - 2009 Invision Power Services, Inc.
  13. * @license http://www.invisionpower.com/company/standards.php#license
  14. * @package IP.Board
  15. * @link http://www.invisionpower.com
  16. * @version $Rev: 11754 $
  17. * @since 3.0.0
  18. *
  19. */
  20.  
  21. class cp_skin_global extends output
  22. {
  23.  
  24. /**
  25. * Prevent our main destructor being called by this class
  26. *
  27. * @access public
  28. * @return @e void
  29. */
  30. public function __destruct()
  31. {
  32. }
  33.  
  34. /**
  35. * Redirector page
  36. *
  37. * @param string $url URL to send to
  38. * @param string $text Text to display
  39. * @return @e string
  40. */
  41. public function temporaryRedirect( $url, $text, $time=2 )
  42. {
  43.  
  44. $time = floatval( $time ) * 1000;
  45.  
  46. $IPBHTML = "";
  47. //--starthtml--//
  48.  
  49. $url = str_replace( '&amp;', '&', $url );
  50.  
  51. $IPBHTML .= <<<EOF
  52. <div class='information-box'>{$text}</div>
  53. <script type='text/javascript'>
  54. jQ(document).ready(function() {
  55. setTimeout( "window.location = '{$url}';", {$time} );
  56. });
  57. </script>
  58. EOF;
  59.  
  60. //--endhtml--//
  61. return $IPBHTML;
  62. }
  63.  
  64. /**
  65. * manageBookmarks
  66. *
  67. * @param array Bookmarks
  68. * @return @e string
  69. */
  70. public function manageBookmarks( $bookmarks )
  71. {
  72.  
  73. $IPBHTML = "";
  74. //--starthtml--//
  75.  
  76. $IPBHTML .= <<<EOF
  77. <h3>{$this->lang->words['bookmarks_title']}</h3>
  78. <div class='ipsPad fixed_inner'>
  79. <div class='right desctext'>{$this->lang->words['bookmarks_make_home']}</div>
  80. <br />
  81. <ul id='sortable'>
  82. EOF;
  83.  
  84. foreach( $bookmarks as $id => $data )
  85. {
  86. $url = IPSText::truncate( $data['bookmark_url'], 42 );
  87. $sel = ( $data['bookmark_home'] ) ? ' checked="checked" ' : '';
  88. $pos = intval( $data['bookmark_pos'] );
  89.  
  90. $IPBHTML .= <<<EOF
  91. <li data-rowid='{$id}' id='bookmark_{$id}'>
  92. <span class="draghandle"></span>
  93. <div class='right'>
  94. <input type='checkbox' data-cboxid='{$id}' name='bookmarkHome[{$id}]' value='{$id}' {$sel}>
  95. &nbsp; <img src="{$this->settings['skin_acp_url']}/images/aff_cross.png" data-deleteid="{$id}" class='clickable' />
  96. </div>
  97. <input type='text' class='input_text' size='60' data-inputname="{$id}" name='bookmarkName[{$id}]' value='{$data['bookmark_title']}' />
  98. <span class='desctext'><a href="{$this->settings['_base_url']}&amp;{$data['bookmark_url']}" target="_blank">{$url}</a></span>
  99. </li>
  100. EOF;
  101. }
  102.  
  103. $IPBHTML .= <<<EOF
  104. </ul>
  105. <div class='ipsPad'><input type='button' id='saveBookmarksManage' class='realbutton right' value='{$this->lang->words['bookmarks_save']}' /></div>
  106. </div>
  107. <script type="text/javascript">
  108. (function($){
  109. $("#sortable").sortable();
  110. }(jQuery));
  111. </script>
  112. EOF;
  113.  
  114. //--endhtml--//
  115. return $IPBHTML;
  116. }
  117.  
  118. //===========================================================================
  119. // <ips:ips_editor:desc::trigger:>
  120. //===========================================================================
  121. function editor($formField='post', $content='', $options=array(), $autoSaveData=array() ) {
  122. $IPBHTML = "";
  123. //--starthtml--//
  124.  
  125. $options['type'] = ( $options['type'] ) ? $options['type'] : "''";
  126. $options['minimize'] = intval( $options['minimize'] );
  127. $options['smilies'] = IPSText::jsonEncodeForTemplate( is_array($options['smilies']) ? $options['smilies'] : array() );
  128. $options['noSmilies'] = intval( $options['noSmilies'] );
  129. $bbcode = IPSLib::fetchBbcodeAsJson();
  130.  
  131. $defaultSkin = $this->registry->output->_fetchSkinByDefault();
  132.  
  133. if ( ! $this->_editorJsLoaded )
  134. {
  135. $this->_editorJsLoaded = true;
  136.  
  137. if ( defined("CK_LOAD_SOURCE") AND CK_LOAD_SOURCE )
  138. {
  139. $IPBHTML .= <<<EOF
  140. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/ckeditor/ckeditor_source.js"></script>
  141. EOF;
  142. }
  143. else
  144. {
  145. $IPBHTML .= <<<EOF
  146. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/ckeditor/ckeditor.js"></script>
  147. EOF;
  148. }
  149.  
  150. $CmdVAsPlainText = ( $this->memberData['bw_paste_plain'] ) ? 'true' : 'false';
  151.  
  152. $IPBHTML .= <<<EOF
  153. <script type="text/javascript" src='{$this->settings['cache_dir']}lang_cache/{$this->lang->lang_id}/ipb.lang.js' charset='{$this->settings['gb_char_set']}'></script>
  154. <script type="text/javascript" src="{$this->settings['public_dir']}js/ips.textEditor.js"></script>
  155. <script type="text/javascript" src="{$this->settings['public_dir']}js/ips.textEditor.bbcode.js"></script>
  156. <script type="text/javascript">
  157. /* Dynamic items */
  158. CKEDITOR.config.IPS_BBCODE = {$bbcode};
  159. CKEDITOR.config.IPS_BBCODE_IMG_URL = "{$this->settings['public_dir']}style_extra/bbcode_icons";
  160. CKEDITOR.config.IPS_BBCODE_BUTTONS = [];
  161.  
  162. /* Has to go before config load */
  163. var IPS_smiley_path = "{$this->settings['emoticons_url']}/";
  164. var IPS_smiles = {$options['smilies']};
  165. var IPS_remove_plugins = [];
  166. var IPS_extra_plugins = [];
  167.  
  168. /* Load our configuration */
  169. CKEDITOR.config.customConfig = '{$this->settings['public_dir']}js/3rd_party/ckeditor/ips_config.js';
  170.  
  171. /* Override with prefs */
  172. CKEDITOR.config.CmdVAsPlainText = {$CmdVAsPlainText};
  173. </script>
  174. <style type="text/css">
  175. @import url("{$this->settings['css_base_url']}style_css/css_{$defaultSkin}/ipb_ckeditor.css");
  176. </style>
  177. EOF;
  178. }
  179.  
  180. $options['noSmilies'] = intval($options['noSmilies']);
  181. $options['isRte'] = intval($options['isRte']);
  182.  
  183. $IPBHTML .= <<<EOF
  184. <input type='hidden' name='noSmilies' id='noSmilies_{$options['editorName']}' value='{$options['noSmilies']}' />
  185. <textarea id="{$options['editorName']}" name="{$formField}" class='ips_EditorTextArea'>{$content}</textarea>
  186. <a id="ips_switchEditor" style="display:none" href="javascript:void()">Switch to Rich Text Editor</a>
  187. <script type="text/javascript">
  188. ipb.textEditor.initialize('{$options['editorName']}', { type: '{$options['type']}',
  189. minimize: {$options['minimize']},
  190. bypassCKEditor: {$options['bypassCKEditor']},
  191. isRte: {$options['isRte']},
  192. noSmilies: {$options['noSmilies']},
  193. ips_AutoSaveKey: '',
  194. ips_AutoSaveData: {} } );
  195. </script>
  196. EOF;
  197. //--endhtml--//
  198. return $IPBHTML;
  199. }
  200.  
  201. /**
  202. * Editor template for ACP
  203. *
  204. * @access public
  205. * @param string From field name
  206. * @param string Initial content for the editor
  207. * @param string Path to the images
  208. * @param integer Whether RTE is enabled (1) or not (0)
  209. * @param string Editor id
  210. * @param string Emoticon data
  211. * @return string HTML
  212. */
  213. public function ips_editor($form_field="",$initial_content="",$images_path="",$rte_mode=0,$editor_id='ed-0',$smilies='') {
  214.  
  215. $IPBHTML = "";
  216. //--starthtml--//
  217.  
  218. $this->settings['extraJsModules'] .= ",editor";
  219. $bbcodes = IPSLib::fetchBbcodeAsJson();
  220. $show_sidebar = IPSCookie::get('emoticon_sidebar');
  221. $show_sidebar_class = $show_sidebar && $this->settings['_remove_emoticons'] == 0 ? 'with_sidebar' : '';
  222. $show_sidebar_style = $show_sidebar && $this->settings['_remove_emoticons'] == 0 ? '' : "style='display:none'";
  223. $show_sidebar_link = $show_sidebar && $this->settings['_remove_emoticons'] == 0 ? 'true' : 'false';
  224.  
  225. $IPBHTML .= <<<EOF
  226. <!--top-->
  227. <input type='hidden' name='{$editor_id}_wysiwyg_used' id='{$editor_id}_wysiwyg_used' value='0' />
  228. <input type='hidden' name='editor_ids[]' value='{$editor_id}' />
  229. <div class='ips_editor {$show_sidebar_class}' id='editor_{$editor_id}'>
  230. EOF;
  231. if( $this->settings['_remove_emoticons'] == 0 )
  232. {
  233. $IPBHTML .= <<<EOF
  234. <div class='sidebar row1 altrow' id='{$editor_id}_sidebar' {$show_sidebar_style}>
  235. <h4><img src='{$this->settings['img_url']}/close_popup.png' alt='{$this->lang->words['icon']}' id='{$editor_id}_close_sidebar' /><span>{$this->lang->words['emoticons_template_title']}</span></h4>
  236. <div id='{$editor_id}_emoticon_holder' class='emoticon_holder'></div>
  237. <div class='show_all_emoticons' id='{$editor_id}_showall_bar'>
  238. <input type='button' value='{$this->lang->words['show_all_emotes']}' id='{$editor_id}_showall_emoticons' class='input_submit emoticons' />
  239. </div>
  240. </div>
  241. EOF;
  242. }
  243.  
  244. $IPBHTML .= <<<EOF
  245. <div id='{$editor_id}_controls' class='controls'>
  246. <ul id='{$editor_id}_toolbar_1' class='toolbar' style='display: none'>
  247. <li class='left'>
  248. <span id='{$editor_id}_cmd_removeformat' class='rte_control rte_button' title='{$this->lang->words['js_tt_noformat']}'><img src='{$this->settings['img_url']}/rte_icons/remove_formatting.png' alt='{$this->lang->words['js_tt_noformat']}' /></span>
  249. </li>
  250. <li class='left'>
  251. <span id='{$editor_id}_cmd_togglesource' class='rte_control rte_button' title='{$this->lang->words['js_tt_htmlsource']}'><img src='{$this->settings['img_url']}/rte_icons/toggle_source.png' alt='{$this->lang->words['js_tt_htmlsource']}' /></span>
  252. </li>
  253. <li class='left'>
  254. <span id='{$editor_id}_cmd_otherstyles' class='rte_control rte_menu rte_special' title='{$this->lang->words['box_other_desc']}' style='display: none'>{$this->lang->words['box_other']}</span>
  255. </li>
  256. <li class='left'>
  257. <span id='{$editor_id}_cmd_fontname' class='rte_control rte_menu rte_font' title='{$this->lang->words['box_font_desc']}'>{$this->lang->words['box_font']}</span>
  258. </li>
  259. <li class='left'>
  260. <span id='{$editor_id}_cmd_fontsize' class='rte_control rte_menu rte_fontsize' title='{$this->lang->words['box_size_desc']}'>{$this->lang->words['box_size']}</span>
  261. </li>
  262. <li class='left'>
  263. <span id='{$editor_id}_cmd_forecolor' class='rte_control rte_palette' title='{$this->lang->words['js_tt_font_col']}'><img src='{$this->settings['img_url']}/rte_icons/font_color.png' alt='{$this->lang->words['js_tt_font_col']}' /></span>
  264. </li>
  265. <!--<li class='left'>
  266. <span id='{$editor_id}_cmd_backcolor' class='rte_control rte_palette' title='{$this->lang->words['js_tt_back_col']}'><img src='{$this->settings['img_url']}/rte_icons/background_color.png' alt='{$this->lang->words['js_tt_back_col']}' /></span>
  267. </li>-->
  268.  
  269. <li class='right'>
  270. <span id='{$editor_id}_cmd_spellcheck' class='rte_control rte_button' title='{$this->lang->words['js_tt_spellcheck']}'><img src='{$this->settings['img_url']}/rte_icons/spellcheck.png' alt='{$this->lang->words['js_tt_spellcheck']}' /></span>
  271. </li>
  272. <li class='right'>
  273. <span id='{$editor_id}_cmd_r_small' class='rte_control rte_button' title='{$this->lang->words['js_tt_resizesmall']}'><img src='{$this->settings['img_url']}/rte_icons/resize_small.png' alt='{$this->lang->words['js_tt_resizesmall']}' /></span>
  274. </li>
  275. <li class='right'>
  276. <span id='{$editor_id}_cmd_r_big' class='rte_control rte_button' title='{$this->lang->words['js_tt_resizebig']}'><img src='{$this->settings['img_url']}/rte_icons/resize_big.png' alt='{$this->lang->words['js_tt_resizebig']}' /></span>
  277. </li>
  278. <li class='right sep'>
  279. <span id='{$editor_id}_cmd_help' class='rte_control rte_button' title='{$this->lang->words['js_tt_help']}'><a href='{$this->settings['board_url']}/index.php?app=forums&amp;module=extras&amp;section=legends&amp;do=bbcode' title='{$this->lang->words['js_tt_help']}'><img src='{$this->settings['img_url']}/rte_icons/help.png' alt='{$this->lang->words['js_tt_help']}' /></a></span>
  280. </li>
  281. <li class='right sep'>
  282. <span id='{$editor_id}_cmd_undo' class='rte_control rte_button' title='{$this->lang->words['js_tt_undo']}'><img src='{$this->settings['img_url']}/rte_icons/undo.png' alt='{$this->lang->words['js_tt_undo']}' /></span>
  283. </li>
  284. <li class='right'>
  285. <span id='{$editor_id}_cmd_redo' class='rte_control rte_button' title='{$this->lang->words['js_tt_redo']}'><img src='{$this->settings['img_url']}/rte_icons/redo.png' alt='{$this->lang->words['js_tt_redo']}' /></span>
  286. </li>
  287. </ul>
  288. <ul id='{$editor_id}_toolbar_2' class='toolbar' style='display: none'>
  289. <li>
  290. <span id='{$editor_id}_cmd_bold' class='rte_control rte_button' title='{$this->lang->words['js_tt_bold']}'><img src='{$this->settings['img_url']}/rte_icons/bold.png' alt='{$this->lang->words['js_tt_bold']}' /></span>
  291. </li>
  292. <li>
  293. <span id='{$editor_id}_cmd_italic' class='rte_control rte_button' title='{$this->lang->words['js_tt_italic']}'><img src='{$this->settings['img_url']}/rte_icons/italic.png' alt='{$this->lang->words['js_tt_italic']}' /></span>
  294. </li>
  295. <li>
  296. <span id='{$editor_id}_cmd_underline' class='rte_control rte_button' title='{$this->lang->words['js_tt_underline']}'><img src='{$this->settings['img_url']}/rte_icons/underline.png' alt='{$this->lang->words['js_tt_underline']}' /></span>
  297. </li>
  298. <li class='sep'>
  299. <span id='{$editor_id}_cmd_strikethrough' class='rte_control rte_button' title='{$this->lang->words['js_tt_strike']}'><img src='{$this->settings['img_url']}/rte_icons/strike.png' alt='{$this->lang->words['js_tt_strike']}' /></span>
  300. </li>
  301. <li>
  302. <span id='{$editor_id}_cmd_subscript' class='rte_control rte_button' title='{$this->lang->words['js_tt_sub']}'><img src='{$this->settings['img_url']}/rte_icons/subscript.png' alt='{$this->lang->words['js_tt_sub']}' /></span>
  303. </li>
  304. <li class='sep'>
  305. <span id='{$editor_id}_cmd_superscript' class='rte_control rte_button' title='{$this->lang->words['js_tt_sup']}'><img src='{$this->settings['img_url']}/rte_icons/superscript.png' alt='{$this->lang->words['js_tt_sup']}' /></span>
  306. </li>
  307. <li>
  308. <span id='{$editor_id}_cmd_insertunorderedlist' class='rte_control rte_button' title='{$this->lang->words['js_tt_list']}'><img src='{$this->settings['img_url']}/rte_icons/unordered_list.png' alt='{$this->lang->words['js_tt_list']}' /></span>
  309. </li>
  310. <li class='sep'>
  311. <span id='{$editor_id}_cmd_insertorderedlist' class='rte_control rte_button' title='{$this->lang->words['js_tt_list']}'><img src='{$this->settings['img_url']}/rte_icons/ordered_list.png' alt='{$this->lang->words['js_tt_list']}' /></span>
  312. </li>
  313. EOF;
  314.  
  315. if( $this->settings['_remove_emoticons'] == 0 )
  316. {
  317. $IPBHTML .= <<<EOF
  318. <li>
  319. <span id='{$editor_id}_cmd_emoticons' class='rte_control rte_button' title='{$this->lang->words['js_tt_emoticons']}'><img src='{$this->settings['img_url']}/rte_icons/emoticons.png' alt='{$this->lang->words['js_tt_emoticons']}' /></span>
  320. </li>
  321. EOF;
  322. }
  323.  
  324. $IPBHTML .= <<<EOF
  325. <li>
  326. <span id='{$editor_id}_cmd_link' class='rte_control rte_palette' title='{$this->lang->words['js_tt_link']}'><img src='{$this->settings['img_url']}/rte_icons/link.png' alt='{$this->lang->words['js_tt_link']}' /></span>
  327. </li>
  328. <li>
  329. <span id='{$editor_id}_cmd_image' class='rte_control rte_palette' title='{$this->lang->words['js_tt_image']}'><img src='{$this->settings['img_url']}/rte_icons/picture.png' alt='{$this->lang->words['js_tt_image']}' /></span>
  330. </li>
  331. <li>
  332. <span id='{$editor_id}_cmd_email' class='rte_control rte_palette' title='{$this->lang->words['js_tt_email']}'><img src='{$this->settings['img_url']}/rte_icons/email.png' alt='{$this->lang->words['js_tt_email']}' /></span>
  333. </li>
  334. <li>
  335. <span id='{$editor_id}_cmd_ipb_quote' class='rte_control rte_button' title='{$this->lang->words['js_tt_quote']}'><img src='{$this->settings['img_url']}/rte_icons/quote.png' alt='{$this->lang->words['js_tt_quote']}' /></span>
  336. </li>
  337. <li>
  338. <span id='{$editor_id}_cmd_ipb_code' class='rte_control rte_button' title='{$this->lang->words['js_tt_code']}'><img src='{$this->settings['img_url']}/rte_icons/code.png' alt='{$this->lang->words['js_tt_code']}' /></span>
  339. </li>
  340. <li>
  341. <span id='{$editor_id}_cmd_media' class='rte_control rte_palette' title='{$this->lang->words['js_tt_media']}'><img src='{$this->settings['img_url']}/rte_icons/media.png' alt='{$this->lang->words['js_tt_media']}' /></span>
  342. </li>
  343. <li class='right'>
  344. <span id='{$editor_id}_cmd_justifyright' class='rte_control rte_button' title='{$this->lang->words['js_tt_right']}'><img src='{$this->settings['img_url']}/rte_icons/align_right.png' alt='{$this->lang->words['js_tt_right']}' /></span>
  345. </li>
  346. <li class='right'>
  347. <span id='{$editor_id}_cmd_justifycenter' class='rte_control rte_button' title='{$this->lang->words['js_tt_center']}'><img src='{$this->settings['img_url']}/rte_icons/align_center.png' alt='{$this->lang->words['js_tt_center']}' /></span>
  348. </li>
  349. <li class='right'>
  350. <span id='{$editor_id}_cmd_justifyleft' class='rte_control rte_button' title='{$this->lang->words['js_tt_left']}'><img src='{$this->settings['img_url']}/rte_icons/align_left.png' alt='{$this->lang->words['js_tt_left']}' /></span>
  351. </li>
  352. <li class='right sep'>
  353. <span id='{$editor_id}_cmd_indent' class='rte_control rte_button' title='{$this->lang->words['js_tt_indent']}'><img src='{$this->settings['img_url']}/rte_icons/indent.png' alt='{$this->lang->words['js_tt_indent']}' /></span>
  354. </li>
  355. <li class='right'>
  356. <span id='{$editor_id}_cmd_outdent' class='rte_control rte_button' title='{$this->lang->words['js_tt_outdent']}'><img src='{$this->settings['img_url']}/rte_icons/outdent.png' alt='{$this->lang->words['js_tt_outdent']}' /></span>
  357. </li>
  358. </ul>
  359. </div>
  360. <div id='{$editor_id}_wrap' class='editor'>
  361. <textarea name="{$form_field}" class="input_rte" id="{$editor_id}_textarea" rows="10" cols="60" tabindex="0">{$initial_content}</textarea>
  362. </div>
  363. </div>
  364.  
  365. <!-- Toolpanes -->
  366. <script type="text/javascript">
  367. //<![CDATA[
  368. $('{$editor_id}_toolbar_1').show();
  369. $('{$editor_id}_toolbar_2').show();
  370. // Rikki: Had to remove <form>... </form> because Opera would see </form> and not pass the topic icons / hidden fields properly. Tried "</" + "form>" but when it is parsed, it had the same affect
  371. ipb.editor_values.get('templates')['link'] = new Template("<label for='#{id}_url'>{$this->lang->words['js_template_url']}</label><input type='text' class='input_text' id='#{id}_url' value='http://' tabindex='10' /><label for='#{id}_urltext'>{$this->lang->words['js_template_link']}</label><input type='text' class='input_text _select' id='#{id}_urltext' value='{$this->lang->words['js_template_default']}' tabindex='11' /><input type='submit' class='input_submit' value='{$this->lang->words['js_template_insert_link']}' tabindex='12' />");
  372.  
  373. ipb.editor_values.get('templates')['image'] = new Template("<label for='#{id}_img'>{$this->lang->words['js_template_imageurl']}</label><input type='text' class='input_text' id='#{id}_img' value='http://' tabindex='10' /><input type='submit' class='input_submit' value='{$this->lang->words['js_template_insert_img']}' tabindex='11' />");
  374.  
  375. ipb.editor_values.get('templates')['email'] = new Template("<label for='#{id}_email'>{$this->lang->words['js_template_email_url']}</label><input type='text' class='input_text' id='#{id}_email' tabindex='10' /><label for='#{id}_emailtext'>{$this->lang->words['js_template_link']}</label><input type='text' class='input_text _select' id='#{id}_emailtext' value='{$this->lang->words['js_template_email_me']}' tabindex='11' /><input type='submit' class='input_submit' value='{$this->lang->words['js_template_insert_email']}' tabindex='12' />");
  376.  
  377. ipb.editor_values.get('templates')['media'] = new Template("<label for='#{id}_media'>{$this->lang->words['js_template_media_url']}</label><input type='text' class='input_text' id='#{id}_media' value='http://' tabindex='10' /><input type='submit' class='input_submit' value='{$this->lang->words['js_template_insert_media']}' tabindex='11' />");
  378.  
  379. ipb.editor_values.get('templates')['generic'] = new Template("<div class='rte_title'>#{title}</div><strong>{$this->lang->words['js_template_example']}</strong><pre>#{example}</pre><label for='#{id}_option' class='optional'>#{option_text}</label><input type='text' class='input_text optional' id='#{id}_option' tabindex='10' /><label for='#{id}_text' class='tagcontent'>#{value_text}</label><input type='text' class='input_text _select tagcontent' id='#{id}_text' tabindex='11' /><input type='submit' class='input_submit' value='{$this->lang->words['js_template_add']}' tabindex='12' />");
  380.  
  381. ipb.editor_values.get('templates')['toolbar'] = new Template("<ul id='#{id}_toolbar_#{toolbarid}' class='toolbar' style='display: none'>#{content}</ul>");
  382.  
  383. ipb.editor_values.get('templates')['button'] = new Template("<li><span id='#{id}_cmd_custom_#{cmd}' class='rte_control rte_button specialitem' title='#{title}'><img src='{$this->settings['img_url']}/rte_icons/#{img}' alt='{$this->lang->words['icon']}' /></span></li>");
  384.  
  385. ipb.editor_values.get('templates')['menu_item'] = new Template("<li id='#{id}_cmd_custom_#{cmd}' class='specialitem clickable'>#{title}</li>");
  386.  
  387. ipb.editor_values.get('templates')['togglesource'] = new Template("<fieldset id='#{id}_ts_controls' class='submit' style='text-align: left'><input type='button' class='input_submit' value='{$this->lang->words['js_template_update']}' id='#{id}_ts_update' />&nbsp;&nbsp;&nbsp; <a href='#' id='#{id}_ts_cancel' class='cancel'>{$this->lang->words['js_template_cancel_source']}</a></fieldset>");
  388.  
  389. ipb.editor_values.get('templates')['emoticons_showall'] = new Template("<input class='input_submit emoticons' type='button' id='#{id}_all_emoticons' value='{$this->lang->words['show_all_emoticons']}' />");
  390.  
  391. ipb.editor_values.get('templates')['emoticon_wrapper'] = new Template("<h4><span>{$this->lang->words['emoticons_template_title']}</span></h4><div id='#{id}_emoticon_holder' class='emoticon_holder'></div>");
  392.  
  393. // Add smilies into the mix
  394. ipb.editor_values.set( 'show_emoticon_link', true );
  395. ipb.editor_values.set( 'emoticons', \$H({ $smilies }) );
  396. ipb.editor_values.set( 'bbcodes', \$H( $bbcodes ) );
  397.  
  398. ipb.vars['emoticon_url'] = "{$this->settings['emoticons_url']}";
  399.  
  400. Event.observe(window, 'load', function(e){
  401. ipb.editors[ '{$editor_id}' ] = new ipb.editor( '{$editor_id}', USE_RTE );
  402. });
  403.  
  404. //]]>
  405. </script>
  406.  
  407. EOF;
  408. //--endhtml--//
  409. return $IPBHTML;
  410. }
  411.  
  412. /**
  413. * Page wrapper for popup windows
  414. *
  415. * @access public
  416. * @param string Document character set
  417. * @param array CSS Files
  418. * @return string HTML
  419. */
  420. public function global_main_popup_wrapper($IPS_DOC_CHAR_SET=IPS_DOC_CHAR_SET, $cssFiles=array() ) {
  421.  
  422. $IPBHTML = "";
  423. //--starthtml--//
  424.  
  425. $_path = IPS_PUBLIC_SCRIPT;
  426. $boardurl = ($this->registry->output->isHTTPS) ? $this->settings['board_url_https'] : $this->settings['board_url'];
  427.  
  428. $IPBHTML .= <<<EOF
  429. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  430. <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  431. <head>
  432. <meta http-equiv="content-type" content="text/html; charset={$IPS_DOC_CHAR_SET}" />
  433. <meta http-equiv="Pragma" content="no-cache" />
  434. <meta http-equiv="Cache-Control" content="no-cache" />
  435. <meta http-equiv="Expires" content="Fri, 01 January 1999 01:00:00 GMT" />
  436. <link rel="shortcut icon" href='{$boardurl}/favicon.ico' />
  437.  
  438. <title><%TITLE%></title>
  439. <script type='text/javascript'>
  440. jsDebug = 1;
  441. USE_RTE = 1;
  442. inACP = true;
  443. isRTL = false;
  444. </script>
  445. EOF;
  446.  
  447. /** CSS ----------------------------------------- */
  448. /*if ( $this->settings['use_minify'] )
  449. {
  450. $_basics = CP_DIRECTORY . '/skin_cp/acp.css,' . CP_DIRECTORY . '/skin_cp/acp_editor.css';
  451. $_others = '';
  452.  
  453. if ( is_array( $cssFiles['import'] ) AND count( $cssFiles['import'] ) )
  454. {
  455. foreach( $cssFiles['import'] as $data )
  456. {
  457. $_others .= ',' . preg_replace( "#^(.*)/(" . CP_DIRECTORY . "/.*)$#", "$2", $data['content'] );
  458. }
  459. }
  460.  
  461. $IPBHTML .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" media='screen' href=\"{$this->settings['public_dir']}min/index.php?f={$_basics}{$_others}\">\n";
  462. }
  463. else
  464. {*/
  465. $IPBHTML .= <<<HTML
  466. <style type='text/css' media='all'>
  467. @import url( "{$this->settings['skin_acp_url']}/acp.css" );
  468. @import url( "{$this->settings['skin_acp_url']}/acp_editor.css" );
  469. </style>
  470. HTML;
  471.  
  472. if( is_array($cssFiles['import']) AND count($cssFiles['import']) )
  473. {
  474. foreach( $cssFiles['import'] as $data )
  475. {
  476. $IPBHTML .= <<<EOF
  477. <link rel="stylesheet" type="text/css" {$data['attributes']} href="{$data['content']}" />
  478. EOF;
  479. }
  480. }
  481. //}
  482.  
  483. $IPBHTML .= <<<HTML
  484. <!--[if IE]>
  485. <style type='text/css' media='all'>
  486. @import url( "{$this->settings['skin_acp_url']}/acp_ie_tweaks.css" );
  487. </style>
  488. <![endif]-->
  489. HTML;
  490.  
  491. if( IN_DEV )
  492. {
  493. $IPBHTML .= <<<HTML
  494. <style type='text/css' media='all'>
  495. .ipsActionBar > ul > li.inDev {
  496. display: inline;
  497. }
  498. </style>
  499. HTML;
  500. }
  501.  
  502. if( is_array($cssFiles['inline']) AND count($cssFiles['inline']) )
  503. {
  504. $IPBHTML .= <<<EOF
  505. <style type='text/css' media="all">
  506. EOF;
  507.  
  508. foreach( $cssFiles['inline'] as $data )
  509. {
  510. $IPBHTML .= $data['content'];
  511. }
  512.  
  513. $IPBHTML .= <<<EOF
  514. </style>
  515. EOF;
  516. }
  517.  
  518. /** JS ----------------------------------------- */
  519. /*if ( $this->settings['use_minify'] )
  520. {
  521. $_others = ',' . CP_DIRECTORY . '/js/acp.js,' . CP_DIRECTORY . '/js/acp.' . implode('.js,' . CP_DIRECTORY . '/js/acp.', array( 'menu', 'tabs' ) ) . '.js';
  522.  
  523. $IPBHTML .= <<<HTML
  524.  
  525. <script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?g=js&amp;ipbv={$this->registry->output->antiCacheHash}'></script>
  526. HTML;
  527.  
  528. $IPBHTML .= "\n\t<script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?ipbv={$this->registry->output->antiCacheHash}&amp;f=" . PUBLIC_DIRECTORY . "/js/ipb.js" . $_others;
  529.  
  530. if ( $this->settings['extraJsModules'] )
  531. {
  532. $_modules = explode( ',', $this->settings['extraJsModules'] );
  533. $_loadModules = '';
  534. $_seenModules = array();
  535.  
  536. foreach( $_modules as $_jsModule )
  537. {
  538. if( !$_jsModule )
  539. {
  540. continue;
  541. }
  542.  
  543. if( in_array( $_jsModule, $_seenModules ) )
  544. {
  545. continue;
  546. }
  547.  
  548. $_seenModules[] = $_jsModule;
  549.  
  550. $_loadModules .= "," . PUBLIC_DIRECTORY . "/js/ips." . $_jsModule . ".js";
  551. }
  552.  
  553. $IPBHTML .= $_loadModules . "'></script>\n";
  554. }
  555. else
  556. {
  557. $IPBHTML .= "'></script>\n";
  558. }
  559. }
  560. else
  561. {*/
  562. $IPBHTML .= <<<HTML
  563. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/prototype.js?ipbv={$this->registry->output->antiCacheHash}"></script>
  564. <script type='text/javascript' src='{$this->settings['public_dir']}js/3rd_party/scriptaculous/scriptaculous-cache.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  565. <script type="text/javascript" src='{$this->settings['public_dir']}js/ipb.js?ipbv={$this->registry->output->antiCacheHash}&amp;load={$this->settings['extraJsModules']}'></script>
  566. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.menu.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  567. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  568. <script type="text/javascript" src='{$this->settings['js_main_url']}acp.tabs.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  569. HTML;
  570. //}
  571.  
  572. $mem_info = json_encode( array( 'g_mem_info' => $this->memberData['g_mem_info'] ) );
  573.  
  574. $IPBHTML .= <<<EOF
  575. <script type='text/javascript'>
  576. //<![CDATA[
  577. ipb.vars['st'] = "{$this->request['st']}";
  578. ipb.vars['base_url'] = "{$this->settings['_base_url']}";
  579. ipb.vars['front_url'] = "{$this->settings['board_url']}/index.php?";
  580. ipb.vars['app_url'] = "{$this->settings['base_url']}";
  581. ipb.vars['image_url'] = "{$this->settings['skin_app_url']}/images/";
  582. ipb.vars['md5_hash'] = "{$this->member->form_hash}";
  583. ipb.vars['is_touch'] = false;
  584. ipb.vars['member_group'] = {$mem_info};
  585. /* ---- cookies ----- */
  586. ipb.vars['cookie_id'] = '{$this->settings['cookie_id']}';
  587. ipb.vars['cookie_domain'] = '{$this->settings['cookie_domain']}';
  588. ipb.vars['cookie_path'] = '{$this->settings['cookie_path']}';
  589. ipb.templates['close_popup'] = "<img src='{$this->settings['img_url']}/close_popup.png' alt='x' />";
  590. ipb.templates['page_jump'] = new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>{$this->lang->words['gl_pagejump']}</h3><input type='text' class='input_text' id='#{id}_input' size='8' /> <input type='submit' value='Go' class='input_submit add_folder' id='#{id}_submit' /></div>");
  591. ipb.templates['ajax_loading'] = "<div id='ajax_loading'>{$this->lang->words['gl_loading']}</div>";
  592. //]]>
  593. </script>
  594. <!--<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>-->
  595. <script type='text/javascript'>
  596. Loader.boot();
  597. acp = new IPBACP;
  598. </script>
  599. <script type="text/javascript" src="{$this->settings['cache_dir']}lang_cache/{$this->lang->lang_id}/acp.lang.js?ipbv={$this->registry->output->antiCacheHash}" charset="{$IPS_DOC_CHAR_SET}"></script>
  600. </head>
  601. <body<%BODYEXTRA%> id='ipboard_body' class='popupwindow'>
  602. <div id='loading-layer' style='display:none'>
  603. <div id='loading-layer-shadow'>
  604. <div id='loading-layer-inner' >
  605. <img src='{$this->settings['skin_acp_url']}/images/loading_anim.gif' style='vertical-align:middle' />
  606. <span style='font-weight:bold' id='loading-layer-text'>{$this->lang->words['ajax_please_wait']}</span>
  607. </div>
  608. </div>
  609. </div>
  610. <div id='main_content'>
  611. <div id='content_wrap'>
  612. <%CONTENT%>
  613. </div>
  614. </div>
  615. </body>
  616. </html>
  617. EOF;
  618.  
  619. //--endhtml--//
  620. return $IPBHTML;
  621. }
  622.  
  623. /**
  624. * Primary page wrapper - used for all full pages
  625. *
  626. * @access public
  627. * @param string Document character set
  628. * @param array CSS Files
  629. * @param string Global submenu HTML (@see global_menu_sub_navigation)
  630. * @param array Order of tabs
  631. * @return string HTML
  632. */
  633. public function global_main_wrapper($IPS_DOC_CHAR_SET=IPS_DOC_CHAR_SET, $cssFiles=array(), $gbl_sub_menu='', $mainTabData, $otherTabData, $bookMarks=array() ) {
  634.  
  635. $IPBHTML = "";
  636. //--starthtml--//
  637.  
  638. //$_encoded = base64_encode( $this->settings['query_string_safe'] );
  639. $_url = str_replace( '&amp;' , '&', $this->settings['query_string_safe'] );
  640. $_url = preg_replace( '#&{1,}#', ';', $_url );
  641. $_url = preg_replace( '#={1,}#', ':', $_url );
  642. $_url = ltrim( $_url, ';' );
  643.  
  644. $_path = IPS_PUBLIC_SCRIPT;
  645. $year = date('Y');
  646.  
  647. /* Open Tab */
  648. $__tabs = ( is_array( $this->member->acp_tab_data ) and count( $this->member->acp_tab_data ) )
  649. ? "'" . implode( "','", array_keys( $this->member->acp_tab_data ) ) . "'"
  650. : '';
  651.  
  652. $_apptitle = ipsRegistry::$applications[ ipsRegistry::$current_application ]['app_title'];
  653.  
  654. $defaultFakeApp = '';
  655. $defaultFakeModule = '';
  656.  
  657. $curApp = array();
  658.  
  659. switch( ipsRegistry::$current_application )
  660. {
  661. case 'forums':
  662. $curApp['forums'] = 'active';
  663. break;
  664. case 'core':
  665. $curApp['core'] = 'active';
  666. break;
  667. case 'members':
  668. $curApp['members'] = 'active';
  669. break;
  670. default:
  671. $curApp['other'] = 'active';
  672. break;
  673. }
  674.  
  675. $fakeApps = $this->registry->output->fetchFakeApps();
  676.  
  677. foreach( $fakeApps as $fa => $data )
  678. {
  679. foreach( $data as $appData )
  680. {
  681. if ( ! $defaultFakeApp )
  682. {
  683. $defaultFakeApp = $appData['app'];
  684. $defaultFakeModule = $appData['module'];
  685. }
  686.  
  687. if ( $appData['app'] == ipsRegistry::$current_application && $appData['module'] == ipsRegistry::$current_module )
  688. {
  689. $curApp = array();
  690. $curApp[ $fa ] = 'active';
  691. break 2;
  692. }
  693. }
  694. }
  695.  
  696. /*
  697. if( !$this->settings['ipb_reg_number'] )
  698. {
  699. $this->lang->words['license_missing_info'] = sprintf( $this->lang->words['license_missing_info'], $this->settings['base_url'] . 'app=core&module=tools&section=licensekey' );
  700. $extra_class = 'force_license';
  701. $license_html = <<<HTML
  702. <div id='license_notice_force'>
  703. <h4>{$this->lang->words['license_missing_header']}</h4>
  704. <p>{$this->lang->words['license_missing_info']}</p>
  705. </div>
  706. HTML;
  707. }
  708. else
  709. {
  710. $licenseData = $this->cache->getCache( 'licenseData' );
  711. if( ( !$licenseData OR !$licenseData['key']['_expires'] OR $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW and $licenseData['key']['_expires'] != -1 ) AND !IPSCookie::get( 'ignore-license-notice' ) )
  712. {
  713. $extra_class = 'expired_license';
  714. $license_html = <<<HTML
  715. <div id='license_notice_expired'>
  716. <div class='right'><a id='license-close' href='#'>Close</a></div>
  717. <h4>{$this->lang->words['license_expired_header']}</h4>
  718. <p>{$this->lang->words['license_expired_info']}</p>
  719. </div>
  720. HTML;
  721. }
  722. }
  723. */
  724.  
  725. $boardurl = ($this->registry->output->isHTTPS) ? $this->settings['board_url_https'] : $this->settings['board_url'];
  726.  
  727. $IPBHTML .= <<<HTML
  728. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  729. <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  730. <head>
  731. <meta http-equiv="content-type" content="text/html; charset={$IPS_DOC_CHAR_SET}" />
  732. <meta http-equiv="Pragma" content="no-cache" />
  733. <meta http-equiv="Cache-Control" content="no-cache" />
  734. <meta http-equiv="Expires" content="Fri, 01 January 1999 01:00:00 GMT" />
  735. <link rel="shortcut icon" href='{$boardurl}/favicon.ico' />
  736.  
  737. <title><%TITLE%></title>
  738. <script type='text/javascript'>
  739. jsDebug = 1;
  740. USE_RTE = 1;
  741. inACP = true;
  742. isRTL = false;
  743. </script>
  744. HTML;
  745.  
  746. /** CSS ----------------------------------------- */
  747. /*if ( $this->settings['use_minify'] )
  748. {
  749. $_basics = CP_DIRECTORY . '/skin_cp/acp.css,' . CP_DIRECTORY . '/skin_cp/acp_editor.css';
  750. $_others = '';
  751.  
  752. if ( is_array( $cssFiles['import'] ) AND count( $cssFiles['import'] ) )
  753. {
  754. foreach( $cssFiles['import'] as $data )
  755. {
  756. $_others .= ',' . preg_replace( "#^(.*)/(" . CP_DIRECTORY . "/.*)$#", "$2", $data['content'] );
  757. }
  758. }
  759.  
  760. $IPBHTML .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" media='screen' href=\"{$this->settings['public_dir']}min/index.php?ipbv={$this->registry->output->antiCacheHash}&amp;f={$_basics}{$_others}\">\n";
  761. }
  762. else
  763. {*/
  764. $IPBHTML .= <<<HTML
  765. <style type='text/css' media='all'>
  766. @import url( "{$this->settings['skin_acp_url']}/acp.css?ipbv={$this->registry->output->antiCacheHash}" );
  767. @import url( "{$this->settings['skin_acp_url']}/acp_editor.css?ipbv={$this->registry->output->antiCacheHash}" );
  768. </style>
  769. HTML;
  770.  
  771. if( is_array($cssFiles['import']) AND count($cssFiles['import']) )
  772. {
  773. foreach( $cssFiles['import'] as $data )
  774. {
  775. $IPBHTML .= <<<EOF
  776. <link rel="stylesheet" type="text/css" {$data['attributes']} href="{$data['content']}?ipbv={$this->registry->output->antiCacheHash}" />
  777. EOF;
  778. }
  779. }
  780. //}
  781.  
  782. $IPBHTML .= <<<HTML
  783. <!--[if IE]>
  784. <style type='text/css' media='all'>
  785. @import url( "{$this->settings['skin_acp_url']}/acp_ie_tweaks.css" );
  786. </style>
  787. <![endif]-->
  788. HTML;
  789.  
  790. if( IN_DEV )
  791. {
  792. $IPBHTML .= <<<HTML
  793. <style type='text/css' media='all'>
  794. .ipsActionBar > ul > li.inDev {
  795. display: inline;
  796. }
  797. </style>
  798. HTML;
  799. }
  800.  
  801. if( is_array($cssFiles['inline']) AND count($cssFiles['inline']) )
  802. {
  803. $IPBHTML .= <<<EOF
  804. <style type='text/css' media="all">
  805. EOF;
  806.  
  807. foreach( $cssFiles['inline'] as $data )
  808. {
  809. $IPBHTML .= $data['content'];
  810. }
  811.  
  812. $IPBHTML .= <<<EOF
  813. </style>
  814. EOF;
  815. }
  816.  
  817. /** JS ----------------------------------------- */
  818. /*if ( $this->settings['use_minify'] )
  819. {
  820. $_others = ',' . CP_DIRECTORY . '/js/acp.js,' . CP_DIRECTORY . '/js/acp.' . implode('.js,' . CP_DIRECTORY . '/js/acp.', array( 'menu', 'tabs' ) ) . '.js';
  821.  
  822. if ( $this->settings['remote_load_js'] )
  823. {
  824. $IPBHTML .= <<<HTML
  825. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js'></script>
  826. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8/scriptaculous.js?load=effects,dragdrop,builder'></script>
  827. HTML;
  828.  
  829. }
  830. else
  831. {
  832. $IPBHTML .= <<<HTML
  833.  
  834. <script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?g=js&amp;ipbv={$this->registry->output->antiCacheHash}'></script>
  835. HTML;
  836. }
  837.  
  838. $IPBHTML .= "\n\t<script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?ipbv={$this->registry->output->antiCacheHash}&amp;f=" . PUBLIC_DIRECTORY . "/js/ipb.js" . $_others;
  839.  
  840. if ( $this->settings['extraJsModules'] )
  841. {
  842. $_modules = explode( ',', $this->settings['extraJsModules'] );
  843. $_loadModules = '';
  844. $_seenModules = array();
  845.  
  846. foreach( $_modules as $_jsModule )
  847. {
  848. if( !$_jsModule )
  849. {
  850. continue;
  851. }
  852.  
  853. if( in_array( $_jsModule, $_seenModules ) )
  854. {
  855. continue;
  856. }
  857.  
  858. $_seenModules[] = $_jsModule;
  859.  
  860. $_loadModules .= "," . PUBLIC_DIRECTORY . "/js/ips." . $_jsModule . ".js";
  861. }
  862.  
  863. $IPBHTML .= $_loadModules . "'></script>\n";
  864. }
  865. else
  866. {
  867. $IPBHTML .= "'></script>\n";
  868. }
  869. }
  870. else
  871. {*/
  872. $IPBHTML .= <<<HTML
  873. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/prototype.js?ipbv={$this->registry->output->antiCacheHash}"></script>
  874. <script type='text/javascript' src='{$this->settings['public_dir']}js/3rd_party/scriptaculous/scriptaculous-cache.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  875. <script type="text/javascript" src='{$this->settings['public_dir']}js/ipb.js?ipbv={$this->registry->output->antiCacheHash}&amp;load={$this->settings['extraJsModules']}'></script>
  876. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.menu.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  877. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  878. <script type="text/javascript" src='{$this->settings['js_main_url']}acp.tabs.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  879. HTML;
  880. //}
  881.  
  882. /* SIDEBAR */
  883. if( $this->settings['hide_sidebar'] || IPSCookie::get("acp_sidebar") == 'closed' )
  884. {
  885. if( $this->settings['hide_sidebar'] )
  886. {
  887. //$sidebar['toggle_class'] = "style='display: none'";
  888. }
  889. $sidebar['content_class'] = "close_menu";
  890. $sidebar['menu_style'] = "style='display: none'";
  891. }
  892. else
  893. {
  894. $sidebar['content_class'] = "open_menu";
  895. $sidebar['menu_style'] = "";
  896. }
  897.  
  898. $mem_info = json_encode( array( 'g_mem_info' => $this->memberData['g_mem_info'] ) );
  899. $base_url = str_replace( '&amp;', '&', $this->settings['_base_url'] );
  900.  
  901. $IPBHTML .= <<<HTML
  902. <script type='text/javascript' src='{$this->settings['board_url']}/cache/lang_cache/{$this->lang->lang_id}/ipb.lang.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  903. <script type="text/javascript" src="{$this->settings['cache_dir']}lang_cache/{$this->lang->lang_id}/acp.lang.js?ipbv={$this->registry->output->antiCacheHash}" charset="{$IPS_DOC_CHAR_SET}"></script>
  904. <script type='text/javascript' src='{$this->settings['js_main_url']}3rd_party/jquery.min.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  905. <script type='text/javascript' src='{$this->settings['js_main_url']}3rd_party/jquery-ui.min.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  906. <script type='text/javascript'>
  907. var jQ = jQuery.noConflict();
  908. </script>
  909. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.jquery.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  910. <script type='text/javascript'>
  911. //<![CDATA[
  912. ipb.vars['st'] = "{$this->request['st']}";
  913. ipb.vars['base_url'] = "{$base_url}";
  914. ipb.vars['front_url'] = "{$this->settings['board_url']}/index.php?";
  915. ipb.vars['app_url'] = "{$this->settings['base_url']}";
  916. ipb.vars['upload_url'] = "{$this->settings['upload_url']}";
  917. ipb.vars['image_url'] = "{$this->settings['skin_app_url']}images/";
  918. ipb.vars['image_acp_url'] = "{$this->settings['skin_acp_url']}/images/";
  919. ipb.vars['md5_hash'] = "{$this->member->form_hash}";
  920. ipb.vars['is_touch'] = false;
  921. ipb.vars['member_group'] = {$mem_info};
  922. ipb.vars['member_id'] = parseInt("{$this->memberData['member_id']}");
  923.  
  924. /* ---- cookies ----- */
  925. ipb.vars['cookie_id'] = '{$this->settings['cookie_id']}';
  926. ipb.vars['cookie_domain'] = '{$this->settings['cookie_domain']}';
  927. ipb.vars['cookie_path'] = '{$this->settings['cookie_path']}';
  928. ipb.templates['close_popup'] = "<img src='{$this->settings['img_url']}/close_popup.png' alt='x' />";
  929. ipb.templates['page_jump'] = new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>{$this->lang->words['gl_pagejump']}</h3><input type='text' class='input_text' id='#{id}_input' size='8' /> <input type='submit' value='Go' class='realbutton' id='#{id}_submit' /></div>");
  930. ipb.templates['ajax_loading'] = "<div id='ajax_loading'>{$this->lang->words['gl_loading']}</div>";
  931. ipb.templates['global_notify'] = new Template("<div class='popupWrapper'><div class='popupInner'><div class='ipsPad'>#{message} #{close}</div></div></div>");
  932. ipb.templates['global_notify_close'] = "<span id='ipsGlobalNotification_close' class='realbutton'>{$this->lang->words['gbl_ok']}</span>";
  933. ipb.templates['acp_bookmark_add'] = new Template("<h3>{$this->lang->words['bookmarks_add_title']}</h3><div class='ipsPad' id='bmcontent'>{$this->lang->words['bookmarks_add_field_title']} <input type='text' class='input_text' style='width:99%' name='bookmarkTitle' value='#{title}' /><br /><input type='checkbox' name='homePage' value='1' /> <span class='desctext'>{$this->lang->words['bookmarks_add_field_home']}</span><br /><br /><div style='text-align:center'><input type='button' class='realbutton' value='{$this->lang->words['bookmarks_save']}' /></div></div>" );
  934. //]]>
  935. </script>
  936. <script type='text/javascript'>
  937. Loader.boot();
  938. acp = new IPBACP;
  939. </script>
  940. </head>
  941. <body id='ipboard_body' data-bookmarkurl="{$bookMarks['url']}" data-bookmarkable="{$bookMarks['can']}" data-bookmarked="{$bookMarks['has']}" class='{$extra_class} clearfix'>
  942. <!-- Inline Form Box -->
  943. <div id='modal' style='display: none'></div>
  944. {$license_html}
  945. <div id='inlineFormWrap' style='display: none;'>
  946. <div id='inlineFormInnerWrap'>
  947. <div id='inlineFormInnerClose' onclick="Effect.Fade( 'inlineFormWrap', { duration: .5 } );"></div>
  948. <div id='inlineFormInnerTitle'></div>
  949. <div id='inlineErrorBox'>
  950. <img src='{$this->settings['skin_acp_url']}/images/stopLarge.png' />
  951. <strong>{$this->lang->words['gl_error']}</strong>
  952. <div id='inlineErrorText'></div>
  953. </div>
  954. <div id='inlineFormInnerContent'></div>
  955. <div id='inlineFormLoading'>
  956. {$this->lang->words['gl_pleasewait']}...
  957. <br /><br />
  958. <img src='{$this->settings['skin_acp_url']}/images/loading_big.gif' alt='loading' id='search_loading' />
  959. </div>
  960. </div>
  961. </div>
  962. <!-- / Inline Form Box -->
  963. <div id='header'>
  964. <div id='search' class='right'>
  965. <img src='{$this->settings['skin_acp_url']}/images/search_icon_white.png' alt='' /> <input type='text' value='{$this->lang->words['gl_livesearch']}' id='acpSearchKeyword' class='inactive' /><img src='{$this->settings['skin_acp_url']}/images/loading.gif' id='acp_loading' style='display: none' />
  966. </div>
  967. <a href='{$this->settings['_base_url']}' title='{$this->lang->words['home']}'>
  968. <img src='{$this->settings['skin_acp_url']}/images/logo.png' alt='Logo' />
  969. </a>
  970. <div class='logged_in'>
  971. {$this->lang->words['gl_loggedinas']} {$this->memberData['members_display_name']}
  972. <ul id='user_links' class='ipsList_inline'>
  973. <li>
  974. <a href='../' target='_blank'>{$this->lang->words['gbl_view_site']}</a>
  975. </li>
  976. <li>
  977. <a href='{$this->settings['_base_url']}app=core&amp;module=mycp&amp;section=dashboard'>{$this->lang->words['gbl_dashboard']}</a>
  978. </li>
  979. <li>
  980. <a href='{$this->settings['_base_url']}&amp;module=login&amp;do=login-out'>{$this->lang->words['gbl_log_out']}</a>
  981. </li>
  982. </ul>
  983. </div>
  984. </div>
  985. <div id='live_search_results' style='display: none'>
  986. <div id='ls_sections'>
  987. <ul>
  988. HTML;
  989. if ( $this->registry->getClass('class_permissions')->checkPermission( 'settings_manage', 'core', 'settings' ) )
  990. {
  991. $IPBHTML .= <<<HTML
  992. <li id='ls_settings'>{$this->lang->words['livesearch_settings']}<span class='count'></span></li>
  993. HTML;
  994. }
  995. if ( $this->registry->getClass('class_permissions')->checkPermission( 'member_edit', 'members', 'members' ) )
  996. {
  997. $IPBHTML .= <<<HTML
  998. <li id='ls_members'>{$this->lang->words['livesearch_members']}<span class='count'></span></li>
  999. HTML;
  1000. }
  1001. if ( $this->registry->getClass('class_permissions')->checkPermission( 'groups_edit', 'members', 'groups' ) )
  1002. {
  1003. $IPBHTML .= <<<HTML
  1004. <li id='ls_groups'>{$this->lang->words['livesearch_groups']}<span class='count'></span></li>
  1005. HTML;
  1006. }
  1007. if ( $this->registry->getClass('class_permissions')->checkPermission( 'forums_edit', 'forums', 'forums' ) )
  1008. {
  1009. $IPBHTML .= <<<HTML
  1010. <li id='ls_forums'>{$this->lang->words['livesearch_forums']}<span class='count'></span></li>
  1011. HTML;
  1012. }
  1013. $IPBHTML .= <<<HTML
  1014. <li id='ls_location'>{$this->lang->words['livesearch_pages']}<span class='count'></span></li>
  1015. HTML;
  1016. if( IPSLib::appIsInstalled('nexus') and $this->registry->getClass('class_permissions')->checkForAppAccess('nexus') )
  1017. {
  1018. $IPBHTML .= "<li id='ls_nexus'>{$this->lang->words['livesearch_nexus']}<span class='count'></span></li>";
  1019. }
  1020.  
  1021. $IPBHTML .= <<<HTML
  1022. <li id='ls_marketplace' title='{$this->lang->words['search_marketplace_more']}'>{$this->lang->words['search_ipsmarketplace']}</li>
  1023. </ul>
  1024. </div>
  1025. <div id='ls_results'>
  1026. <span id='ls_no_results' style='display: none'>{$this->lang->words['live_search_no_results']}</span>
  1027. <div id='ls_settings_panel'></div>
  1028. <div id='ls_members_panel'></div>
  1029. <div id='ls_groups_panel'></div>
  1030. <div id='ls_forums_panel'></div>
  1031. <div id='ls_location_panel'></div>
  1032. HTML;
  1033. if( IPSLib::appIsInstalled('nexus') ){
  1034. $IPBHTML .= "<div id='ls_nexus_panel'></div>";
  1035. }
  1036.  
  1037. $IPBHTML .= <<<HTML
  1038. <div id='ls_marketplace_panel'>
  1039. <div class='pad'>
  1040. {$this->lang->words['ipsmarketplace_is_best']}
  1041. <br /><br />
  1042.  
  1043. <a href='http://community.invisionpower.com/files/' class='realbutton'>{$this->lang->words['gotomarketplace']}</a>
  1044. </div>
  1045. </div>
  1046. </div>
  1047. <img src='{$this->settings['skin_acp_url']}/images/live_search_stem.png' id='ls_stem' />
  1048. </div>
  1049. <!-- pre load -->
  1050. <img src='{$this->settings['skin_acp_url']}/images/icons/bookmark_white_20.png' style='display:none' />
  1051. <img src='{$this->settings['skin_acp_url']}/images/icons/bookmark_grey_20.png' style='display:none' />
  1052. <div id='app_bar'>
  1053. <a class='right' id='edit_tabs' href='#' title="Set up the app bar just the way you want">Edit Tabs</a>
  1054.  
  1055. HTML;
  1056. $IPBHTML .= $this->global_app_menu_html( $gbl_sub_menu, $mainTabData, $otherTabData );
  1057.  
  1058. $IPBHTML .= <<<HTML
  1059. </div>
  1060.  
  1061. <div id='page_body' class='{$sidebar['content_class']} clearfix'>
  1062. <a href='#' id='toggle_sidebar' title='Close the sidebar' {$sidebar['toggle_class']}>&larr;</a>
  1063. <div id='section_navigation' {$sidebar['menu_style']}>
  1064. <%SIDEBAR_EXTRA%>
  1065. <%MENU%>
  1066. </div>
  1067. <div id='main_content' class='clearfix'>
  1068. <%NAV%>
  1069. <%CONTENT%>
  1070. </div>
  1071. </div>
  1072. <div id='footer' class='clear'>
  1073. <a href='http://www.invisionpower.com'>IP.Board 3</a> &copy; {$year} IPS, Inc. &nbsp;&nbsp;|&nbsp;&nbsp; <a href='http://www.invisionpower.com/clients/' target='_blank' title='{$this->lang->words['gl_getsupport_title']}'>{$this->lang->words['gl_getsupport']}</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href='http://community.invisionpower.com/index.php?app=ccs' target='_blank' title='{$this->lang->words['gl_resources_title']}'>{$this->lang->words['gl_resources']}</a>
  1074. HTML;
  1075.  
  1076. if ( IN_DEV )
  1077. {
  1078. $count = count( $this->DB->obj['cached_queries'] );
  1079. $files = count( get_included_files() );
  1080.  
  1081. $IPBHTML .= <<<HTML
  1082. &nbsp;&nbsp;|&nbsp;&nbsp; <a href='#' onclick="$('acpQueries').toggle(); return false;">{$count} Queries and {$files} Included Files</a>
  1083.  
  1084. HTML;
  1085. }
  1086.  
  1087. $acpUrl = str_replace( '&amp;', '&', $this->settings['_base_url'] );
  1088.  
  1089. $IPBHTML .= <<<HTML
  1090. </div>
  1091. <script type='text/javascript'>
  1092. jQuery.extend(true, ips,
  1093. {
  1094. member: { member_id: parseInt( $this->memberData['member_id'] ) },
  1095. acpUrl: '{$acpUrl}',
  1096. rootUrl: '{$this->settings['board_url']}',
  1097. publicUrl: '{$this->settings['board_url']}/index.php?}',
  1098. publicImageUrl: "{$this->settings['skin_app_url']}images/",
  1099. acpImageUrl: "{$this->settings['skin_acp_url']}/images/",
  1100. formToken: '{$this->member->form_hash}',
  1101. bookmarksJSON: {$bookMarks['jsn']}
  1102. } );
  1103. </script>
  1104. </body>
  1105. </html>
  1106. HTML;
  1107. //--endhtml--//
  1108. return $IPBHTML;
  1109. }
  1110.  
  1111. /**
  1112. * Global page primary template - fits in content area
  1113. *
  1114. * @access public
  1115. * @return string HTML
  1116. */
  1117. public function global_frame_wrapper() {
  1118.  
  1119. $year = date('Y');
  1120.  
  1121. $IPBHTML = "";
  1122. //--starthtml--//
  1123.  
  1124. $IPBHTML .= <<<EOF
  1125. <%CONTEXT_MENU%>
  1126.  
  1127. <%MSG%>
  1128. <%SECTIONCONTENT%>
  1129.  
  1130. <div id='acpQueries' style='display:none'>
  1131. <%QUERIES%>
  1132. </div>
  1133. EOF;
  1134.  
  1135. //--endhtml--//
  1136. return $IPBHTML;
  1137. }
  1138.  
  1139. /**
  1140. * Generate sub navigation menu for global use (all apps)
  1141. *
  1142. * @access public
  1143. * @param array Menu data
  1144. * @param array Application and module titles data
  1145. * @return string array
  1146. */
  1147. public function global_menu_sub_navigation( $menu ) {
  1148.  
  1149. $seen = array();
  1150. $fakeApps = $this->registry->output->fetchFakeApps();
  1151.  
  1152. foreach( $menu['menu'] as $app => $modules )
  1153. {
  1154. $this_menu = "<ul id='menu_{$app}' style='display: none'>\r\n";
  1155.  
  1156. foreach( $modules as $key => $items )
  1157. {
  1158. $this_menu .= "\t<li>\r\n";
  1159.  
  1160. if( count( $items['items'] ) == 1 )
  1161. {
  1162. $real_app = $items['items'][0]['app_dir'];
  1163.  
  1164. if ( !ipsRegistry::getClass('class_permissions')->checkForSectionAccess( $real_app, $items['items'][0]['module'], $items['items'][0]['section'] ) )
  1165. {
  1166. continue;
  1167. }
  1168.  
  1169. $_url = ( $items['items'][0]['url'] ) ? "&amp;{$items['items'][0]['url']}" : "";
  1170. $_title = $menu['titles'][ $app ][ $key ] ? $menu['titles'][ $app ][ $key ]['title'] : $items['items'][0]['title'];
  1171. $this_menu .= "\t\t<a href='{$this->settings['_base_url']}app={$real_app}&amp;module={$items['items'][0]['module']}&amp;section={$items['items'][0]['section']}{$_url}'>{$_title}</a>\r\n";
  1172. }
  1173. else
  1174. {
  1175. $haveItems = FALSE;
  1176. $_this_menu = "";
  1177.  
  1178. if( $menu['titles'][ $app ][ $key ] )
  1179. {
  1180. $_this_menu .= "\t\t<span>" . $menu['titles'][ $app ][ $key ]['title'] . "</span>\r\n";
  1181. }
  1182. else
  1183. {
  1184. $_this_menu .= "\t\t<span>" . $key . "</span>\r\n";
  1185. }
  1186.  
  1187. $_this_menu .= "\t\t<ul>\r\n";
  1188. foreach( $items['items'] as $i => $info )
  1189. {
  1190. $real_app = $info['app_dir'];
  1191.  
  1192. if ( !ipsRegistry::getClass('class_permissions')->checkForSectionAccess( $real_app, $info['module'], $info['section'] ) )
  1193. {
  1194. continue;
  1195. }
  1196. if( is_array( $seen[ $app ][ $info['module'] ] ) && in_array( $info['pos'], $seen[ $app ][ $info['module'] ] ) ){
  1197. // Decided to show these because we need to retain access to the options for 3rd party apps
  1198. //continue; // don't show sub-sub items
  1199. }
  1200.  
  1201. $haveItems = TRUE;
  1202. $_this_menu .= "\t\t\t<li>\r\n";
  1203. $_this_menu .= "\t\t\t\t<a href='{$this->settings['_base_url']}app={$real_app}&amp;module={$info['module']}&amp;section={$info['section']}&amp;{$info['url']}'>{$info['title']}</a>\r\n";
  1204. $_this_menu .= "\t\t\t</li>\r\n";
  1205.  
  1206. $seen[ $app ][ $info['module'] ][] = $info['pos'];
  1207. }
  1208. $_this_menu .= "\t\t</ul>\r\n";
  1209.  
  1210. if ( $haveItems )
  1211. {
  1212. $this_menu .= $_this_menu;
  1213. }
  1214. }
  1215.  
  1216. $this_menu .= "\t</li>\r\n";
  1217. }
  1218.  
  1219. $this_menu .= "</ul>\r\n";
  1220.  
  1221. $return[ $app ] = $this_menu;
  1222. }
  1223.  
  1224. //print_r( $seen );
  1225. //print_r($menu);exit;
  1226. //print_r($titles);exit;
  1227.  
  1228. //--endhtml--//
  1229. return $return;
  1230. }
  1231.  
  1232. /**
  1233. * Generate the application menu HTML
  1234. *
  1235. * @access public
  1236. * @param string Raw menu data
  1237. * @param array Tab order
  1238. * @return string HTML
  1239. */
  1240. public function global_app_menu_html( $raw_menu, $mainTabData, $otherTabData ) {
  1241.  
  1242. $fakeAppAccess = array();
  1243.  
  1244. $IPBHTML = "";
  1245. //--starthtml--//
  1246.  
  1247. $menus = $this->global_menu_sub_navigation( $raw_menu );
  1248.  
  1249. $defaultFakeApp = array();
  1250. $defaultFakeModule = array();
  1251.  
  1252. $IPBHTML .= <<<HTML
  1253. <ul id='app_menu' class='app_menu'>
  1254. <li>
  1255. <a href='#' id='bookmarks_button'><img src='{$this->settings['skin_acp_url']}/images/icons/bookmark_white_20.png' /></a>
  1256. <ul id='bookmarks_items' class='right' style='display:none'></ul>
  1257. </li>
  1258. HTML;
  1259.  
  1260. $count = 0;
  1261. $other_menu = "";
  1262. $otherIsActive = false;
  1263.  
  1264. /* Loop */
  1265. foreach( $otherTabData as $tabkey => $data )
  1266. {
  1267. $tag = '';
  1268.  
  1269. if ( ! $data['isEnabled'] || ! $data['permCheck'] )
  1270. {
  1271. continue;
  1272. }
  1273.  
  1274. if ( $data['active'] )
  1275. {
  1276. $otherIsActive = true;
  1277. }
  1278.  
  1279. if ( ipsRegistry::$applications[ $data['appDir'] ]['app_location'] == 'ips' || ipsRegistry::$applications[ $data['appDir'] ]['app_location'] == 'root' )
  1280. {
  1281. $tag = "<span class='ipsBadge badge_purple'>{$this->lang->words['gl_ipsapp']}</span>&nbsp;&nbsp;";
  1282. }
  1283.  
  1284. $other_menu .= <<<EOF
  1285. <li id='app_{$data['appDir']}'>
  1286. <a href='{$data['url']}'>
  1287. {$tag}
  1288. {$data['title']}
  1289. </a>
  1290. {$menus[ $tabkey ]}
  1291. </li>
  1292. EOF;
  1293. $count++;
  1294. }
  1295.  
  1296. //-----------------------------------------
  1297. // Draw tabs based on order preference
  1298. //-----------------------------------------
  1299.  
  1300. foreach( $mainTabData as $tabkey => $data )
  1301. {
  1302. if ( $tabkey == 'other' )
  1303. {
  1304. if ( ! $count )
  1305. {
  1306. continue;
  1307. }
  1308.  
  1309. $data['active'] = $otherIsActive;
  1310. }
  1311.  
  1312. if ( ! $data['isEnabled'] || ! $data['permCheck'] )
  1313. {
  1314. continue;
  1315. }
  1316.  
  1317. $class = ( $data['active'] ) ? 'active' : '';
  1318.  
  1319. if( $tabkey == 'other' )
  1320. {
  1321. $IPBHTML .= <<<HTML
  1322. <li class='{$class}'>
  1323. <a href='{$this->settings['_base_url']}app=core&amp;module=applications&amp;section=applications&amp;do=applications_overview'>{$this->lang->words['other_applications']}</a>
  1324. <ul id='menu__other' style='display: none'>
  1325. {$other_menu}
  1326. </ul>
  1327. </li>
  1328. HTML;
  1329. }
  1330. else
  1331. {
  1332. $IPBHTML .= <<<HTML
  1333. <li class='{$class}'>
  1334. <a href='{$data['url']}'>{$data['title']}</a>
  1335. {$menus[ $tabkey ]}
  1336. </li>
  1337. HTML;
  1338. }
  1339. }
  1340.  
  1341. $IPBHTML .= "</ul>";
  1342.  
  1343. //--endhtml--//
  1344. return $IPBHTML;
  1345. }
  1346.  
  1347. /**
  1348. * Show the information box on the page
  1349. *
  1350. * @access public
  1351. * @param string Box title
  1352. * @param string Box content
  1353. * @return string HTML
  1354. */
  1355. public function information_box($title="", $content="") {
  1356.  
  1357. $IPBHTML = "";
  1358. //--starthtml--//
  1359.  
  1360. $IPBHTML .= <<<EOF
  1361. <div class='section_title'>
  1362. <h2>{$title}</h2>
  1363. </div>
  1364. <div class='section_info'>{$content}</div>
  1365. EOF;
  1366.  
  1367. //--endhtml--//
  1368. return $IPBHTML;
  1369. }
  1370.  
  1371. /**
  1372. * Show a warning box
  1373. *
  1374. * @access public
  1375. * @param string Title
  1376. * @param string Content
  1377. * @return string HTML
  1378. */
  1379. public function warning_box($title="", $content="") {
  1380.  
  1381. $IPBHTML = "";
  1382. //--starthtml--//
  1383.  
  1384. $IPBHTML .= <<<EOF
  1385. <div class='warning'>
  1386. <h4>{$title}</h4>
  1387. {$content}
  1388. </div>
  1389. EOF;
  1390.  
  1391. //--endhtml--//
  1392. return $IPBHTML;
  1393. }
  1394.  
  1395. /**
  1396. * Shows the debug query output at the bottom of the page
  1397. *
  1398. * @access public
  1399. * @param string Queries to show
  1400. * @return string HTML
  1401. */
  1402. public function global_query_output($queries="") {
  1403.  
  1404. $IPBHTML = "";
  1405. //--starthtml--//
  1406.  
  1407. $IPBHTML .= <<<EOF
  1408. <br /><br />
  1409. <div align='center' class='clear' style='margin-left:auto;margin-right:0'>
  1410. <div class='acp-box' style='text-align:left;'>
  1411. <h3>{$this->lang->words['gbl_queries']}</h3>
  1412. <div style='overflow:auto'>{$queries}</div>
  1413. </div>
  1414. </div>
  1415. EOF;
  1416.  
  1417. //--endhtml--//
  1418. return $IPBHTML;
  1419. }
  1420.  
  1421. /**
  1422. * Shows the debug included files output at the bottom of the page
  1423. *
  1424. * @param int Number of files
  1425. * @param string Files to show
  1426. * @return string HTML
  1427. */
  1428. public function global_if_output($count=0,$files="") {
  1429.  
  1430. $IPBHTML = "";
  1431. //--starthtml--//
  1432.  
  1433. $IPBHTML .= <<<EOF
  1434. <br /><br />
  1435. <div align='center' style='margin-left:auto;margin-right:0'>
  1436. <div class='acp-box' style='text-align:left;'>
  1437. <h3>{$count} {$this->lang->words['gbl_inc_files']}</h3>
  1438. <div style='padding: 4px;'>{$files}</div>
  1439. </div>
  1440. </div>
  1441. EOF;
  1442.  
  1443. //--endhtml--//
  1444. return $IPBHTML;
  1445. }
  1446.  
  1447. /**
  1448. * Shows the debug memory output at the bottom of the page
  1449. *
  1450. * @access public
  1451. * @param string Memory to show
  1452. * @param string Total memory used
  1453. * @param string Peak memory used
  1454. * @return string HTML
  1455. */
  1456. public function global_memory_output($memory="", $total=0, $peak=0 ) {
  1457.  
  1458. $IPBHTML = "";
  1459. //--starthtml--//
  1460.  
  1461. $IPBHTML .= <<<EOF
  1462. <br /><br />
  1463. <div align='center' style='margin-left:auto;margin-right:0'>
  1464. <div class='acp-box' style='text-align:left;'>
  1465. <h3>{$this->lang->words['gbl_memory']}</h3>
  1466. <table class='ipsTable'>
  1467. {$memory}
  1468. </table>
  1469. <div class='acp-actionbar' style='text-align: left;'>
  1470. <strong>{$this->lang->words['ttlmemoryused']} {$total} ({$this->lang->words['peakmemoryused']} {$peak})</strong>
  1471. </div>
  1472. </div>
  1473. </div>
  1474. EOF;
  1475.  
  1476. //--endhtml--//
  1477. return $IPBHTML;
  1478. }
  1479.  
  1480. /**
  1481. * Show the login form
  1482. *
  1483. * @access public
  1484. * @param string Query string to remember
  1485. * @param string Message to show
  1486. * @param bool Replace the form (deprecated)
  1487. * @param array Additional data to add to the form
  1488. * @return string HTML
  1489. */
  1490. public function log_in_form( $query_string="", $message="", $replace_form=false, $additional_data=array() ) {
  1491.  
  1492. $IPBHTML = "";
  1493. //--starthtml--//
  1494.  
  1495. $IPS_DOC_CHAR_SET = IPS_DOC_CHAR_SET;
  1496. $publicDirectory = PUBLIC_DIRECTORY;
  1497.  
  1498. if ( $this->settings['logins_over_https'] )
  1499. {
  1500. $this->settings['skin_acp_url'] = str_replace( 'http://', 'https://', $this->settings['skin_acp_url'] );
  1501. $this->settings['public_dir'] = str_replace( 'http://', 'https://', $this->settings['public_dir'] );
  1502. $this->settings['js_main_url'] = str_replace( 'http://', 'https://', $this->settings['js_main_url'] );
  1503. }
  1504.  
  1505. $IPBHTML .= <<<HTML
  1506. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  1507. <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  1508. <head>
  1509. <meta http-equiv="content-type" content="text/html; charset={$IPS_DOC_CHAR_SET}" />
  1510. <meta http-equiv="Pragma" content="no-cache" />
  1511. <meta http-equiv="Cache-Control" content="no-cache" />
  1512. <meta http-equiv="Expires" content="Fri, 01 January 1999 01:00:00 GMT" />
  1513. <link rel="shortcut icon" href='favicon.ico' />
  1514.  
  1515. <title><%TITLE%></title>
  1516. <script type='text/javascript'>
  1517. jsDebug = 1;
  1518. USE_RTE = 0;
  1519. isRTL = false;
  1520.  
  1521. if ( top != self )
  1522. {
  1523. top.location.href = window.location.href;
  1524. }
  1525. </script>
  1526. HTML;
  1527.  
  1528.  
  1529. /** CSS ----------------------------------------- */
  1530. /*if ( $this->settings['use_minify'] )
  1531. {
  1532. $_basics = CP_DIRECTORY . '/skin_cp/acp.css,' . CP_DIRECTORY . '/skin_cp/acp_editor.css';
  1533.  
  1534. $IPBHTML .= "\n\t<link rel=\"stylesheet\" type=\"text/css\" media='screen' href=\"{$this->settings['public_dir']}min/index.php?ipbv={$this->registry->output->antiCacheHash}&amp;f={$_basics}\">\n";
  1535. }
  1536. else
  1537. {*/
  1538. $IPBHTML .= <<<HTML
  1539. <style type='text/css' media='all'>
  1540. @import url( "{$this->settings['skin_acp_url']}/acp.css?ipbv={$this->registry->output->antiCacheHash}" );
  1541. @import url( "{$this->settings['skin_acp_url']}/acp_editor.css?ipbv={$this->registry->output->antiCacheHash}" );
  1542. </style>
  1543. HTML;
  1544. //}
  1545.  
  1546. $IPBHTML .= <<<HTML
  1547. <!--[if IE]>
  1548. <style type='text/css' media='all'>
  1549. @import url( "{$this->settings['skin_acp_url']}/acp_ie_tweaks.css?ipbv={$this->registry->output->antiCacheHash}" );
  1550. </style>
  1551. <![endif]-->
  1552. HTML;
  1553.  
  1554. if( IN_DEV )
  1555. {
  1556. $IPBHTML .= <<<HTML
  1557. <style type='text/css' media='all'>
  1558. .ipsActionBar > ul > li.inDev {
  1559. display: inline;
  1560. }
  1561. </style>
  1562. HTML;
  1563. }
  1564.  
  1565. /** JS ----------------------------------------- */
  1566. /*if ( $this->settings['use_minify'] )
  1567. {
  1568. $_others = ',' . CP_DIRECTORY . '/js/acp.js,' . CP_DIRECTORY . '/js/acp.' . implode('.js,' . CP_DIRECTORY . '/js/acp.', array( 'menu', 'tabs' ) ) . '.js';
  1569.  
  1570. $IPBHTML .= <<<HTML
  1571.  
  1572. <script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?g=js&amp;ipbv={$this->registry->output->antiCacheHash}'></script>
  1573. <script type='text/javascript' src='{$this->settings['public_dir']}min/index.php?ipbv={$this->registry->output->antiCacheHash}&amp;f={$publicDirectory}/js/ipb.js{$_others}'></script>
  1574. HTML;
  1575. }
  1576. else
  1577. {*/
  1578. $IPBHTML .= <<<HTML
  1579. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/prototype.js?ipbv={$this->registry->output->antiCacheHash}"></script>
  1580. <script type='text/javascript' src='{$this->settings['public_dir']}js/3rd_party/scriptaculous/scriptaculous-cache.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1581. <script type="text/javascript" src='{$this->settings['public_dir']}js/ipb.js?ipbv={$this->registry->output->antiCacheHash}&amp;load={$this->settings['extraJsModules']}'></script>
  1582. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.menu.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1583. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1584. <script type="text/javascript" src='{$this->settings['js_main_url']}acp.tabs.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1585. HTML;
  1586. //}
  1587.  
  1588. $IPBHTML .= <<<HTML
  1589. <script type='text/javascript'>
  1590. //<![CDATA[
  1591. ipb.vars['st'] = "{$this->request['st']}";
  1592. ipb.vars['base_url'] = "{$this->settings['_base_url']}";
  1593. ipb.vars['front_url'] = "{$this->settings['board_url']}/index.php?";
  1594. ipb.vars['app_url'] = "{$this->settings['base_url']}";
  1595. ipb.vars['image_url'] = "{$this->settings['skin_app_url']}/images/";
  1596. ipb.vars['md5_hash'] = "{$this->member->form_hash}";
  1597. /* ---- cookies ----- */
  1598. ipb.vars['cookie_id'] = '{$this->settings['cookie_id']}';
  1599. ipb.vars['cookie_domain'] = '{$this->settings['cookie_domain']}';
  1600. ipb.vars['cookie_path'] = '{$this->settings['cookie_path']}';
  1601. ipb.templates['close_popup'] = "<img src='{$this->settings['img_url']}/close_popup.png' alt='x' />";
  1602. ipb.templates['page_jump'] = new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>{$this->lang->words['gl_pagejump']}</h3><input type='text' class='input_text' id='#{id}_input' size='8' /> <input type='submit' value='Go' class='input_submit add_folder' id='#{id}_submit' /></div>");
  1603. ipb.templates['ajax_loading'] = "<div id='ajax_loading'>{$this->lang->words['gl_loading']}</div>";
  1604. //]]>
  1605. </script>
  1606. <script type='text/javascript'>
  1607. Loader.boot();
  1608. acp = new IPBACP;
  1609.  
  1610. Event.observe( window, 'load', function(e){
  1611. $('username').focus();
  1612. });
  1613. </script>
  1614. <script type="text/javascript" src="{$this->settings['cache_dir']}lang_cache/{$this->lang->lang_id}/acp.lang.js?ipbv={$this->registry->output->antiCacheHash}" charset="{$IPS_DOC_CHAR_SET}"></script>
  1615. </head>
  1616. <body id='ipboard_body' class='login_screen'>
  1617. <div id='loading-layer' style='display:none'>
  1618. <div id='loading-layer-shadow'>
  1619. <div id='loading-layer-inner' >
  1620. <img src='{$this->settings['skin_acp_url']}/images/loading_anim.gif' style='vertical-align:middle' />
  1621. <span style='font-weight:bold' id='loading-layer-text'>{$this->lang->words['ajax_please_wait']}</span>
  1622. </div>
  1623. </div>
  1624. </div>
  1625. HTML;
  1626.  
  1627. $extraClass = ( $message ) ? 'with_message' : '';
  1628.  
  1629. if( $replace_form )
  1630. {
  1631. $IPBHTML .= $additional_data[0];
  1632. }
  1633. else
  1634. {
  1635. $url = "{$this->settings['_base_url']}app=core&amp;module=login&amp;do=login-complete";
  1636. if ( $this->settings['logins_over_https'] )
  1637. {
  1638. $url = str_replace( 'http://', 'https://', $url );
  1639. }
  1640.  
  1641. $IPBHTML .= <<<HTML
  1642. <form action='{$url}' method='post'>
  1643. <input type='hidden' name='qstring' id='qstring' value='{$query_string}' />
  1644. <div id='login' class='{$extraClass}'>
  1645. <img src='{$this->settings['skin_acp_url']}/images/login_logo.png' id='login_logo' />
  1646. HTML;
  1647.  
  1648. if ( $message )
  1649. {
  1650. $IPBHTML .= <<<HTML
  1651. <div id='login_error'>{$message}</div>
  1652. HTML;
  1653. }
  1654.  
  1655. $IPBHTML .= <<<HTML
  1656. <div id='login_controls'>
  1657. <label for='username'>{$this->lang->words['gl_signinname']}</label>
  1658. <input type='text' size='20' id='username' name='username' value='' class='textinput'>
  1659.  
  1660. <label for='password'>{$this->lang->words['gl_password']}</label>
  1661. <input type='password' size='20' id='password' name='password' value='' class='textinput'>
  1662. HTML;
  1663.  
  1664. if( count($additional_data) > 0 )
  1665. {
  1666. foreach( $additional_data as $form_html )
  1667. {
  1668. $IPBHTML .= $form_html;
  1669. }
  1670. }
  1671.  
  1672. $IPBHTML .= <<<HTML
  1673. </div>
  1674. <div id='login_submit'>
  1675. <input type='submit' class='button' value="{$this->lang->words['gl_signin']}" />
  1676. </div>
  1677. </div>
  1678. </form>
  1679. HTML;
  1680.  
  1681. $IPBHTML .= <<<HTML
  1682. </div>
  1683. </div>
  1684. </form>
  1685. <script type='text/javascript'>
  1686. $('username').focus();
  1687. </script>
  1688. </body>
  1689. </html>
  1690. HTML;
  1691. }
  1692.  
  1693. //--endhtml--//
  1694. return $IPBHTML;
  1695. }
  1696.  
  1697. /**
  1698. * Redirect hit for auto-redirecting pages (e.g. "recache all caches")
  1699. *
  1700. * @access public
  1701. * @param string URL to send to
  1702. * @param string Text to show
  1703. * @param integer Number of seconds to wait
  1704. * @return string HTML
  1705. */
  1706. public function global_redirect_hit($url, $text="", $time=1) {
  1707.  
  1708. $IPBHTML = "";
  1709. //--starthtml--//
  1710.  
  1711. $IPBHTML .= <<<EOF
  1712. <script type='text/javascript'>
  1713. jsDebug = 0;
  1714. USE_RTE = 0;
  1715. </script>
  1716. <script type="text/javascript" src="{$this->settings['public_dir']}js/3rd_party/prototype.js?ipbv={$this->registry->output->antiCacheHash}"></script>
  1717. <script type='text/javascript' src='{$this->settings['public_dir']}js/3rd_party/scriptaculous/scriptaculous-cache.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1718. <script type="text/javascript" src='{$this->settings['public_dir']}js/ipb.js?ipbv={$this->registry->output->antiCacheHash}&amp;load={$this->settings['extraJsModules']}'></script>
  1719. <script type='text/javascript' src='{$this->settings['js_main_url']}acp.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1720. <script type="text/javascript" src='{$this->settings['js_main_url']}acp.tabs.js?ipbv={$this->registry->output->antiCacheHash}'></script>
  1721. <script type="text/javascript">
  1722. //<![CDATA[
  1723.  
  1724. ipb.vars['st'] = "{$this->request['st']}";
  1725.  
  1726. ipb.vars['base_url'] = "{$this->settings['_base_url']}";
  1727. ipb.vars['front_url'] = "{$this->settings['board_url']}/index.php?";
  1728. ipb.vars['app_url'] = "{$this->settings['base_url']}";
  1729. ipb.vars['image_url'] = "{$this->settings['skin_app_url']}/images/";
  1730. ipb.vars['md5_hash'] = "{$this->member->form_hash}";
  1731. /* ---- cookies ----- */
  1732. ipb.vars['cookie_id'] = '{$this->settings['cookie_id']}';
  1733. ipb.vars['cookie_domain'] = '{$this->settings['cookie_domain']}';
  1734. ipb.vars['cookie_path'] = '{$this->settings['cookie_path']}';
  1735.  
  1736. Loader.boot();
  1737. acp = new IPBACP;
  1738. //]]>
  1739. </script>
  1740.  
  1741. <style type='text/css' media='all'>
  1742. @import url( "{$this->settings['skin_acp_url']}/acp.css?ipbv={$this->registry->output->antiCacheHash}" );
  1743. </style>
  1744.  
  1745. <meta http-equiv='refresh' content='{$time}; url={$url}' />
  1746.  
  1747. <div class='information-box'>
  1748. <h4>{$this->lang->words['gbl_page_redirecting']}</h4>
  1749. {$this->lang->words['page_will_refresh']} <a href='$url'>{$this->lang->words['refresh_dont_wait']}</a>
  1750. </div>
  1751. <br />
  1752. <div class='redirector'>
  1753. <div class='info'>{$text}</div>
  1754. </div>
  1755.  
  1756. EOF;
  1757.  
  1758. //--endhtml--//
  1759. return $IPBHTML;
  1760. }
  1761.  
  1762. /**
  1763. * Initialize global redirection javascript for AJAX redirecting
  1764. *
  1765. * @access public
  1766. * @param string URL to redirect to
  1767. * @param string Text to show
  1768. * @param string Additional text to add
  1769. * @return string HTML
  1770. */
  1771. public function global_ajax_redirect_init($url='', $text='', $addtotext='') {
  1772.  
  1773. $IPBHTML = "";
  1774. //--starthtml--//
  1775.  
  1776. $IPBHTML .= <<<EOF
  1777. <div class='redirector'>
  1778. <div class='info' id='refreshbox'>{$this->lang->words['gbl_initializing']}</div>
  1779. </div>
  1780. <script type='text/javascript'>
  1781. //<![CDATA[
  1782. acp.ajaxRefresh( '$url', '$text', $addtotext );
  1783. //]]>
  1784. </script>
  1785. EOF;
  1786.  
  1787. //--endhtml--//
  1788. return $IPBHTML;
  1789. }
  1790.  
  1791. /**
  1792. * Global redirection completed page
  1793. *
  1794. * @access public
  1795. * @param string Text to show
  1796. * @return string HTML
  1797. */
  1798. public function global_redirect_done($text='This function has now finished executing') {
  1799.  
  1800. $IPBHTML = "";
  1801. //--starthtml--//
  1802.  
  1803. $IPBHTML .= <<<EOF
  1804. <style type='text/css' media='all'>
  1805. @import url( "{$this->settings['skin_acp_url']}/acp.css?ipbv={$this->registry->output->antiCacheHash}" );
  1806. </style>
  1807.  
  1808. <div class='redirector complete'>
  1809. <div class='info'>{$text}</div>
  1810. </div>
  1811.  
  1812. EOF;
  1813.  
  1814. //--endhtml--//
  1815. return $IPBHTML;
  1816. }
  1817.  
  1818. /**
  1819. * General redirect page with message
  1820. *
  1821. * @access public
  1822. * @param string URL to send to
  1823. * @param integer Number of seconds to wait before redirecting
  1824. * @param string Text to display
  1825. * @return string HTML
  1826. */
  1827. public function global_redirect_halt($url) {
  1828.  
  1829. $IPBHTML = "";
  1830. //--starthtml--//
  1831.  
  1832.  
  1833. $IPBHTML .= <<<EOF
  1834. <div class='warning'>
  1835. <h4>{$this->lang->words['redirect_halt_title']}</h4>
  1836. <p><strong>{$this->registry->output->global_error}</strong></p>
  1837. <br />
  1838. <ul>
  1839. <li style='font-weight:bold'><a href='$url'>{$this->lang->words['redirect_halt_continue']}</a></a>
  1840. <li><a href='{$this->settings['this_url']}'>{$this->lang->words['redirect_repeat_step']}</a>
  1841. </ul>
  1842. </div>
  1843. EOF;
  1844.  
  1845. $this->registry->output->global_error = '';
  1846.  
  1847. //--endhtml--//
  1848. return $IPBHTML;
  1849. }
  1850.  
  1851. /**
  1852. * Generate sub navigation menu for sidebar
  1853. *
  1854. * @access public
  1855. * @param array Menu data
  1856. * @return string HTML
  1857. */
  1858. public function menu_sub_navigation( $menu ) {
  1859.  
  1860. $main_html = array();
  1861. $IPBHTML = "";
  1862. //--starthtml--//
  1863.  
  1864. if( is_array($menu[ ipsRegistry::$current_application ]) AND count($menu[ ipsRegistry::$current_application ]) )
  1865. {
  1866. foreach( $menu[ ipsRegistry::$current_application ] as $id => $data )
  1867. {
  1868. $links = "";
  1869. $_id = preg_replace( '/^\d+?_(.*)$/', "\\1", $id );
  1870.  
  1871. if ( $_id != ipsRegistry::$current_module )
  1872. {
  1873. continue;
  1874. }
  1875.  
  1876. foreach( $data['items'] as $_id => $_data )
  1877. {
  1878. $_url = ( $_data['url'] ) ? "&amp;{$_data['url']}" : "";
  1879. $links .= <<<EOF
  1880. <div class='menulinkwrapBlock'>
  1881. <a href="{$this->settings['base_url']}module={$_data['module']}&amp;section={$_data['section']}{$_url}">{$_data['title']}</a>
  1882. </div>
  1883. EOF;
  1884. }
  1885.  
  1886. if ( $links )
  1887. {
  1888. $main_html[] = <<<EOF
  1889. <!-- MENU FOR {$data['title']}-->
  1890. <div class='menuouterwrap'>
  1891. <div class='menucatwrapBlock'>{$data['title']}</div>
  1892. {$links}
  1893. </div>
  1894. <!-- / MENU FOR {$data['title']}-->
  1895. EOF;
  1896. }
  1897. }
  1898. }
  1899.  
  1900. if ( is_array( $main_html ) AND count( $main_html ) )
  1901. {
  1902. $IPBHTML .= <<<EOF
  1903. <div id='subMenuWrap'>
  1904. EOF;
  1905. $IPBHTML .= implode( "<br />", $main_html );
  1906. $IPBHTML .= <<<EOF
  1907. </div>
  1908. EOF;
  1909. }
  1910.  
  1911. //--endhtml--//
  1912. return $IPBHTML;
  1913. }
  1914.  
  1915. /**
  1916. * Menu category wrapper for sidebar "categories"
  1917. *
  1918. * @access public
  1919. * @param array Links to show
  1920. * @param string Module (cleaned)
  1921. * @param array Menu items to show
  1922. * @return string HTML
  1923. */
  1924. public function menu_cat_wrap( $links=array(), $clean_module="", $menu=array() ) {
  1925.  
  1926. $IPBHTML = "";
  1927. $seen = 0;
  1928. $titles = 0;
  1929.  
  1930. //--starthtml--//
  1931.  
  1932. foreach( $links as $app => $module )
  1933. {
  1934. $IPBHTML .= "<ul>\n";
  1935. $_CHILD = '';
  1936. $_MENU = '';
  1937.  
  1938. foreach( $module as $data )
  1939. {
  1940. $class = '';
  1941.  
  1942. if ( $app == ipsRegistry::$current_application AND $clean_module == $data['module'] )
  1943. {
  1944. $class = 'active';
  1945. }
  1946.  
  1947. if( isset( $menu[ $app ] ) && is_array( $menu[ $app ] ) )
  1948. {
  1949. foreach( $menu[ $app ] as $id => $__data )
  1950. {
  1951. //print_r($__data);exit;
  1952. preg_match( '/^(\d+?)_(.*)$/', $id, $result );
  1953.  
  1954. if ( $result[2] != $data['module'] )
  1955. {
  1956. continue;
  1957. }
  1958.  
  1959. /* Heres where we check whether this is a single item */
  1960. if( intval($result[1]) === 0 )
  1961. {
  1962. $_single_item = true;
  1963. $_count = 0;
  1964.  
  1965. foreach( $menu[ $app ] as $__k => $__v )
  1966. {
  1967. if ( preg_match( '/(\d+?)_' . $result[2] . "/", $__k ) )
  1968. {
  1969. $_count++;
  1970. }
  1971. }
  1972.  
  1973. if( $_count > 1 )
  1974. {
  1975. $_single_item = false;
  1976. }
  1977.  
  1978. if( $_single_item )
  1979. {
  1980. $_url = ( $__data['items'][0]['url'] ) ? "&amp;{$__data['items'][0]['url']}" : "";
  1981.  
  1982. $_MENU .= <<<EOF
  1983. <!-- UHM MENU FOR {$data['title']}-->
  1984. <li class='{$class}'>
  1985. <a href='{$this->settings['_base_url']}app={$app}&amp;module={$__data['items'][0]['module']}&amp;section={$__data['items'][0]['section']}{$_url}'>{$__data['title']}</a>
  1986. </li>
  1987. EOF;
  1988.  
  1989. continue(2);
  1990. }
  1991. }
  1992. /* /end */
  1993.  
  1994. if ( count( $__data['items'] ) > 1 )
  1995. {
  1996. $_CHILD .= <<<EOF
  1997. <li>
  1998. <a href='{$this->settings['_base_url']}app={$app}&amp;module={$__data['items'][0]['module']}&amp;section={$__data['items'][0]['section']}&amp;{$__data['items'][0]['url']}'>{$__data['items'][0]['title']}</a>
  1999. <ul>
  2000. EOF;
  2001.  
  2002. $_seen = 0;
  2003. $seen_in_this_group = 0;
  2004. foreach( $__data['items'] as $_id => $_data )
  2005. {
  2006. $_seen++;
  2007.  
  2008. if( $seen_in_this_group == 0 )
  2009. {
  2010. $seen_in_this_group++;
  2011. continue;
  2012. }
  2013.  
  2014. $_class = '';
  2015. $_url = ( $_data['url'] ) ? "&amp;{$_data['url']}" : "";
  2016.  
  2017. if ( $_seen == count( $__data['items'] ) )
  2018. {
  2019. $_class = 'last';
  2020. }
  2021.  
  2022. $_CHILD .= <<<EOF
  2023. <li class='{$_class}'><a href="{$this->settings['_base_url']}app={$app}&amp;module={$_data['module']}&amp;section={$_data['section']}{$_url}">{$_data['title']}</a></li>
  2024. EOF;
  2025. }
  2026.  
  2027. $_CHILD .= <<<EOF
  2028. </ul>
  2029. </li>
  2030. EOF;
  2031. ####### / MORE THAN 1 CHILD ITEM #######
  2032. }
  2033. else
  2034. {
  2035. $_url = ( $__data['items'][0]['url'] ) ? "&amp;{$__data['items'][0]['url']}" : "";
  2036. $_CHILD .= <<<EOF
  2037. <li>
  2038. <a href="{$this->settings['_base_url']}app={$app}&amp;module={$__data['items'][0]['module']}&amp;section={$__data['items'][0]['section']}{$_url}">{$__data['items'][0]['title']}</a>
  2039. </li>
  2040.  
  2041. EOF;
  2042. }
  2043. }
  2044.  
  2045. if( $_CHILD )
  2046. {
  2047. $_MENU .= <<<EOF
  2048. <!-- MENU FOR {$data['title']}-->
  2049. <li class='{$class} has_sub'>
  2050. {$data['title']}
  2051. <ul>
  2052. {$_CHILD}
  2053. </ul>
  2054. </li>
  2055. EOF;
  2056. }
  2057. $_CHILD = '';
  2058.  
  2059. }
  2060. }
  2061.  
  2062. $IPBHTML .= <<<EOF
  2063.  
  2064. {$_MENU}
  2065. </ul>
  2066. EOF;
  2067.  
  2068. }
  2069.  
  2070. //--endhtml--//
  2071. return $IPBHTML;
  2072. }
  2073.  
  2074. /**
  2075. * Navigation HTML wrapper
  2076. *
  2077. * @access public
  2078. * @param string Menu content
  2079. * @return string HTML
  2080. */
  2081. public function wrap_nav($content="") {
  2082.  
  2083. $IPBHTML = "";
  2084. //--starthtml--//
  2085.  
  2086. $IPBHTML .= <<<EOF
  2087. <ol id='breadcrumb'>
  2088. {$content}
  2089. </ol>
  2090. EOF;
  2091.  
  2092. //--endhtml--//
  2093. return $IPBHTML;
  2094. }
  2095.  
  2096. /**
  2097. * Global informational message to display
  2098. *
  2099. * @access public
  2100. * @return string HTML
  2101. */
  2102. public function global_message() {
  2103. $IPBHTML = "";
  2104. //--starthtml--//
  2105.  
  2106. if( !$this->registry->getClass('output')->persistent_message )
  2107. {
  2108. $IPBHTML .= <<<EOF
  2109. <script type='text/javascript'>
  2110. document.observe("dom:loaded", function(){
  2111. ipb.global.showInlineNotification( "{$this->registry->getClass('output')->global_message}", { showClose: false } );
  2112. });
  2113. </script>
  2114. EOF;
  2115. }
  2116. else
  2117. {
  2118. $IPBHTML .= <<<EOF
  2119. <div class='information-box'>
  2120. EOF;
  2121. $IPBHTML .= $this->registry->getClass('output')->global_message;
  2122.  
  2123. $IPBHTML .= <<<EOF
  2124. </div>
  2125. <br />
  2126. EOF;
  2127. }
  2128.  
  2129. //--endhtml--//
  2130. return $IPBHTML;
  2131. }
  2132.  
  2133.  
  2134. /**
  2135. * Global error message to display
  2136. *
  2137. * @access public
  2138. * @return string HTML
  2139. */
  2140. public function global_error_message() {
  2141. $IPBHTML = "";
  2142. //--starthtml--//
  2143.  
  2144. $IPBHTML .= <<<EOF
  2145. <div class='warning'>
  2146. <h4>{$this->lang->words['ipb_message']}</h4>
  2147. {$this->registry->output->global_error}
  2148. </div>
  2149. <br />
  2150. EOF;
  2151.  
  2152. //--endhtml--//
  2153. return $IPBHTML;
  2154. }
  2155.  
  2156. /**
  2157. * Pagination wrapper
  2158. *
  2159. * @access public
  2160. * @param array Work data
  2161. * @param array Pagination data
  2162. * @return string HTML
  2163. */
  2164. public function paginationTemplate( $work, $data ) {
  2165. $IPBHTML = "";
  2166. //--starthtml--//
  2167.  
  2168. if( $work['pages'] > 1 )
  2169. {
  2170. $IPBHTML .= <<<EOF
  2171. <ul class='pagination'>
  2172. EOF;
  2173.  
  2174. if( !$data['noDropdown'] )
  2175. {
  2176. $IPBHTML .= <<<EOF
  2177. <li class='pagejump pj{$data['uniqid']}'>
  2178. <img src='{$this->settings['skin_acp_url']}/images/dropdown.png' alt='+' />
  2179. <script type='text/javascript'>
  2180. ipb.global.registerPageJump( '{$data['uniqid']}', { url: "{$data['baseUrl']}", stKey: '{$data['startValueKey']}', perPage: {$data['itemsPerPage']}, totalPages: {$work['pages']} } );
  2181. </script>
  2182. </li>
  2183. EOF;
  2184. }
  2185.  
  2186. if( 1 < ($work['current_page'] - $data['dotsSkip']) )
  2187. {
  2188. $IPBHTML .= <<<EOF
  2189. <li class='first'><a href='{$data['baseUrl']}&amp;{$data['startValueKey']}=0' title='{$this->lang->words['tpl_gotofirst']}' rel='start'>{$this->lang->words['_laquo']} {$this->lang->words['tpl_isfirst']}</a></li>
  2190. EOF;
  2191. }
  2192.  
  2193. if( $work['current_page'] > 1 )
  2194. {
  2195. $stkey = intval( $data['currentStartValue'] - $data['itemsPerPage'] );
  2196. $IPBHTML .= <<<EOF
  2197. <li class='prev'><a href="{$data['baseUrl']}&amp;{$data['startValueKey']}={$stkey}" title="{$this->lang->words['tpl_prev']}" rel='prev'>{$this->lang->words['pg_prev']}</a></li>
  2198. EOF;
  2199. }
  2200.  
  2201. if( count($work['_pageNumbers']) AND is_array($work['_pageNumbers']) )
  2202. {
  2203. foreach( $work['_pageNumbers'] as $_real => $_page )
  2204. {
  2205. if( $_real == $data['currentStartValue'] )
  2206. {
  2207. $IPBHTML .= <<<EOF
  2208. <li class='active'>{$_page}</li>
  2209. EOF;
  2210. }
  2211. else
  2212. {
  2213. $IPBHTML .= <<<EOF
  2214. <li><a href="{$data['baseUrl']}&amp;{$data['startValueKey']}={$_real}" title="{$_page}">{$_page}</a></li>
  2215. EOF;
  2216. }
  2217. }
  2218. }
  2219.  
  2220. if( $work['current_page'] < $work['pages'] )
  2221. {
  2222. $stkey = intval( $data['currentStartValue'] + $data['itemsPerPage'] );
  2223. $IPBHTML .= <<<EOF
  2224. <li class='next'><a href="{$data['baseUrl']}&amp;{$data['startValueKey']}={$stkey}" title="{$this->lang->words['tpl_next']}" rel='next'>{$this->lang->words['pg_next']}</a></li>
  2225. EOF;
  2226. }
  2227.  
  2228. if( !empty( $work['_showEndDots'] ) )
  2229. {
  2230. $stkey = intval( ( $work['pages'] - 1 ) * $data['itemsPerPage'] );
  2231. $IPBHTML .= <<<EOF
  2232. <li class='last'><a href="{$data['baseUrl']}&amp;{$data['startValueKey']}={$stkey}" title="{$this->lang->words['tpl_gotolast']}" rel='last'>{$this->lang->words['tpl_islast']} {$this->lang->words['_raquo']}</a></li>
  2233. EOF;
  2234. }
  2235.  
  2236. $_tplpages = sprintf( $this->lang->words['tpl_pages_acp'], $work['current_page'], $work['pages'] );
  2237.  
  2238. $IPBHTML .= <<<EOF
  2239. <li class='total'>({$_tplpages})</li>
  2240. </ul>
  2241. EOF;
  2242. }
  2243. else
  2244. {
  2245. $IPBHTML .= <<<EOF
  2246. <span class='pagination no_pages'>{$this->lang->words['page_1_of_1']}</span>
  2247. EOF;
  2248. }
  2249. //--endhtml--//
  2250. return $IPBHTML;
  2251. }
  2252.  
  2253.  
  2254. /**
  2255. * System error page
  2256. *
  2257. * @access public
  2258. * @param string Error message to show
  2259. * @param integer Error code
  2260. * @param string Error title
  2261. * @param string Document character set
  2262. * @return string HTML
  2263. */
  2264. public function system_error( $msg, $code=0, $title='', $IPS_DOC_CHAR_SET=IPS_DOC_CHAR_SET )
  2265. {
  2266. $title = !empty( $title ) ? $title : $this->lang->words['gbl_system_error'];
  2267.  
  2268. if( $code )
  2269. {
  2270. $finalMessage = "[#{$code}] " . ( is_array( $msg ) ? implode( "<br />", $msg ) : $msg );
  2271. }
  2272. else
  2273. {
  2274. $finalMessage = is_array( $msg ) ? implode( "<br />", $msg ) : $msg;
  2275. }
  2276.  
  2277. $HTML .= <<<EOF
  2278. <div class='warning'>
  2279. <h4>{$title}</h4>
  2280. <p><strong>{$finalMessage}</strong></p>
  2281. <br />
  2282. <ul>
  2283. <li><a href='javascript:history.go(-1)'>{$this->lang->words['gbl_go_back']}</a>
  2284. <li><a href='{$this->settings['_base_url']}'>{$this->lang->words['gbl_go_to_dashboard']}</a>
  2285. <li><a href='{$this->settings['base_url']}'>{$this->lang->words['gbl_go_to_module_home']}</a>
  2286. </ul>
  2287. </div>
  2288. EOF;
  2289.  
  2290. return $HTML;
  2291. }
  2292.  
  2293. /**
  2294. * HTML for quick help popup boxes
  2295. *
  2296. * @access public
  2297. * @param string Title
  2298. * @param string Help contents
  2299. * @return string HTML
  2300. */
  2301. public function quickHelp( $title, $body ) {
  2302.  
  2303. $IPBHTML = "";
  2304. //--starthtml--//
  2305.  
  2306. $IPBHTML .= <<<EOF
  2307. <div class='acp-box'>
  2308. <h3>{$title}</h3>
  2309. <div style='padding: 4px; line-height: 1.5'>{$body}</div>
  2310. </div>
  2311. EOF;
  2312.  
  2313. //--endhtml--//
  2314. return $IPBHTML;
  2315. }
  2316.  
  2317. }
Advertisement
Add Comment
Please, Sign In to add comment