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


PHP Application_Model_User::GetCurrentUser方法代码示例

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


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

示例1: _initGlobals

 protected function _initGlobals()
 {
     $view = $this->getResource('view');
     $baseUrl = Application_Common_OsPath::getBaseDir();
     $view->headScript()->appendScript("var baseUrl = '{$baseUrl}'");
     $user = Application_Model_User::GetCurrentUser();
     if (!is_null($user)) {
         $userType = $user->getType();
     } else {
         $userType = "";
     }
     $view->headScript()->appendScript("var userType = '{$userType}';");
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:13,代码来源:Bootstrap.php

示例2: indexAction

 public function indexAction()
 {
     $CC_CONFIG = Config::getConfig();
     $request = $this->getRequest();
     $baseUrl = Application_Common_OsPath::getBaseDir();
     $user = Application_Model_User::GetCurrentUser();
     $userType = $user->getType();
     $this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '{$userType}' );");
     $this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/js/jquery.dataTables.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.pluginAPI.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.ColVis.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.ColReorder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.FixedColumns.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.columnFilter.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/blockui/jquery.blockUI.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     $this->view->headLink()->appendStylesheet($baseUrl . 'css/media_library.css?' . $CC_CONFIG['airtime_version']);
     $this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
     $this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColVis.css?' . $CC_CONFIG['airtime_version']);
     $this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColReorder.css?' . $CC_CONFIG['airtime_version']);
     $refer_sses = new Zend_Session_Namespace('referrer');
     if ($request->isPost()) {
         $form = new Application_Form_RegisterAirtime();
         $values = $request->getPost();
         if ($values["Publicise"] != 1 && $form->isValid($values)) {
             Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
             if (isset($values["Privacy"])) {
                 Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
             }
             // unset session
             Zend_Session::namespaceUnset('referrer');
         } elseif ($values["Publicise"] == '1' && $form->isValid($values)) {
             Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
             Application_Model_Preference::SetPhone($values["Phone"]);
             Application_Model_Preference::SetEmail($values["Email"]);
             Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
             Application_Model_Preference::SetPublicise($values["Publicise"]);
             $form->Logo->receive();
             $imagePath = $form->Logo->getFileName();
             Application_Model_Preference::SetStationCountry($values["Country"]);
             Application_Model_Preference::SetStationCity($values["City"]);
             Application_Model_Preference::SetStationDescription($values["Description"]);
             Application_Model_Preference::SetStationLogo($imagePath);
             Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
             if (isset($values["Privacy"])) {
                 Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
             }
             // unset session
             Zend_Session::namespaceUnset('referrer');
         } else {
             $logo = Application_Model_Preference::GetStationLogo();
             if ($logo) {
                 $this->view->logoImg = $logo;
             }
             $this->view->dialog = $form;
             $this->view->headScript()->appendFile($baseUrl . 'js/airtime/nowplaying/register.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
         }
     }
     //popup if previous page was login
     if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp() && !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()) {
         $form = new Application_Form_RegisterAirtime();
         $logo = Application_Model_Preference::GetStationLogo();
         if ($logo) {
             $this->view->logoImg = $logo;
         }
         $this->view->dialog = $form;
         $this->view->headScript()->appendFile($baseUrl . 'js/airtime/nowplaying/register.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
     }
     //determine whether to remove/hide/display the library.
     $showLib = false;
     if (!$user->isGuest()) {
         $disableLib = false;
         $data = Application_Model_Preference::getNowPlayingScreenSettings();
         if (!is_null($data)) {
             if ($data["library"] == "true") {
                 $showLib = true;
             }
         }
     } else {
         $disableLib = true;
     }
     $this->view->disableLib = $disableLib;
     $this->view->showLib = $showLib;
     //only include library things on the page if the user can see it.
     if (!$disableLib) {
         $this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/library.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
         $this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/events/library_showbuilder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
         $data = Application_Model_Preference::getCurrentLibraryTableSetting();
         if (!is_null($data)) {
             $libraryTable = json_encode($data);
             $this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', JSON.stringify({$libraryTable}) );");
         } else {
             $this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', '' );");
         }
     }
     $data = Application_Model_Preference::getTimelineDatatableSetting();
     if (!is_null($data)) {
//.........这里部分代码省略.........
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:101,代码来源:ShowbuilderController.php


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