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


PHP Permissions::canViewFile方法代码示例

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


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

示例1: checkPermissions

 public function checkPermissions($mixed)
 {
     if (isset($this->permissionsChecker)) {
         if ($this->permissionsChecker === -1) {
             return true;
         } else {
             return call_user_func_array($this->permissionsChecker, array($mixed));
         }
     }
     $fp = new \Permissions($mixed);
     return $fp->canViewFile();
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:12,代码来源:FileList.php

示例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()));
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:40,代码来源:Menu.php

示例3: view_inline

 public function view_inline($fID = 0)
 {
     if ($fID > 0 && Loader::helper('validation/numbers')->integer($fID)) {
         $file = File::getByID($fID);
         $fp = new Permissions($file);
         if (!$fp->canViewFile()) {
             return false;
         }
         $mimeType = $file->getMimeType();
         $fc = Loader::helper('file');
         $contents = $fc->getContents($file->getPath());
         header("Content-type: {$mimeType}");
         print $contents;
         exit;
     }
 }
开发者ID:nveid,项目名称:concrete5,代码行数:16,代码来源:download_file.php

示例4: loadFileSet

 function loadFileSet()
 {
     if (intval($this->fsID) < 1) {
         return false;
     }
     Loader::helper('concrete/file');
     Loader::model('file_attributes');
     Loader::library('file/types');
     Loader::model('file_list');
     Loader::model('file_set');
     $ak = FileAttributeKey::getByHandle('height');
     $fs = FileSet::getByID($this->fsID);
     $fileList = new FileList();
     $fileList->filterBySet($fs);
     $fileList->filterByType(FileType::T_IMAGE);
     $fileList->sortByFileSetDisplayOrder();
     $files = $fileList->get(1000, 0);
     $image = array();
     $image['duration'] = $this->duration;
     $image['fadeDuration'] = $this->fadeDuration;
     $image['groupSet'] = 0;
     $image['url'] = '';
     $images = array();
     $maxHeight = 0;
     foreach ($files as $f) {
         $fp = new Permissions($f);
         if (!$fp->canViewFile()) {
             continue;
         }
         $image['fID'] = $f->getFileID();
         $image['fileName'] = $f->getFileName();
         $image['fullFilePath'] = $f->getPath();
         $image['url'] = $f->getRelativePath();
         // find the max height of all the images so slideshow doesn't bounce around while rotating
         $vo = $f->getAttributeValueObject($ak);
         if (is_object($vo)) {
             $image['imgHeight'] = $vo->getValue('height');
         }
         if ($maxHeight == 0 || $image['imgHeight'] > $maxHeight) {
             $maxHeight = $image['imgHeight'];
         }
         $images[] = $image;
     }
     $this->images = $images;
     $this->maxHeight = $maxHeight;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:46,代码来源:slideshow.php

示例5: array

$searchInstance = Loader::helper('text')->entities($_REQUEST['searchInstance']);
$extensions = array();

if (is_array($_REQUEST['fID'])) {
	foreach($_REQUEST['fID'] as $fID) {
		$f = File::getByID($fID);
		$fp = new Permissions($f);
		if ($fp->canViewFile()) {
			$files[] = $f;
			$extensions[] = strtolower($f->getExtension());
		}
	}
} else {
	$f = File::getByID($_REQUEST['fID']);
	$fp = new Permissions($f);
	if ($fp->canViewFile()) {
		$files[] = $f;
		$extensions[] = strtolower($f->getExtension());
	}
}

$extensions = array_unique($extensions);
$sets = array();
// tri state checkbox
// state 0 - none of the selected files are in the set
// state 1 - SOME of the selected files are in the set
// state 2 - ALL files are in the set

foreach($s1 as $fs) {
	
	$foundInSets = 0;
开发者ID:ronlobo,项目名称:concrete5,代码行数:31,代码来源:add_to_sets.php

示例6: die

<?
defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');

$f = File::getByID($_REQUEST['fID']);
if (isset($_REQUEST['fvID'])) {
	$fv = $f->getVersion($_REQUEST['fvID']);
} else {
	$fv = $f->getApprovedVersion();
}

$fp = new Permissions($f);
if (!$fp->canViewFile()) {
	die(t("Access Denied."));
}
?>
<div style="text-align: center">

<?
$to = $fv->getTypeObject();
if ($to->getPackageHandle() != '') {
	Loader::packageElement('files/view/' . $to->getView(), $to->getPackageHandle(), array('fv' => $fv));
} else {
	Loader::element('files/view/' . $to->getView(), array('fv' => $fv));
}
?>
</div>

<div class="dialog-buttons">
<form method="post" action="<?php 
开发者ID:nveid,项目名称:concrete5,代码行数:31,代码来源:view.php


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