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


PHP Permissions::canAddBlocks方法代码示例

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


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

示例1: t

"><span><i class="fa fa-share-alt"></i> <?php 
echo $a->getAreaDisplayName();
?>
</span></div>
        <div class="popover fade" data-area-menu="area-menu-a<?php 
echo $a->getAreaID();
?>
">
            <div class="arrow"></div>
            <div class="popover-inner">
                <ul class="dropdown-menu">
                    <?php 
$showAreaDesign = $ap->canEditAreaDesign() && Config::get('concrete.design.enable_custom') == true;
$showAreaLayouts = $ap->canAddLayoutToArea() && Config::get('concrete.design.enable_layouts') == true && !$a->isGlobalArea();
$canEditAreaPermissions = $ap->canEditAreaPermissions() && Config::get('concrete.permissions.model') != 'simple' && !$a->isGlobalArea();
$showAddBlock = (bool) $ap->canAddBlocks();
if ($showAddBlock) {
    ?>
<li><a href='#' data-menu-action="area-add-block"><?php 
    echo t('Add Block');
    ?>
</a></li><?php 
}
if ($showAreaDesign || $showAreaLayouts) {
    if ($showAreaDesign) {
        ?>
<li><a data-menu-action="edit-area-design" href="#"><?php 
        echo t("Edit Area Design");
        ?>
</a></li><?php 
    }
开发者ID:seebaermichi,项目名称:concrete5,代码行数:31,代码来源:block_area_footer.php

示例2: foreach

     foreach ($aBlocks as $ab) {
         $abp = new Permissions($ab);
         if ($abp->canRead()) {
             $p->add($ab);
         }
     }
     break;
 case 'add_prepare':
     $c = Page::getByID($_REQUEST['cID']);
     $cp = new Permissions($c);
     if (!$cp->canViewPage()) {
         exit;
     }
     $a = Area::get($c, $_REQUEST['arHandle']);
     $ap = new Permissions($a);
     if (!$ap->canViewArea() || !$ap->canAddBlocks()) {
         exit;
     }
     break;
 case 'delete_content':
     if (is_array($_POST['pcID'])) {
         foreach ($_POST['pcID'] as $pcID) {
             $pc = PileContent::get($pcID);
             $p = $pc->getPile();
             if ($p->isMyPile()) {
                 $pc->delete();
             }
         }
     }
     break;
 case 'delete_pile':
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:pile_manager.php

示例3: t

echo $a->getAreaDisplayName();
?>
</span></div>

<div class="popover fade" data-area-menu="area-menu-a<?php 
echo $a->getAreaID();
?>
">
	<div class="arrow"></div>
	<div class="popover-inner">
	<ul class="dropdown-menu">
	<?php 
$showAreaDesign = $ap->canEditAreaDesign() && Config::get('concrete.design.enable_custom') == true;
$showAreaLayouts = $ap->canAddLayoutToArea() && Config::get('concrete.design.enable_layouts') == true && !$a->isGlobalArea();
$canEditAreaPermissions = $ap->canEditAreaPermissions() && Config::get('concrete.permissions.model') != 'simple' && !$a->isGlobalArea();
$showAddBlock = !!$ap->canAddBlocks();
if ($showAddBlock) {
    ?>
        <li><a href='#' data-menu-action="area-add-block"><?php 
    echo t('Add Block');
    ?>
</a></li>
        <?php 
}
?>

	<?php 
if ($showAreaDesign || $showAreaLayouts) {
    ?>
		<?php 
    if ($showAreaDesign) {
开发者ID:lequer,项目名称:mlequer.com,代码行数:31,代码来源:block_area_footer.php

示例4: die

$valt = Loader::helper('validation/token');
$token = '&' . $valt->getParameter();
if (!$cp->canEditPageContents()) {
    die(t("Access Denied."));
}
$args = array('c' => $c, 'a' => $a, 'cp' => $cp, 'ap' => $ap, 'token' => $token);
Loader::element("dialog_header");
if ($a->isGlobalArea()) {
    echo '<div class="ccm-ui"><div class="alert-message block-message warning">';
    echo t('This is a global area. Content added here will be visible on every page that contains this area.');
    echo '</div></div>';
}
switch ($_GET['atask']) {
    case 'add':
        $toolSection = "block_area_add_new";
        $canViewPane = $ap->canAddBlocks();
        break;
    case 'add_from_stack':
        $toolSection = "block_area_add_stack";
        $canViewPane = $ap->canAddStacks();
        break;
    case 'add_stack_contents':
        $toolSection = "block_area_add_stack_contents";
        $stack = Stack::getByID($_REQUEST['stackID']);
        $canViewPane = false;
        if (is_object($stack)) {
            $stp = new Permissions($stack);
            $canViewPane = $stp->canRead() && $ap->canAddStacks();
        }
        break;
    case 'paste':
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:edit_area_popup.php

示例5:

.aID = <?php 
        echo $a->getAreaID();
        ?>
;
	ccm_areaMenuObj<?php 
        echo $a->getAreaID();
        ?>
.arHandle = "<?php 
        echo $arHandle;
        ?>
";
	ccm_areaMenuObj<?php 
        echo $a->getAreaID();
        ?>
.canAddBlocks = <?php 
        echo $ap->canAddBlocks();
        ?>
;
	ccm_areaMenuObj<?php 
        echo $a->getAreaID();
        ?>
.canWrite = <?php 
        echo $ap->canWrite();
        ?>
;
	<?php 
        if ($cp->canAdmin() && PERMISSIONS_MODEL != 'simple') {
            ?>
		ccm_areaMenuObj<?php 
            echo $a->getAreaID();
            ?>
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:block_area_footer.php

示例6: Permissions

				$abp = new Permissions($ab);
				if ($abp->canRead()) {
					$p->add($ab);
				}
			}
			break;
			
		case 'add_prepare':
			$c = Page::getByID($_REQUEST['cID']);
			$cp = new Permissions($c);
			if (!$cp->canRead()) {
				exit;
			}
			$a = Area::get($c, $_REQUEST['arHandle']);
			$ap = new Permissions($a);
			if (!$ap->canRead() || !$ap->canAddBlocks()) {
				exit;
			}
			break;
			
		case 'delete_content':
			if (is_array($_POST['pcID'])) {
				foreach($_POST['pcID'] as $pcID) {
					$pc = PileContent::get($pcID);
					$p = $pc->getPile();
					if ($p->isMyPile()) {
						$pc->delete();
					}
				}
			}
			
开发者ID:nbourguig,项目名称:concrete5,代码行数:30,代码来源:pile_manager.php

示例7: die

<?php 

defined('C5_EXECUTE') or die("Access Denied.");

$c = Page::getByID($_REQUEST['cID']);
$cp = new Permissions($c);
$bt = BlockType::getByID($_REQUEST['btID']);
$a = Area::get($c, $_REQUEST['arHandle']);
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(
开发者ID:rii-J,项目名称:concrete5-de,代码行数:31,代码来源:add_block_popup.php

示例8: User

$c = $a->getAreaCollectionObject();
$cID = $c->getCollectionID();
$u = new User();
$ap = new Permissions($a);
$cp = new Permissions($c);

if ($a->areaAcceptsBlocks()) { ?>

<?php  if (!$c->isArrangeMode()) { ?>
	<script type="text/javascript">
	ccm_areaMenuObj<?php echo $a->getAreaID()?> = new Object();
	ccm_areaMenuObj<?php echo $a->getAreaID()?>.type = "AREA";
	ccm_areaMenuObj<?php echo $a->getAreaID()?>.aID = <?php echo $a->getAreaID()?>;
	ccm_areaMenuObj<?php echo $a->getAreaID()?>.arHandle = "<?php echo $arHandle?>";
	ccm_areaMenuObj<?php echo $a->getAreaID()?>.canAddBlocks = <?php echo $ap->canAddBlocks()?>;
	ccm_areaMenuObj<?php echo $a->getAreaID()?>.canWrite = <?php echo $ap->canWrite()?>;
	<?php  if ($cp->canAdmin() && PERMISSIONS_MODEL != 'simple') { ?>
		ccm_areaMenuObj<?php echo $a->getAreaID()?>.canModifyGroups = true;
	<?php  } ?>
	<?php  if ($ap->canWrite() && ENABLE_AREA_LAYOUTS == true && (!$c->isMasterCollection())) { ?>
		ccm_areaMenuObj<?php echo $a->getAreaID()?>.canLayout = true;
	<?php  } else { ?>
		ccm_areaMenuObj<?php echo $a->getAreaID()?>.canLayout = false;
	<?php  } ?>
	<?php  if ($ap->canWrite() && ENABLE_CUSTOM_DESIGN == true && (!$c->isMasterCollection())) { ?>
		ccm_areaMenuObj<?php echo $a->getAreaID()?>.canDesign = true;
	<?php  } else { ?>
		ccm_areaMenuObj<?php echo $a->getAreaID()?>.canDesign = false;
	<?php  } ?>
	$(function() {ccm_menuInit(ccm_areaMenuObj<?php echo $a->getAreaID()?>)});
开发者ID:rii-J,项目名称:concrete5-de,代码行数:30,代码来源:block_area_footer.php


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