本文整理汇总了PHP中eZPackage::canUsePolicyFunction方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPackage::canUsePolicyFunction方法的具体用法?PHP eZPackage::canUsePolicyFunction怎么用?PHP eZPackage::canUsePolicyFunction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPackage
的用法示例。
在下文中一共展示了eZPackage::canUsePolicyFunction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ( $http->hasSessionVariable( 'eZPackageInstallerData' ) )
{
$persistentData = $http->sessionVariable( 'eZPackageInstallerData' );
if ( isset( $persistentData['currentItem'] ) )
$currentItem = $persistentData['currentItem'];
}
else
{
$persistentData = array();
$persistentData['currentItem'] = $currentItem;
$persistentData['error'] = array();
$persistentData['error_default_actions'] = array();
}
if ( !eZPackage::canUsePolicyFunction( 'install' ) )
return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
$package = eZPackage::fetch( $packageName );
if ( !$package )
return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
if ( $module->isCurrentAction( 'SkipPackage' ) )
{
$http->removeSessionVariable( 'eZPackageInstallerData' );
return $module->redirectToView( 'view', array( 'full', $package->attribute( 'name' ) ) );
}
$tpl = eZTemplate::factory();
// Get all uninstall items and reverse array
示例2: array
<?php
/**
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2013.11
* @package kernel
*/
$module = $Params['Module'];
if (!eZPackage::canUsePolicyFunction('import')) {
return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
}
$package = false;
$installElements = false;
$errorList = array();
if ($module->isCurrentAction('UploadPackage')) {
if (eZHTTPFile::canFetch('PackageBinaryFile')) {
$file = eZHTTPFile::fetch('PackageBinaryFile');
if ($file) {
$packageFilename = $file->attribute('filename');
$package = eZPackage::import($packageFilename, $packageName);
if ($package instanceof eZPackage) {
if ($package->attribute('install_type') != 'install' or !$package->attribute('can_install')) {
return $module->redirectToView('view', array('full', $package->attribute('name')));
} else {
if ($package->attribute('install_type') == 'install') {
return $module->redirectToView('install', array($package->attribute('name')));
}
}
} else {
if ($package == eZPackage::STATUS_ALREADY_EXISTS) {
示例3: canRemove
function canRemove()
{
return array('result' => eZPackage::canUsePolicyFunction('remove'));
}