• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eZModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中eZModule的典型用法代码示例。如果您正苦于以下问题:PHP eZModule类的具体用法?PHP eZModule怎么用?PHP eZModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: loadDefinition

 /**
  * Loads the operations definition for the current module
  * @return bool true if the operations were loaded, false if an error occured
  */
 function loadDefinition()
 {
     $pathList = eZModule::globalPathList();
     foreach ( $pathList as $path )
     {
         $definitionFile = $path . '/' . $this->ModuleName . '/operation_definition.php';
         if ( file_exists( $definitionFile ) )
             break;
         $definitionFile = null;
     }
     if ( $definitionFile === null )
     {
         eZDebug::writeError( 'Missing operation definition file for module: ' . $this->ModuleName, __METHOD__ );
         return false;
     }
     unset( $OperationList );
     include( $definitionFile );
     if ( !isset( $OperationList ) )
     {
         eZDebug::writeError( 'Missing operation definition list for module: ' . $this->ModuleName, __METHOD__ );
         return false;
     }
     $this->OperationList = $OperationList;
     $this->IsValid = true;
     return true;
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:30,代码来源:ezmoduleoperationinfo.php


示例2: loadDefinition

 function loadDefinition()
 {
     $definitionFile = null;
     $pathList = eZModule::globalPathList();
     if ($pathList) {
         foreach ($pathList as $path) {
             $definitionFile = $path . '/' . $this->ModuleName . '/function_definition.php';
             if (file_exists($definitionFile)) {
                 break;
             }
             $definitionFile = null;
         }
     }
     if ($definitionFile === null) {
         eZDebug::writeError('Missing function definition file for module: ' . $this->ModuleName, 'eZModuleFunctionInfo::loadDefinition');
         return false;
     }
     unset($FunctionList);
     include $definitionFile;
     if (!isset($FunctionList)) {
         eZDebug::writeError('Missing function definition list for module: ' . $this->ModuleName, 'eZModuleFunctionInfo::loadDefinition');
         return false;
     }
     $this->FunctionList = $FunctionList;
     $this->IsValid = true;
     return true;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:27,代码来源:ezmodulefunctioninfo.php


示例3: redirect

 /**
  * Trasforma le variabili $_GET in view_parameters e redirige la richiesta in base al parametro $_GET['RedirectUrlAlias']
  *
  * @see modules/ocsearch/action.php
  * @param array $requestFields
  * @param eZModule $module
  */
 public static function redirect(array $requestFields, eZModule $module = null)
 {
     $result = new OCClassSearchFormFetcher();
     $result->setRequestFields($requestFields);
     if ($module) {
         $redirect = '/';
         if (isset($requestFields['RedirectUrlAlias'])) {
             $redirect = $requestFields['RedirectUrlAlias'];
         } elseif (isset($requestFields['RedirectNodeID'])) {
             $node = eZContentObjectTreeNode::fetch($requestFields['RedirectNodeID']);
             if ($node instanceof eZContentObjectTreeNode) {
                 $redirect = $node->attribute('url_alias');
             }
         }
         $redirect = rtrim($redirect, '/') . $result->getViewParametersString();
         $module->redirectTo($redirect);
     }
 }
开发者ID:OpencontentCoop,项目名称:ocsearchtools,代码行数:25,代码来源:occlasssearchformhelper.php


示例4: modify

 function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
 {
     $uri = new eZURI( $namedParameters[ 'uri' ] );
     $moduleName = $uri->element( 0 );
     $moduleList = eZINI::instance( 'module.ini' )->variable( 'ModuleSettings', 'ModuleList' );
     if ( in_array( $moduleName, $moduleList, true ) )
         $check = eZModule::accessAllowed( $uri );
     $operatorValue = isset( $check['result'] ) ? $check['result'] : false;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:9,代码来源:ezmoduleoperator.php


示例5: getModuleList

 /**
  * Finds all available modules in the system
  * @return array $modulename => $path
  */
 static function getModuleList()
 {
     $out = array();
     foreach (eZModule::globalPathList() as $path) {
         foreach (scandir($path) as $subpath) {
             if ($subpath != '.' && $subpath != '..' && is_dir($path . '/' . $subpath) && file_exists($path . '/' . $subpath . '/module.php')) {
                 $out[$subpath] = $path . '/' . $subpath . '/module.php';
             }
         }
     }
     return $out;
 }
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:16,代码来源:ezmodulelister.php


示例6: array

/**
 * List all existing operations (optionally, in a given module)
 * @author G. Giunta
 * @copyright (C) G. Giunta 2010-2016
 * @license Licensed under GNU General Public License v2.0. See file license.txt
 *
 */
// generic info for all views: module name, extension name, ...
$operationList = array();
$modules = eZModuleLister::getModuleList();
if ($Params['modulename'] != '' && !array_key_exists($Params['modulename'], $modules)) {
    /// @todo
} else {
    foreach ($modules as $modulename => $path) {
        if ($Params['modulename'] == '' || $Params['modulename'] == $modulename) {
            $module = eZModule::exists($modulename);
            if ($module instanceof eZModule) {
                $moduleOperationInfo = new eZModuleOperationInfo($modulename);
                /// @todo prevent warning to be generated here
                $moduleOperationInfo->loadDefinition();
                if ($moduleOperationInfo->isValid()) {
                    $extension = '';
                    if (preg_match('#extension/([^/]+)/modules/#', $path, $matches)) {
                        $extension = $matches[1];
                    }
                    foreach ($moduleOperationInfo->OperationList as $op) {
                        $operationList[$op['name'] . '_' . $modulename] = $op;
                        $operationList[$op['name'] . '_' . $modulename]['module'] = $modulename;
                        $operationList[$op['name'] . '_' . $modulename]['extension'] = $extension;
                    }
                }
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:operationlist.php


示例7: array

        if ( isset( $rerunURLList[$errorNumber] ) )
            $errorRerunURL = $rerunURLList[$errorNumber];
        $Result = array();
        $Result['content'] = false;
        $Result['rerun_uri'] = $errorRerunURL;
        $module->setExitStatus( eZModule::STATUS_RERUN );
        return $Result;
    }
    else if ( $errorHandlerType == 'embed' )
    {
        $errorEmbedURL = $errorINI->variable( 'ErrorSettings', 'DefaultEmbedURL' );
        if ( isset( $embedURLList[$errorNumber] ) )
            $errorEmbedURL = $embedURLList[$errorNumber];
        $uri = new eZURI( $errorEmbedURL );
        $moduleName = $uri->element();
        $embedModule = eZModule::exists( $moduleName );
        if ( $module instanceof eZModule )
        {
            $uri->increase();
            $viewName = false;
            if ( !$embedModule->singleFunction() )
            {
                $viewName = $uri->element();
                $uri->increase();
            }
            $embedParameters = $uri->elements( false );
            $embedResult = $embedModule->run( $viewName, $embedParameters );
            $embedContent = $embedResult['content'];
        }

        // write reason to debug
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:view.php


示例8: array

        }
        $db->commit();
    }
}
$tpl = eZTemplate::factory();
$triggers = eZTrigger::fetchList(array('module' => $moduleName, 'function' => $functionName));
$showModuleList = false;
$showFunctionList = false;
$functionList = array();
$moduleList = array();
if ($moduleName == '*') {
    $showModuleList = true;
    $ini = eZINI::instance('module.ini');
    $moduleList = $ini->variable('ModuleSettings', 'ModuleList');
} elseif ($functionName == '*') {
    $mod = eZModule::exists($moduleName);
    $functionList = array_keys($mod->attribute('available_functions'));
    eZDebug::writeNotice($functionList, "functions");
    $showFunctionList = true;
}
$tpl->setVariable('current_module', $moduleName);
$tpl->setVariable('current_function', $functionName);
$tpl->setVariable('show_functions', $showFunctionList);
$tpl->setVariable('show_modules', $showModuleList);
$tpl->setVariable('possible_triggers', $possibleTriggers);
$tpl->setVariable('modules', $moduleList);
$tpl->setVariable('functions', $functionList);
$tpl->setVariable('triggers', $triggers);
$tpl->setVariable('module', $Module);
$Result['content'] = $tpl->fetch('design:trigger/list.tpl');
$Result['path'] = array(array('text' => ezpI18n::tr('kernel/trigger', 'Trigger'), 'url' => false), array('text' => ezpI18n::tr('kernel/trigger', 'List'), 'url' => false));
开发者ID:nfrp,项目名称:ezpublish,代码行数:31,代码来源:list.php


示例9: exitWithInternalError

}
$GLOBALS['eZCurrentAccess'] = $access;
// Check for new extension loaded by siteaccess
eZExtension::activateExtensions('access');
$db = eZDB::instance();
if ($db->isConnected()) {
    eZSession::start();
} else {
    exitWithInternalError();
    return;
}
$moduleINI = eZINI::instance('module.ini');
$globalModuleRepositories = $moduleINI->variable('ModuleSettings', 'ModuleRepositories');
$globalModuleRepositories[] = 'extension/eztags/modules';
eZModule::setGlobalPathList($globalModuleRepositories);
$module = eZModule::exists('tags');
if (!$module) {
    exitWithInternalError();
    return;
}
$function_name = 'treemenu';
$uri->increase();
$uri->increase();
$currentUser = eZUser::currentUser();
$siteAccessResult = $currentUser->hasAccessTo('user', 'login');
$tagsReadResult = $currentUser->hasAccessTo('tags', 'read');
$hasAccessToSite = false;
if ($siteAccessResult['accessWord'] == 'limited') {
    $policyChecked = false;
    foreach ($siteAccessResult['policies'] as $policy) {
        if (isset($policy['SiteAccess'])) {
开发者ID:oki34,项目名称:eztags,代码行数:31,代码来源:index_treemenu_tags.php


示例10:

<?php

/**
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
 * @license For full copyright and license information view LICENSE file distributed with this source code.
 * @version 2014.11.1
 * @package kernel
 */
// Redirect to visual module which is the correct place for this functionality
$module = $Params['Module'];
$parameters = $Params["Parameters"];
$visualModule = eZModule::exists('visual');
if ($visualModule) {
    return $module->forward($visualModule, 'templatecreate', $parameters);
}
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:15,代码来源:templatecreate.php


示例11: urlToAction

 public static function urlToAction($url)
 {
     if (preg_match("#^content/view/full/([0-9]+)\$#", $url, $matches)) {
         return "eznode:" . $matches[1];
     }
     if (preg_match("#^([a-zA-Z0-9]+)/#", $url, $matches)) {
         $name = $matches[1];
         $module = eZModule::exists($name);
         if ($module !== null) {
             return 'module:' . $url;
         }
     }
     return false;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:14,代码来源:ezurlaliasml.php


示例12: setUseExceptions

 /**
  * Sets whether to use exceptions inside the kernel.
  *
  * @param bool $useExceptions
  */
 public function setUseExceptions($useExceptions)
 {
     eZModule::$useExceptions = (bool) $useExceptions;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:9,代码来源:ezpkernelrest.php


示例13: allValuesAsArrayWithNames

 function allValuesAsArrayWithNames()
 {
     $returnValue = null;
     $valueList = $this->attribute('values_as_array');
     $names = array();
     $policy = $this->attribute('policy');
     if (!$policy) {
         return $returnValue;
     }
     $currentModule = $policy->attribute('module_name');
     $mod = eZModule::exists($currentModule);
     if (!is_object($mod)) {
         eZDebug::writeError('Failed to fetch instance for module ' . $currentModule);
         return $returnValue;
     }
     $functions = $mod->attribute('available_functions');
     $functionNames = array_keys($functions);
     $currentFunction = $policy->attribute('function_name');
     $limitationValueArray = array();
     $limitation = $functions[$currentFunction][$this->attribute('identifier')];
     if ($limitation && isset($limitation['class']) && count($limitation['values'] == 0)) {
         $obj = new $limitation['class'](array());
         $limitationValueList = call_user_func_array(array($obj, $limitation['function']), $limitation['parameter']);
         foreach ($limitationValueList as $limitationValue) {
             $limitationValuePair = array();
             $limitationValuePair['Name'] = $limitationValue['name'];
             $limitationValuePair['value'] = $limitationValue['id'];
             $limitationValueArray[] = $limitationValuePair;
         }
     } else {
         if ($limitation['name'] === 'Node') {
             foreach ($valueList as $value) {
                 $node = eZContentObjectTreeNode::fetch($value, false, false);
                 if ($node == null) {
                     continue;
                 }
                 $limitationValuePair = array();
                 $limitationValuePair['Name'] = $node['name'];
                 $limitationValuePair['value'] = $value;
                 $limitationValuePair['node_data'] = $node;
                 $limitationValueArray[] = $limitationValuePair;
             }
         } else {
             if ($limitation['name'] === 'Subtree') {
                 foreach ($valueList as $value) {
                     $subtreeObject = eZContentObjectTreeNode::fetchByPath($value, false);
                     if ($subtreeObject != null) {
                         $limitationValuePair = array();
                         $limitationValuePair['Name'] = $subtreeObject['name'];
                         $limitationValuePair['value'] = $value;
                         $limitationValuePair['node_data'] = $subtreeObject;
                         $limitationValueArray[] = $limitationValuePair;
                     }
                 }
             } else {
                 $limitationValueArray = $limitation['values'];
             }
         }
     }
     $limitationValuesWithNames = array();
     foreach (array_keys($valueList) as $key) {
         $value = $valueList[$key];
         if (isset($limitationValueArray)) {
             reset($limitationValueArray);
             foreach (array_keys($limitationValueArray) as $ckey) {
                 if ($value == $limitationValueArray[$ckey]['value']) {
                     $limitationValuesWithNames[] = $limitationValueArray[$ckey];
                 }
             }
         }
     }
     return $limitationValuesWithNames;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:73,代码来源:ezpolicylimitation.php


示例14: contentViewGenerateError

 /**
  * @param eZModule $Module
  * @param int $error
  * @param bool $store
  * @param array $errorParameters
  *
  * @return array
  */
 protected static function contentViewGenerateError(eZModule $Module, $error, $store = true, array $errorParameters = array())
 {
     $content = $Module->handleError($error, 'kernel', $errorParameters);
     return array('content' => $content, 'scope' => 'viewcache', 'store' => $store, 'binarydata' => serialize($content));
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:13,代码来源:eznodeviewfunctions.php


示例15: accessAllowed

/**
 * Checks if access is allowed to a module/view based on site.ini[SiteAccessRules]Rules settings
 *
 * @see eZModule::accessAllowed()
 * @param eZURI $uri
 * @return array An associative array with:
 *   'result'       => bool   Indicates if access is allowed
 *   'module'       => string Module name
 *   'view'         => string View name
 *   'view_checked' => bool   Indicates if view access has been checked
 */
function accessAllowed(eZURI $uri)
{
    return eZModule::accessAllowed($uri);
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:15,代码来源:access.php


示例16: findModule

 /**
  * Loads a module object by name.
  * The only difference with exists() is that the $module parameter will be
  * assigned the found module.
  *
  * @param string $moduleName The name of the module to find (ex: content)
  * @param mixed $module This parameter will receive the found module object
  * @param array|string
  *        Either an array of path or a single path string. These will be
  *        used as additionnal locations that will be looked into
  * @param boolean $showError
  *        If true an error will be shown if the module it not found.
  * @return eZModule The eZModule object, or null if the module wasn't found
  * @see exists()
  */
 static function findModule($moduleName, $module = null, $pathList = null, $showError = false)
 {
     if ($pathList === null) {
         $pathList = array();
     } else {
         if (!is_array($pathList)) {
             $pathList = array($pathList);
         }
     }
     $searchPathList = eZModule::globalPathList();
     if ($searchPathList === null) {
         $searchPathList = array();
     }
     $searchPathList = array_merge($searchPathList, $pathList);
     $triedList = array();
     $triedDirList = array();
     $foundADir = false;
     foreach ($searchPathList as $path) {
         $dir = "{$path}/{$moduleName}";
         $file = "{$dir}/module.php";
         if (file_exists($file)) {
             if ($module === null) {
                 $module = new eZModule($path, $file, $moduleName, false);
             } else {
                 $module->initialize($path, $file, $moduleName, false);
             }
             return $module;
         } else {
             if (!file_exists($dir)) {
                 $triedDirList[] = $dir;
             } else {
                 $foundADir = true;
                 $triedList[] = $dir;
             }
         }
     }
     $msg = "Could not find module named '{$moduleName}'";
     if ($foundADir) {
         $msg = "\nThese directories had a directory named '{$moduleName}' but did not contain the module.php file:\n" . implode(", ", $triedList) . "\n" . "This usually means it is missing or has a wrong name.";
         if (count($triedDirList) > 0) {
             $msg .= "\n\nThese directories were tried too but none of them exists:\n" . implode(', ', $triedDirList);
         }
     } else {
         if (count($triedDirList) > 0) {
             $msg .= "\nThese directories were tried but none of them exists:\n" . implode(", ", $triedDirList);
         }
     }
     if ($showError) {
         eZDebug::writeWarning($msg);
     }
     return null;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:67,代码来源:ezmodule.php


示例17: fetchModule

function fetchModule($uri, $check, &$module, &$module_name, &$function_name, &$params)
{
    $module_name = $uri->element();
    if ($check !== null and isset($check["module"])) {
        $module_name = $check["module"];
    }
    // Try to fetch the module object
    $module = eZModule::exists($module_name);
    if (!$module instanceof eZModule) {
        return false;
    }
    $uri->increase();
    $function_name = "";
    if (!$module->singleFunction()) {
        $function_name = $uri->element();
        $uri->increase();
    }
    // Override it if required
    if ($check !== null and isset($check["function"])) {
        $function_name = $check["function"];
    }
    $params = $uri->elements(false);
    return true;
}
开发者ID:legende91,项目名称:ez,代码行数:24,代码来源:index.php


示例18: array

    $cli->output();
}
$rows = eZPersistentObject::fetchObjectList(eZPolicy::definition(), array(), null, false, null, false, false, array(array('operation' => 'count( * )', 'name' => 'count')));
$total = $rows[0]['count'];
if (!$optDryRun) {
    $cli->output("{$total} policies to check... (In the progess bar, 'R' means that the policy was removed)");
} else {
    $cli->output("{$total} policies to check...");
}
if (!$optDryRun) {
    $script->setIterationData('R', '.');
    $script->resetIteration($total);
}
$limitation = array('offset' => 0, 'limit' => 100);
$db = eZDB::instance();
$modules = eZModule::globalPathList();
$removedPolicies = 0;
while (true) {
    $policies = eZPersistentObject::fetchObjectList(eZPolicy::definition(), null, null, null, $limitation, true);
    if (empty($policies)) {
        break;
    }
    foreach ($policies as $policy) {
        if ($policy->attribute('module_name') === '*') {
            continue;
        }
        $moduleExists = false;
        foreach ($modules as $module) {
            if (file_exists($module . '/' . $policy->attribute('module_name'))) {
                $moduleExists = true;
                break;
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:cleanuppolicies.php


示例19: array

    $tpl->setVariable('current_module', $currentModule);
    $tpl->setVariable('functions', $functionNames);
    $tpl->setVariable('no_functions', false);
    $Result = array();
    $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/role', 'Create new policy, step two: select function')));
    $Result['content'] = $tpl->fetch('design:role/createpolicystep2.tpl');
    return;
}
if ($http->hasPostVariable('CreatePolicy') || $http->hasPostVariable('Step1')) {
    // Set flag for audit. If true audit will be processed
    $http->setSessionVariable('RoleWasChanged', true);
    $Module->setTitle('Edit ' . $role->attribute('name'));
    $tpl->setVariable('modules', $modules);
    $moduleList = array();
    foreach ($modules as $module) {
        $moduleList[] = eZModule::exists($module);
    }
    $tpl->setVariable('module_list', $moduleList);
    $tpl->setVariable('role', $role);
    $tpl->setVariable('module', $Module);
    $Result = array();
    $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/role', 'Create new policy, step one: select module')));
    $Result['content'] = $tpl->fetch('design:role/createpolicystep1.tpl');
    return;
}
// Set flag for audit. If true audit will be processed
// Cancel button was pressed
if ($http->hasPostVariable('CancelPolicyButton')) {
    $http->setSessionVariable('RoleWasChanged', false);
}
$policies = $role->attribute('policies');
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:edit.php


示例20: eZUpdateTextCodecSettings

// reload soap.ini cache now that override paths have changed
$soapINI->loadCache();
/*!
 Reads settings from i18n.ini and passes them to eZTextCodec.
*/
function eZUpdateTextCodecSettings()
{
    $ini = eZINI::instance('i18n.ini');
    list($i18nSettings['internal-charset'], $i18nSettings['http-charset'], $i18nSettings['mbstring-extension']) = $ini->variableMulti('CharacterSettings', array('Charset', 'HTTPCharset', 'MBStringExtension'), array(false, false, 'enabled'));
    eZTextCodec::updateSettings($i18nSettings);
}
// Initialize text codec settings
eZUpdateTextCodecSettings();
// Initialize module loading
$moduleRepositories = eZModule::activeModuleRepositories();
eZModule::setGlobalPathList($moduleRepositories);
// Load soap extensions
$enableSOAP = $soapINI->variable('GeneralSettings', 'EnableSOAP');
if ($enableSOAP == 'true') {
    eZSys::init('soap.php');
    // Login if we have username and password.
    if (eZHTTPTool::username() and eZHTTPTool::password()) {
        eZUser::loginUser(eZHTTPTool::username(), eZHTTPTool::password());
    }
    $server = new eZSOAPServer();
    foreach ($soapINI->variable('ExtensionSettings', 'SOAPExtensions') as $extension) {
        include_once eZExtension::baseDirectory() . '/' . $extension . '/soap/initialize.php';
    }
    $server->processRequest();
}
ob_end_flush();
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:soap.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eZNodeAssignment类代码示例发布时间:2022-05-23
下一篇:
PHP eZMimeType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap