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


PHP BlockView::setAreaObject方法代码示例

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


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

示例1: t

        echo t('Approve Changes');
        ?>
</a>
		<?php 
    }
    ?>
	</div>
	<div class="ccm-pane-body ccm-pane-body-footer clearfix" id="ccm-stack-container">
	<?php 
    $a = Area::get($stack, 'Main');
    $bv = new BlockView();
    $bv->renderElement('block_area_header', array('a' => $a));
    $bv->renderElement('block_area_header_view', array('a' => $a));
    foreach ($blocks as $b) {
        $bv = new BlockView();
        $bv->setAreaObject($a);
        $p = new Permissions($b);
        if ($p->canViewBlock()) {
            $bv->renderElement('block_controls', array('a' => $a, 'b' => $b, 'p' => $p));
            $bv->renderElement('block_header', array('a' => $a, 'b' => $b, 'p' => $p));
            $bv->render($b);
            $bv->renderElement('block_footer');
        }
    }
    $bv->renderElement('block_area_footer_view', array('a' => $a));
    print '</div>';
    // instead  of loading block area footer view
    ?>
	
	</div>
	<?php 
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:31,代码来源:view.php

示例2: display

 /**
  * displays the Area in the page
  * ex: $a = new Area('Main'); $a->display($c);
  * @param Page|Collection $c
  * @param Block[] $alternateBlockArray optional array of blocks to render instead of default behavior
  * @return void
  */
 function display(&$c, $alternateBlockArray = null)
 {
     if (!intval($c->cID)) {
         //Invalid Collection
         return false;
     }
     if ($this->arIsGlobal) {
         $stack = Stack::getByName($this->arHandle);
     }
     $currentPage = Page::getCurrentPage();
     $ourArea = self::getOrCreate($c, $this->arHandle, $this->arIsGlobal);
     if (count($this->customTemplateArray) > 0) {
         $ourArea->customTemplateArray = $this->customTemplateArray;
     }
     if (count($this->attributes) > 0) {
         $ourArea->attributes = $this->attributes;
     }
     if ($this->maximumBlocks > -1) {
         $ourArea->maximumBlocks = $this->maximumBlocks;
     }
     $ap = new Permissions($ourArea);
     if (!$ap->canViewArea()) {
         return false;
     }
     $blocksToDisplay = $alternateBlockArray ? $alternateBlockArray : $ourArea->getAreaBlocksArray($c, $ap);
     $this->totalBlocks = $ourArea->getTotalBlocksInArea();
     $u = new User();
     $bv = new BlockView();
     // now, we iterate through these block groups (which are actually arrays of block objects), and display them on the page
     if ($this->showControls && $c->isEditMode() && $ap->canViewAreaControls()) {
         $bv->renderElement('block_area_header', array('a' => $ourArea));
     }
     $bv->renderElement('block_area_header_view', array('a' => $ourArea));
     //display layouts tied to this area
     //Might need to move this to a better position
     $areaLayouts = $this->getAreaLayouts($c);
     if (is_array($areaLayouts) && count($areaLayouts)) {
         foreach ($areaLayouts as $layout) {
             $layout->display($c, $this);
         }
         if ($this->showControls && ($c->isArrangeMode() || $c->isEditMode())) {
             echo '<div class="ccm-layouts-block-arrange-placeholder ccm-block-arrange"></div>';
         }
     }
     $blockPositionInArea = 1;
     //for blockWrapper output
     foreach ($blocksToDisplay as $b) {
         $includeEditStrip = false;
         $bv = new BlockView();
         $bv->setAreaObject($ourArea);
         // this is useful for rendering areas from one page
         // onto the next and including interactive elements
         if ($currentPage->getCollectionID() != $c->getCollectionID()) {
             $b->setBlockActionCollectionID($c->getCollectionID());
         }
         if ($this->arIsGlobal && is_object($stack)) {
             $b->setBlockActionCollectionID($stack->getCollectionID());
         }
         $p = new Permissions($b);
         if ($c->isEditMode() && $this->showControls && $p->canViewEditInterface()) {
             $includeEditStrip = true;
         }
         if ($p->canViewBlock()) {
             if (!$c->isEditMode()) {
                 $this->outputBlockWrapper(true, $b, $blockPositionInArea);
             }
             if ($includeEditStrip) {
                 $bv->renderElement('block_controls', array('a' => $ourArea, 'b' => $b, 'p' => $p));
                 $bv->renderElement('block_header', array('a' => $ourArea, 'b' => $b, 'p' => $p));
             }
             $bv->render($b);
             if ($includeEditStrip) {
                 $bv->renderElement('block_footer');
             }
             if (!$c->isEditMode()) {
                 $this->outputBlockWrapper(false, $b, $blockPositionInArea);
             }
         }
         $blockPositionInArea++;
     }
     $bv->renderElement('block_area_footer_view', array('a' => $ourArea));
     if ($this->showControls && $c->isEditMode() && $ap->canViewAreaControls()) {
         $bv->renderElement('block_area_footer', array('a' => $ourArea));
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:92,代码来源:area.php


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