コード例 #1
0
<?php

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

<?php 
$included = $permissionAccess->getAccessListItems(PermissionKey::ACCESS_TYPE_INCLUDE);
$excluded = $permissionAccess->getAccessListItems(PermissionKey::ACCESS_TYPE_EXCLUDE);
$btl = new BlockTypeList();
$blockTypes = $btl->getBlockTypeList();
$form = Loader::helper('form');
?>

<?php 
if (count($included) > 0 || count($excluded) > 0) {
    ?>

<?php 
    if (count($included) > 0) {
        ?>

<h3><?php 
        echo t('Who can add what?');
        ?>
</h3>

<?php 
        foreach ($included as $assignment) {
            $entity = $assignment->getAccessEntityObject();
            ?>
コード例 #2
0
ファイル: block_types.php プロジェクト: nbourguig/concrete5
 /**
  * gets the block types that are allowed to be added to the given area - given the current user's permissions
  * @param Area
  * @param CollectionPermissions
  * @return BlockType[]
  */
 public function getAreaBlockTypes(&$a, &$cp)
 {
     $btl = new BlockTypeList();
     $btlaTMP = $btl->getBlockTypeList();
     $btla = array();
     foreach ($btlaTMP as $bt) {
         $bt->setAreaPermissions($a, $cp);
         $btla[] = $bt;
     }
     return $btla;
 }