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


PHP eZModule::findModule方法代码示例

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


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

示例1: exitWithInternalError

        }
        if ($view && in_array($moduleName . '/' . $view, $policyAccessList)) {
            return true;
        }
    }
    return false;
}
// look for module and view info in uri parameters
if (!isset($uriParams[1])) {
    exitWithInternalError("Did not find module info in url.");
    return;
}
// find module
$uri = eZURI::instance(eZSys::requestURI());
$moduleName = $uri->element();
$module = eZModule::findModule($moduleName);
if (!$module instanceof eZModule) {
    exitWithInternalError("'{$moduleName}' module does not exist, or is not a valid module.");
    return;
}
// check existance of view
$viewName = $uri->element(1);
$moduleViews = $module->attribute('views');
if (!isset($moduleViews[$viewName])) {
    exitWithInternalError("'{$viewName}' view does not exist on the current module.");
    return;
}
// Check if module / view is disabled
$moduleCheck = eZModule::accessAllowed($uri);
if (!$moduleCheck['result']) {
    exitWithInternalError('$moduleName/$viewName is disabled.');
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:run.php

示例2: if

        }

        // Redirect to request URI if it is set, if not view the new object in main node
        if ( $upload->attribute( 'result_uri' ) )
        {
            $uri = $upload->attribute( 'result_uri' );
            return $module->redirectTo( $uri );
        }
        else if ( $upload->attribute( 'result_module' ) )
        {
            $data = $upload->attribute( 'result_module' );
            $moduleName = $data[0];
            $view = $data[1];
            $parameters = isset( $data[2] ) ? $data[2] : array();
            $userParameters = isset( $data[3] ) ? $data[3] : array();
            $resultModule = eZModule::findModule( $moduleName, $module );
            $resultModule->setCurrentAction( $upload->attribute( 'result_action_name' ), $view );
            $actionParameters = false;
            if ( $upload->hasAttribute( 'result_action_parameters' ) )
            {
                $actionParameters = $upload->attribute( 'result_action_parameters' );
            }

            if ( $actionParameters )
            {
                foreach ( $actionParameters as $actionParameterName => $actionParameter )
                {
                    $resultModule->setActionParameter( $actionParameterName, $actionParameter, $view );
                }
            }
            return $resultModule->run( $view, $parameters, false, $userParameters );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:upload.php

示例3: testEditAfterFetchTemplateRepeatOperation

 /**
  * Test regression for issue #14371 in a module/view context:
  * Workflow template repeat broken by security patch.
  *
  * Test Outline
  * ------------
  * 1. Setup a workflow that features a custom workflow event that expects a
  *    value to be submitted before
  * 2. Create & publish an article
  * 3. Add a global POST variable that would be sent interactively from POST
  * 4. Publish again with this variable
  *
  * @result: Redirection to content/history
  * @expected: The object gets published without being redirected
  * @link http://issues.ez.no/14371
  */
 public function testEditAfterFetchTemplateRepeatOperation()
 {
     // first, we need to create an appropriate test workflow
     $adminUser = eZUser::fetchByName('admin');
     $adminUserID = $adminUser->attribute('contentobject_id');
     // Create approval workflow and set up pre publish trigger
     $this->workflow = $this->createWorkFlow($adminUserID);
     $this->trigger = $this->createTrigger($this->workflow->attribute('id'));
     // Log in as a user who's allowed to publish content
     $this->currentUser = eZUser::currentUser();
     eZUser::setCurrentlyLoggedInUser($adminUser, $adminUserID);
     // required to avoid a notice
     $GLOBALS['eZSiteBasics']['user-object-required'] = false;
     $contentModule = eZModule::findModule('content');
     $adminUserID = eZUser::fetchByName('admin')->attribute('contentobject_id');
     // STEP 1: Create an article
     // This should start the publishing process, and interrupt it because
     // of the fetch template repeat workflow (expected)
     $article = new ezpObject("article", 2, $adminUserID);
     $article->name = "Article (with interactive workflow) for issue/regression #14371";
     $objectID = $article->publish();
     $version = eZContentObjectVersion::fetchVersion(1, $objectID);
     // STEP 2: Add the POST variables that will allow the operation to continue
     $_POST['CompletePublishing'] = 1;
     // STEP 3: run content/edit again in order to simulate a POST from the custom TPL
     $operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $objectID, 'version' => 1));
     $this->assertInternalType('array', $operationResult);
     $this->assertEquals($operationResult['status'], eZModuleOperationInfo::STATUS_CONTINUE, "The operation result wasn't CONTINUE");
     $this->removeWorkflow($this->workflow);
     // Log in as whoever was logged in
     eZUser::setCurrentlyLoggedInUser($this->currentUser, $this->currentUser->attribute('id'));
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:48,代码来源:ezworkflowevent_regression.php

示例4: exists

 /**
  * Loads a module object by name
  *
  * @param string $moduleName The name of the module to find (ex: content)
  * @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 findModule()
  */
 static function exists($moduleName, $pathList = null, $showError = false)
 {
     $module = null;
     return eZModule::findModule($moduleName, $module, $pathList, $showError);
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:17,代码来源:ezmodule.php

示例5: foreach

         $dataMap = $node->attribute('data_map');
         $query = $dataMap['solr_filter']->attribute('content');
         $tpl->setVariable('query', $query);
         $content = $tpl->fetch('design:modules/mugo_bootstrap_admin/treemenu_search.tpl');
     }
     break;
     // including type 'node_id'
 // including type 'node_id'
 default:
     // special case for setup node
     if ($value == 48) {
         $data = [];
         $moduleIni = eZINI::instance('module.ini');
         $moduleNames = $moduleIni->variable('ModuleSettings', 'ModuleList');
         foreach ($moduleNames as $identifier) {
             $module = eZModule::findModule($identifier);
             // if module does not have a name
             $name = $module->Module['name'] ? $module->Module['name'] : $identifier;
             $data[$name] = array('title' => $name, 'key' => $identifier, 'folder' => true, 'lazy' => true, 'icon' => 'glyphicon icon-default', 'type' => 'view');
         }
         ksort($data, SORT_STRING);
         // remove keys
         foreach ($data as $entry) {
             $cleanData[] = $entry;
         }
         $content = json_encode($cleanData);
     } else {
         $data = array();
         $parentNodeId = (int) $value;
         $parentNode = eZContentObjectTreeNode::fetch($parentNodeId);
         $params = array('parent_node_id' => $parentNodeId, 'limit' => 200, 'sort_by' => $parentNode->attribute('sort_array'));
开发者ID:pkamps,项目名称:mugo_bootstrap_admin,代码行数:31,代码来源:treemenu_list.php


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