本文整理汇总了PHP中Permissions::canAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canAdmin方法的具体用法?PHP Permissions::canAdmin怎么用?PHP Permissions::canAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canAdmin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: refresh
public function refresh($cID = 0, $token)
{
if (intval($cID) > 0) {
if ($this->token->validate('refresh', $token)) {
Loader::model('single_page');
$p = SinglePage::getByID($cID);
$cp = new Permissions($p);
if ($cp->canAdmin()) {
$p->refresh();
$this->redirect('/dashboard/pages/single', t('Page Successfully Refreshed.'));
}
$this->redirect('/dashboard/pages/single', t('You do not have permissions to refresh this page.'), 1);
}
$this->redirect('/dashboard/pages/single', $this->token->getErrorMessage(), 1);
}
$this->redirect('/dashboard/pages/single', t('Page Unsuccessfully Refreshed.'), 1);
}
示例2: if
<div class="options">
<? if ($bp->canWrite()) { ?>
<a href="javascript:void(0)" onclick="GlobalScrapbook.toggleRename(<?=intval($b->bID) ?>)"><?=t('Rename')?></a>
|
<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockTemplate(<?=intval($b->bID) ?>)" ><?=t('Custom Template')?></a>
|
<? if (ENABLE_CUSTOM_DESIGN == true) { ?>
<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockDesign(<?=intval($b->bID) ?>)" ><?=t('Design')?></a>
|
<? } ?>
<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlock(<?=intval($b->bID) ?>,<?=$bt->getBlockTypeInterfaceWidth()?> , <?=$bt->getBlockTypeInterfaceHeight()?> )" ><?=t('Edit')?></a>
|
<? } ?>
<? if (PERMISSIONS_MODEL != 'simple' && $bp->canAdmin()) { ?>
<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockPermissions(<?=$b->getBlockID()?>)" ><?=t('Permissions')?></a>
<? if ($bp->canDeleteBlock()) { ?>
|
<? } ?>
<? } ?>
<? if ($bp->canDeleteBlock()) { ?>
<a href="<?php echo $this->action('deleteBlock', Loader::helper('text')->entities($scrapbookName), 0, intval($b->bID), $valt->generate('delete_scrapbook_block'))?>" onclick="return GlobalScrapbook.confirmDelete()">
<?=t('Delete')?>
</a>
<? } ?>
</div>
<div id="ccm-block-type-inner<?=intval($b->bID)?>" class="ccm-block-type-inner">
<div class="ccm-block-type-inner-icon ccm-scrapbook-item-handle" style="background: url(<?=$btIcon?>) no-repeat center left;">
示例3: t
?>
"><?php
echo $p->getCollectionName();
?>
</a></td>
<td style="width: 40%"><?php
echo $p->getCollectionPath();
?>
</td>
<td style="width: 30%"><?php
print $packageName;
?>
</td>
<td style="width: 1">
<?php
if ($cp->canAdmin()) {
?>
<a href="<?php
echo $view->action('refresh', $p->getCollectionID(), $this->controller->token->generate('refresh'));
?>
" title="<?php
echo t('Refreshes the page, rebuilding its permissions and its name.');
?>
" class="icon-link launch-tooltip"><i class="fa fa-refresh"></i></a>
<?php
}
?>
</td>
</tr>
<?php
}
示例4: rename_block
public function rename_block(){
$valt = Loader::helper('validation/token');
if(!$valt->validate('rename_scrapbook_block')){
$this->set('error', array($valt->getErrorMessage()));
$this->view();
return;
}
$bID=intval($_REQUEST['bID']);
$globalScrapbookC=$this->getCollectionObject();
$scrapbookName = $_REQUEST['scrapbookName'];
$globalScrapbookArea = Area::getOrCreate( $globalScrapbookC, $scrapbookName );
$block=Block::getById($bID, $globalScrapbookC, $globalScrapbookArea);
if($block && strlen($_POST['bName']) ){ //&& $block->getAreaHandle()=='Global Scrapbook'
//this is needed so the cache clears correctly
$bp = new Permissions($block);
if ($bp->canAdmin()) {
$block->setBlockAreaObject($globalScrapbookArea);
$block->updateBlockName( $_POST['bName'], 1 );
}
}
header('Location: ' . View::url('/dashboard/scrapbook', 'view') . '?scrapbookName=' . $scrapbookName);
exit;
}
示例5: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
$searchInstance = Loader::helper('text')->entities($_REQUEST['searchInstance']);
$ih = Loader::helper('concrete/interface');
$f = File::getByID($_REQUEST['fID']);
$cp = new Permissions($f);
if (!$cp->canAdmin()) {
die(t("Access Denied."));
}
$form = Loader::helper('form');
if ($_POST['task'] == 'set_password') {
$f->setPassword($_POST['fPassword']);
exit;
}
Loader::model('file_storage_location');
if ($_POST['task'] == 'set_location') {
if ($_POST['fslID'] == 0) {
$f->setStorageLocation(0);
} else {
$fsl = FileStorageLocation::getByID($_POST['fslID']);
if (is_object($fsl)) {
$f->setStorageLocation($fsl);
}
}
exit;
}
?>
示例6: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
$f = File::getByID($_REQUEST['fID']);
$fp = new Permissions($f);
if (!$fp->canRead()) {
die(t("Access Denied."));
}
$fv = $f->getApprovedVersion();
$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = $fv->canEdit() ? 1 : 0;
?>
<div class="ccm-file-selected" fID="<?php echo $_REQUEST['fID']?>" ccm-file-manager-field="<?php echo $_REQUEST['ccm_file_selected_field']?>" ccm-file-manager-can-admin="<?php echo ($fp->canAdmin())?>" ccm-file-manager-can-delete="<?php echo $fp->canAdmin()?>" ccm-file-manager-can-view="<?php echo $canViewInline?>" ccm-file-manager-can-replace="<?php echo $fp->canWrite()?>" ccm-file-manager-can-edit="<?php echo $canEdit?>" >
<div class="ccm-file-selected-thumbnail"><?php echo $fv->getThumbnail(1)?></div>
<div class="ccm-file-selected-data"><div><?php echo $fv->getTitle()?></div><div></div></div>
<div class="ccm-spacer"> </div>
</div>
示例7:
if (isset($_REQUEST['fvID'])) {
$fv = $f->getVersion($_REQUEST['fvID']);
} else {
$fv = $f->getApprovedVersion();
}
if ($_REQUEST['task'] == 'preview_version') {
$previewMode = true;
}
if ($_POST['task'] == 'approve_version' && $fp->canWrite() && (!$previewMode)) {
$fv->approve();
exit;
}
if ($_POST['task'] == 'delete_version' && $fp->canAdmin() && (!$previewMode)) {
$fv->delete();
exit;
}
if ($_POST['task'] == 'update_core' && $fp->canWrite() && (!$previewMode)) {
$fv = $f->getVersionToModify();
switch($_POST['attributeField']) {
case 'fvTitle':
$text = $_POST['fvTitle'];
$fv->updateTitle($text);
print $text;
break;
case 'fvDescription':
示例8:
ccm_areaMenuObj<?php
echo $a->getAreaID();
?>
.canAddBlocks = <?php
echo $ap->canAddBlocks();
?>
;
ccm_areaMenuObj<?php
echo $a->getAreaID();
?>
.canWrite = <?php
echo $ap->canWrite();
?>
;
<?php
if ($cp->canAdmin() && PERMISSIONS_MODEL != 'simple') {
?>
ccm_areaMenuObj<?php
echo $a->getAreaID();
?>
.canModifyGroups = true;
<?php
}
?>
<?php
if ($ap->canWrite() && ENABLE_AREA_LAYOUTS == true && !$c->isMasterCollection()) {
?>
ccm_areaMenuObj<?php
echo $a->getAreaID();
?>
.canLayout = true;
示例9:
}
$fv = $f->getApprovedVersion();
$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = $fv->canEdit() ? 1 : 0;
?>
<div class="ccm-file-selected" fID="<?php
echo $_REQUEST['fID'];
?>
" ccm-file-manager-field="<?php
echo $_REQUEST['ccm_file_selected_field'];
?>
" ccm-file-manager-can-admin="<?php
echo $fp->canAdmin();
?>
" ccm-file-manager-can-delete="<?php
echo $fp->canAdmin();
?>
" ccm-file-manager-can-view="<?php
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php
echo $fp->canWrite();
?>
" ccm-file-manager-can-edit="<?php
echo $canEdit;
?>
" >
<div class="ccm-file-selected-thumbnail"><?php
示例10: if
</ol>
<?php
$v = $entry->getVersionObject();
?>
<?php echo Loader::helper('concrete/interface')->submit(t('Save'), 'save', 'left')?>
<?php echo Loader::helper('concrete/interface')->submit(t('Discard'), 'discard', 'left', 'ccm-composer-hide-on-approved')?>
<?php echo Loader::helper('concrete/interface')->button_js(t('Preview'), 'javascript:ccm_composerLaunchPreview()', 'left', 'ccm-composer-hide-on-approved')?>
<?php if ($entry->isComposerDraft()) {
$pp = new Permissions($entry);
?>
<?php if (PERMISSIONS_MODEL != 'simple' && $pp->canAdmin()) { ?>
<?php echo Loader::helper('concrete/interface')->button_js(t('Permissions'), 'javascript:ccm_composerLaunchPermissions()', 'left', 'ccm-composer-hide-on-no-target')?>
<?php } ?>
<?php echo Loader::helper('concrete/interface')->submit(t('Publish Page'), 'publish')?>
<?php } else { ?>
<?php echo Loader::helper('concrete/interface')->submit(t('Publish Changes'), 'publish')?>
<?php } ?>
<?php echo $form->hidden('entryID', $entry->getCollectionID())?>
<?php if ($entry->isComposerDraft()) { ?>
<input type="hidden" name="cPublishParentID" value="<?php echo $entry->getComposerDraftPublishParentID()?>" />
<?php } ?>
<?php echo $form->hidden('autosave', 0)?>
<?php echo Loader::helper('validation/token')->output('composer')?>
<div class="ccm-spacer"> </div>
示例11: Permissions
</tr>
<?php
foreach($files as $f) {
$pf = new Permissions($f);
if (!isset($striped) || $striped == 'ccm-list-record-alt') {
$striped = '';
} else if ($striped == '') {
$striped = 'ccm-list-record-alt';
}
$star_icon = ($f->isStarred() == 1) ? 'star_yellow.png' : 'star_grey.png';
$fv = $f->getApprovedVersion();
$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = ($fv->canEdit() && $pf->canWrite()) ? 1 : 0;
$pfg = FilePermissions::getGlobal();
?>
<tr class="ccm-list-record <?php echo $striped?>" ccm-file-manager-instance="<?php echo $searchInstance?>" ccm-file-manager-can-admin="<?php echo ($pf->canAdmin())?>" ccm-file-manager-can-duplicate="<?php echo ($pfg->canAddFileType($f->getExtension()) && $pf->canWrite())?>" ccm-file-manager-can-delete="<?php echo $pf->canAdmin()?>" ccm-file-manager-can-view="<?php echo $canViewInline?>" ccm-file-manager-can-replace="<?php echo $pf->canWrite()?>" ccm-file-manager-can-edit="<?php echo $canEdit?>" fID="<?php echo $f->getFileID()?>" id="fID<?php echo $f->getFileID()?>">
<td class="ccm-file-list-cb" style="vertical-align: middle !important"><input type="checkbox" value="<?php echo $f->getFileID()?>" /></td>
<td>
<div class="ccm-file-list-thumbnail">
<div class="ccm-file-list-thumbnail-image" fID="<?php echo $f->getFileID()?>"><table border="0" cellspacing="0" cellpadding="0" height="70" width="100%"><tr><td align="center" fID="<?php echo $f->getFileID()?>" style="padding: 0px"><?php echo $fv->getThumbnail(1)?></td></tr></table></div>
</div>
<?php if ($fv->hasThumbnail(2)) { ?>
<div class="ccm-file-list-thumbnail-hover" id="fID<?php echo $f->getFileID()?>hoverThumbnail"><div><?php echo $fv->getThumbnail(2)?></div></div>
<?php } ?>
</td>
<td class="ccm-file-list-starred"><img src="<?php echo ASSETS_URL_IMAGES?>/icons/<?php echo $star_icon?>" height="16" width="16" border="0" class="ccm-star" /></td>
<?php foreach($columns->getColumns() as $col) { ?>
<?php // special one for keywords ?>
<?php if ($col->getColumnKey() == 'fvTitle') { ?>
示例12:
$toolSection = "block_area_layout";
$canViewPane = $ap->canWrite();
$args['action'] = $a->getAreaUpdateAction('layout').'&originalLayoutID='.$originalLayoutId.'&cvalID='.intval($_REQUEST['cvalID']);
break;
case 'design':
$toolSection = 'custom_style';
$args['style'] = $c->getAreaCustomStyleRule($a);
$args['action'] = $a->getAreaUpdateAction('design');
$args['refreshAction'] = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_area_popup?atask=design&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&refresh=1';
$canViewPane = $ap->canWrite();
if ($canViewPane) {
if ($_REQUEST['subtask'] == 'delete_custom_style_preset') {
$styleToDelete = CustomStylePreset::getByID($_REQUEST['deleteCspID']);
$styleToDelete->delete();
}
}
break;
case 'groups':
$toolSection = "block_area_groups";
$canViewPane = $cp->canAdmin();
break;
}
if (!$canViewPane) {
die(t("Access Denied."));
}
?>
<?php Loader::element($toolSection, $args);
示例13:
$striped = 'ccm-list-record-alt';
}
$star_icon = ($f->isStarred() == 1) ? 'star_yellow.png' : 'star_grey.png';
$fv = $f->getApprovedVersion();
$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = ($fv->canEdit() && $pf->canWrite()) ? 1 : 0;
$pfg = FilePermissions::getGlobal();
?>
<tr class="ccm-list-record <?php
echo $striped;
?>
" ccm-file-manager-instance="<?php
echo $searchInstance;
?>
" ccm-file-manager-can-admin="<?php
echo $pf->canAdmin();
?>
" ccm-file-manager-can-duplicate="<?php
echo $pfg->canAddFileType($f->getExtension());
?>
" ccm-file-manager-can-delete="<?php
echo $pf->canAdmin();
?>
" ccm-file-manager-can-view="<?php
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php
echo $pf->canWrite();
?>
" ccm-file-manager-can-edit="<?php
echo $canEdit;
示例14: die
if (!$fp->canRead()) {
die(_("Access Denied."));
}
if (isset($_REQUEST['fvID'])) {
$fv = $f->getVersion($_REQUEST['fvID']);
} else {
$fv = $f->getApprovedVersion();
}
if ($_REQUEST['task'] == 'preview_version') {
$previewMode = true;
}
if ($_POST['task'] == 'approve_version' && $fp->canWrite() && !$previewMode) {
$fv->approve();
exit;
}
if ($_POST['task'] == 'delete_version' && $fp->canAdmin() && !$previewMode) {
$fv->delete();
exit;
}
if ($_POST['task'] == 'update_core' && $fp->canWrite() && !$previewMode) {
$fv = $f->getVersionToModify();
switch ($_POST['attributeField']) {
case 'fvTitle':
$text = $_POST['fvTitle'];
$fv->updateTitle($text);
print $text;
break;
case 'fvDescription':
$text = $_POST['fvDescription'];
$fv->updateDescription($text);
print $text;
示例15: foreach
<form id="ccm-<?php
echo $searchInstance;
?>
-delete-form" method="post" action="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/files/delete">
<?php
echo $form->hidden('task', 'delete_files');
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="ccm-results-list">
<?php
foreach ($files as $f) {
$fp = new Permissions($f);
if ($fp->canAdmin()) {
$fv = $f->getApprovedVersion();
if (is_object($fv)) {
?>
<?php
echo $form->hidden('fID[]', $f->getFileID());
?>
<tr>
<td>
<div class="ccm-file-list-thumbnail">
<div class="ccm-file-list-thumbnail-image" fID="<?php
echo $f->getFileID();
?>