コード例 #1
0
		<?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 
    echo Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);
    ?>
コード例 #2
0
    echo '<div class="ccm-notification">';
    echo t('This block is an alias of Page Defaults. Editing it here will "disconnect" it so changes to Page Defaults will no longer affect this block.');
    echo '</div>';
}
if (is_object($b)) {
    switch ($_REQUEST['btask']) {
        case 'block_css':
            if ($bp->canWrite()) {
                $style = $b->getBlockCustomStyleRule();
                $action = $b->getBlockUpdateCssAction();
                if ($_REQUEST['subtask'] == 'delete_custom_style_preset') {
                    $styleToDelete = CustomStylePreset::getByID($_REQUEST['deleteCspID']);
                    $styleToDelete->delete();
                }
                $refreshAction = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_block_popup?btask=block_css&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&bID=' . $b->getBlockID() . '&isGlobal=' . $_REQUEST['isGlobal'] . '&refresh=1';
                $bv->renderElement('custom_style', array('b' => $b, 'rcID' => $rcID, 'c' => $c, 'a' => $a, 'style' => $style, 'action' => $action, 'refreshAction' => $refreshAction));
            }
            break;
        case 'template':
            if ($bp->canWrite()) {
                $bv->renderElement('block_custom_template', array('b' => $b, 'rcID' => $rcID));
            }
            break;
        case 'view':
            if ($bp->canRead()) {
                $bv->render($b, 'view', array('c' => $c, 'a' => $a));
            }
            break;
        case 'view_edit_mode':
            if ($bp->canWrite() || $c->canWrite() && $b->isGlobalBlock() && $b->canRead()) {
                $btc = $b->getInstance();
コード例 #3
0
ファイル: area.php プロジェクト: ojalehto/concrete5-legacy
 /**
  * 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));
     }
 }
コード例 #4
0
    echo '<div class="ccm-ui"><div class="alert-message block-message warning">';
    echo t('This block is an alias of Page Defaults. Editing it here will "disconnect" it so changes to Page Defaults will no longer affect this block.');
    echo '</div></div>';
}
if (is_object($b)) {
    switch ($_REQUEST['btask']) {
        case 'block_css':
            if ($bp->canEditBlockDesign()) {
                $style = $b->getBlockCustomStyleRule();
                $action = $b->getBlockUpdateCssAction();
                if ($_REQUEST['subtask'] == 'delete_custom_style_preset') {
                    $styleToDelete = CustomStylePreset::getByID($_REQUEST['deleteCspID']);
                    $styleToDelete->delete();
                }
                $refreshAction = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_block_popup?btask=block_css&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&bID=' . $b->getBlockID() . '&refresh=1';
                $bv->renderElement('custom_style', array('b' => $b, 'rcID' => $rcID, 'c' => $c, 'a' => $a, 'style' => $style, 'action' => $action, 'refreshAction' => $refreshAction));
            }
            break;
        case 'template':
            if ($bp->canEditBlockCustomTemplate()) {
                $bv->renderElement('block_custom_template', array('b' => $b, 'rcID' => $rcID));
            }
            break;
        case 'view':
            if ($bp->canViewBlock()) {
                $bv->render($b, 'view', array('c' => $c, 'a' => $a));
            }
            break;
        case 'view_edit_mode':
            if ($bp->canViewEditInterface()) {
                $btc = $b->getInstance();