コード例 #1
0
 public function view()
 {
     $bv = new BlockView($this->block);
     if (isset($_REQUEST['arGridMaximumColumns'])) {
         $this->area->setAreaGridMaximumColumns(intval($_REQUEST['arGridMaximumColumns']));
     }
     if (isset($_REQUEST['arEnableGridContainer']) && $_REQUEST['arEnableGridContainer'] == 1) {
         $this->area->enableGridContainer();
     }
     $bv->addScopeItems(array('c' => $this->page, 'a' => $this->area, 'dialogController' => $this));
     $this->set('bv', $bv);
 }
コード例 #2
0
ファイル: block.php プロジェクト: ceko/concrete5-1
 public function render()
 {
     $btc = $this->block->getInstance();
     $bv = new BlockView($this->block);
     if (isset($_REQUEST['arEnableGridContainer']) && $_REQUEST['arEnableGridContainer'] == 1) {
         $this->area->enableGridContainer();
     }
     $this->area->forceControlsToDisplay();
     // we always want to show them controls.
     $bv->addScopeItems(array('c' => $this->page, 'a' => $this->area, 'dialogController' => $this));
     $this->set('bv', $bv);
     $this->view = new DialogView('/backend/block');
 }
コード例 #3
0
ファイル: block.php プロジェクト: ppiedaderawnet/concrete5
 public function render()
 {
     $loc = Localization::getInstance();
     $loc->setActiveContext('site');
     $c = $this->block->getBlockCollectionObject();
     $dl = Core::make('multilingual/detector');
     $dl->setupSiteInterfaceLocalization($this->page);
     $btc = $this->block->getInstance();
     $bv = new BlockView($this->block);
     if (isset($_REQUEST['arEnableGridContainer']) && $_REQUEST['arEnableGridContainer'] == 1) {
         $this->area->enableGridContainer();
     }
     $this->area->forceControlsToDisplay();
     // we always want to show them controls.
     $bv->addScopeItems(array('c' => $this->page, 'a' => $this->area, 'dialogController' => $this));
     $this->set('bv', $bv);
     $this->view = new DialogView('/backend/block');
 }
コード例 #4
0
 public function view()
 {
     $bv = new BlockView($this->blockType);
     $bv->setAreaObject($this->area);
     // Handle special posted area parameters here
     if (isset($_REQUEST['arGridMaximumColumns'])) {
         $this->area->setAreaGridMaximumColumns(intval($_REQUEST['arGridMaximumColumns']));
     }
     if (isset($_REQUEST['arEnableGridContainer']) && $_REQUEST['arEnableGridContainer'] == 1) {
         $this->area->enableGridContainer();
     }
     $bv->addScopeItems(array('a' => $this->a, 'cp' => $this->permissions, 'ap' => $this->areaPermissions));
     $this->set('blockView', $bv);
     $this->set('blockType', $this->blockType);
     $this->set('btHandle', $this->blockType->getBlockTypeHandle());
     $this->set("blockTypeController", $this->blockTypeController);
     $this->set('area', $this->area);
 }
コード例 #5
0
ファイル: design.php プロジェクト: ngreimel/kovent
 public function view()
 {
     $btc = $this->block->getInstance();
     $btc->outputAutoHeaderItems();
     $bv = new BlockView($this->block);
     $bv->addScopeItems(array('c' => $this->page, 'a' => $this->area, 'dialogController' => $this));
     $this->set('bv', $bv);
     $canEditCustomTemplate = false;
     if ($this->permissions->canEditBlockCustomTemplate()) {
         $canEditCustomTemplate = true;
         switch ($this->block->getBlockTypeHandle()) {
             case BLOCK_HANDLE_SCRAPBOOK_PROXY:
                 $bi = $this->block->getInstance();
                 $bx = \Block::getByID($bi->getOriginalBlockID());
                 $bt = \BlockType::getByID($bx->getBlockTypeID());
                 $bFilename = $bx->getBlockFilename();
                 break;
             case BLOCK_HANDLE_PAGE_TYPE_OUTPUT_PROXY:
                 $bi = $this->block->getInstance();
                 $output = $bi->getComposerOutputControlObject();
                 $control = FormLayoutSetControl::getByID($output->getPageTypeComposerFormLayoutSetControlID());
                 $object = $control->getPageTypeComposerControlObject();
                 if ($object instanceof BlockControl) {
                     $bt = $object->getBlockTypeObject();
                 }
                 $bFilename = $this->block->getBlockFilename();
                 break;
             default:
                 $bt = \BlockType::getByID($this->block->getBlockTypeID());
                 $bFilename = $this->block->getBlockFilename();
                 break;
         }
         $templates = array();
         if (is_object($bt)) {
             $templates = $bt->getBlockTypeCustomTemplates();
         }
         $this->set('bFilename', $bFilename);
         $this->set('templates', $templates);
     }
     $this->set('canEditCustomTemplate', $canEditCustomTemplate);
 }
コード例 #6
0
ファイル: edit.php プロジェクト: yakamoz-fang/concrete
<?php

use Concrete\Core\Block\View\BlockView;
defined('C5_EXECUTE') or die("Access Denied.");
$bo = Block::getByID($bOriginalID);
$bp = new Permissions($bo);
$bo->setProxyBlock($b);
if ($bp->canWrite()) {
    $bv = new BlockView($bo);
    ?>

    <div class="ccm-ui">
        <div class="alert alert-info">
            <?php 
    echo t("This block was copied from another location. Editing it will create a new instance of it.");
    ?>
        </div>
    </div>

    <?php 
    $bv->addScopeItems($view->getScopeItems());
    $bv->render('edit');
}
コード例 #7
0
 public function view()
 {
     $btc = $this->block->getInstance();
     $btc->outputAutoHeaderItems();
     $bv = new BlockView($this->block);
     $bv->addScopeItems(array('c' => $this->page, 'a' => $this->area, 'dialogController' => $this));
     $this->set('bv', $bv);
     $canEditCustomTemplate = false;
     if ($this->permissions->canEditBlockCustomTemplate()) {
         $canEditCustomTemplate = true;
         if ($this->block->getBlockTypeHandle() == BLOCK_HANDLE_SCRAPBOOK_PROXY) {
             $bi = $this->block->getInstance();
             $bx = \Block::getByID($bi->getOriginalBlockID());
             $bt = \BlockType::getByID($bx->getBlockTypeID());
         } else {
             $bt = \BlockType::getByID($this->block->getBlockTypeID());
         }
         $templates = $bt->getBlockTypeCustomTemplates();
         $this->set('templates', $templates);
     }
     $this->set('canEditCustomTemplate', $canEditCustomTemplate);
 }