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


PHP BlockView类代码示例

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


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

示例1: on_page_view

 public function on_page_view()
 {
     $html = Loader::helper('html');
     $bv = new BlockView();
     $bv->setBlockObject($this->getBlockObject());
     $this->addFooterItem($html->javascript($bv->getBlockURL() . '/magnific/magnific-combined-1.0.0.min.js', array('minify' => true)));
 }
开发者ID:robchenski,项目名称:ids,代码行数:7,代码来源:controller.php

示例2: view

 public function view()
 {
     Loader::model('sortable_fancybox_gallery', 'sortable_fancybox_gallery');
     $sg = new SortableFancyboxGallery($this->bID);
     $files = $sg->getPermittedImages();
     $ih = Loader::helper('image');
     $images = array();
     $max_row_height = 0;
     foreach ($files as $file) {
         $image = array();
         //$image['src'] = $file->getRelativePath();
         // $size = @getimagesize($file->getPath());
         // $image['width'] = $size[0];
         // $image['height'] = $size[1];
         $fv = $file->getRecentVersion();
         $image['title'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8');
         $image['description'] = htmlspecialchars($fv->getDescription(), ENT_QUOTES, 'UTF-8');
         $full = $ih->getThumbnail($file, $this->fullWidth, $this->fullHeight);
         $image['full_src'] = $full->src;
         $image['full_width'] = $full->width;
         $image['full_height'] = $full->height;
         if ($this->enableLightbox) {
             $thumb = $ih->getThumbnail($file, $this->thumbWidth, $this->thumbHeight, true);
             $image['thumb_src'] = $thumb->src;
             $image['thumb_width'] = $thumb->width;
             $image['thumb_height'] = $thumb->height;
             $max_row_height = $thumb->height > $max_row_height ? $thumb->height : $max_row_height;
         } else {
             $image['thumb_src'] = '';
             $image['thumb_width'] = 0;
             $image['thumb_height'] = 0;
             $max_row_height = $full->height > $max_row_height ? $full->height : $max_row_height;
         }
         $images[] = $image;
     }
     $this->set('images', $images);
     $this->set('max_row_height', $max_row_height);
     //For "initial block add" css workaround:
     $html = Loader::helper('html');
     $bv = new BlockView();
     $bv->setBlockObject($this->getBlockObject());
     $css_output_object = $html->css($bv->getBlockURL() . '/view.css');
     //Pick up theme overrides
     $this->set('inline_view_css_url', $css_output_object->file);
 }
开发者ID:madmarker,项目名称:creatureslab,代码行数:45,代码来源:controller.php

示例3: testCoreImageBlockWithNoOverridesHasCorrectTemplates

 function testCoreImageBlockWithNoOverridesHasCorrectTemplates()
 {
     // Test a.
     $p = Page::getByID(1);
     $blocks = $p->getBlocks('Header');
     $b = $blocks[0];
     $bvt = new BlockViewTemplate($b);
     $this->assertEqual($bvt->getTemplate(), DIR_BASE_CORE . '/blocks/image/view.php', 'Test A');
     // Test b.
     $bt = BlockType::getByHandle('image');
     global $a, $ap, $c, $cp;
     if (is_object($bt)) {
         ob_start();
         $bv = new BlockView();
         $bv->render($bt, 'add', array('a' => $a, 'ap' => $ap, 'c' => $c, 'cp' => $cp));
         ob_end_clean();
     }
     $this->assertEqual($bv->getTemplate(), DIR_BASE_CORE . '/blocks/image/add.php', 'Test B');
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:19,代码来源:template_tests.php

示例4: intval

    $rcID = intval($_REQUEST['cID']);
    $isGlobal = 1;
    $rarHandle = $_REQUEST['arHandle'];
} else {
    $c = Page::getByID($_REQUEST['cID']);
    $a = Area::get($c, $_REQUEST['arHandle']);
    $b = Block::getByID($_REQUEST['bID'], $c, $a);
}
$bp = new Permissions($b);
if (!$bp->canWrite()) {
    die(t("Access Denied."));
}
if ($_REQUEST['btask'] != 'view' && $_REQUEST['btask'] != 'view_edit_mode') {
    include DIR_FILES_ELEMENTS_CORE . '/dialog_header.php';
}
$bv = new BlockView();
if (($isGlobal || $c->isMasterCollection()) && !in_array($_REQUEST['btask'], array('child_pages', 'composer', 'view_edit_mode'))) {
    echo '<div class="ccm-notification">';
    echo t('This is a global block.  Editing it here will change all instances of this block throughout the site.');
    //echo t('This is a global block.  Edit it from the <a href="%s">Global Scrapbook</a> in your dashboard.<br /><br /><br />', View::url('/dashboard/scrapbook/') );
    //echo '[<a class="ccm-dialog-close">'.t('Close Window').'</a>]';
    echo '</div>';
}
if ($b->isAliasOfMasterCollection() && $_REQUEST['btask'] != 'view_edit_mode') {
    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':
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:edit_block_popup.php

示例5: 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

示例6: function

echo $c->getCollectionID();
?>
&arHandle=<?php 
echo $a->getAreaHandle();
?>
&btask=alias_existing_block&<?php 
echo $token;
?>
', function(r) { ccm_parseBlockResponse(r, false, 'add'); })"><?php 
echo $bt->getBlockTypeName();
?>
</a>
					<div class="ccm-scrapbook-list-item-detail">	
						<?	
						try {
							$bv = new BlockView();
							$bv->render($item, 'scrapbook');
						} catch(Exception $e) {
							print BLOCK_NOT_AVAILABLE_TEXT;
						}	
						?>
					</div>
				</div>
			</div>	
			<?
			$i++;
		} else { ?>
		
		
			<div class="ccm-scrapbook-list-item" id="ccm-pc-<?php 
echo $obj->getPileContentID();
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:scrapbook_lists.php

示例7: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$bo = Block::getByID($bOriginalID);
$bp = new Permissions($bo);
$bo->setProxyBlock($b);
if ($bp->canWrite()) {
    $bv = new BlockView();
    ?>
	
		<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->render($bo, 'edit', array('c' => $c, 'a' => $a));
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:20,代码来源:edit.php

示例8: render

 /**
  * Renders a view in the block's folder.
  * <code>
  * public function view() { // The view() method is automatically run when a block is viewed
  *     $this->render("other_special_view"); // don't use .php
  * }
  * </code>
  * @param string $view
  * @return void
  */
 function render($view)
 {
     $bv = new BlockView();
     $bv->setController($this);
     // sometimes we need the block type available in here
     if (is_object($this->getBlockObject())) {
         $bt = BlockType::getByID($this->getBlockObject()->getBlockTypeID());
         $a = $this->getBlockObject()->getBlockAreaObject();
     }
     $this->renderOverride = $view;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:21,代码来源:block_controller.php

示例9: hasComposerBlockTemplate

 public function hasComposerBlockTemplate()
 {
     $bv = new BlockView();
     $bv->setBlockObject($this);
     $cpFilename = $this->getBlockComposerFilename();
     if ($cpFilename) {
         $cmpbase = $bv->getBlockPath(DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $cpFilename);
         if (file_exists($cmpbase . '/' . DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $cpFilename)) {
             return true;
         }
     }
     $cmpbase = $bv->getBlockPath(FILENAME_BLOCK_COMPOSER);
     if (file_exists($cmpbase . '/' . FILENAME_BLOCK_COMPOSER)) {
         return true;
     }
     return false;
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:17,代码来源:block.php

示例10: computeView

	private function computeView() {
		$bFilename = $this->bFilename;
		$obj = $this->obj;
		
		// if we've passed in "templates/" as the first part, we strip that off.
		if (strpos($bFilename, 'templates/') === 0) {
			$bFilename = substr($bFilename, 10);
		}

		if ($bFilename) {
			if (is_file(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
				$bv = new BlockView();
				$bv->setBlockObject($obj);
				$this->baseURL = $bv->getBlockURL();
				$this->basePath = $bv->getBlockPath($this->render);
			} else if (is_file(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
				$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
				$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
			} else if (is_dir(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
				$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
			} else if (is_dir(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/'  . $this->render;
				$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
			}

			// we check all installed packages
			if (!isset($template)) {
				$pl = PackageList::get();
				$packages = $pl->getPackages();
				foreach($packages as $pkg) {
					$d = '';
					if (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) {
						$d = DIR_PACKAGES . '/'. $pkg->getPackageHandle();
					} else if (is_dir(DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle())) {
						$d = DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle();
					}
					
					if ($d != '') {
						$baseStub = (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) ? DIR_REL . '/' . DIRNAME_PACKAGES . '/'. $pkg->getPackageHandle() : ASSETS_URL . '/'. DIRNAME_PACKAGES . '/' . $pkg->getPackageHandle();
						
						if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename;
							$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
							$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
						} else if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
							$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
							$this->basePath = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
						} else if (is_dir($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
							$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
						}
					}
					
					if ($this->baseURL != '') {
						continue;
					}
					
				}
			}
			
		} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php')) {
			$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php';
			$bv = new BlockView();
			$bv->setBlockObject($obj);
			$this->baseURL = $bv->getBlockURL();
			$this->basePath = $bv->getBlockPath($this->render);
		} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render)) {
			$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render;
			$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
		}
		
		if (!isset($template)) {
			$bv = new BlockView();
			$bv->setBlockObject($obj);
			$template = $bv->getBlockPath($this->render) . '/' . $this->render;
			$this->baseURL = $bv->getBlockURL();
		}
		
		if ($this->basePath == '') {
			$this->basePath = dirname($template);
		}
		$this->template = $template;
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:87,代码来源:block_view_template.php

示例11: view

 public function view()
 {
     Loader::model('deluxe_image_gallery', 'deluxe_image_gallery');
     $sg = new DeluxeImageGallery($this->bID);
     $files = $sg->getPermittedImages();
     $ch = Loader::helper('deluxe_image_gallery', 'deluxe_image_gallery');
     $ih = Loader::helper('image');
     $images = array();
     $max_img_height = 0;
     foreach ($files as $file) {
         $image = array();
         $image['fID'] = $file['fID'];
         $image['title'] = htmlentities($file['title'], ENT_QUOTES, APP_CHARSET);
         if (defined('DELUXE_IMAGE_GALLERY_HTML_CAPTIONS') && (bool) DELUXE_IMAGE_GALLERY_HTML_CAPTIONS) {
             $image['caption'] = $file['caption'];
         } else {
             $image['caption'] = htmlentities($file['caption'], ENT_QUOTES, APP_CHARSET);
         }
         if ($this->lightboxTitlePosition == 'inside' || $this->lightboxTitlePosition == 'over') {
             $image['caption'] = nl2br($image['caption']);
             //Don't insert linebreaks if title position is 'float'/'outside',
             // because that style doesn't expand down to fit more than one line.
         }
         $f = $file['file'];
         if ($this->enableCropping) {
             $thumb = $ch->getThumbnail($f, $this->thumbWidth, $this->thumbHeight);
         } else {
             $thumb = $ih->getThumbnail($f, $this->thumbWidth, $this->thumbHeight);
         }
         $image['thumb_src'] = $thumb->src;
         $image['thumb_width'] = $thumb->width;
         $image['thumb_height'] = $thumb->height;
         $max_img_height = $thumb->height > $max_img_height ? $thumb->height : $max_img_height;
         if ($this->enableLightbox && empty($this->fullWidth) && empty($this->fullHeight)) {
             $image['full_src'] = $f->getRelativePath();
             $image['full_width'] = $f->getAttribute('width');
             $image['full_height'] = $f->getAttribute('height');
         } else {
             if ($this->enableLightbox) {
                 $maxWidth = empty($this->fullWidth) ? 9999 : $this->fullWidth;
                 $maxHeight = empty($this->fullHeight) ? 9999 : $this->fullHeight;
                 $full = $ih->getThumbnail($f, $maxWidth, $maxHeight);
                 $image['full_src'] = $full->src;
                 $image['full_width'] = $full->width;
                 $image['full_height'] = $full->height;
             } else {
                 $image['full_src'] = '';
                 $image['full_width'] = 0;
                 $image['full_height'] = 0;
             }
         }
         $images[] = $image;
     }
     $this->set('images', $images);
     $this->set('max_img_height', $max_img_height);
     //For "initial block add" css workaround:
     // (Note that this is only needed if the site is under a sub-directory)
     $inline_view_css_url = '';
     $dir_rel = DIR_REL;
     //uhh... php is weird -- won't let us put a constant inside the empty() function?!
     if (!empty($dir_rel)) {
         $html = Loader::helper('html');
         $bv = new BlockView();
         $bv->setBlockObject($this->getBlockObject());
         $css_output_object = $html->css($bv->getBlockURL() . '/view.css');
         //Pick up theme overrides
         $inline_view_css_url = $css_output_object->file;
     }
     $this->set('inline_view_css_url', $inline_view_css_url);
 }
开发者ID:robchenski,项目名称:ids,代码行数:70,代码来源:controller.php

示例12: isEditable

	function isEditable() {
		$bv = new BlockView();
		$bv->setBlockObject($this);
		$path = $bv->getBlockPath(FILENAME_BLOCK_EDIT);
		if (file_exists($path . '/' . FILENAME_BLOCK_EDIT)) {
			return true;
		}
		return false;
	}
开发者ID:nveid,项目名称:concrete5,代码行数:9,代码来源:block.php

示例13: BlockView

					<?php 
            echo $ak->render('composer', $value, true);
            ?>
				</div>
			</div>
		
		<?php 
        } else {
            $b = $ci;
            $b = $entry->getComposerBlockInstance($b);
            ?>
		
		<div class="control-group">
		<?php 
            if (is_object($b)) {
                $bv = new BlockView();
                $bv->render($b, 'composer');
            } else {
                print t('Block not found. Unable to edit in composer.');
            }
            ?>
		
		</div>
		
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	</fieldset>
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:write.php

示例14: render

		/** 
		 * Renders a particular view of a block type, using the public $controller variable as the block type's controller
		 * @param string template 'view' for the default
		 * @return void
		 */
		public function render($view = 'view') {
			$bv = new BlockView();
			$bv->setController($this->controller);
			$bv->render($this, $view);
		}			
开发者ID:ronlobo,项目名称:concrete5,代码行数:10,代码来源:block_types.php

示例15: Permissions

if (!is_object($a)) {
	exit;
}
$ap = new Permissions($a);
$canContinue = ($_REQUEST['btask'] == 'alias') ? $ap->canAddBlocks() : $ap->canAddBlock($bt);

if (!$canContinue) {
	exit;
}
	
$c->loadVersionObject('RECENT');
require_once(DIR_FILES_ELEMENTS_CORE . '/dialog_header.php');

if ($ap->canAddBlock($bt)) {
	$cnt = $bt->getController();
	if (!is_a($cnt, 'BlockController')) {
		$jsh = Loader::helper('concrete/interface');
		print '<div class="ccm-error">' . t('Unable to load the controller for this block type. Perhaps it has been moved or removed.') . '</div>';
		print '<br><br>';
		print $jsh->button_js(t('Close'), 'jQuery.fn.dialog.closeTop()', 'left');
	} else {
		$bv = new BlockView();
		$bv->render($bt, 'add', array(
			'a' => $a,
			'cp' => $cp,
			'ap' => $ap
		));
	}
}

require_once(DIR_FILES_ELEMENTS_CORE . '/dialog_footer.php'); ?>
开发者ID:rii-J,项目名称:concrete5-de,代码行数:31,代码来源:add_block_popup.php


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