本文整理汇总了PHP中Permissions::canEditPageProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canEditPageProperties方法的具体用法?PHP Permissions::canEditPageProperties怎么用?PHP Permissions::canEditPageProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canEditPageProperties方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: t
</li>
<li><a dialog-width="640" dialog-height="340" class="dialog-launch" id="stackVersions" dialog-title="<?php
echo t('Version History');
?>
" href="<?php
echo URL::to('/ccm/system/panels/page/versions');
?>
?cID=<?php
echo $stackToEdit->getCollectionID();
?>
"><?php
echo t('Version History');
?>
</a></li>
<?php
if (!$isGlobalArea && $cpc->canEditPageProperties()) {
?>
<li><a href="<?php
echo $view->action('rename', $neutralStack->getCollectionID());
?>
"><?php
echo t('Rename');
?>
</a></li>
<?php
}
?>
<?php
if (!$isGlobalArea && $cpc->canEditPagePermissions() && Config::get('concrete.permissions.model') == 'advanced') {
?>
<li><a dialog-width="580" class="dialog-launch" dialog-append-buttons="true" dialog-height="420" dialog-title="<?php
示例2: getNode
function getNode($cItem, $level = 0, $autoOpenNodes = true)
{
if (!is_object($cItem)) {
$cID = $cItem;
$c = Page::getByID($cID, 'RECENT');
} else {
$cID = $cItem->getCollectionID();
$c = $cItem;
}
$cp = new Permissions($c);
$canEditPageProperties = $cp->canEditPageProperties();
$canEditPageSpeedSettings = $cp->canEditPageSpeedSettings();
$canEditPagePermissions = $cp->canEditPagePermissions();
$canEditPageDesign = $cp->canEditPageTheme() || $cp->canEditPageType();
$canViewPageVersions = $cp->canViewPageVersions();
$canDeletePage = $cp->canDeletePage();
$canAddSubpages = $cp->canAddSubpage();
$canAddExternalLinks = $cp->canAddExternalLink();
$nodeOpen = false;
if (is_array($_SESSION['dsbSitemapNodes'])) {
if (in_array($cID, $_SESSION['dsbSitemapNodes'])) {
$nodeOpen = true;
}
}
$status = '';
$cls = $c->getNumChildren() > 0 ? "folder" : "file";
$leaf = $c->getNumChildren() > 0 ? false : true;
$numSubpages = $c->getNumChildren() > 0 ? $c->getNumChildren() : '';
$cvName = $c->getCollectionName() ? $c->getCollectionName() : '(No Title)';
$cvName = $c->isSystemPage() ? t($cvName) : $cvName;
$selected = ConcreteDashboardSitemapHelper::isOneTimeActiveNode($cID) ? true : false;
$ct = CollectionType::getByID($c->getCollectionTypeID());
$isInTrash = $c->isInTrash();
$canCompose = false;
if (is_object($ct)) {
if ($ct->isCollectionTypeIncludedInComposer()) {
$h = Loader::helper('concrete/dashboard');
if ($cp->canEditPageProperties() && $h->canAccessComposer()) {
$canCompose = true;
}
}
}
$isTrash = $c->getCollectionPath() == TRASH_PAGE_PATH;
if ($isTrash || $isInTrash) {
$pk = PermissionKey::getByHandle('empty_trash');
if (!$pk->validate()) {
return false;
}
}
$cIcon = $c->getCollectionIcon();
$cAlias = $c->isAlias();
$cPointerID = $c->getCollectionPointerID();
if ($cAlias) {
if ($cPointerID > 0) {
$cIcon = ASSETS_URL_IMAGES . '/icons/alias.png';
$cAlias = 'POINTER';
$cID = $c->getCollectionPointerOriginalID();
} else {
$cIcon = ASSETS_URL_IMAGES . '/icons/alias_external.png';
$cAlias = 'LINK';
}
}
$node = array('cvName' => $cvName, 'cIcon' => $cIcon, 'cAlias' => $cAlias, 'isInTrash' => $isInTrash, 'isTrash' => $isTrash, 'numSubpages' => $numSubpages, 'status' => $status, 'canEditPageProperties' => $canEditPageProperties, 'canEditPageSpeedSettings' => $canEditPageSpeedSettings, 'canEditPagePermissions' => $canEditPagePermissions, 'canEditPageDesign' => $canEditPageDesign, 'canViewPageVersions' => $canViewPageVersions, 'canDeletePage' => $canDeletePage, 'canAddSubpages' => $canAddSubpages, 'canAddExternalLinks' => $canAddExternalLinks, 'canCompose' => $canCompose, 'id' => $cID, 'selected' => $selected);
if ($cID == 1 || $nodeOpen && $autoOpenNodes) {
// We open another level
$node['subnodes'] = $this->getSubNodes($cID, $level, false, $autoOpenNodes);
}
return $node;
}
示例3: t
&arHandle=<?php
echo STACKS_AREA_NAME;
?>
&atask=paste&addOnly=0"><?php
echo t('Paste From Clipboard');
?>
</a></li>
</ul>
</div>
<?php
$cpc = new Permissions($stack);
?>
<?php
if ($cpc->canEditPageProperties()) {
?>
<a class="btn small ccm-main-nav-edit-option"href="<?php
echo $this->action('rename', $stack->getCollectionID());
?>
"><?php
echo t('Rename');
?>
</a>
<?php
}
?>
<a class="btn small ccm-main-nav-edit-option" dialog-width="640" dialog-height="340" id="stackVersions" dialog-title="<?php
echo t('Version History');
?>
示例4: t
dialog-modal="false" dialog-title="<?php
echo t('Composer');
?>
" href="<?php
echo URL::to('/ccm/system/panels/details/page/composer');
?>
?cID=<?php
echo $cID;
?>
"><?php
echo t('Composer');
?>
</a></li>
<?php
}
if ($permissions->canEditPageProperties() || $permissions->canEditPageTheme() || $permissions->canEditPageTemplate() || $permissions->canDeletePage() || $permissions->canEditPagePermissions()) {
?>
<li><a class="dialog-launch" dialog-width="640" dialog-height="360"
dialog-modal="false" dialog-title="<?php
echo t('SEO');
?>
" href="<?php
echo URL::to('/ccm/system/panels/details/page/seo');
?>
?cID=<?php
echo $cID;
?>
"><?php
echo t('SEO');
?>
</a></li>
示例5: t
</li>
<li><a dialog-width="640" dialog-height="340" class="dialog-launch" id="stackVersions" dialog-title="<?php
echo t('Version History');
?>
" href="<?php
echo URL::to('/ccm/system/panels/page/versions');
?>
?cID=<?php
echo $stack->getCollectionID();
?>
"><?php
echo t('Version History');
?>
</a></li>
<? if ($cpc->canEditPageProperties() && $stack->getStackType() != \Concrete\Core\Page\Stack\Stack::ST_TYPE_GLOBAL_AREA) { ?>
<li><a href="<?php
echo $view->action('rename', $stack->getCollectionID());
?>
"><?php
echo t('Rename');
?>
</a></li>
<? } ?>
<? if ($cpc->canEditPagePermissions() && Config::get('concrete.permissions.model') == 'advanced') { ?>
<li><a dialog-width="580" class="dialog-launch" dialog-append-buttons="true" dialog-height="420" dialog-title="<?php
echo t('Stack Permissions');
?>
" id="stackPermissions" href="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
示例6: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
if (!Loader::helper('validation/numbers')->integer($_GET['cID'])) {
die(t('Access Denied'));
}
$c = Page::getByID($_GET['cID'], 'RECENT');
$cp = new Permissions($c);
$canViewPane = false;
$additionalArgs = array();
switch ($_GET['ctask']) {
case 'edit_metadata':
$toolSection = "collection_metadata";
$canViewPane = $cp->canEditPageProperties();
break;
case 'edit_speed_settings':
$toolSection = "collection_speed_settings";
$canViewPane = $cp->canEditPageSpeedSettings();
break;
case 'edit_permissions':
if (PERMISSIONS_MODEL == 'simple') {
$toolSection = 'collection_permissions_simple';
} else {
$toolSection = "permission/lists/collection";
}
$canViewPane = $cp->canEditPagePermissions();
break;
case 'set_advanced_permissions':
$toolSection = "permission/details/collection";
$canViewPane = $cp->canEditPagePermissions();
break;
示例7: foreach
?>
</tr>
<?php
$h = Loader::helper('concrete/dashboard');
$dsh = Loader::helper('concrete/dashboard/sitemap');
foreach ($pages as $cobj) {
$cpobj = new Permissions($cobj);
if (!isset($striped) || $striped == 'ccm-list-record-alt') {
$striped = '';
} else {
if ($striped == '') {
$striped = 'ccm-list-record-alt';
}
}
$canEditPageProperties = $cpobj->canEditPageProperties();
$canEditPageSpeedSettings = $cpobj->canEditPageSpeedSettings();
$canEditPagePermissions = $cpobj->canEditPagePermissions();
$canEditPageDesign = $cpobj->canEditPageTheme() || $cpobj->canEditPageType();
$canViewPageVersions = $cpobj->canViewPageVersions();
$canDeletePage = $cpobj->canDeletePage();
$canAddSubpages = $cpobj->canAddSubpage();
$canAddExternalLinks = $cpobj->canAddExternalLink();
$permissionArray = array('canEditPageProperties' => $canEditPageProperties, 'canEditPageSpeedSettings' => $canEditPageSpeedSettings, 'canEditPagePermissions' => $canEditPagePermissions, 'canEditPageDesign' => $canEditPageDesign, 'canViewPageVersions' => $canViewPageVersions, 'canDeletePage' => $canDeletePage, 'canAddSubpages' => $canAddSubpages, 'canAddExternalLinks' => $canAddExternalLinks);
$canCompose = false;
$ct = CollectionType::getByID($cobj->getCollectionTypeID());
if (is_object($ct)) {
if ($ct->isCollectionTypeIncludedInComposer()) {
if ($canEditPageProperties && $h->canAccessComposer()) {
$canCompose = 1;
}
示例8: printAttributeRow
if ($cp->canEditPageProperties($ak)) {
$ak->saveAttributeForm($c);
$c->reindex();
}
}
$val = $c->getAttributeValueObject($ak);
print $val->getValue('display');
exit;
}
if ($_POST['task'] == 'clear_extended_attribute') {
$cakID = $_REQUEST['cakID'];
$value = '';
$ak = CollectionAttributeKey::get($cakID);
foreach ($pages as $c) {
$cp = new Permissions($c);
if ($cp->canEditPageProperties($ak)) {
$c->clearAttribute($ak);
$c->reindex();
}
}
print '<div class="ccm-attribute-field-none">' . t('None') . '</div>';
exit;
}
function printAttributeRow($ak)
{
global $pages, $form;
$value = '';
for ($i = 0; $i < count($pages); $i++) {
$lastValue = $value;
$c = $pages[$i];
$vo = $c->getAttributeValueObject($ak);
示例9: switch
switch ($cp->getError()) {
case COLLECTION_FORBIDDEN:
$v = View::getInstance();
$v->setCollectionObject($c);
$v->render('/page_forbidden');
break;
}
}
if (!$c->isActive() && !$cp->canViewPageVersions()) {
$v = View::getInstance();
$v->render('/page_not_found');
}
## If there's no error, then we build the collection, but first we load it with the appropriate
## version. We pass the function the collection object, as well as the collection permissions
## object, which the function will use to determine what version we get to see
if ($cp->canEditPageContents() || $cp->canEditPageProperties() || $cp->canViewPageVersions()) {
$cvID = $_REQUEST['cvID'] ? $_REQUEST['cvID'] : "RECENT";
$c->loadVersionObject($cvID);
}
$vp = new Permissions($c->getVersionObject());
if ($_REQUEST['ccm-disable-controls'] == true || intval($cvID) > 0) {
$v = View::getInstance();
$v->disableEditing();
$v->disableLinks();
}
// returns the $vp object, which we then check
if (is_object($vp) && $vp->isError()) {
// if we've gotten an error getting information about this particular collection
// than we load up the Content class, and get prepared to fire away
switch ($vp->getError()) {
case COLLECTION_NOT_FOUND:
示例10: t
href="<?= DIR_REL ?>/<?= DISPATCHER_FILENAME ?>?cID=<?= $c->getCollectionID() ?>&ctask=check-out<?= $token ?>"><?php echo t(
'Edit this Page') ?></a></li>
<? } ?>
<li class="parent-ul"><i class="fa fa-cog mobile-leading-icon"></i><a href="#"><?php echo t(
'Page Properties') ?><i class="fa fa-caret-down"></i></a>
<ul class="list-unstyled">
<?
$pagetype = PageType::getByID($c->getPageTypeID());
if (is_object($pagetype) && $cp->canEditPageContents()) { ?>
<li><a class="dialog-launch" dialog-width="640" dialog-height="640"
dialog-modal="false" dialog-title="<?= t('Composer') ?>" href="<?= URL::to(
'/ccm/system/panels/details/page/composer') ?>?cID=<?= $cID ?>"><?= t(
'Composer') ?></a></li>
<?
}
if ($permissions->canEditPageProperties() ||
$permissions->canEditPageTheme() ||
$permissions->canEditPageTemplate() ||
$permissions->canDeletePage() ||
$permissions->canEditPagePermissions()) { ?>
<li><a class="dialog-launch" dialog-width="640" dialog-height="360"
dialog-modal="false" dialog-title="<?= t('SEO') ?>" href="<?= URL::to(
'/ccm/system/panels/details/page/seo') ?>?cID=<?= $cID ?>"><?= t(
'SEO') ?></a></li>
<?
}
if ($permissions->canEditPageProperties()) {
if ($cID > 1) {
?>
<li><a class="dialog-launch" dialog-width="500" dialog-height="500"
dialog-modal="false" dialog-title="<?= t('Location') ?>"
示例11: t
defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Set as AttributeSet;
$cp = new Permissions($c);
$pk = PermissionKey::getByHandle('edit_page_properties');
$pk->setPermissionObject($c);
$asl = $pk->getMyAssignment();
$seoSet = AttributeSet::getByHandle('seo');
?>
<section>
<header><?php
echo t('Page Settings');
?>
</header>
<?php
if ($cp->canEditPageContents() || $cp->canEditPageTheme() || $cp->canEditPageProperties() || $cp->canEditPageTemplate()) {
?>
<menu class="ccm-panel-page-basics">
<?php
$pagetype = PageType::getByID($c->getPageTypeID());
if (is_object($pagetype) && $cp->canEditPageContents()) {
?>
<li>
<a href="#" data-launch-panel-detail="page-composer"
data-panel-detail-url="<?php
echo URL::to('/ccm/system/panels/details/page/composer');
?>
"
data-panel-transition="fade">
<?php
示例12: t
menuHTML += '<?php
echo t('Page last edited on %s', $c->getCollectionDateLastModified(DATE_APP_GENERIC_MDYT));
?>
';
<? } ?>
menuHTML += '</div>';
<? if (!$cantCheckOut) { ?>
menuHTML += '<div id="ccm-edit-overlay-footer">';
menuHTML += '<div class="ccm-edit-overlay-inner">';
menuHTML += '<ul>';
<? if ($cp->canEditPageProperties()) { ?>
menuHTML += '<li><a class="ccm-menu-icon ccm-icon-properties" <? if (!$c->isCheckedOut()) { ?> dialog-on-close="ccm_sitemapExitEditMode(<?php
echo $c->getCollectionID();
?>
)" <? } ?> id="ccm-toolbar-nav-properties" dialog-width="640" dialog-height="<? if ($cp->canApprovePageVersions() && (!$c->isEditMode())) { ?>450<? } else { ?>390<? } ?>" dialog-append-buttons="true" dialog-modal="false" dialog-title="<?php
echo t('Page Properties');
?>
" href="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/edit_collection_popup.php?<? if ($cp->canApprovePageVersions() && (!$c->isEditMode())) { ?>approveImmediately=1<? } ?>&cID=<?php
echo $c->getCollectionID();
?>
&ctask=edit_metadata"><?php
echo t('Properties');
?>
示例13: rename
public function rename($cID)
{
$s = Stack::getByID($cID);
if (is_object($s)) {
$this->set('stack', $s);
} else {
throw new Exception(t('Invalid stack'));
}
$sps = new Permissions($s);
if (!$sps->canEditPageProperties()) {
$this->redirect('/dashboard/blocks/stacks', 'view_details', $cID);
}
if ($this->isPost()) {
if (Loader::helper('validation/token')->validate('rename_stack')) {
if (Loader::helper('validation/strings')->notempty($stackName = trim($this->post('stackName')))) {
$txt = Loader::helper('text');
$v = $s->getVersionToModify();
$v->update(array('cName' => $stackName, 'cHandle' => str_replace('-', PAGE_PATH_SEPARATOR, $txt->urlify($stackName))));
$u = new User();
$pkr = new ApproveStackPageWorkflowRequest();
$pkr->setRequestedPage($s);
$pkr->setRequestedVersionID($v->getVersionID());
$pkr->setRequesterUserID($u->getUserID());
$response = $pkr->trigger();
if ($response instanceof WorkflowProgressResponse) {
// we only get this response if we have skipped workflows and jumped straight in to an approve() step.
$this->redirect('/dashboard/blocks/stacks', 'stack_renamed', $cID);
} else {
$this->redirect('/dashboard/blocks/stacks', 'view_details', $cID, 'rename_saved');
}
} else {
$this->error->add(t("The stack name cannot be empty."));
}
} else {
$this->error->add(Loader::helper('validation/token')->getErrorMessage());
}
}
}
示例14: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getByID($_REQUEST['cID']);
$cp = new Permissions($c);
if (!$cp->canEditPageProperties() && !$cp->canEditPageContents()) {
die(t("Access Denied."));
}
$v = CollectionVersion::get($c, "RECENT", true);
if ($cp->canApprovePageVersions()) {
$approveChecked = "";
if (isset($_SESSION['checkInApprove'])) {
if ($_SESSION['checkInApprove'] == true) {
$approveChecked = " checked";
}
}
}
Loader::element('pane_header', array('c' => $c));
?>
<div class="ccm-pane-controls">
<div id="ccm-edit-collection">
<form method="post" id="ccm-check-in" action="<?php
echo DIR_REL;
?>
/<?php
echo DISPATCHER_FILENAME;
?>
?cID=<?php
echo $c->getCollectionID();
?>
&ctask=check-in">
示例15: t
?>
"
data-launch-panel-detail="page-design"
data-panel-detail-url="<?php
echo URL::to('/ccm/system/panels/details/page/preview');
?>
"
data-panel-transition="fade">
<?php
echo t('Design');
?>
</a>
</li>
<?php
}
if ($cp->canEditPageProperties() && is_object($seoSet)) {
?>
<li>
<a href="#" data-launch-panel-detail="page-seo"
data-panel-detail-url="<?php
echo URL::to('/ccm/system/panels/details/page/seo');
?>
"
data-panel-transition="fade">
<?php
echo t('SEO');
?>
</a>
</li>
<?php
}