本文整理汇总了PHP中Permissions::canDeleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canDeleteFile方法的具体用法?PHP Permissions::canDeleteFile怎么用?PHP Permissions::canDeleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canDeleteFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(FileEntity $file)
{
parent::__construct();
$this->setAttribute('data-search-file-menu', $file->getFileID());
$this->addItem(new LinkItem('#', t('Clear'), ['data-file-manager-action' => 'clear']));
$this->addItem(new DividerItem());
$fp = new \Permissions($file);
if ($fp->canViewFile() && $file->canView()) {
$this->addItem(new DialogLinkItem(REL_DIR_FILES_TOOLS_REQUIRED . '/files/view?fID=' . $file->getFileID(), t('View'), t('View'), '90%', '75%'));
}
if ($fp->canViewFile() && $file->canView()) {
$this->addItem(new LinkItem('#', t('Download'), ['data-file-manager-action' => 'download', 'data-file-id' => $file->getFileID()]));
}
if ($file->canEdit() && $fp->canEditFileContents()) {
$this->addItem(new DialogLinkItem(REL_DIR_FILES_TOOLS_REQUIRED . '/files/edit?fID=' . $file->getFileID(), t('Edit'), t('Edit'), '90%', '75%'));
$this->addItem(new DialogLinkItem(\URL::to('/ccm/system/dialogs/file/thumbnails?fID=' . $file->getFileID()), t('Thumbnails'), t('Thumbnails'), '90%', '75%'));
}
if ($fp->canViewFileInFileManager()) {
$this->addItem(new DialogLinkItem(\URL::to('/ccm/system/dialogs/file/properties?fID=' . $file->getFileID()), t('Properties'), t('Properties'), '850', '450'));
}
if ($fp->canEditFileContents()) {
$this->addItem(new DialogLinkItem(REL_DIR_FILES_TOOLS_REQUIRED . '/files/replace?fID=' . $file->getFileID(), t('Replace'), t('Replace'), '500', '200'));
}
if ($fp->canCopyFile()) {
$this->addItem(new LinkItem('#', t('Duplicate'), ['data-file-manager-action' => 'duplicate', 'data-file-id' => $file->getFileID()]));
}
if ($fp->canViewFileInFileManager()) {
$this->addItem(new DialogLinkItem(\URL::to('/ccm/system/dialogs/file/sets?fID=' . $file->getFileID()), t('Sets'), t('File Sets'), '500', '400'));
}
if ($fp->canEditFilePermissions() || $fp->canDeleteFile()) {
$this->addItem(new DividerItem());
}
if ($fp->canEditFilePermissions()) {
$this->addItem(new DialogLinkItem(REL_DIR_FILES_TOOLS_REQUIRED . '/files/permissions?fID=' . $file->getFileID(), t('Permissions'), t('Permissions & Access'), '520', '450'));
}
$this->addItem(new DialogLinkItem(\URL::to('/ccm/system/dialogs/file/usage', $file->getFileID()), t('File Usage'), t('File Usage'), '90%', '75%'));
if ($fp->canDeleteFile()) {
$this->addItem(new DeleteItem($file->getFileNodeObject()));
}
}
示例2:
?>
<div class="ccm-file-selected" fID="<?php
echo $_REQUEST['fID'];
?>
" ccm-file-manager-field="<?php
echo $selectedField;
?>
" ccm-file-manager-can-duplicate="<?php
echo $fp->canCopyFile();
?>
" ccm-file-manager-can-admin="<?php
echo $fp->canEditFilePermissions();
?>
" ccm-file-manager-can-delete="<?php
echo $fp->canDeleteFile();
?>
" ccm-file-manager-can-view="<?php
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php
echo $fp->canEditFileContents();
?>
" ccm-file-manager-can-edit="<?php
echo $canEdit;
?>
" >
<div class="ccm-file-selected-thumbnail"><?php
echo $fv->getThumbnail(1);
?>
</div>
示例3:
$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->canEditFilePermissions();
?>
" ccm-file-manager-can-duplicate="<?php
echo $pf->canCopyFile();
?>
" ccm-file-manager-can-delete="<?php
echo $pf->canDeleteFile();
?>
" ccm-file-manager-can-view="<?php
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php
echo $pf->canEditFileContents();
?>
" ccm-file-manager-can-edit="<?php
echo $canEdit;
?>
" fID="<?php
echo $f->getFileID();
?>
" id="fID<?php
echo $f->getFileID();
示例4: foreach
</div>
<form data-dialog-form="delete-file" method="post" action="<?php
echo $controller->action('delete_files');
?>
">
<?php
\Core::make('token')->output('files/bulk_delete');
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="table table-striped">
<?php
foreach ($files as $f) {
$fp = new Permissions($f);
if ($fp->canDeleteFile()) {
$fv = $f->getApprovedVersion();
if (is_object($fv)) {
?>
<?php
echo $form->hidden('fID[]', $f->getFileID());
?>
<tr>
<td><?php
echo $fv->getType();
?>
</td>
<td class="ccm-file-list-filename" width="100%"><div style="word-wrap: break-word; width: 150px"><?php
echo h($fv->getTitle());
示例5: delete_files
public function delete_files()
{
if (!$this->token->validate('delete_files')) {
$this->error->add($this->token->getErrorMessage());
}
if (!$this->error->has()) {
$r = $this->entityManager->getRepository('\\PortlandLabs\\Concrete5\\MigrationTool\\Entity\\Import\\Batch');
$batch = $r->findOneById($this->request->request->get('id'));
if (is_object($batch)) {
foreach ($batch->getFiles() as $f) {
$fp = new \Permissions($f);
if ($fp->canDeleteFile()) {
$f->delete();
}
}
$fs = $batch->getFileSet();
if (is_object($fs)) {
$fsp = new \Permissions($fs);
if ($fsp->canDeleteFileSet()) {
$fs->delete();
}
}
$this->flash('success', t('Batch files deleted successfully.'));
$this->redirect('/dashboard/system/migration/import', 'batch_files', $batch->getId());
}
}
$this->view();
}