当前位置: 首页>>代码示例>>PHP>>正文


PHP Legacy_Utils::createBlockProcedure方法代码示例

本文整理汇总了PHP中Legacy_Utils::createBlockProcedure方法的典型用法代码示例。如果您正苦于以下问题:PHP Legacy_Utils::createBlockProcedure方法的具体用法?PHP Legacy_Utils::createBlockProcedure怎么用?PHP Legacy_Utils::createBlockProcedure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Legacy_Utils的用法示例。


在下文中一共展示了Legacy_Utils::createBlockProcedure方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setupBlock

 function setupBlock()
 {
     $showFlag = 0;
     $mid = 0;
     if ($this->mController->mRoot->mContext->mModule != null) {
         $showFlag = preg_match("/index\\.php\$/i", xoops_getenv('PHP_SELF')) && $this->mController->mRoot->mContext->mXoopsConfig['startpage'] == $this->mController->mRoot->mContext->mXoopsModule->get('dirname');
         $mid = $this->mController->mRoot->mContext->mXoopsModule->get('mid');
     } else {
         //
         // If you does not have module_contoller, this request is to toppage or other pages of toppage.
         //
         // $mid = preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) ? -1 : 0;
         $pathArray = parse_url(!empty($_SERVER['PATH_INFO']) ? substr($_SERVER['PHP_SELF'], 0, -strlen($_SERVER['PATH_INFO'])) : $_SERVER['PHP_SELF']);
         $mid = preg_match("#(/index\\.php|/)\$#i", @$pathArray['path']) ? -1 : 0;
     }
     $blockHandler =& xoops_gethandler('block');
     $showCenterFlag = SHOW_CENTERBLOCK_LEFT | SHOW_CENTERBLOCK_CENTER | SHOW_CENTERBLOCK_RIGHT;
     $showRightFlag = SHOW_SIDEBLOCK_RIGHT;
     $showFlag = SHOW_SIDEBLOCK_LEFT | $showRightFlag | $showCenterFlag;
     $groups = is_object($this->mController->mRoot->mContext->mXoopsUser) ? $this->mController->mRoot->mContext->mXoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
     $blockObjects =& $blockHandler->getBlocks($groups, $mid, $showFlag);
     foreach ($blockObjects as $blockObject) {
         $block =& Legacy_Utils::createBlockProcedure($blockObject);
         if ($block->prepare() !== false) {
             $this->mController->_mBlockChain[] =& $block;
         }
         unset($block);
         unset($blockObject);
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:30,代码来源:Legacy_PublicControllerStrategy.class.php

示例2: renderCell4BlockOptions

 function renderCell4BlockOptions($block_data)
 {
     if ($this->target_dirname && substr($this->target_dirname, 0, 1) != '_') {
         $langman =& D3LanguageManager::getInstance();
         $langman->read('admin.php', $this->target_dirname);
     }
     $bid = intval($block_data['bid']);
     $block = new XoopsBlock($bid);
     $legacy_block =& Legacy_Utils::createBlockProcedure($block);
     return $legacy_block->getOptionForm();
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:11,代码来源:MyBlocksAdminForXCL21.class.php

示例3: renderCell4BlockOptions

 function renderCell4BlockOptions($block_data)
 {
     if ($this->target_dirname && substr($this->target_dirname, 0, 1) != '_') {
         $langman =& D3LanguageManager::getInstance();
         $langman->read('admin.php', $this->target_dirname);
     }
     $bid = intval($block_data['bid']);
     //HACK by domifara
     //	$block = new XoopsBlock( $bid ) ;
     $handler =& xoops_gethandler('block');
     $block =& $handler->create(false);
     $block->load($bid);
     $legacy_block =& Legacy_Utils::createBlockProcedure($block);
     return $legacy_block->getOptionForm();
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:15,代码来源:MyBlocksAdminForXCL21.class.php

示例4: cubeUtils_GetBlock

/**
 *
 * @package CubeUtils
 * @version $Id: xoops_version.php 1294 2008-01-31 05:32:20Z nobunobu $
 * @copyright Copyright 2006-2008 NobuNobuXOOPS Project <http://sourceforge.net/projects/nobunobuxoops/>
 * @author NobuNobu <nobunobu@nobunobu.com>
 * @license http://www.gnu.org/licenses/gpl.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
function cubeUtils_GetBlock($bid, $useCache = true)
{
    $blockHandler =& xoops_gethandler('block');
    $blockObject =& $blockHandler->get($bid);
    if (!$blockObject) {
        return false;
    }
    $blockProcedure =& Legacy_Utils::createBlockProcedure($blockObject);
    if ($blockProcedure->prepare()) {
        $root =& XCube_Root::getSingleton();
        $controller = $root->mController;
        $context =& $root->mContext;
        $usedCacheFlag = false;
        $cacheInfo = null;
        if ($useCache) {
            if ($controller->isEnableCacheFeature() && $blockProcedure->isEnableCache()) {
                $cacheInfo =& $blockProcedure->createCacheInfo();
                $controller->mSetBlockCachePolicy->call(new XCube_Ref($cacheInfo));
                $filepath = $cacheInfo->getCacheFilePath();
                if ($cacheInfo->isEnableCache() && $controller->existActiveCacheFile($filepath, $blockProcedure->getCacheTime())) {
                    $content = $controller->loadCache($filepath);
                    if ($blockProcedure->isDisplay() && !empty($content)) {
                        $block['content'] = $content;
                    }
                    $usedCacheFlag = true;
                }
            }
        }
        if (!$usedCacheFlag) {
            $blockProcedure->execute();
            $renderBuffer = null;
            if ($blockProcedure->isDisplay()) {
                $renderBuffer =& $blockProcedure->getRenderTarget();
                $block['content'] = $renderBuffer->getResult();
            } else {
                $renderBuffer = new XCube_RenderTarget();
            }
            if ($useCache) {
                if ($controller->isEnableCacheFeature() && $blockProcedure->isEnableCache() && is_object($cacheInfo) && $cacheInfo->isEnableCache()) {
                    $controller->cacheRenderTarget($cacheInfo->getCacheFilePath(), $renderBuffer);
                }
            }
        }
    }
    return $block;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:55,代码来源:blockFunc.inc.php

示例5: _getOptionForm

 /**
  * Gets rendered HTML buffer of the block optional edit form.
  */
 function _getOptionForm()
 {
     $block =& Legacy_Utils::createBlockProcedure($this->mObject);
     return $block->getOptionForm();
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:8,代码来源:BlockEditAction.class.php

示例6: _getBlockProcedure

 /**
  * ブロックプロシージャを生成する
  * @param XoopsBlock $xoopsBlock 
  * @returns Legacy_BlockProcedure
  */
 protected function _getBlockProcedure(XoopsBlock $xoopsBlock)
 {
     return Legacy_Utils::createBlockProcedure($xoopsBlock);
 }
开发者ID:nouphet,项目名称:xoopscube-preloads,代码行数:9,代码来源:SampleFetchBlockContents.class.php

示例7: executeXCL2CLASS

 function executeXCL2CLASS($dummy = '', $max_entries = '')
 {
     if (!$this->init()) {
         return array();
     }
     // file check
     if (!file_exists($this->func_file)) {
         $this->errors[] = _MD_D3PIPES_ERR_INVALIDFILEINBLOCK . "\n" . $this->func_file . ' (' . get_class($this) . ')';
         return array();
     }
     require_once $this->func_file;
     //d3module and function type module check
     if (function_exists($this->func_name) || array_key_exists('disable_renderer', $this->block_options)) {
         $block = $this->executeStandard($dummy, $max_entries);
         return $block;
     }
     //----------  get block object  ----------//
     //XCL modules
     $db =& XoopsDatabaseFactory::getDatabaseConnection();
     //chanhe class_name -> func_name
     //only no xoos_trust_path module class type , convert class_name to func_name
     //you need to set $this->func_name when xoos_trust_path module class type
     if (!empty($this->class_name) && empty($this->func_name)) {
         if (!empty($this->trustdirname)) {
             $this->func_name = 'cl::' . preg_replace('/^' . $this->trustdirname . '_/i', '', $this->class_name);
         } else {
             $this->func_name = 'cl::' . preg_replace('/^' . $this->target_dirname . '_/i', '', $this->class_name);
         }
     }
     //get bid
     $sql = "SELECT bid FROM " . $db->prefix("newblocks") . " WHERE dirname=" . $db->quoteString($this->target_dirname) . " AND show_func=" . $db->quoteString($this->func_name) . " AND block_type='M' ";
     $result = $db->query($sql);
     list($bid) = $db->fetchRow($result);
     // bid check old function
     if (empty($bid)) {
         $block = $this->executeStandard($dummy, $max_entries);
         return $block;
     }
     //----------  module object check ----------//
     $module_handler =& xoops_gethandler('module');
     $module = $module_handler->getByDirname($this->target_dirname);
     if (!is_object($module) || !$module->getVar('isactive')) {
         $this->errors[] = _MD_D3PIPES_ERR_INVALIDPIPEIDINBLOCK . "\n" . ' modulet not found : target_dirname=' . $this->target_dirname . ' func_name=' . $this->func_name . ' (' . get_class($this) . ')';
         return array();
     }
     //----------  get block object  ----------//
     $blockHandler =& xoops_gethandler('block');
     $blockObject =& $blockHandler->get($bid);
     if (!is_object($blockObject)) {
         $this->errors[] = _MD_D3PIPES_ERR_INVALIDPIPEIDINBLOCK . "\n" . ' block object not found : target_dirname=' . $this->target_dirname . ' func_name=' . $this->func_name . ' (' . get_class($this) . ')';
         return array();
     }
     //XCL AND other Xoops single module
     $options_separated = implode('|', $this->block_options);
     $blockObject->set('options', $options_separated);
     //get tager of block
     $blockProcedure =& Legacy_Utils::createBlockProcedure($blockObject);
     $blockProcedure->prepare();
     $blockProcedure->execute();
     $target =& $blockProcedure->getRenderTarget();
     $buffer = $target->getAttributes();
     //class type
     $block = $buffer;
     // update lastfetch_time
     $db->queryF("UPDATE " . $db->prefix($this->mydirname . "_pipes") . " SET lastfetch_time=UNIX_TIMESTAMP() WHERE pipe_id={$this->pipe_id}");
     return $this->reassign($block);
 }
开发者ID:nouphet,项目名称:rata,代码行数:67,代码来源:D3pipesBlockAbstract.class.php


注:本文中的Legacy_Utils::createBlockProcedure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。