本文整理汇总了PHP中Permissions::canEditPageTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canEditPageTheme方法的具体用法?PHP Permissions::canEditPageTheme怎么用?PHP Permissions::canEditPageTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canEditPageTheme方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$tArray2 = PageTheme::getLocalList();
$tArrayTmp = array_merge($tArray, $tArray2);
$tArray = array();
foreach($tArrayTmp as $pt) {
if ($cp->canEditPageTheme($pt)) {
$tArray[] = $pt;
}
}
$ctArray = CollectionType::getList();
$cp = new Permissions($c);
if ($c->getCollectionID() > 1) {
$parent = Page::getByID($c->getCollectionParentID());
$parentCP = new Permissions($parent);
}
if (!$cp->canEditPageType() && !$cp->canEditPageTheme()) {
die(t('Access Denied'));
}
$cnt = 0;
for ($i = 0; $i < count($ctArray); $i++) {
$ct = $ctArray[$i];
if ($c->getCollectionID() == 1 || $parentCP->canAddSubCollection($ct)) {
$cnt++;
}
}
$plID = $c->getCollectionThemeID();
$ctID = $c->getCollectionTypeID();
if ($plID == 0) {
$pl = PageTheme::getSiteTheme();
示例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: Permissions
}
$pcnt = 0;
$isMasterCollection = false;
$isSinglePage = false;
$tArray = PageTheme::getGlobalList();
$tArray2 = PageTheme::getLocalList();
$tArray = array_merge($tArray, $tArray2);
foreach ($pages as $c) {
if ($c->isGeneratedCollection()) {
$isSinglePage = true;
}
if ($c->isMasterCollection()) {
$isMasterCollection = true;
}
$cp = new Permissions($c);
if ($cp->canEditPageTheme() && $cp->canEditPageType()) {
$pcnt++;
}
}
if ($pcnt > 0) {
// i realize there are a lot of loops through this, but the logic here is a bit tough to follow if you don't do it this way.
// first we determine which page types to show, if any
$notAllowedPageTypes = array();
$allowedPageTypes = array();
$ctArray = CollectionType::getList();
foreach ($ctArray as $ct) {
foreach ($pages as $c) {
if ($c->getCollectionID() != HOME_CID) {
$parentC = Page::getByID($c->getCollectionParentID());
$parentCP = new Permissions($parentC);
if (!$parentCP->canAddSubCollection($ct)) {
示例4: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('collection_types');
Loader::library('view');
if (isset($_POST['ttask']) && $_POST['ttask'] == 'preview_theme_customization') {
Cache::set('preview_theme_style', $_REQUEST['themeID'], $_POST, 30);
}
$previewCID = intval($_REQUEST['previewCID']);
$themeID = intval($_REQUEST['themeID']);
$ctID = intval($_REQUEST['ctID']);
$collectionType = CollectionType::getByID($ctID);
$c = Page::getByID($previewCID, 'RECENT');
//,"ACTIVE"
$cp = new Permissions($c);
if (!$cp->canEditPageTheme()) {
throw new Exception(t('Access Denied'));
}
$v = View::getInstance();
if ($themeID > 0) {
$th = PageTheme::getByID($themeID);
if (!file_exists($th->getThemeDirectory())) {
throw new Exception(t('Theme not found in %s', $th->getThemeDirectory()));
}
$v->setTheme($th);
}
$v->disableEditing();
$v->disableLinks();
$v->enablePreview();
$v->render($c);
示例5: 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>
示例6:
$toolSection = "collection_timed_permission_list";
$canViewPane = $cp->canPreviewPageAsUser() && PERMISSIONS_MODEL == 'advanced';
break;
case 'mcd':
$toolSection = "collection_mcd";
$canViewPane = $cp->canMoveOrCopyPage();
$divID = "ccm-collection-mcd";
break;
case 'delete':
$toolSection = "collection_delete";
$canViewPane = $cp->canDeletePage();
break;
case 'set_theme':
$toolSection = "collection_theme";
$divID = 'ccm-edit-collection-design';
$canViewPane = $cp->canEditPageTheme() || $cp->canEditPageType();
break;
case 'add':
$toolSection = "collection_add";
$divID = 'ccm-edit-collection-design';
$canViewPane = $cp->canAddSubpage();
if ($_REQUEST['ctID']) {
$ct = CollectionType::getByID($_REQUEST['ctID']);
if (!is_object($ct)) {
$canViewPane = false;
} else {
$canViewPane = $cp->canAddSubCollection($ct);
}
}
break;
case 'add_external':
示例7: foreach
<?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: 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
示例9: 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') ?>"
href="<?= URL::to(
示例10: t
?>
)" <? } ?> id="ccm-toolbar-nav-preview-as-user" dialog-width="90%" dialog-height="70%" dialog-append-buttons="true" dialog-modal="false" dialog-title="<?php
echo t('View Page as Someone Else');
?>
" href="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/edit_collection_popup.php?cID=<?php
echo $c->getCollectionID();
?>
&ctask=preview_page_as_user"><?php
echo t('Preview as User');
?>
</a></li>';
<? } ?>
<? if ($cp->canEditPageTheme() || $cp->canEditPageType()) { ?>
menuHTML += '<li><a class="ccm-menu-icon ccm-icon-design" <? if (!$c->isCheckedOut()) { ?> dialog-on-close="ccm_sitemapExitEditMode(<?php
echo $c->getCollectionID();
?>
)" <? } ?> id="ccm-toolbar-nav-design" dialog-append-buttons="true" dialog-width="610" dialog-height="405" dialog-modal="false" dialog-title="<?php
echo t('Design');
?>
" href="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/edit_collection_popup.php?cID=<?php
echo $cID;
?>
&ctask=set_theme"><?php
echo t('Design');
?>
示例11: Permissions
}
$pcnt = 0;
$isMasterCollection = false;
$isSinglePage = false;
$tArray = PageTheme::getGlobalList();
$tArray2 = PageTheme::getLocalList();
$tArray = array_merge($tArray, $tArray2);
foreach ($pages as $c) {
if ($c->isGeneratedCollection()) {
$isSinglePage = true;
}
if ($c->isMasterCollection()) {
$isMasterCollection = true;
}
$cp = new Permissions($c);
if ($cp->canEditPageTheme() && $cp->canEditPageTemplate()) {
$pcnt++;
}
}
if ($pcnt > 0) {
// i realize there are a lot of loops through this, but the logic here is a bit tough to follow if you don't do it this way.
// first we determine which page types to show, if any
$notAllowedPageTypes = array();
$allowedPageTypes = array();
$ctArray = PageType::getList();
foreach ($ctArray as $ct) {
foreach ($pages as $c) {
if ($c->getCollectionID() != HOME_CID) {
$parentC = Page::getByID($c->getCollectionParentID());
$parentCP = new Permissions($parentC);
if (!$parentCP->canAddSubCollection($ct)) {
示例12: 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>
<? 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">