本文整理汇总了PHP中XoopsBlock::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsBlock::getContent方法的具体用法?PHP XoopsBlock::getContent怎么用?PHP XoopsBlock::getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsBlock
的用法示例。
在下文中一共展示了XoopsBlock::getContent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$block['title'] = $myblock->getVar('title', 'E');
$block['content'] = $myblock->getVar('content', 'n');
$block['modules'] =& $bmodule;
$block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type');
$block['is_custom'] = true;
$block['cachetime'] = intval($bcachetime);
echo '<a href="myblocksadmin.php">' . _AM_BADMIN . '</a> <span style="font-weight:bold;">»»</span> ' . $block['form_title'] . '<br /><br />';
include dirname(__FILE__) . '/../admin/myblockform.php';
//GIJ
//echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />';
//include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
$form->addElement($xoopsGTicket->getTicketXoopsForm(__LINE__, 1800, 'myblocksadmin'));
//GIJ
$form->display();
$original_level = error_reporting(E_ALL);
echo "\r\n <table width='100%' class='outer' cellspacing='1'>\r\n <tr>\r\n <th>" . $myblock->getVar('title') . "</th>\r\n </tr>\r\n <tr>\r\n <td class='odd'>" . $myblock->getContent('S', $bctype) . "</td>\r\n </tr>\r\n </table>\n";
error_reporting($original_level);
xoops_cp_footer();
/* echo '<script type="text/javascript">
preview_window = openWithSelfMain("'.XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
</script>';*/
exit;
}
/* if ($op == 'previewpopup') {
if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
exit('Invalid Referer');
}
$file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($_GET['file']));
if (file_exists($file)) {
include $file;
@unlink($file);
示例2: XoopsBlock
$block['form_title'] = _AM_EDITBLOCK;
$myblock = new XoopsBlock($bid);
$block['name'] = $myblock->getVar('name');
} else {
if ($op == 'save') {
$block['form_title'] = _AM_ADDBLOCK;
} else {
$block['form_title'] = _AM_CLONEBLOCK;
}
$myblock = new XoopsBlock();
$myblock->setVar('block_type', 'C');
}
$myts =& MyTextSanitizer::getInstance();
$myblock->setVar('title', $myts->stripSlashesGPC($btitle));
$myblock->setVar('content', $myts->stripSlashesGPC($bcontent));
$dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" /><meta http-equiv="content-language" content="' . _LANGCODE . '" /><title>' . $xoopsConfig['sitename'] . '</title><link rel="stylesheet" type="text/css" media="all" href="' . getcss($xoopsConfig['theme_set']) . '" /></head><body><table><tr><th>' . $myblock->getVar('title') . '</th></tr><tr><td>' . $myblock->getContent('S', $bctype) . '</td></tr></table></body></html>';
$dummyfile = '_dummyfile_' . time() . '.html';
$fp = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w');
fwrite($fp, $dummyhtml);
fclose($fp);
$block['edit_form'] = false;
$block['template'] = '';
$block['op'] = $op;
$block['side'] = $bside;
$block['weight'] = $bweight;
$block['visible'] = $bvisible;
$block['title'] = $myblock->getVar('title', 'E');
$block['content'] = $myblock->getVar('content', 'E');
$block['modules'] =& $bmodule;
$block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type');
$block['is_custom'] = true;
示例3: test_getContent
public function test_getContent()
{
$instance = new XoopsBlock();
$level = ob_get_level();
$value = $instance->getContent();
while (ob_get_level() > $level) {
ob_end_clean();
}
$this->assertSame('', $value);
$value = $instance->getContent('s', 'T');
$this->assertSame('', $value);
$value = $instance->getContent('s', 'H');
$this->assertSame('', $value);
$value = $instance->getContent('s', 'P');
$this->assertSame('', $value);
$value = $instance->getContent('s', 'S');
$this->assertSame('', $value);
$value = $instance->getContent('e');
$this->assertSame('', $value);
$value = $instance->getContent('default');
$this->assertSame(null, $value);
}
示例4: XoopsBlock
if ($op == 'save') {
$block['form_title'] = _AM_ADDBLOCK;
} else {
$block['form_title'] = _AM_CLONEBLOCK;
}
$myblock = new XoopsBlock();
$myblock->setVar('block_type', 'C');
}
$myts =& MyTextSanitizer::getInstance();
$myblock->setVar('title', $myts->stripSlashesGPC($btitle));
$myblock->setVar('content', $myts->stripSlashesGPC($bcontent));
$dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />';
$dummyhtml .= '<meta http-equiv="content-language" content="' . _LANGCODE . '" /><title>' . $xoopsConfig['sitename'] . '</title>';
$dummyhtml .= '<link rel="stylesheet" type="text/css" media="all" href="' . xoops_getcss($xoopsConfig['theme_set']) . '" />';
$dummyhtml .= '</head><body><table><tr><th>' . $myblock->getVar('title') . '</th></tr><tr><td>';
$dummyhtml .= $myblock->getContent('S', $bctype) . '</td></tr></table></body></html>';
$block['groups'] = $bgroups;
$block['edit_form'] = false;
$block['template'] = '';
$block['op'] = $op;
$block['side'] = $bside;
$block['weight'] = $bweight;
$block['visible'] = $bvisible;
$block['title'] = $myblock->getVar('title', 'E');
$block['content'] = $myblock->getVar('content', 'E');
$block['modules'] =& $bmodule;
$block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type');
$block['is_custom'] = true;
$block['cachetime'] = intval($bcachetime);
echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a> <span style="font-weight:bold;">»»</span> ' . $block['form_title'] . '<br /><br />';
include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php';
示例5: intval
$block['cachetime'] = intval($bcachetime);
echo '<a href="myblocksadmin.php">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />';
include dirname(__FILE__).'/../admin/myblockform.php'; //GIJ
//echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />';
//include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
$form->addElement( $xoopsGTicket->getTicketXoopsForm( __LINE__ ) );//GIJ
$form->display();
$original_level = error_reporting( E_ALL ) ;
echo "
<table width='100%' class='outer' cellspacing='1'>
<tr>
<th>".$myblock->getVar('title')."</th>
</tr>
<tr>
<td class='odd'>".$myblock->getContent('S', $bctype)."</td>
</tr>
</table>\n" ;
error_reporting( $original_level ) ;
xoops_cp_footer();
/* echo '<script type="text/javascript">
preview_window = openWithSelfMain("'.XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
</script>';*/
exit();
}
/* if ($op == 'previewpopup') {
if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
exit('Invalid Referer');
示例6: previewContent
function previewContent($block_data)
{
$bid = intval($block_data['bid']);
if (!$block_data['is_custom']) {
return '';
}
if (empty($this->preview_request)) {
return '';
}
$block = new XoopsBlock($bid);
if ($block->getVar('mid')) {
return '';
}
$block->setVar('title', $block_data['title']);
$block->setVar('content', $block_data['content']);
restore_error_handler();
$original_level = error_reporting(E_ALL);
$ret = $block->getContent('S', $block_data['ctype']);
error_reporting($original_level);
return $ret;
}
示例7: previewContent
function previewContent($block_data)
{
$bid = intval($block_data['bid']);
if (!$block_data['is_custom']) {
return '';
}
if (empty($this->preview_request)) {
return '';
}
//HACK by domifara
//TODO : need no hook block at this
$block = new XoopsBlock($bid);
/*
$handler =& xoops_gethandler('block');
$block =& $handler->create(false) ;
$block->load($bid) ;
*/
if ($block->getVar('mid')) {
return '';
}
$block->setVar('title', $block_data['title']);
$block->setVar('content', $block_data['content']);
restore_error_handler();
$original_level = error_reporting(E_ALL);
$ret = $block->getContent('S', $block_data['ctype']);
error_reporting($original_level);
return $ret;
}