本文整理汇总了PHP中Gpf_Session::getModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Session::getModule方法的具体用法?PHP Gpf_Session::getModule怎么用?PHP Gpf_Session::getModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gpf_Session
的用法示例。
在下文中一共展示了Gpf_Session::getModule方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRoleType
public function getRoleType()
{
if ($this->roleType == '') {
return Gpf_Session::getModule()->getRoleType();
}
return $this->roleType;
}
示例2: __construct
/**
*
* @param string $templateSource if $fetchType is FETCH_FILE,
* then $templateSource is template file name
* if $fetchType is FETCH_TEXT,
* then $templateSource is template source as a string
* @param string $panelName optional
* @param string $fetchType FETCH_FILE (default) or FETCH_TEXT
*/
public function __construct($templateSource, $panelName = '', $fetchType = self::FETCH_FILE, $theme = '')
{
if ($theme == '') {
$this->theme = Gpf_Session::getAuthUser()->getTheme();
$this->paths = Gpf_Paths::getInstance();
} else {
$this->theme = $theme;
$this->paths = Gpf_Paths::getInstance()->clonePaths($theme);
}
if ($panelName == '') {
$this->panel = Gpf_Session::getModule()->getPanelName();
} else {
$this->panel = $panelName;
}
$this->basePath = $this->paths->getTopPath();
if ($fetchType == self::FETCH_FILE) {
$this->initFetchFromFile($templateSource);
} else {
$this->initFetchFromText($templateSource);
}
$this->addPluginsDirectories();
$this->setAndCheckCompileDir();
$this->smarty->register_prefilter(array(&$this, 'preProcess'));
$this->assign('basePath', $this->paths->getBaseServerUrl());
$this->assign('imgPath', $this->getImgUrl());
$this->assign('logoutUrl', $this->getLogoutUrl());
Gpf_Session::getModule()->assignModuleAttributes($this);
}
示例3: getThemes
/**
* @service theme read
*
* @return Gpf_Data_RecordSet
*/
public function getThemes(Gpf_Rpc_Params $params)
{
if ($params->exists('panelName')) {
return $this->getThemesNoRpc($params->get('panelName'));
} else {
return $this->getThemesNoRpc(Gpf_Session::getModule()->getPanelName(), $params->get('filterDisabled'));
}
}
示例4: __construct
public function __construct($themeId = '', $panelName = '')
{
$this->themeId = $themeId;
$this->panelName = $panelName;
if ($this->themeId == '') {
$this->themeId = Gpf_Session::getAuthUser()->getTheme();
}
if ($this->panelName == '') {
$this->panelName = Gpf_Session::getModule()->getPanelName();
}
$this->initThemeConfig();
}
示例5: init
public function init()
{
$this->initLanguage();
try {
$this->setLanguage(Gpf_Lang_Dictionary::getInstance()->load($this->getLanguage()));
} catch (Exception $e) {
}
$this->loadTheme();
if (!Gpf_Session::getModule()->isThemeValid($this->theme)) {
$this->setTheme(Gpf_Session::getModule()->getDefaultTheme());
}
}
示例6: logoutByURL
/**
*
* @service authentication logout
* @return Gpf_Rpc_Action
*/
public function logoutByURL(Gpf_Rpc_Params $params)
{
try {
$panelName = Gpf_Session::getModule()->getPanelName();
Gpf_Session::getAuthUser()->logout();
Gpf_Http::setHeader('Location', Gpf_Paths::getInstance()->getTopPath() . $panelName . '/login.php');
} catch (Exception $e) {
echo $this->_('Logout was not successful');
}
}
示例7: getTemplateSearchPaths
public function getTemplateSearchPaths($panelName = '', $postDirectory = '', $onlyDefault = false)
{
$key = $panelName . '|' . $postDirectory . '|' . $onlyDefault;
if (isset($this->cachedSearchPaths[$key])) {
return $this->cachedSearchPaths[$key];
}
$paths = array();
if ($panelName == '') {
$panelName = $this->addTrailingSlash(Gpf_Session::getModule()->getPanelName());
} else {
$panelName = $this->addTrailingSlash($panelName);
}
foreach ($this->serverPaths as $path) {
if ($path == $this->frameworkPath && $this->isDevelopementVersion()) {
$panel = '';
} else {
$panel = $panelName;
}
if (!$onlyDefault && $panel != '') {
$paths[] = $this->buildTemplatePath($path, $panel, $this->getTheme(), $postDirectory);
}
$paths[] = $this->buildTemplatePath($path, $panel, self::DEFAULT_THEME, $postDirectory);
}
$this->cachedSearchPaths[$key] = $paths;
return $paths;
}