本文整理汇总了PHP中JResponse::GetBody方法的典型用法代码示例。如果您正苦于以下问题:PHP JResponse::GetBody方法的具体用法?PHP JResponse::GetBody怎么用?PHP JResponse::GetBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JResponse
的用法示例。
在下文中一共展示了JResponse::GetBody方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterRender
public function onAfterRender()
{
if ($this->app->isAdmin()) {
return;
}
$app = JFactory::getApplication();
$option = $app->input->get('option');
$view = $app->input->get('view');
$tmpl = $app->input->get('tmpl');
$body = JResponse::GetBody();
if ($app->isSite() && $tmpl != 'component') {
$_cls = explode(',', $this->_params->get('item_class'));
if (empty($_cls)) {
return;
}
$cls = array();
for ($i = 0; $i < count($_cls); $i++) {
$cls[] = trim($_cls[$i]);
}
$cls_str = implode(', ', $cls);
$body = str_replace('</body>', $this->_addScriptQV($cls_str) . '</body>', $body);
JResponse::setBody($body);
return true;
}
$is_ajax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
$is_ajax_qv = (int) JRequest::getVar('isajax_qv', 0);
if ($is_ajax && $is_ajax_qv) {
$body = JResponse::GetBody();
preg_match("~<body.*?>(.*?)<\\/body>~is", $body, $match);
echo '<div id="sj_quickview">' . $match[1] . '</div>';
die;
//die(json_encode('<div id="sj_quickview">'.$match[1].'</div>'));
}
}
示例2: onAfterRender
function onAfterRender()
{
$runmode = $this->params->get('runmode');
if ($runmode != 1) return;
// $user =& JFactory::getUser();
$app = JFactory::getApplication();
if ($app->isSite()) {
$page = JResponse::GetBody();
$page = do_shortcode($page);
JResponse::SetBody($page);
}
}
示例3: addBtnShortCodes
public function addBtnShortCodes()
{
$page = JResponse::GetBody();
$button = $this->listShortCodes();
$stext = '<script type="text/javascript">
function jSelectShortcode(text) {
jQuery("#yt_shorcodes").removeClass("open");
text = text.replace(/\'/g, \'"\');
//1.Editor Content
if(document.getElementById(\'jform_articletext\') != null) {
jInsertEditorText(text, \'jform_articletext\');
}
if(document.getElementById(\'jform_description\') != null) {
jInsertEditorText(text, \'jform_description\');
}
//2.Editor K2
if(document.getElementById(\'description\') != null) {
jInsertEditorText(text, \'description\');
}
if(document.getElementById(\'text\') != null) {
jInsertEditorText(text, \'text\');
}
//3.Editor VirtueMart
if(document.getElementById(\'category_description\') != null) {
jInsertEditorText(text, \'category_description\');
}
if(document.getElementById(\'product_desc\') != null) {
jInsertEditorText(text, \'product_desc\');
}
//4.Editor Contact
if(document.getElementById(\'jform_misc\') != null) {
jInsertEditorText(text, \'jform_misc\');
}
//5.Editor Easyblog
if(document.getElementById(\'write_content\') != null) {
jInsertEditorText(text, \'write_content\');
}
//6.Editor Joomshoping
if(document.getElementById(\'description1\') != null) {
jInsertEditorText(text, \'description1\');
}
//6.Editor HTML
if(document.getElementById(\'jform_content\') != null) {
jInsertEditorText(text, \'jform_content\');
}
SqueezeBox.close();
}
</script>';
$page = str_replace('<div id="editor-xtd-buttons">', '<div id="editor-xtd-buttons">' . $button, $page);
$page = str_replace('<div id="editor-xtd-buttons" class="btn-toolbar pull-left">', '<div id="editor-xtd-buttons" class="btn-toolbar pull-left">' . $button, $page);
$page = str_replace('</body>', $stext . '</body>', $page);
JResponse::SetBody($page);
}
示例4: onAfterRender
function onAfterRender()
{
if ($this->_admin || $this->_view == '') {
return;
}
$body = JResponse::GetBody();
if ($this->_params->get('display_pagination') == 0) {
$body = str_replace('div class="pagination">', 'div class="pagination" style="display:none;">', $body);
}
$body = str_replace('</body>', $this->addBtnLoadMore() . '</body>', $body);
$body = str_replace('</body>', $this->addjQuery() . '</body>', $body);
JResponse::setBody($body);
return true;
}