예제 #1
0
 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;
 }
                                       dialog-modal="false" dialog-title="<?php 
            echo t('Attributes');
            ?>
" href="<?php 
            echo URL::to('/ccm/system/dialogs/page/attributes');
            ?>
?cID=<?php 
            echo $cID;
            ?>
"><?php 
            echo t('Attributes');
            ?>
</a></li>
                            <?php 
        }
        if ($permissions->canEditPageSpeedSettings()) {
            ?>
                                <li><a class="dialog-launch" dialog-width="550" dialog-height="280"
                                       dialog-modal="false" dialog-title="<?php 
            echo t('Caching');
            ?>
" href="<?php 
            echo URL::to('/ccm/system/panels/details/page/caching');
            ?>
?cID=<?php 
            echo $cID;
            ?>
>"><?php 
            echo t('Caching');
            ?>
</a></li>
예제 #3
0
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;
    case 'preview_page_as_user':
        $toolSection = "collection_preview_as_user";
예제 #4
0
		</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;
                }
            }
예제 #5
0
파일: page.php 프로젝트: ceko/concrete5-1
"
                       data-launch-panel-detail="page-attributes"
                       data-panel-detail-url="<?php 
        echo URL::to('/ccm/system/panels/details/page/attributes');
        ?>
"
                       data-panel-transition="fade">
                        <?php 
        echo t('Attributes');
        ?>
                    </a>
                </li>
            <?php 
    }
}
if ($cp->canEditPageSpeedSettings()) {
    ?>
            <li>
                <a href="#" data-launch-panel-detail="page-caching"
                   data-panel-detail-url="<?php 
    echo URL::to('/ccm/system/panels/details/page/caching');
    ?>
"
                   data-panel-transition="fade">
                    <?php 
    echo t('Caching');
    ?>
                </a>
            </li>
        <?php 
}