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


PHP Session::newInstance方法代码示例

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


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

示例1: doView

 function doView($file)
 {
     osc_run_hook('before_html');
     osc_current_web_theme_path($file);
     Session::newInstance()->_clearVariables();
     osc_run_hook('after_html');
 }
开发者ID:semul,项目名称:Osclass,代码行数:7,代码来源:page.php

示例2: processEditForm

 public function processEditForm($new_item = array(), $files = array())
 {
     $param_name = 'new_item';
     Session::newInstance()->_setForm($param_name, $new_item);
     // keep values on session
     Session::newInstance()->_keepForm($param_name);
     $default_fields = array('gn_id' => NULL, 'gn_title' => '', 'gn_description' => '', 'gn_tags' => '', 'gn_lang' => osc_current_admin_locale());
     $new_item = array_merge($default_fields, $new_item);
     if (!$new_item['gn_title']) {
         throw new Exception(__('The title must not be empty', 'gz_news'));
     }
     if (!$new_item['gn_description']) {
         throw new Exception(__('The description must not be empty', 'gz_news'));
     }
     $dao = GzNewsDao::newInstance();
     if ($new_item['gn_id']) {
         $item_exists = $dao->findByPrimaryKey($new_item['gn_id']);
         if ($item_exists == FALSE) {
             throw new Exception(__('The new does not exists anymore', 'gz_news'));
         }
     }
     $success = $dao->save($new_item);
     if ($success) {
         if (!empty($files)) {
             $this->uploadFiles($success, $files);
         }
         Session::newInstance()->_dropKeepForm($param_name);
     }
     return $success;
 }
开发者ID:faosclass,项目名称:gz_news,代码行数:30,代码来源:GzNewsModel.php

示例3: doView

 function doView($file)
 {
     osc_run_hook("before_admin_html");
     osc_current_admin_theme_path($file);
     Session::newInstance()->_clearVariables();
     osc_run_hook("after_admin_html");
 }
开发者ID:jmcclenon,项目名称:Osclass,代码行数:7,代码来源:upgrade.php

示例4: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'logout':
             // unset only the required parameters in Session
             Session::newInstance()->_drop('adminId');
             Session::newInstance()->_drop('adminUserName');
             Session::newInstance()->_drop('adminName');
             Session::newInstance()->_drop('adminEmail');
             Session::newInstance()->_drop('adminLocale');
             Cookie::newInstance()->pop('oc_adminId');
             Cookie::newInstance()->pop('oc_adminSecret');
             Cookie::newInstance()->pop('oc_adminLocale');
             Cookie::newInstance()->set();
             $this->redirectTo(osc_admin_base_url(true));
             break;
         default:
             //default dashboard page (main page at oc-admin)
             $this->_exportVariableToView("numUsers", User::newInstance()->count());
             $this->_exportVariableToView("numAdmins", Admin::newInstance()->count());
             $this->_exportVariableToView("numItems", Item::newInstance()->count());
             $this->_exportVariableToView("numItemsPerCategory", CategoryStats::newInstance()->toNumItemsMap());
             $this->_exportVariableToView("categories", Category::newInstance()->listAll());
             $this->_exportVariableToView("newsList", osc_listNews());
             $this->_exportVariableToView("comments", ItemComment::newInstance()->getLastComments(5));
             //calling the view...
             $this->doView('main/index.php');
     }
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:29,代码来源:main.php

示例5: __construct

        public function __construct()
        {
            parent::__construct();
            $this->path = osc_themes_path();

            if( Params::getParam('theme') != '' && Session::newInstance()->_get('adminId') != '' ) {
                $this->setCurrentTheme( Params::getParam('theme') );
            } else {
                $this->setCurrentTheme( osc_theme() );
            }

            $functions_path = $this->getCurrentThemePath() . 'functions.php';
            if( file_exists($functions_path) ) {
                require_once $functions_path;
            }

            $info = $this->loadThemeInfo($this->theme);
            if($info['template'] != '' ) {
				//$this->setCurrentTheme($info['template']);
				$parent_functions_path = osc_base_path() . 'oc-content/themes/' . $info['template'] . '/functions.php';
				if( file_exists($parent_functions_path) ) {
					require_once $parent_functions_path;
				}
			}
        }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:25,代码来源:WebThemes.php

示例6: osc_show_flash_message

