本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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
示例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();
?>
示例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");
?>
&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);
示例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);
}
}
}
示例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();
?>
示例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
示例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();
示例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
示例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();
示例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);
}
}
}
}
}
}
示例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);
?>