本文整理汇总了PHP中Router::GetAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::GetAction方法的具体用法?PHP Router::GetAction怎么用?PHP Router::GetAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::GetAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitAction
public function InitAction($aVars)
{
$oLang = $this->Lang_Dictionary();
$this->Viewer_Assign('oLang', $oLang);
$oUser = $this->GetUser();
if ($oUser && $oUser->IsAdministrator() && Config::Get('plugin.' . $this->sPlugin . '.' . 'icon_menu')) {
$sScript = Plugin::GetTemplateWebPath($this->sPlugin) . 'js/' . 'icon_menu.js';
$this->Viewer_AppendScript($sScript);
}
if (Router::GetAction() == 'admin' || Router::GetAction() == 'error') {
return;
}
if (!$oUser) {
if (Router::GetAction() == 'registration') {
$aIp = admGetAllUserIp();
foreach ($aIp as $sIp) {
if ($this->PluginAceadminpanel_Admin_IsBanIp($sIp)) {
$this->Message_AddErrorSingle($this->Lang_Get('adm_banned2_text'), $this->Lang_Get('adm_denied_title'));
return $this->UserBanned(null);
}
}
}
return;
}
if (defined('ADMIN_SITE_CLOSED') && ADMIN_SITE_CLOSED && !$oUser->IsAdministrator()) {
$this->SiteClosed();
}
if ($oUser->IsBannedByLogin() || $oUser->IsBannedByIp() && !$oUser->IsAdministrator()) {
return $this->UserBanned($oUser);
}
}
示例2: hook_meta
/**
* Meta hook
*
* @return void
*/
public function hook_meta()
{
$sAction = Router::GetAction();
$sUrl = E::ModuleSeopack()->ClearUrl(R::Url('path'));
$oSeopack = E::ModuleSeopack()->GetSeopackByUrl($sUrl);
E::ModuleViewer()->Assign('sCurrentUrl', $sUrl);
if ($oSeopack) {
E::ModuleViewer()->Assign('oSeopack', $oSeopack);
}
$sMetaDescriptionTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/description/' . $sAction . '.tpl';
if (E::ModuleViewer()->TemplateExists($sMetaDescriptionTemplate)) {
$sMetaDescription = E::ModuleViewer()->Fetch($sMetaDescriptionTemplate);
if ($oSeopack && $oSeopack->getDescription()) {
E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($oSeopack->getDescription()));
} else {
E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($sMetaDescription));
}
}
$sMetaKeywordsTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/keywords/' . $sAction . '.tpl';
if (E::ModuleViewer()->TemplateExists($sMetaKeywordsTemplate)) {
$sMetaKeywords = E::ModuleViewer()->Fetch($sMetaKeywordsTemplate);
if ($oSeopack && $oSeopack->getKeywords()) {
E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($oSeopack->getKeywords()));
} else {
E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($sMetaKeywords));
}
}
if ($oSeopack && $oSeopack->getTitle()) {
E::ModuleViewer()->Assign('sHtmlTitle', htmlspecialchars($oSeopack->getTitle()));
}
}
示例3: Copyright
public function Copyright()
{
if (Router::GetAction() != 'blogs' and Router::GetAction() != 'index' and Router::GetAction() != 'page') {
return false;
}
return 'Спонсор плагина - <a href="http://catalognica.ru" target="_blank">catalognica.ru</a><br />';
}
示例4: Copyright
public function Copyright()
{
if (Router::GetAction() != 'blogs') {
return;
}
return '<a href="http://imonger.ru" target="_blank">Спонсор DPB - ЯТрейдер</a><br />';
}
示例5: Init
public function Init()
{
if ($result = parent::Init()) {
return $result;
}
$this->SetDefaultEvent('info');
$this->InitParams();
$this->aConfig = array_merge($this->aConfig, HelperPlugin::GetConfig());
$this->oUserCurrent = $this->PluginAceadminpanel_Admin_GetUserCurrent();
if (!$this->User_IsAuthorization() || !$this->oUserCurrent->isAdministrator()) {
return $this->EventDenied();
}
$this->oUserCurrent = $this->User_GetUserCurrent();
$this->Viewer_Assign('ROUTE_PAGE_ADMIN', ROUTE_PAGE_ADMIN);
$this->Viewer_Assign('sModuleVersion', $this->PluginAceadminpanel_Admin_getVersion(true));
if (Config::Get('plugin.avalogs.admin_file') && Config::Get('plugin.avalogs.admin_enable')) {
if (!$this->oLogs) {
$this->oLogs = $this->Adminlogs_GetLogs();
}
$this->oLogs->SetLogOptions('admin', array('file' => Config::Get('plugin.avalogs.admin_file')));
$this->aLogsMsg[] = 'user=>' . $this->oUserCurrent->GetLogin() . ', ip=>' . $_SERVER["REMOTE_ADDR"] . ', action=>' . Router::GetAction() . ', event=>' . Router::GetActionEvent() . ', path=>' . Router::GetPathWebCurrent();
}
if (isset($_SERVER['HTTP_REFERER'])) {
$this->sPageRef = $_SERVER['HTTP_REFERER'];
}
$this->PluginSetTemplate(Router::GetActionEvent());
$this->sMenuItemSelect = Router::GetActionEvent();
$this->sMenuSubItemSelect = Router::GetParam(0);
$this->aPluginInfo = array('version' => HelperPlugin::GetConfig('version'));
$this->PluginAppendStyle('admin.css');
$this->PluginAppendScript('admin.js');
}
示例6: InitAction
public function InitAction()
{
if (Config::Get('general.close') and Config::Get('plugin.getlasttopics.enable_rss')) {
$sUrl = @$_SERVER['REDIRECT_URL'];
if (Router::GetAction() == 'login' and substr_count($sUrl, '/rss') > 0) {
Router::Action('rss', 'login');
}
}
}
示例7: CopyrightLink
public function CopyrightLink()
{
/**
* Выводим везде, кроме страницы списка блогов и списка всех комментов
*/
if (!(Router::GetAction() == 'blogs' or Router::GetAction() == 'comments')) {
return '© Powered by <a href="http://livestreetcms.ru">LiveStreet CMS</a>';
}
return '';
}
示例8: EventError
protected function EventError()
{
if (Router::GetAction() == 'admin') {
//func_header_location(Config::Get('path.root.web') . '/admin/');
admHeaderLocation(Config::Get('path.root.web') . '/admin/');
exit;
} else {
return parent::EventError();
}
}
示例9: SponsorLink
public function SponsorLink()
{
/**
* Выводим на странице списка блогов и списка всех комментов
*/
if (Router::GetAction() == 'blogs' or Router::GetAction() == 'comments') {
return 'Спонсор релиза LiveStreet - <a href="http://radiorealty.ru" target="_blank">Портал недвижимости</a>';
}
return '';
}
示例10: WriteActionCounter
public function WriteActionCounter($aParams)
{
$sAction = Router::GetAction();
$sEvent = Router::GetActionEvent();
if (!$sEvent) {
$sEvent = 'default';
}
$oUser = $this->User_GetUserCurrent();
if ($oUser) {
$this->PluginBotchecker_Botchecker_writeActionCounter($oUser, $sAction, $sEvent);
}
}
示例11: CheckVerificationKey
/**
* Проверка ключа, в ответ браузеру выдается только сообщение "ok" или "no"
*/
public function CheckVerificationKey()
{
if (Router::GetAction() == 'error' and isset($_GET['livestreet_check_verification_key'])) {
$sKey = trim((string) Config::Get('module.ls.verification_key'));
if ($sKey and $_GET['livestreet_check_verification_key'] === $sKey) {
echo 'ok';
exit;
}
echo 'no';
exit;
}
}
示例12: Exec
public function Exec()
{
$aPages = $this->PluginPage_Page_GetPages(array('pid' => Config::Get('block.pageslist.pid'), 'active' => 1));
//Для того, чтобы не допустить конфликта создаем локальный объект представления
$oViewer = $this->Viewer_GetLocalViewer();
$sAction = strtolower(Router::GetAction());
$sParams = Router::GetParams();
$oViewer->Assign('aPages', $aPages);
$oViewer->Assign('sAction', $sAction);
$oViewer->Assign('sParams', $sParams);
$sPagesList = $oViewer->Fetch('block.pageslist_content.tpl');
//Передаем данные уже в глобальный объект вида
$this->Viewer_Assign('sPagesList', $sPagesList);
}
示例13: CheckSearch
public function CheckSearch($aVars)
{
if (!MYSEARCH_HOOK_ENABLE) {
return;
}
if (Router::GetAction() == 'search') {
if (getRequest('q') && isset($_SERVER["HTTP_REFERER"]) && preg_match('|/search/(\\w+)/|', $_SERVER["HTTP_REFERER"], $m)) {
$sActionEvent = $m[1];
} else {
$sActionEvent = Router::GetActionEvent();
}
Router::Action('mysearch', $sActionEvent, Router::GetParams());
}
}
示例14: InitAction
/**
* Логика инициализации
*
*/
public function InitAction()
{
/**
* Проверяем наличие директории install
*/
if (is_dir(rtrim(Config::Get('path.root.server'), '/') . '/install')) {
$this->Message_AddErrorSingle($this->Lang_Get('install_directory_exists'));
Router::Action('error');
}
if (!$this->oUserCurrent and Config::Get('general.close') and Router::GetAction() != 'registration' and Router::GetAction() != 'login') {
Router::Action('login');
}
$this->Hook_Run('init_action');
}
示例15: Init
public function Init()
{
$this->sCurrentEvent = Router::GetActionEvent();
if ($result = parent::Init()) {
return $result;
}
if ($this->User_IsAuthorization()) {
$this->oUserCurrent = $this->PluginAceadminpanel_Admin_GetUserCurrent();
}
if (!$this->oUserCurrent or !$this->oUserCurrent->isAdministrator()) {
return $this->EventDenied();
}
if (!$this->oUserCurrent) {
$this->oUserCurrent = $this->User_GetUserCurrent();
}
$this->Viewer_Assign('ROUTE_PAGE_ADMIN', ROUTE_PAGE_ADMIN);
$this->Viewer_Assign('sModuleVersion', $this->PluginAceadminpanel_Admin_getVersion(true));
$this->_InitParams();
$this->aConfig = array_merge($this->aConfig, HelperPlugin::GetConfig());
if (Config::Get('plugin.avalogs.admin_file') and Config::Get('plugin.avalogs.admin_enable')) {
if (!$this->oLogs) {
$this->oLogs = $this->Adminlogs_GetLogs();
}
$this->oLogs->SetLogOptions('admin', array('file' => Config::Get('plugin.avalogs.admin_file')));
$this->aLogsMsg[] = 'user=>' . $this->oUserCurrent->GetLogin() . ', ip=>' . $_SERVER["REMOTE_ADDR"] . ', action=>' . Router::GetAction() . ', event=>' . Router::GetActionEvent() . ', path=>' . Router::GetPathWebCurrent();
}
$this->sPageRef = ACE::Backward('url');
if (ACE::Backward('action') == Router::GetAction()) {
$this->sFormAction = $this->sPageRef;
}
//$this->_PluginSetTemplate(Router::GetActionEvent());
$this->sMenuItemSelect = Router::GetActionEvent();
$this->sMenuSubItemSelect = Router::GetParam(0);
$sVerion = HelperPlugin::GetConfig('version');
if (!$sVerion) {
$sVerion = ACEADMINPANEL_VERSION . '.' . ACEADMINPANEL_VERSION_BUILD;
}
if (preg_match('|[a-z\\-]+|i', $sVerion, $m)) {
$sVerion = str_replace($m[0], '', $sVerion) . $m[0];
}
$this->aPluginInfo = array('version' => $sVerion);
$sHtmlTitle = $this->Lang_Get('adm_title') . ' v.' . $this->PluginAceadminpanel_Admin_getVersion();
//$this->Viewer_AddTemplateDir(HelperPlugin::GetTemplatePath(), true);
$this->Viewer_AddHtmlTitle($sHtmlTitle);
$this->Viewer_Assign('sAdminTitle', 'aceAdminPanel v.' . $this->PluginAceadminpanel_Admin_getVersion());
}