function osc_show_flash_message($section = 'pubMessages', $class = "FlashMessage", $id = "FlashMessage")
{
    $message = Session::newInstance()->_getMessage($section);
    if ($message != '') {
        echo '<div id="' . $id . '" class="' . $class . '">';
        echo Session::newInstance()->_getMessage($section);
        echo '</div>';
        Session::newInstance()->_dropMessage($section);
    }
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:10,代码来源:hMessages.php

示例7: your_message

 public static function your_message()
 {
     if (Session::newInstance()->_getForm("message_body") != "") {
         $message_body = Session::newInstance()->_getForm("message_body");
         parent::generic_textarea("message", $message_body, null, false);
     } else {
         parent::generic_textarea("message", "");
     }
     return true;
 }
开发者ID:semul,项目名称:Osclass,代码行数:10,代码来源:SendFriend.form.class.php

示例8: body_input_textarea

 public static function body_input_textarea($comment = null)
 {
     $commentBody = '';
     if (isset($comment['s_body'])) {
         $commentBody = $comment['s_body'];
     }
     if (Session::newInstance()->_getForm('commentBody') != '') {
         $commentBody = Session::newInstance()->_getForm('commentBody');
     }
     parent::generic_textarea("body", $commentBody);
 }
开发者ID:acharei,项目名称:OSClass,代码行数:11,代码来源:Comment.form.class.php

示例9: logout

 function logout()
 {
     //destroying session
     Session::newInstance()->session_destroy();
     Session::newInstance()->_drop('userId');
     Session::newInstance()->_drop('userName');
     Session::newInstance()->_drop('userEmail');
     Session::newInstance()->_drop('userPhone');
     Cookie::newInstance()->pop('oc_userId');
     Cookie::newInstance()->pop('oc_userSecret');
     Cookie::newInstance()->set();
 }
开发者ID:jmcclenon,项目名称:Osclass,代码行数:12,代码来源:WebSecBaseModel.php

示例10: osc_resend_flash_messages

/**
 * Re-send the flash messages of the given section. Usefull for custom theme/plugins files.
 *
 * @param string $$section
 */
function osc_resend_flash_messages($section = "pubMessages")
{
    $message = Session::newInstance()->_getMessage($section);
    if ($message["type"] == "info") {
        osc_add_flash_info_message($message['msg'], $section);
    } else {
        if ($message["type"] == "ok") {
            osc_add_flash_ok_message($message['msg'], $section);
        } else {
            osc_add_flash_error_message($message['msg'], $section);
        }
    }
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:18,代码来源:hTheme.php

示例11: __construct

 public function __construct()
 {
     $this->path = osc_themes_path();
     if (Params::getParam('theme') != '' && Session::newInstance()->_get('adminId') != '') {
         $this->setCurrentTheme(Params::getParam('theme'));
     } else {
         $this->setCurrentTheme(osc_theme());
     }
     $functions_path = $this->getCurrentThemePath() . 'functions.php';
     if (file_exists($functions_path)) {
         require_once $functions_path;
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:13,代码来源:WebThemes.php

示例12: __construct

 public function __construct()
 {
     //#dev.conquer this fix is needed for the preview of appearance in oc-admin
     if (Params::getParam('theme') != '' && Session::newInstance()->_get('adminId') != '') {
         $this->setCurrentTheme(Params::getParam('theme'));
     } else {
         $this->setCurrentTheme(osc_theme());
     }
     //#juanramon: check if exists functions.php
     $functions_path = $this->getCurrentThemePath() . 'functions.php';
     if (file_exists($functions_path)) {
         require_once $functions_path;
     }
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:14,代码来源:WebThemes.php

示例13: logout

 function logout()
 {
     //destroying session
     Session::newInstance()->session_destroy();
     Session::newInstance()->_drop('adminId');
     Session::newInstance()->_drop('adminUserName');
     Session::newInstance()->_drop('adminName');
     Session::newInstance()->_drop('adminEmail');
     Session::newInstance()->_drop('adminLocale');
     Cookie::newInstance()->pop('oc_adminId');
     Cookie::newInstance()->pop('oc_adminSecret');
     Cookie::newInstance()->pop('oc_adminLocale');
     Cookie::newInstance()->set();
 }
开发者ID:acharei,项目名称:OSClass,代码行数:14,代码来源:AdminSecBaseModel.php

示例14: logout

 function logout()
 {
     //destroying session
     $locale = Session::newInstance()->_get('userLocale');
     Session::newInstance()->session_destroy();
     Session::newInstance()->_drop('userId');
     Session::newInstance()->_drop('userName');
     Session::newInstance()->_drop('userEmail');
     Session::newInstance()->_drop('userPhone');
     Session::newInstance()->session_start();
     Session::newinstance()->_set('userLocale', $locale);
     Cookie::newInstance()->pop('oc_userId');
     Cookie::newInstance()->pop('oc_userSecret');
     Cookie::newInstance()->set();
 }
开发者ID:mylastof,项目名称:os-class,代码行数:15,代码来源:WebSecBaseModel.php

示例15: multilanguage_name_description

 public static function multilanguage_name_description($locales, $page = null)
 {
     $num_locales = count($locales);
     if ($num_locales > 1) {
         echo '<div class="tabber">';
     }
     $aFieldsDescription = Session::newInstance()->_getForm("aFieldsDescription");
     foreach ($locales as $locale) {
         if ($num_locales > 1) {
             echo '<div class="tabbertab">';
             echo '<h2>' . $locale['s_name'] . '</h2>';
         }
         echo '<div class="FormElement">';
         echo '<div class="FormElementName">' . __('Title') . '</div>';
         echo '<div class="FormElementInput">';
         $title = '';
         if (isset($page['locale'][$locale['pk_c_code']])) {
             $title = $page['locale'][$locale['pk_c_code']]['s_title'];
         }
         if (isset($aFieldsDescription[$locale['pk_c_code']]) && isset($aFieldsDescription[$locale['pk_c_code']]['s_title']) && $aFieldsDescription[$locale['pk_c_code']]['s_title'] != '') {
             $title = $aFieldsDescription[$locale['pk_c_code']]['s_title'];
         }
         parent::generic_input_text($locale['pk_c_code'] . '#s_title', $title);
         echo '</div>';
         echo '</div>';
         echo '<div class="FormElement">';
         echo '<div class="FormElementName">' . __('Body') . '</div>';
         echo '<div class="FormElementInput">';
         $description = '';
         if (isset($page['locale'][$locale['pk_c_code']])) {
             $description = $page['locale'][$locale['pk_c_code']]['s_text'];
         }
         if (isset($aFieldsDescription[$locale['pk_c_code']]) && isset($aFieldsDescription[$locale['pk_c_code']]['s_text']) && $aFieldsDescription[$locale['pk_c_code']]['s_text'] != '') {
             $description = $aFieldsDescription[$locale['pk_c_code']]['s_text'];
         }
         parent::generic_textarea($locale['pk_c_code'] . '#s_text', $description);
         echo '</div>';
         echo '</div>';
         if ($num_locales > 1) {
             echo '</div>';
         }
     }
     if ($num_locales > 1) {
         echo '</div>';
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:46,代码来源:Page.form.class.php


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