當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。