Beispiel #1
0
 /**
  * Register globally accessible vars.
  *
  * @param bool $final_render				- Whether we are rendering the final response
  */
 protected function register_globals($final_render = false)
 {
     if ($this->registered_globals) {
         return;
     }
     $this->registered_globals = true;
     global $vbulletin, $style;
     $this->register_ref('bbuserinfo', $vbulletin->userinfo);
     $this->register_ref('vboptions', $vbulletin->options);
     $this->register_ref('session', $vbulletin->session->vars);
     $this->register('relpath', htmlspecialchars_uni($vbulletin->input->fetch_relpath()));
     $this->register_global('vbphrase');
     $this->register_global('vbcollapse');
     $this->register_global('ad_location');
     $this->register_global('style');
     $this->register_global('show', false);
     $this->register_global('template_hook', false);
     $vbcsspath = vB_Template::fetch_css_path();
     $this->register('vbcsspath', $vbcsspath);
     $this->register('yui_version', YUI_VERSION);
     if ($vbulletin->products['vbcms']) {
         $this->register('vb_suite_installed', true);
     }
     // If we're using bgclass, we might be using exec_switch_bg()
     // but we can only be sure if we match the global value.
     // A hack that will hopefully go away.
     if (isset($bgclass) and $bgclass == $GLOBALS['bgclass']) {
         $this->register_ref('bgclass', $GLOBALS['bgclass']);
     }
 }
Beispiel #2
0
 /**
  * Sets dynamic configuration options that should be used on all vbulletin editors
  * These options get serialized to JSON and passed to the the editor instance as config options
  */
 protected function setGlobalConfig()
 {
     global $style;
     $this->config['customConfig'] = vB::$vbulletin->options['bburl'] . '/clientscript/ckeditor_config.js?v=' . vB::$vbulletin->options['simpleversion'];
     $css_path = (empty(vB::$vbulletin->options['cssurl']) ? vB::$vbulletin->options['bburl'] . '/' : '') . vB_Template::fetch_css_path();
     $this->config['contentsCss'] = $css_path . 'editor_contents.css';
     $this->config['yuiUploadCss'] = str_replace('&', '&', $css_path . 'yuiupload.css');
     if (vB::$vbulletin->options['storecssasfile']) {
         $this->config['contentsCss'] .= '?d=' . $style['dateline'];
         $this->config['yuiUploadCss'] .= '?d=' . $style['dateline'];
     }
     $this->config['vbulletin'] = array('securitytoken' => vB::$vbulletin->userinfo['securitytoken'], 'bburl' => vB::$vbulletin->options['bburl'], 'bbcodecache' => vB::$vbulletin->bbcodecache);
     $this->config['vbulletin']['lastphraseupdate'] = intval($this->vbphrasegroup['ckeditor']['maxdateline']);
     $this->config['vbulletin']['contenttypeid'] = $this->contenttypeid;
     $this->config['vbulletin']['contentid'] = intval($this->contentid);
     $this->config['vbulletin']['parentcontentid'] = intval($this->parentcontentid);
     $this->config['vbulletin']['userid'] = intval($this->userid);
     $postautosave = intval(vB::$vbulletin->options['postautosave']);
     if ($postautosave and $postautosave < 20) {
         $postautosave = 20;
     }
     $this->config['vbulletin']['postautosave'] = $postautosave;
     $this->config['vbulletin']['phrase'] = array('attachments' => $this->vbphrase['attachments'], 'wrap_quote_tags' => $this->vbphrase['wrap_quote_tags'], 'wrap_html_tags' => $this->vbphrase['wrap_html_tags'], 'wrap_php_tags' => $this->vbphrase['wrap_php_tags'], 'wrap_code_tags' => $this->vbphrase['wrap_code_tags'], 'wrap_x_tags' => $this->vbphrase['wrap_x_tags'], 'enter_tag_option' => $this->vbphrase['enter_tag_option'], 'enter_video_url_below' => $this->vbphrase['enter_video_url_below'], 'example_video_url' => $this->vbphrase['example_video_url'], 'insert_video' => $this->vbphrase['insert_video'], 'insert_video_clip' => $this->vbphrase['insert_video_clip'], 'supported_videos' => $this->vbphrase['supported_videos'], 'insert_preview_break' => $this->vbphrase['insert_preview_break'], 'insert_page_break' => $this->vbphrase['insert_page_break'], 'this_message_already_contains_a_preview_break' => $this->vbphrase['this_message_already_contains_a_preview_break'], 'switch_editor_mode' => $this->vbphrase['switch_editor_mode'], 'enter_link_url' => $this->vbphrase['enter_link_url'], 'enter_list_item' => $this->vbphrase['enter_list_item'], 'iespell_not_installed' => $this->vbphrase['iespell_not_installed']);
     $this->config['language'] = vB::$vbulletin->userinfo['lang_code'];
     if (vB::$vbulletin->stylevars['textdirection']['string'] == 'rtl') {
         $this->config['contentsLangDirection'] = 'rtl';
     }
     $this->config['smiley_categories'] = array();
     $this->config['smiley_images'] = array();
     $this->config['smiley_descriptions'] = array();
     $this->config['indentOffset'] = EDITOR_INDENT;
     $this->setEditorMode();
 }