本文整理汇总了PHP中Permissions::canDeleteFileSet方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canDeleteFileSet方法的具体用法?PHP Permissions::canDeleteFileSet怎么用?PHP Permissions::canDeleteFileSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canDeleteFileSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete($fsID, $token = '')
{
$u = new User();
Loader::model('file_set');
$fs = FileSet::getByID($fsID);
$valt = Loader::helper('validation/token');
if (!$valt->validate('delete_file_set', $token)) {
throw new Exception($valt->getErrorMessage());
}
$fsp = new Permissions($fs);
if ($fsp->canDeleteFileSet()) {
$fs->delete();
$this->redirect('/dashboard/files/sets', 'file_set_deleted');
} else {
throw new Exception(t('You do not have permission to delete this file set.'));
}
}
示例2: t
<p><?php
echo t('There are no files in this set.');
?>
</p>
<?php
}
?>
</div>
</div>
<div class="ccm-pane-footer">
<input type="submit" value="<?php
echo t('Save');
?>
" class="btn primary ccm-button-v2-right" />
<?php
if ($fsp->canDeleteFileSet()) {
?>
<?php
print $ih->button_js(t('Delete'), "deleteFileSet()", 'right', 'error');
?>
<?php
}
?>
</div>
<?php
echo Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);
?>
</form>
示例3: foreach
</td>
</tr>
</table>
</div>
<div class="ccm-file-search-advanced-sets-results">
<ul id="ccm-file-search-advanced-sets-list">
<?php foreach($s1 as $fs) {
$pfs = new Permissions($fs);
?>
<li class="ccm-<?php echo $searchInstance?>-search-advanced-sets-cb">
<div class="ccm-file-search-advanced-set-controls">
<a href="<?php echo View::url('/dashboard/files/sets', 'view_detail', $fs->getFileSetID())?>"><?php echo $html->image('icons/wrench.png')?></a>
<?php if ($pfs->canDeleteFileSet()) { ?>
<a href="<?php echo REL_DIR_FILES_TOOLS_REQUIRED?>/files/delete_set?fsID=<?php echo $fs->getFileSetID()?>&searchInstance=<?php echo $searchInstance?>" class="ccm-file-set-delete-window" dialog-title="<?php echo t('Delete File Set')?>" dialog-width="320" dialog-height="200" dialog-modal="false"><?php echo $html->image('icons/delete_small.png')?></a>
<?php } ?>
</div>
<?php echo $form->checkbox('fsID[' . $fs->getFileSetID() . ']', $fs->getFileSetID(), (is_array($searchRequest['fsID']) && in_array($fs->getFileSetID(), $searchRequest['fsID'])))?> <?php echo $form->label('fsID[' . $fs->getFileSetID() . ']', $fs->getFileSetName())?></li>
<?php } ?>
</ul>
</div>
<div style="padding-left: 6px; padding-top: 6px" class="ccm-note"><?php echo $form->checkbox('fsIDNone', '1', $searchRequest['fsIDNone'] == 1, array('instance' => $searchInstance))?> <?php echo $form->label('fsIDNone', t('Display files in no sets.'))?></div>
</div>
<script type="text/javascript">
$(function() {
$('a.ccm-file-set-delete-window').dialog();
示例4: Permissions
$pfs = new Permissions($fs);
?>
<li class="ccm-<?php
echo $searchInstance;
?>
-search-advanced-sets-cb">
<div class="ccm-file-search-advanced-set-controls">
<a href="<?php
echo View::url('/dashboard/files/sets', 'view_detail', $fs->getFileSetID());
?>
"><?php
echo $html->image('icons/wrench.png');
?>
</a>
<?php
if ($pfs->canDeleteFileSet()) {
?>
<a href="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/files/delete_set?fsID=<?php
echo $fs->getFileSetID();
?>
&searchInstance=<?php
echo $searchInstance;
?>
" dialog-append-buttons="true" class="ccm-file-set-delete-window" dialog-title="<?php
echo t('Delete File Set');
?>
" dialog-width="320" dialog-height="110" dialog-modal="false"><?php
echo $html->image('icons/delete_small.png');
示例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();
}