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


PHP Permissions::canDeleteCollection方法代码示例

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


在下文中一共展示了Permissions::canDeleteCollection方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->canDeleteCollection()) {
					$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:nbourguig,项目名称:concrete5,代码行数:18,代码来源:controller.php

示例2: die

<?

defined('C5_EXECUTE') or die("Access Denied.");
$dh = Loader::helper('concrete/dashboard/sitemap');
if (!$dh->canRead()) {
	die(t("Access Denied."));
}

$c = Page::getByID($_REQUEST['cID']);
if (is_object($c) && !$c->isError()) { 
	$cp = new Permissions($c);
	if ($cp->canDeleteCollection()) { 
		$c->delete();	
		$message = t('Page deleted.');
		
		$obj = new stdClass;
		$obj->message = $message;
		print Loader::helper('json')->encode($obj);
	}
}
开发者ID:nbourguig,项目名称:concrete5,代码行数:20,代码来源:sitemap_delete_forever.php

示例3:

     }
     $canViewPane = $cp->canAdminPage();
     break;
 case 'edit_permissions_composer':
     $toolSection = "collection_permissions";
     $canViewPane = $cp->canAdminPage();
     $additionalArgs['isComposer'] = true;
     break;
 case 'mcd':
     $toolSection = "collection_mcd";
     $canViewPane = $cp->canWrite();
     $divID = "ccm-collection-mcd";
     break;
 case 'delete':
     $toolSection = "collection_delete";
     $canViewPane = $cp->canDeleteCollection();
     break;
 case 'set_theme':
     $toolSection = "collection_theme";
     $divID = 'ccm-edit-collection-design';
     $canViewPane = $cp->canWrite();
     break;
 case 'add':
     $toolSection = "collection_add";
     $divID = 'ccm-edit-collection-design';
     $canViewPane = $cp->canAddSubContent();
     if ($_REQUEST['ctID']) {
         $ct = CollectionType::getByID($_REQUEST['ctID']);
         if (!is_object($ct)) {
             $canViewPane = false;
         } else {
开发者ID:rmxdave,项目名称:concrete5,代码行数:31,代码来源:edit_collection_popup.php

示例4: t

 <?php 
            if ($cp->canReadVersions() && !$c->isMasterCollection()) {
                ?>
 	menuHTML += '<li class="ccm-main-nav-edit-option" <?php 
                if (!$c->isEditMode()) {
                    ?>
 style="display: none" <?php 
                }
                ?>
><a href="javascript:void(0)" id="ccm-nav-versions"><?php 
                echo t('Versions');
                ?>
</a></li>';
 <?php 
            }
            if (($sh->canRead() || $cp->canDeleteCollection()) && !$c->isMasterCollection()) {
                ?>
 	menuHTML += '<li class="ccm-main-nav-edit-option" <?php 
                if (!$c->isEditMode()) {
                    ?>
 style="display: none" <?php 
                }
                ?>
><a href="javascript:void(0)" id="ccm-nav-mcd"><?php 
                echo t('Move/Delete');
                ?>
</a></li>';
 <?php 
            }
            ?>
 <?php 
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:page_controls_menu_js.php

示例5: t

            }
            if ($cp->canReadVersions()) {
                ?>
	menuHTML += '<li class="ccm-main-nav-edit-option" <?php 
                if (!$c->isEditMode()) {
                    ?>
 style="display: none" <?php 
                }
                ?>
><a href="javascript:void(0)" id="ccm-nav-versions"><?php 
                echo t('Versions');
                ?>
</a></li>';
<?php 
            }
            if ($sh->canRead() || $cp->canDeleteCollection()) {
                ?>
	menuHTML += '<li class="ccm-main-nav-edit-option" <?php 
                if (!$c->isEditMode()) {
                    ?>
 style="display: none" <?php 
                }
                ?>
><a href="javascript:void(0)" id="ccm-nav-mcd"><?php 
                echo t('Move/Delete');
                ?>
</a></li>';
<?php 
            }
        }
        ?>
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:31,代码来源:page_controls_menu_js.php

示例6: t

			<a class="btn small ccm-main-nav-edit-option" dialog-width="580" dialog-append-buttons="true" dialog-height="420" dialog-title="<?php 
echo t('Stack Permissions');
?>
" 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>
		<? } ?>

		<? if ($cpc->canDeleteCollection()) { ?>
			<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>
		<? } ?>

		<?
		$vo = $stack->getVersionObject();
		if ($cp->canApproveCollection()) {
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:view.php


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