本文整理匯總了PHP中Permissions::canViewFileInFileManager方法的典型用法代碼示例。如果您正苦於以下問題:PHP Permissions::canViewFileInFileManager方法的具體用法?PHP Permissions::canViewFileInFileManager怎麽用?PHP Permissions::canViewFileInFileManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Permissions
的用法示例。
在下文中一共展示了Permissions::canViewFileInFileManager方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: populateFiles
protected function populateFiles()
{
if (is_array($_REQUEST['fID'])) {
foreach ($_REQUEST['fID'] as $fID) {
$f = File::getByID($fID);
if (is_object($f)) {
$this->files[] = $f;
}
}
}
if (count($this->files) > 0) {
$this->canEdit = true;
foreach ($this->files as $f) {
$fp = new \Permissions($f);
if (!$fp->canViewFileInFileManager()) {
$this->canEdit = false;
}
}
} else {
$this->canEdit = false;
}
return $this->canEdit;
}
示例2: __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()));
}
}
示例3: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
Loader::model("file_attributes");
$previewMode = false;
$f = File::getByID($_REQUEST['fID']);
$fp = new Permissions($f);
if (!$fp->canViewFileInFileManager()) {
die(t("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->canEditFileProperties() && !$previewMode) {
$fv->approve();
exit;
}
if ($_POST['task'] == 'delete_version' && $fp->canEditFileContents() && !$previewMode) {
$fv->delete();
exit;
}
if ($_POST['task'] == 'update_core' && $fp->canEditFileProperties() && !$previewMode) {
$fv = $f->getVersionToModify();
switch ($_POST['attributeField']) {