本文整理匯總了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;
}