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


PHP Permissions::canEditFileContents方法代码示例

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


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

示例2: die

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']) {
        case 'fvTitle':
            $text = $_POST['fvTitle'];
            $fv->updateTitle($text);
            print $text;
            break;
        case 'fvDescription':
            $text = $_POST['fvDescription'];
            $fv->updateDescription($text);
            print $text;
开发者ID:Mihail9575,项目名称:concrete5,代码行数:31,代码来源:properties.php

示例3: catch

        $thumbnails = $fv->getThumbnails();
    } catch (\Concrete\Core\File\Exception\InvalidDimensionException $e) {
        ?>
        <div class="row">

            <div class="col-md-2"><p><?php 
        echo t('Thumbnails');
        ?>
</p></div>
            <div class="col-md-10">
                <p style="color:#cc3333">
                    <?php 
        echo t('Invalid file dimensions, please rescan this file.');
        ?>
                    <?php 
        if ($mode != 'preview' && $fp->canEditFileContents()) {
            ?>
                        <a href="#" class="btn pull-right btn-default btn-xs"
                           data-action="rescan"><?php 
            echo t('Rescan');
            ?>
</a>
                    <?php 
        }
        ?>
                </p>
            </div>
        </div>
    <?php 
    } catch (\Exception $e) {
        ?>
开发者ID:seebaermichi,项目名称:concrete5,代码行数:31,代码来源:properties.php

示例4: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
$ci = Loader::helper('concrete/urls');
$f = File::getByID($_REQUEST['fID']);
if (!is_object($f)) {
    die(t('File Not Found.'));
}
$fv = $f->getApprovedVersion();
$fp = new Permissions($f);
if (!$fp->canEditFileContents()) {
    die(t("Access Denied."));
}
$to = $fv->getTypeObject();
if ($to->getPackageHandle() != '') {
    Loader::packageElement('files/edit/' . $to->getEditor(), $to->getPackageHandle(), array('fv' => $fv));
} else {
    Loader::element('files/edit/' . $to->getEditor(), array('fv' => $fv));
}
开发者ID:ceko,项目名称:concrete5-1,代码行数:21,代码来源:edit.php

示例5:

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>
<div class="ccm-file-selected-data"><div><?php 
echo $fv->getTitle();
?>
</div><div></div></div>
<div class="ccm-spacer">&nbsp;</div>
</div>
开发者ID:nveid,项目名称:concrete5,代码行数:31,代码来源:selector_data.php

示例6: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$cf = Loader::helper('file');
$fp = FilePermissions::getGlobal();
if (!$fp->canAddFiles()) {
    die(t("Unable to add files."));
}
if (isset($_REQUEST['fID'])) {
    // we are replacing a file
    $fr = File::getByID($_REQUEST['fID']);
    $file_permissions = new Permissions($fr);
    if (!$file_permissions->canEditFileContents()) {
        die(t("Unable to add files."));
    }
} else {
    $fr = false;
}
$searchInstance = $_POST['searchInstance'];
$valt = Loader::helper('validation/token');
Loader::library("file/importer");
Loader::library('3rdparty/Zend/Http/Client');
Loader::library('3rdparty/Zend/Uri/Http');
$file = Loader::helper('file');
Loader::helper('mime');
$error = array();
// load all the incoming fields into an array
$incoming_urls = array();
if (!function_exists('iconv_get_encoding')) {
    $errors[] = t('Remote URL import requires the iconv extension enabled on your server.');
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:remote.php

示例7: foreach

    ?>
		</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->canEditFileContents() ? 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->canEditFilePermissions();
        ?>
" ccm-file-manager-can-duplicate="<?php 
        echo $pf->canCopyFile();
        ?>
" ccm-file-manager-can-delete="<?php 
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:31,代码来源:search_results.php


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