当前位置: 首页>>代码示例>>PHP>>正文


PHP Permissions::canDeletePage方法代码示例

本文整理汇总了PHP中Permissions::canDeletePage方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canDeletePage方法的具体用法?PHP Permissions::canDeletePage怎么用?PHP Permissions::canDeletePage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Permissions的用法示例。


在下文中一共展示了Permissions::canDeletePage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($cID = false, $token = false)
 {
     if (Loader::helper('validation/token')->validate('delete', $token)) {
         $s = Stack::getByID($cID);
         if (is_object($s)) {
             $sps = new Permissions($s);
             if ($sps->canDeletePage()) {
                 $u = new User();
                 $pkr = new DeletePagePageWorkflowRequest();
                 $pkr->setRequestedPage($s);
                 $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_deleted');
                 } else {
                     $this->redirect('/dashboard/blocks/stacks', 'view_details', $cID, 'delete_saved');
                 }
             } else {
                 $this->error->add(t('You do not have access to delete this stack.'));
             }
         } else {
             $this->error->add(t('Invalid stack'));
         }
     } else {
         $this->error->add(Loader::helper('validation/token')->getErrorMessage());
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:28,代码来源:stacks.php

示例2: delete

 public function delete($cID = false, $token = false)
 {
     if (Loader::helper('validation/token')->validate('delete', $token)) {
         $s = Stack::getByID($cID);
         if (is_object($s)) {
             $sps = new Permissions($s);
             if ($sps->canDeletePage()) {
                 $s->delete();
                 $this->redirect('/dashboard/blocks/stacks', 'stack_deleted');
             } else {
                 $this->error->add(t('You do not have access to delete this stack.'));
             }
         } else {
             $this->error->add(t('Invalid stack'));
         }
     } else {
         $this->error->add(Loader::helper('validation/token')->getErrorMessage());
     }
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:19,代码来源:stacks.php

示例3: t

" id="stackPermissions" href="<?php 
        echo REL_DIR_FILES_TOOLS_REQUIRED;
        ?>
/edit_area_popup.php?cID=<?php 
        echo $stack->getCollectionID();
        ?>
&arHandle=Main&atask=groups"><?php 
        echo t('Permissions');
        ?>
</a>
		<?php 
    }
    ?>

		<?php 
    if ($cpc->canDeletePage()) {
        ?>
			<a class="btn ccm-button-v2-right small ccm-main-nav-edit-option error" href="javascript:void(0)" onclick="if (confirm('<?php 
        echo t('Are you sure you want to remove this stack?');
        ?>
')) { window.location.href='<?php 
        echo $this->url('/dashboard/blocks/stacks/', 'delete', $stack->getCollectionID(), Loader::helper('validation/token')->generate('delete'));
        ?>
' }"><?php 
        echo t('Delete Stack');
        ?>
</a>
		<?php 
    }
    ?>
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:30,代码来源:view.php

示例4: t

</th>
		<th><?php 
    echo t('Date Added');
    ?>
</th>
		<th><?php 
    echo t('Author');
    ?>
</th>
	</tr>

	<?php 
    foreach ($pages as $c) {
        $cp = new Permissions($c);
        $c->loadVersionObject();
        if ($cp->canDeletePage() && $c->getCollectionID() > 1) {
            ?>

		<?php 
            echo $form->hidden('cID[]', $c->getCollectionID());
            ?>

		<tr>
			<td class="ccm-page-list-name"><?php 
            echo $c->getCollectionName();
            ?>
</td>
			<td><?php 
            echo $c->getPageTypeName();
            ?>
</td>
开发者ID:ceko,项目名称:concrete5-1,代码行数:31,代码来源:delete.php

示例5: 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;
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:69,代码来源:sitemap.php

示例6: 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>
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:31,代码来源:page_controls_footer.php

示例7: delete

 public function delete($ctID, $cID)
 {
     $c = Page::getByID($cID);
     $p = new Permissions($c);
     if ($p->canDeletePage()) {
         $this->set('message', t("Page deleted."));
         $c->moveToTrash();
     } else {
         $this->set('message', t("You don't have the right to delete this page!"));
     }
     $this->show($ctID);
 }
开发者ID:haeflimi,项目名称:concrete5-composer-list,代码行数:12,代码来源:list.php

示例8: foreach

    $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;
                }
            }
        }
        ?>
			<tr class="ccm-list-record <?php 
        echo $striped;
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:search_results.php

示例9:

 case 'preview_page_as_user':
     $toolSection = "collection_preview_as_user";
     $canViewPane = $cp->canPreviewPageAsUser() && PERMISSIONS_MODEL == 'advanced';
     break;
 case 'view_timed_permission_list':
     $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 {
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:edit_collection_popup.php

示例10: t

 <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(
                            '/ccm/system/panels/details/page/location') ?>?cID=<?= $cID ?>"><?= t(
                             'Location'); ?></a></li>
开发者ID:JeRoNZ,项目名称:concrete5-1,代码行数:31,代码来源:page_controls_footer.php

示例11: t

?>
)" <? } ?> id="ccm-toolbar-nav-speed-settings" dialog-append-buttons="true" dialog-width="550" dialog-height="280" dialog-modal="false" dialog-title="<?php 
echo t('Full Page Caching');
?>
" href="<?php 
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/edit_collection_popup.php?&cID=<?php 
echo $cID;
?>
&ctask=edit_speed_settings"><?php 
echo t('Full Page Caching');
?>
</a></li>';
<? } ?>
<? if ($cp->canDeletePage()) { ?>
	menuHTML += '<li><a class="ccm-menu-icon ccm-icon-delete" <? if (!$c->isCheckedOut()) { ?> dialog-on-close="ccm_sitemapExitEditMode(<?php 
echo $c->getCollectionID();
?>
)" <? } ?>  dialog-append-buttons="true" id="ccm-toolbar-nav-delete" dialog-width="360" dialog-height="150" dialog-modal="false" dialog-title="<?php 
echo t('Delete Page');
?>
" href="<?php 
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/edit_collection_popup.php?&cID=<?php 
echo $cID;
?>
&ctask=delete"><?php 
echo t('Delete');
?>
开发者ID:ronlobo,项目名称:concrete5,代码行数:31,代码来源:page_controls_menu_js.php


注:本文中的Permissions::canDeletePage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。