本文整理汇总了PHP中eZModule::uiComponentName方法的典型用法代码示例。如果您正苦于以下问题:PHP eZModule::uiComponentName方法的具体用法?PHP eZModule::uiComponentName怎么用?PHP eZModule::uiComponentName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZModule
的用法示例。
在下文中一共展示了eZModule::uiComponentName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Execution point for controller actions
*/
public function run()
{
ob_start();
$this->requestInit();
// send header information
foreach (eZHTTPHeader::headerOverrideArray($this->uri) + array('Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT', 'Cache-Control' => 'no-cache, must-revalidate', 'Pragma' => 'no-cache', 'X-Powered-By' => 'eZ Publish', 'Content-Type' => 'text/html; charset=' . $this->httpCharset, 'Served-by' => $_SERVER["SERVER_NAME"], 'Content-language' => $this->languageCode) as $key => $value) {
header($key . ': ' . $value);
}
try {
$moduleResult = $this->dispatchLoop();
} catch (Exception $e) {
$this->shutdown();
throw $e;
}
$ini = eZINI::instance();
/**
* Ouput an is_logged_in cookie when users are logged in for use by http cache solutions.
*
* @deprecated As of 4.5, since 4.4 added lazy session support (init on use)
*/
if ($ini->variable("SiteAccessSettings", "CheckValidity") !== 'true') {
$currentUser = eZUser::currentUser();
$wwwDir = eZSys::wwwDir();
// On host based site accesses this can be empty, causing the cookie to be set for the current dir,
// but we want it to be set for the whole eZ publish site
$cookiePath = $wwwDir != '' ? $wwwDir : '/';
if ($currentUser->isLoggedIn()) {
// Only set the cookie if it doesnt exist. This way we are not constantly sending the set request in the headers.
if (!isset($_COOKIE['is_logged_in']) || $_COOKIE['is_logged_in'] !== 'true') {
setcookie('is_logged_in', 'true', 0, $cookiePath);
}
} else {
if (isset($_COOKIE['is_logged_in'])) {
setcookie('is_logged_in', false, 0, $cookiePath);
}
}
}
if ($this->module->exitStatus() == eZModule::STATUS_REDIRECT) {
$this->redirect();
}
// Store the last URI for access history for login redirection
// Only if user has session and only if there was no error or no redirects happen
if (eZSession::hasStarted() && $this->module->exitStatus() == eZModule::STATUS_OK) {
$currentURI = $this->completeRequestedURI;
if (strlen($currentURI) > 0 && $currentURI[0] !== '/') {
$currentURI = '/' . $currentURI;
}
$lastAccessedURI = "";
$lastAccessedViewURI = "";
$http = eZHTTPTool::instance();
// Fetched stored session variables
if ($http->hasSessionVariable("LastAccessesURI")) {
$lastAccessedViewURI = $http->sessionVariable("LastAccessesURI");
}
if ($http->hasSessionVariable("LastAccessedModifyingURI")) {
$lastAccessedURI = $http->sessionVariable("LastAccessedModifyingURI");
}
// Update last accessed view page
if ($currentURI != $lastAccessedViewURI && !in_array($this->module->uiContextName(), array('edit', 'administration', 'browse', 'authentication'))) {
$http->setSessionVariable("LastAccessesURI", $currentURI);
}
// Update last accessed non-view page
if ($currentURI != $lastAccessedURI) {
$http->setSessionVariable("LastAccessedModifyingURI", $currentURI);
}
}
eZDebug::addTimingPoint("Module end '" . $this->module->attribute('name') . "'");
if (!is_array($moduleResult)) {
eZDebug::writeError('Module did not return proper result: ' . $this->module->attribute('name'), 'index.php');
$moduleResult = array();
$moduleResult['content'] = false;
}
if (!isset($moduleResult['ui_context'])) {
$moduleResult['ui_context'] = $this->module->uiContextName();
}
$moduleResult['ui_component'] = $this->module->uiComponentName();
$moduleResult['is_mobile_device'] = $this->mobileDeviceDetect->isMobileDevice();
$moduleResult['mobile_device_alias'] = $this->mobileDeviceDetect->getUserAgentAlias();
$templateResult = null;
eZDebug::setUseExternalCSS($this->siteBasics['external-css']);
if ($this->siteBasics['show-page-layout']) {
$tpl = eZTemplate::factory();
if ($tpl->hasVariable('node')) {
$tpl->unsetVariable('node');
}
if (!isset($moduleResult['path'])) {
$moduleResult['path'] = false;
}
$moduleResult['uri'] = eZSys::requestURI();
$tpl->setVariable("module_result", $moduleResult);
$meta = $ini->variable('SiteSettings', 'MetaDataArray');
if (!isset($meta['description'])) {
$metaDescription = "";
if (isset($moduleResult['path']) && is_array($moduleResult['path'])) {
foreach ($moduleResult['path'] as $pathPart) {
if (isset($pathPart['text'])) {
$metaDescription .= $pathPart['text'] . " ";
//.........这里部分代码省略.........
示例2: array
}
// Update last accessed non-view page
if ($currentURI != $lastAccessedURI) {
$http->setSessionVariable("LastAccessedModifyingURI", $currentURI);
}
}
eZDebug::addTimingPoint("Module end '" . $module->attribute('name') . "'");
if (!is_array($moduleResult)) {
eZDebug::writeError('Module did not return proper result: ' . $module->attribute('name'), 'index.php');
$moduleResult = array();
$moduleResult['content'] = false;
}
if (!isset($moduleResult['ui_context'])) {
$moduleResult['ui_context'] = $module->uiContextName();
}
$moduleResult['ui_component'] = $module->uiComponentName();
$moduleResult['is_mobile_device'] = $mobileDeviceDetect->isMobileDevice();
$moduleResult['mobile_device_alias'] = $mobileDeviceDetect->getUserAgentAlias();
$templateResult = null;
eZDebug::setUseExternalCSS($use_external_css);
if ($show_page_layout) {
$tpl = eZTemplate::factory();
if ($tpl->hasVariable('node')) {
$tpl->unsetVariable('node');
}
if (!isset($moduleResult['path'])) {
$moduleResult['path'] = false;
}
$moduleResult['uri'] = eZSys::requestURI();
$tpl->setVariable("module_result", $moduleResult);
$meta = $ini->variable('SiteSettings', 'MetaDataArray');