Пример #1
0
 /**
  * Sets the style to use for successive templates.
  *
  * @param int $styleid						- The id of the style to use
  */
 public function setStyle($styleid)
 {
     if (!IS_MOBILE_STYLE) {
         $this->styleid = $styleid;
         $this->bootstrap->force_styleid($this->styleid);
     }
 }
Пример #2
0
	/**
	 * Gets editor in the selected mode.
	 *
	 * @return string
	 */
	public function actionSwitchMode()
	{
		// Set up the style info - we need charset to be set for convert_urlencoded_unicode
		$this->bootstrap->force_styleid(0);
		$this->bootstrap->load_style();


		require_once DIR . '/includes/class_xml.php';

		vB::$vbulletin->input->clean_array_gpc('r', array(
			'towysiwyg' => vB_Input::TYPE_BOOL,
			'allowsmilie' => vB_Input::TYPE_BOOL,
			'message' => vB_Input::TYPE_STR,
		));

		vB::$vbulletin->GPC['message'] = convert_urlencoded_unicode(vB::$vbulletin->GPC['message']);

		$xml = new vB_AJAX_XML_Builder(vB::$vbulletin, 'text/xml');

		if (vB::$vbulletin->GPC['towysiwyg'])
		{
			$wysiwyg_parser = new vBCms_BBCode_Wysiwyg(vB::$vbulletin, vBCms_BBCode_Wysiwyg::fetchCmsTags());

			// todo: options
			$wysiwyg_html = $wysiwyg_parser->do_parse(vB::$vbulletin->GPC['message'], false, vB::$vbulletin->GPC['allowsmilie'], true, true, true);

			$xml->add_tag('message', process_replacement_vars($wysiwyg_html));
		}
		else
		{
			$html_parser = new vBCms_WysiwygHtmlParser(vB::$vbulletin);
			$do_html = false; // todo: option
			$message = $html_parser->parse(vB::$vbulletin->GPC['message'], $do_html);

			$xml->add_tag('message', process_replacement_vars($message));
		}

		if (!vB::contentHeadersSent())
		{
			$xml->send_content_type_header();
			$xml->send_content_length_header();

			vB::contentHeadersSent(true);
		}

		return $xml->fetch_xml();
	}
Пример #3
0
 /**
  * Sets the style to use for successive templates.
  *
  * @param int $styleid						- The id of the style to use
  */
 public function setStyle($styleid)
 {
     $this->styleid = $styleid;
     $this->bootstrap->force_styleid($this->styleid);
 }