52 $this->theme->template->assignByRef(
'xoBlocks', $this->blocks);
84 $xoops = Xoops::getinstance();
88 $isStart = (substr(
$_SERVER[
'PHP_SELF'], -9) ==
'index.php' &&
$xoops->getConfig(
'startpage') ==
$xoops->module->getVar(
'dirname') && empty(
$_SERVER[
'QUERY_STRING']));
91 $isStart =
$xoops->getOption(
'show_cblock');
102 foreach ($oldzones as $zone) {
103 $this->blocks[$zone] = array();
107 $template = $this->theme->template;
109 $template->caching, $template->cache_lifetime
115 $block_handler =
$xoops->getHandlerBlock();
117 $xoops->preload()->triggerEvent(
'core.class.theme_blocks.retrieveBlocks', array(&$this, &$template, &$block_arr));
118 foreach ($block_arr as $block) {
120 $side = $oldzones[$block->getVar(
'side')];
122 $this->blocks[$side][
$var[
"id"]] =
$var;
126 list ($template->caching, $template->cache_lifetime) = $backup;
139 $cache_id = $this->theme->generateCacheId($cache_id);
156 $dirname = $xobject->getVar(
'dirname');
158 'id' => $xobject->getVar(
'bid'),
'module' =>
$dirname,
'title' => $xobject->getVar(
'title'),
159 'weight' => $xobject->getVar(
'weight'),
'lastmod' => $xobject->getVar(
'last_modified')
162 $bcachetime = intval($xobject->getVar(
'bcachetime'));
163 if (empty($bcachetime)) {
164 $template->caching = 0;
166 $template->caching = 2;
167 $template->cache_lifetime = $bcachetime;
170 $tplName = ($tplName = $xobject->getVar(
'template'))
171 ?
"block:{$dirname}/{$tplName}"
172 :
"module:system/system_block_dummy.tpl";
177 $xoops->preload()->triggerEvent(
'core.themeblocks.buildblock.start', array($xobject, $template->isCached($tplName, $cacheid)));
179 if (!$bcachetime || !$template->isCached($tplName, $cacheid)) {
183 if ($this->theme && $bcachetime) {
184 foreach ($this->theme->metas as
$type => $value) {
190 if ($bresult = $xobject->buildBlock()) {
191 $template->assign(
'block', $bresult);
192 $block[
'content'] = $template->fetch($tplName, $cacheid);
198 if ($this->theme && $bcachetime) {
200 foreach ($this->theme->metas as
$type => $value) {
203 $metas[
$type] = $dif;
211 $block[
'content'] = $template->fetch($tplName, $cacheid);
215 if ($this->theme && $bcachetime) {
217 foreach ($metas as
$type => $value) {
218 $this->theme->metas[
$type] = array_merge($this->theme->metas[
$type], $metas[
$type]);
222 $template->setCompileId();
const XOOPS_SIDEBLOCK_RIGHT
const XOOPS_CENTERBLOCK_BOTTOMLEFT
const XOOPS_CENTERBLOCK_LEFT
generateCacheId($cache_id)
const XOOPS_BLOCK_VISIBLE
const XOOPS_CENTERBLOCK_RIGHT
const XOOPS_SIDEBLOCK_LEFT
static write($key, $value, $duration=0)
const XOOPS_CENTERBLOCK_BOTTOM
const XOOPS_CENTERBLOCK_CENTER
buildBlock($xobject, &$template)
static arrayRecursiveDiff(array $aArray1, array $aArray2)
const XOOPS_CENTERBLOCK_BOTTOMRIGHT