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


PHP PermissionKeyCategory::getByHandle方法代码示例

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


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

示例1: getResponse

 public static function getResponse($object)
 {
     $r = PermissionCache::getResponse($object);
     if (is_object($r)) {
         return $r;
     }
     if (method_exists($object, 'getPermissionObjectPermissionKeyCategoryHandle')) {
         $objectClass = Loader::helper('text')->camelcase($object->getPermissionObjectPermissionKeyCategoryHandle());
         $handle = $object->getPermissionObjectPermissionKeyCategoryHandle();
     } else {
         $objectClass = get_class($object);
         $handle = Loader::helper('text')->uncamelcase($objectClass);
     }
     $category = PermissionKeyCategory::getByHandle($handle);
     $c1 = $objectClass . 'PermissionResponse';
     if (!is_object($category)) {
         if ($object instanceof Page) {
             $category = PermissionKeyCategory::getByHandle('page');
             $c1 = 'PagePermissionResponse';
         } else {
             if ($object instanceof Area) {
                 $category = PermissionKeyCategory::getByHandle('area');
                 $c1 = 'AreaPermissionResponse';
             }
         }
     }
     $pr = new $c1();
     $pr->setPermissionObject($object);
     $pr->setPermissionCategoryObject($category);
     PermissionCache::addResponse($object, $pr);
     return $pr;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:32,代码来源:response.php

示例2: install

 public function install()
 {
     $pkg = parent::install();
     $cat = PermissionKeyCategory::getByHandle('page');
     $type = PermissionAccessEntityType::add('parent_page_owner', 'Parent Page Owner', $pkg);
     $cat->associateAccessEntityType($type);
 }
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:7,代码来源:controller.php

示例3: getPermissionKeyToolsURL

 public function getPermissionKeyToolsURL($task = false)
 {
     if (!$task) {
         $task = 'save_permission';
     }
     $uh = Loader::helper('concrete/urls');
     $class = substr(get_class($this), 0, strrpos(get_class($this), 'PermissionAssignment'));
     $handle = Loader::helper('text')->uncamelcase($class);
     if ($handle) {
         $akc = PermissionKeyCategory::getByHandle($handle);
     } else {
         $akc = PermissionKeyCategory::getByID($this->pk->getPermissionKeyCategoryID());
     }
     $url = $uh->getToolsURL('permissions/categories/' . $akc->getPermissionKeyCategoryHandle(), $akc->getPackageHandle());
     $token = Loader::helper('validation/token')->getParameter($task);
     $url .= '?' . $token . '&task=' . $task . '&pkID=' . $this->pk->getPermissionKeyID();
     return $url;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:18,代码来源:assignment.php

示例4: getResponse

 public static function getResponse($object)
 {
     $r = PermissionCache::getResponse($object);
     if (is_object($r)) {
         return $r;
     }
     $category = PermissionKeyCategory::getByHandle(Loader::helper('text')->uncamelcase(get_class($object)));
     if (!is_object($category) && $object instanceof Page) {
         $category = PermissionKeyCategory::getByHandle('page');
     }
     $txt = Loader::helper('text');
     $c1 = get_class($object) . 'PermissionResponse';
     if (!class_exists($c1)) {
         $c1 = 'PagePermissionResponse';
     }
     $pr = new $c1();
     $pr->setPermissionObject($object);
     $pr->setPermissionCategoryObject($category);
     PermissionCache::addResponse($object, $pr);
     return $pr;
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:21,代码来源:response.php

示例5: foreach

	</div>
	</form>
	
	<br/>
	
	
	<?php 
        if ($permissionsInherit == 'OVERRIDE') {
            ?>

<?php 
            echo Loader::element('permission/help');
            ?>

<?php 
            $cat = PermissionKeyCategory::getByHandle('page');
            ?>
<form method="post" id="ccm-permission-list-form" action="<?php 
            echo $cat->getToolsURL("save_permission_assignments");
            echo $cIDStr;
            ?>
">

<table class="ccm-permission-grid">
<?php 
            $permissions = PermissionKey::getList('page');
            foreach ($permissions as $pk) {
                $pk->setPermissionObject($c);
                ?>
	<tr>
	<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php 
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:31,代码来源:permissions.php

示例6: defined

<?php

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

<?php 
$cat = PermissionKeyCategory::getByHandle('basic_workflow');
?>

<table class="ccm-permission-grid">
<?php 
$permissions = PermissionKey::getList('basic_workflow');
foreach ($permissions as $pk) {
    $pk->setPermissionObject($workflow);
    ?>
	<tr>
	<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php 
    echo $pk->getPermissionKeyID();
    ?>
"><strong><?php 
    if ($enablePermissions) {
        ?>
<a dialog-title="<?php 
        echo $pk->getPermissionKeyDisplayName();
        ?>
" data-pkID="<?php 
        echo $pk->getPermissionKeyID();
        ?>
" data-paID="<?php 
        echo $pk->getPermissionAccessID();
        ?>
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:basic_workflow.php

示例7:

	<?php 
    }
    ?>
</div>

<?php 
}
?>


<?php 
echo Loader::element('permission/help');
?>

<?php 
$cat = PermissionKeyCategory::getByHandle($handle);
?>

<form method="post" id="ccm-permission-list-form" action="<?php 
echo $cat->getToolsURL("save_permission_assignments");
?>
&amp;treeNodeID=<?php 
echo $node->getTreeNodeID();
?>
">

<table class="ccm-permission-grid table table-striped">
<?php 
$permissions = PermissionKey::getList($handle);
foreach ($permissions as $pk) {
    $pk->setPermissionObject($node);
开发者ID:ceko,项目名称:concrete5-1,代码行数:31,代码来源:node.php

示例8: installPermissionsAndWorkflow

 protected function installPermissionsAndWorkflow()
 {
     $sx = simplexml_load_file(DIR_BASE_CORE . '/config/install/base/permissions.xml');
     foreach ($sx->permissioncategories->category as $pkc) {
         $handle = (string) $pkc['handle'];
         $pkca = PermissionKeyCategory::getByHandle($handle);
         if (!is_object($pkca)) {
             $pkx = PermissionKeyCategory::add((string) $pkc['handle']);
         }
     }
     foreach ($sx->workflowprogresscategories->category as $pkc) {
         $handle = (string) $pkc['handle'];
         $pkca = WorkflowProgressCategory::getByHandle($handle);
         if (!is_object($pkca)) {
             $pkx = WorkflowProgressCategory::add((string) $pkc['handle']);
         }
     }
     foreach ($sx->workflowtypes->workflowtype as $wt) {
         $handle = (string) $wt['handle'];
         $name = (string) $wt['name'];
         $wtt = WorkflowType::getByHandle($handle);
         if (!is_object($wtt)) {
             $pkx = WorkflowType::add($handle, $name);
         }
     }
     if (isset($sx->permissionaccessentitytypes)) {
         foreach ($sx->permissionaccessentitytypes->permissionaccessentitytype as $pt) {
             $name = $pt['name'];
             if (!$name) {
                 $name = Loader::helper('text')->unhandle($pt['handle']);
             }
             $handle = (string) $pt['handle'];
             $patt = PermissionAccessEntityType::getByHandle($handle);
             if (!is_object($patt)) {
                 $type = PermissionAccessEntityType::add((string) $pt['handle'], $name);
                 if (isset($pt->categories)) {
                     foreach ($pt->categories->children() as $cat) {
                         $catobj = PermissionKeyCategory::getByHandle((string) $cat['handle']);
                         $catobj->associateAccessEntityType($type);
                     }
                 }
             }
         }
     }
     $txt = Loader::helper('text');
     foreach ($sx->permissionkeys->permissionkey as $pk) {
         $pkc = PermissionKeyCategory::getByHandle((string) $pk['category']);
         $className = $txt->camelcase($pkc->getPermissionKeyCategoryHandle());
         $c1 = $className . 'PermissionKey';
         $handle = (string) $pk['handle'];
         $pka = PermissionKey::getByHandle($handle);
         if (!is_object($pka)) {
             $pkx = call_user_func(array($c1, 'import'), $pk);
         }
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:56,代码来源:version_560.php

示例9: defined

<?php

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

<?php 
$cat = PermissionKeyCategory::getByHandle('file_set');
?>

<table class="ccm-permission-grid table table-striped">
<?php 
$permissions = PermissionKey::getList('file_set');
foreach ($permissions as $pk) {
    $pk->setPermissionObject($fs);
    ?>
	<tr>
	<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php 
    echo $pk->getPermissionKeyID();
    ?>
"><strong><a dialog-title="<?php 
    echo $pk->getPermissionKeyDisplayName();
    ?>
" data-pkID="<?php 
    echo $pk->getPermissionKeyID();
    ?>
" data-paID="<?php 
    echo $pk->getPermissionAccessID();
    ?>
" onclick="ccm_permissionLaunchDialog(this)" href="javascript:void(0)"><?php 
    echo $pk->getPermissionKeyDisplayName();
    ?>
开发者ID:ceko,项目名称:concrete5-1,代码行数:31,代码来源:file_set.php

示例10: urlencode

            ?>
</a>
	</div>

<?php 
        }
    }
}
?>

<?php 
echo Loader::element('permission/help');
?>

<?php 
$cat = PermissionKeyCategory::getByHandle('area');
?>

<form method="post" id="ccm-permission-list-form" action="<?php 
echo $cat->getToolsURL("save_permission_assignments");
?>
&cID=<?php 
echo $c->getCollectionID();
?>
&arHandle=<?php 
echo urlencode($a->getAreaHandle());
?>
">
<table class="ccm-permission-grid table table-striped">

<?php 
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:31,代码来源:area.php

示例11: t

    echo t('Revert to Area Permissions');
    ?>
</a>
	</div>

<?php 
}
?>


<?php 
echo Loader::element('permission/help');
?>

<?php 
$cat = PermissionKeyCategory::getByHandle('block');
?>
<form method="post" id="ccm-permission-list-form" action="<?php 
echo $cat->getToolsURL("save_permission_assignments");
?>
&cID=<?php 
echo $c->getCollectionID();
?>
&arHandle=<?php 
echo urlencode($b->getAreaHandle());
?>
&cvID=<?php 
echo $c->getVersionID();
?>
&bID=<?php 
echo $b->getBlockID();
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:31,代码来源:block.php

示例12: t

</div>

<?php 
if (!is_object($pae)) {
    ?>

<div class="btn-group">
	<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
	<i class="icon-plus-sign"></i> <?php 
    echo t('Select');
    ?>
	<span class="caret"></span>
		</a>
	<ul class="dropdown-menu">
	<?php 
    $category = PermissionKeyCategory::getByHandle($_REQUEST['pkCategoryHandle']);
    $entitytypes = PermissionAccessEntityType::getList($category);
    foreach ($entitytypes as $type) {
        ?>
		<li><?php 
        echo $type->getAccessEntityTypeLinkHTML();
        ?>
</li>
	<?php 
    }
    ?>
	</ul>
</div>
<br/><br/>

<?php 
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:31,代码来源:access_entity.php

示例13: defined

<?php

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

<?php 
$cat = PermissionKeyCategory::getByHandle('conversation');
?>

<table class="ccm-permission-grid table table-striped">
<?php 
$cnvID = 0;
if (is_object($conversation)) {
    $cnvID = $conversation->getConversationID();
}
$permissions = PermissionKey::getList('conversation');
foreach ($permissions as $pk) {
    $pk->setPermissionObject($conversation);
    ?>
	<tr>
	<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php 
    echo $pk->getPermissionKeyID();
    ?>
"><strong><a dialog-title="<?php 
    echo $pk->getPermissionKeyDisplayName();
    ?>
" data-pkID="<?php 
    echo $pk->getPermissionKeyID();
    ?>
" data-paID="<?php 
    echo $pk->getPermissionAccessID();
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:31,代码来源:conversation.php

示例14: importPermissions

	protected function importPermissions(SimpleXMLElement $sx) {
		if (isset($sx->permissionkeys)) {
			foreach($sx->permissionkeys->permissionkey as $pk) {
				$pkc = PermissionKeyCategory::getByHandle((string) $pk['category']);
				$pkg = ContentImporter::getPackageObject($pk['package']);
				$txt = Loader::helper('text');
				$className = $txt->camelcase($pkc->getPermissionKeyCategoryHandle());
				$c1 = $className . 'PermissionKey';
				$pkx = call_user_func(array($c1, 'import'), $pk);	
				if (isset($pk->access)) {
					foreach($pk->access->children() as $ch) {
						if ($ch->getName() == 'group') {
							$g = Group::getByName($ch['name']);
							if (!is_object($g)) {
								$g = Group::add($g['name'], $g['description']);
							}
							$pae = GroupPermissionAccessEntity::getOrCreate($g);
							$pa = PermissionAccess::create($pkx);
							$pa->addListItem($pae);
							$pt = $pkx->getPermissionAssignmentObject();
							$pt->assignPermissionAccess($pa);
						}
					}
				}
			
			}
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:28,代码来源:importer.php

示例15: t

</p>
	<br/>
	<a href="javascript:void(0)" class="btn small" onclick="ccm_revertToGlobalFilePermissions()"><?php 
echo t('Revert to File Set and Global Permissions');
?>
</a>
	</div>

<? } ?>


<?php 
echo Loader::element('permission/help');
?>

<? $cat = PermissionKeyCategory::getByHandle('file');?>

<form method="post" id="ccm-permission-list-form" action="<?php 
echo $cat->getToolsURL("save_permission_assignments");
?>
&fID=<?php 
echo $f->getFileID();
?>
">

<table class="ccm-permission-grid">
<?
$permissions = PermissionKey::getList('file');
foreach($permissions as $pk) { 
	$pk->setPermissionObject($f);
	?>
开发者ID:ronlobo,项目名称:concrete5,代码行数:31,代码来源:file.php


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