本文整理汇总了PHP中Area::getAreaBlocksArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Area::getAreaBlocksArray方法的具体用法?PHP Area::getAreaBlocksArray怎么用?PHP Area::getAreaBlocksArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area::getAreaBlocksArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCommentCountString
/**
* Returns a formatted text for the number of comments in the first comment block in the "Entry Comments" area
* @param string $singular_format
* @param string $plural_format
* @param string $disabled_message
* @return string
*/
public function getCommentCountString($singular_format, $plural_format, $disabled_message = '')
{
$count = 0;
$comments_enabled = false;
$c = $this->getCollectionObject();
$a = new Area('Blog Post Footer');
$blocks = $a->getAreaBlocksArray($c);
if (is_array($blocks) && count($blocks) > 0) {
foreach ($blocks as $b) {
if ($b->getBlockTypeHandle() == 'guestbook') {
$controller = $b->getInstance();
$count = $controller->getEntryCount($c->getCollectionID());
$comments_enabled = true;
break;
// stop at the fist guestbook block found
}
}
}
if ($comments_enabled) {
$format = $count == 1 ? $singular_format : $plural_format;
return sprintf($format, $count);
} else {
return $disabled_message;
}
}
示例2: view
public function view() {
//add required header libraries
$html = Loader::helper('html');
$scrapbookHelper=Loader::helper('concrete/scrapbook');
$this->addHeaderItem($html->css('ccm.filemanager.css'));
$this->addHeaderItem($html->javascript('ccm.filemanager.js'));
$this->addHeaderItem($html->javascript('tiny_mce/tiny_mce.js'));
$this->addHeaderItem('<script type="text/javascript">$(function() { ccm_activateFileManager(\'DASHBOARD\'); });</script>');
$c=$this->getCollectionObject();
$cPath=$c->getCollectionPath();
//echo $c->getCollectionId();
/*
$a = Area::get($c, t('Shared Scrapbook 1'));
if (!is_object($a)) {
$a = Area::getOrCreate($c, t('Shared Scrapbook 1'));
}
*/
//get available block areas
$availableScrapbooks = $scrapbookHelper->getAvailableScrapbooks();
$this->set('availableScrapbooks', $availableScrapbooks);
$scrapbookName=$_REQUEST['scrapbookName'];
//get scrapbook name from referrer if a block has just been added or edited
if($_REQUEST['cID']==$c->getCollectionId() && $_REQUEST['mode']=='edit' && !$scrapbookName && stristr($_SERVER['HTTP_REFERER'],'scrapbookName=')){
$startPos = strrpos($_SERVER['HTTP_REFERER'],'?')+1;
$qStr = substr($_SERVER['HTTP_REFERER'],$startPos);
parse_str($qStr,$referrerVals);
$scrapbookName=$referrerVals['scrapbookName'];
$this->redirect('/dashboard/scrapbook/?scrapbookName='.$scrapbookName);
}
//test that the requested scrapbook name is a valid one
if($scrapbookName=='userScrapbook'){
$validScrapbookName=1;
}else{
foreach($availableScrapbooks as $availableScrapbook){
if($availableScrapbook['arHandle']==$scrapbookName)
$validScrapbookName=1;
}
}
if( strlen($scrapbookName) && $validScrapbookName ){
$this->set('scrapbookName', $scrapbookName);
$globalScrapbookArea = new Area( $scrapbookName );
$globalScrapbookBlocks = $globalScrapbookArea->getAreaBlocksArray($c);
$this->set('globalScrapbookArea', $globalScrapbookArea);
$this->set('globalScrapbookBlocks', $globalScrapbookBlocks);
}
$this->set('availableScrapbooks', $availableScrapbooks);
$this->set('cPath', $cPath);
}
示例3: getPageFeedContent
protected function getPageFeedContent(Page $p)
{
switch ($this->pfContentToDisplay) {
case 'S':
return $p->getCollectionDescription();
case 'A':
$a = new \Area($this->getAreaHandleToDisplay());
$blocks = $a->getAreaBlocksArray($p);
$r = Request::getInstance();
$r->setCurrentPage($p);
ob_start();
foreach ($blocks as $b) {
$bv = new BlockView($b);
$bv->render('view');
}
$content = ob_get_contents();
ob_end_clean();
return $content;
}
}
示例4: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$a2 = new Area('Poll');
$aBlocks = $a2->getAreaBlocksArray($c);
/*
$pollBlocks=array();
foreach($aBlocks as $bls){
if($bls->getBlockTypeHandle() != 'poll') continue;
$pollBlocks[]=$bls;
}
*/
if (count($aBlocks) > 0) {
?>
<div id="post-poll">
<div class="aux">
<?php
$a2->display($c, $aBlocks);
?>
</div>
</div>
<?php
}
示例5: getPageFeedContent
protected function getPageFeedContent(Page $p)
{
$content = false;
switch ($this->pfContentToDisplay) {
case 'S':
$content = $p->getCollectionDescription();
break;
case 'A':
$a = new \Area($this->getAreaHandleToDisplay());
$blocks = $a->getAreaBlocksArray($p);
$r = Request::getInstance();
$r->setCurrentPage($p);
ob_start();
foreach ($blocks as $b) {
$bv = new BlockView($b);
$bv->render('view');
}
$content = ob_get_contents();
ob_end_clean();
break;
}
$f = $p->getAttribute('thumbnail');
if (is_object($f)) {
$content = '<p><img src="' . $f->getURL() . '" /></p>' . $content;
}
return $content;
}
示例6: t
$i++;
}
} ?>
</div>
<? } ?>
<?
if($scrapbookName && $scrapbookName!='userScrapbook'){
$globalScrapbookArea = new Area($scrapbookName);
$scrapbookHelper=Loader::helper('concrete/scrapbook');
$globalScrapbookC = $scrapbookHelper->getGlobalScrapbookPage();
$styleHeader = $globalScrapbookC->outputCustomStyleHeaderItems(true);
if ($styleHeader) {
print '<style type="text/css">' . $styleHeader . '</style>';
}
$globalScrapbookBlocks = $globalScrapbookArea->getAreaBlocksArray( $globalScrapbookC );
if( !count($globalScrapbookBlocks) ){ ?>
<div style="padding:16px 0px;"><?php
echo t('No blocks have been added to this scrapbook.');
?>
</div>
<? }else{ ?>
<div id="ccm-scrapbook-list">
<? foreach($globalScrapbookBlocks as $b){
$bt = BlockType::getByID( $b->getBlockTypeID() );
$btIcon = $ci->getBlockTypeIconURL($bt);
?>
<div class="ccm-scrapbook-list-item" id="ccm-scrapbook-list-item-<?php
echo intval($b->bID);
?>
">
示例7: Area
<div class="img-text-content">
<div class="sub-heading">
<?php
$a = new Area('Flavour 4 Title');
$a->display($c);
?>
</div>
<?php
$a = new Area('Flavours 4 Content');
$a->setBlockWrapperStart('<div class="each-flavour">');
$a->setBlockWrapperEnd('</div>');
if ($c->isEditMode()) {
$a->display($c);
} else {
$b = $a->getAreaBlocksArray($c);
foreach ($b as $i => $block) {
$fileID = $block->getInstance()->getFileID();
$title = $block->getInstance()->getTitle();
$alttext = $block->getInstance()->getAltText();
$image = $block->getInstance()->getImageObject($fileID);
?>
<?php
if ($i == 0) {
?>
<div class="each-row"><!-- star first row -->
<?php
} elseif ($i % 6 == 0) {
?>
</div><!-- end each-row after reaching 6 -->
<div class="each-row"><!-- start new row -->