本文整理匯總了PHP中vB_AJAX_XML_Builder::fetch_xml方法的典型用法代碼示例。如果您正苦於以下問題:PHP vB_AJAX_XML_Builder::fetch_xml方法的具體用法?PHP vB_AJAX_XML_Builder::fetch_xml怎麽用?PHP vB_AJAX_XML_Builder::fetch_xml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vB_AJAX_XML_Builder
的用法示例。
在下文中一共展示了vB_AJAX_XML_Builder::fetch_xml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
/**
* Renders the view to a string and returns it.
*
* @return string
*/
public function render($send_content_headers = false)
{
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder(vB::$vbulletin, 'text/xml');
$xml->add_group('container');
$xml->add_tag('success', 1);
if ($this->content) {
$xml->add_tag('html', $this->content->render());
}
$xml->add_tag('title', $this->title);
$xml->add_tag('status', $this->status);
$xml->add_tag('message', $this->feedback);
if (sizeof($this->errors)) {
$xml->add_group('errors');
foreach ($this->errors as $error) {
$xml->add_tag('error', $error['message'], array('errcode' => $error['code']));
}
$xml->close_group();
}
if (sizeof($this->urls)) {
$xml->add_group('urls');
foreach ($this->urls as $type => $url) {
$xml->add_tag('url', $url, array('type' => $type));
}
$xml->close_group();
}
$xml->close_group();
if ($send_content_headers and !vB::contentHeadersSent()) {
$xml->send_content_type_header();
$xml->send_content_length_header();
vB::contentHeadersSent(true);
}
return $xml->fetch_xml();
}
示例2: actionSwitchMode
/**
* 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();
}