當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Session::notice方法代碼示例

本文整理匯總了PHP中Session::notice方法的典型用法代碼示例。如果您正苦於以下問題:PHP Session::notice方法的具體用法?PHP Session::notice怎麽用?PHP Session::notice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Session的用法示例。


在下文中一共展示了Session::notice方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_preview_theme

 /**
  * Configures a theme to be active for the current user's session.
  */
 public function get_preview_theme()
 {
     $theme_name = $this->handler_vars['theme_name'];
     $theme_dir = $this->handler_vars['theme_dir'];
     if (isset($theme_name) && isset($theme_dir)) {
         if (Themes::get_theme_dir() == $theme_dir) {
             Themes::cancel_preview();
             Session::notice(_t("Ended the preview of the theme '%s'", array($theme_name)));
         } else {
             if (Themes::preview_theme($theme_name, $theme_dir)) {
                 Session::notice(_t("Previewing theme '%s'", array($theme_name)));
             }
         }
     }
     Utils::redirect(URL::get('admin', 'page=themes'));
 }
開發者ID:wwxgitcat,項目名稱:habari,代碼行數:19,代碼來源:adminthemeshandler.php

示例2: action_plugin_ui

 public function action_plugin_ui($plugin_id, $action)
 {
     if ($plugin_id == $this->plugin_id()) {
         $frequencies = array('manually' => _t('Manually', 'exportsnapshot'), 'hourly' => _t('Hourly', 'exportsnapshot'), 'daily' => _t('Daily', 'exportsnapshot'), 'weekly' => _t('Weekly', 'exportsnapshot'), 'monthly' => _t('Monthly', 'exportsnapshot'));
         $types = array('blogml' => _t('BlogML', 'exportsnapshot'), 'wxr' => _t('WXR', 'exportsnapshot'));
         switch ($action) {
             case _t('Configure'):
                 $ui = new FormUI('export');
                 $ui->append('text', 'exportsnapshot_max_snapshots', 'option:exportsnapshot__max_snapshots', _t('Max Snapshots to Save:', 'exportsnapshot'));
                 $ui->append('select', 'exportsnapshot_freq', 'option:exportsnapshot__frequency', _t('Auto Snapshot frequency:', 'exportsnapshot'), $frequencies);
                 $ui->append('select', 'exportsnapshot_type', 'option:exportsnapshot__type', _t('Type of export:', 'exportsnapshot'), $types);
                 $ui->append('submit', 'save', _t('Save'));
                 $ui->on_success(array($this, 'updated_config'));
                 $ui->out();
                 break;
             case _t('Take Snapshot'):
                 self::run('manual');
                 Session::notice(_t('Snapshot saved!', 'exportsnapshot'));
                 //CronTab::add_single_cron('snapshot_single', array( 'ExportSnapshot', 'run' ), HabariDateTime::date_create(), 'Run a single snapshot.' );
                 //Session::notice( _t( 'Snapshot scheduled for next cron run.' ) );
                 // don't display the configuration page, just redirect back to the plugin page
                 Utils::redirect(URL::get('admin', 'page=plugins'));
                 break;
         }
     }
 }
開發者ID:habari-extras,項目名稱:exportsnapshot,代碼行數:26,代碼來源:exportsnapshot.plugin.php

示例3: filter_rssblocks_update

 public function filter_rssblocks_update($success, $force = false)
 {
     EventLog::log('Running rrsblocks update');
     $blocks = DB::get_results('SELECT b.* FROM {blocks} b WHERE b.type = ?', array('rssblock'), 'Block');
     Plugins::act('get_blocks', $blocks);
     $success = true;
     foreach ($blocks as $block) {
         $cachename = array('rssblock', md5($block->feed_url));
         if ($force || Cache::expired($cachename)) {
             $r = new RemoteRequest($block->feed_url);
             $r->set_timeout(10);
             $r->execute();
             $feed = $r->get_response_body();
             try {
                 if (is_string($feed)) {
                     new SimpleXMLElement($feed);
                     // This throws an exception if the feed isn't valid
                     Cache::set($cachename, $feed, 3600, true);
                 }
             } catch (Exception $e) {
                 $success = false;
             }
         }
     }
     Session::notice('ran rssblocks update');
     return $success;
 }
開發者ID:habari-extras,項目名稱:rssblocks,代碼行數:27,代碼來源:rssblocks.plugin.php

示例4: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if (realpath($file) == __FILE__) {
         Modules::add('Technorati');
         Session::notice(_t('Please set your Technorati API Key in the configuration.'));
         Options::set('technorati__apikey', '');
     }
 }
開發者ID:habari-extras,項目名稱:technorati,代碼行數:8,代碼來源:technorati.plugin.php

示例5: updated_config

 public function updated_config(FormUI $ui)
 {
     Session::notice(_t('Settings saved.', 's3siloplugin'));
     $ui->save();
     if (is_null(Options::get('s3_bucket'))) {
         Session::notice(_t('Please select a bucket from your S3 account.', 's3siloplugin'));
     }
     Utils::redirect();
 }
開發者ID:ringmaster,項目名稱:s3silo,代碼行數:9,代碼來源:s3silo.plugin.php

示例6: updated_config

 public function updated_config(FormUI $ui)
 {
     $blacklist = explode("\n", $ui->blacklist->value);
     $blacklist = array_unique($blacklist);
     natsort($blacklist);
     $_POST[$ui->blacklist->field] = implode("\n", $blacklist);
     Session::notice(_t('Blacklist saved.', 'simpleblacklist'));
     $ui->save();
 }
開發者ID:habari-extras,項目名稱:simpleblacklist,代碼行數:9,代碼來源:simpleblacklist.plugin.php

示例7: action_theme_activated

 /**
  * On theme activation, activate some default blocks
  */
 public function action_theme_activated()
 {
     $blocks = $this->get_blocks('primary', '', $this);
     if (count($blocks) == 0) {
         $block = new Block(array('title' => _t('Posts'), 'type' => 'grayposts'));
         $block->add_to_area('primary');
         Session::notice(_t('Added default blocks to theme areas.'));
     }
 }
開發者ID:habari-extras,項目名稱:gray,代碼行數:12,代碼來源:theme.php

示例8: action_theme_activated

 /**
  * Add the K2 menu block to the nav area upon theme activation if there's nothing already there
  */
 public function action_theme_activated()
 {
     $blocks = $this->get_blocks('nav', 0, $this);
     if (count($blocks) == 0) {
         $block = new Block(array('title' => _t('K2 Menu'), 'type' => 'k2_menu'));
         $block->add_to_area('nav');
         Session::notice(_t('Added K2 Menu block to Nav area.'));
     }
 }
開發者ID:ringmaster,項目名稱:system,代碼行數:12,代碼來源:theme.php

示例9: filter_do_replace

 /**
  * Handler FormUI success action and do the replacement
  **/
 public function filter_do_replace($show_form, $form)
 {
     if (DB::query('UPDATE {posts} SET content = REPLACE(content, ? , ?)', array($form->search->value, $form->replace->value))) {
         Session::notice(sprintf(_t('Successfully replaced \'%s\' with \'%s\' in all posts'), $form->search->value, $form->replace->value));
         Utils::redirect(URL::get('admin', array('page' => 'plugins', 'configure' => Plugins::id_from_file(__FILE__), 'configaction' => _t('Replace'))), false);
     } else {
         Session::error(_t('There was an error with replacement.'));
     }
     return false;
 }
開發者ID:habari-extras,項目名稱:freeplace,代碼行數:13,代碼來源:freeplace.plugin.php

示例10: act_uninstall

 public function act_uninstall($handler, $theme)
 {
     try {
         $package = HabariPackages::remove($handler->handler_vars['guid']);
         Session::notice("{$package->name} {$package->version} was uninstalled.");
     } catch (Exception $e) {
         Session::error('Could not complete uninstall: ' . $e->getMessage());
         if (DEBUG) {
             Utils::debug($e);
         }
     }
 }
開發者ID:habari-extras,項目名稱:hpm,代碼行數:12,代碼來源:hpm.plugin.php

示例11: updated_config

 /**
  * Save updated configuration
  */
 public function updated_config($ui)
 {
     $msg = _t("Maintenance Mode configuration updated");
     $msg .= "<br/>";
     if ($ui->in_maintenance->value === FALSE) {
         $msg .= _t("The site is not in maintenance mode");
     } else {
         $msg .= _t("The site is in maintenance mode");
     }
     Session::notice($msg);
     $ui->save();
 }
開發者ID:habari-extras,項目名稱:maintenance_mode,代碼行數:15,代碼來源:maintenance_mode.plugin.php

示例12: ajax_tags

 /**
  * Handles AJAX from /admin/tags
  * Used to delete and rename tags
  */
 public function ajax_tags($handler_vars)
 {
     Utils::check_request_method(array('POST'));
     $wsse = Utils::WSSE($handler_vars['nonce'], $handler_vars['timestamp']);
     if ($handler_vars['digest'] != $wsse['digest']) {
         Session::error(_t('WSSE authentication failed.'));
         echo Session::messages_get(true, array('Format', 'json_messages'));
         return;
     }
     $tag_names = array();
     $theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', true));
     $this->theme = Themes::create('admin', 'RawPHPEngine', $theme_dir);
     $action = $this->handler_vars['action'];
     switch ($action) {
         case 'delete':
             foreach ($_POST as $id => $delete) {
                 // skip POST elements which are not tag ids
                 if (preg_match('/^tag_\\d+/', $id) && $delete) {
                     $id = substr($id, 4);
                     $tag = Tags::get_by_id($id);
                     $tag_names[] = $tag->term_display;
                     Tags::vocabulary()->delete_term($tag);
                 }
             }
             $msg_status = _n(_t('Tag %s has been deleted.', array(implode('', $tag_names))), _t('%d tags have been deleted.', array(count($tag_names))), count($tag_names));
             Session::notice($msg_status);
             break;
         case 'rename':
             if (!isset($this->handler_vars['master'])) {
                 Session::error(_t('Error: New name not specified.'));
                 echo Session::messages_get(true, array('Format', 'json_messages'));
                 return;
             }
             $master = $this->handler_vars['master'];
             $tag_names = array();
             foreach ($_POST as $id => $rename) {
                 // skip POST elements which are not tag ids
                 if (preg_match('/^tag_\\d+/', $id) && $rename) {
                     $id = substr($id, 4);
                     $tag = Tags::get_by_id($id);
                     $tag_names[] = $tag->term_display;
                 }
             }
             Tags::vocabulary()->merge($master, $tag_names);
             $msg_status = sprintf(_n('Tag %1$s has been renamed to %2$s.', 'Tags %1$s have been renamed to %2$s.', count($tag_names)), implode($tag_names, ', '), $master);
             Session::notice($msg_status);
             break;
     }
     $this->theme->tags = Tags::vocabulary()->get_tree();
     $this->theme->max = Tags::vocabulary()->max_count();
     echo json_encode(array('msg' => Session::messages_get(true, 'array'), 'tags' => $this->theme->fetch('tag_collection')));
 }
開發者ID:ringmaster,項目名稱:system,代碼行數:56,代碼來源:admintagshandler.php

示例13: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if ($file == str_replace('\\', '/', $this->get_file())) {
         CpgDb::registerTables();
         //Options::set( 'cpg__db_version', CpgDb::DB_VERSION );
         CpgOptions::setDbVersion(CpgDb::DB_VERSION);
         if (CpgDb::install()) {
             Session::notice(_t('Created the CPG database tables.', 'cpg'));
         } else {
             Session::error(_t('Could not install CPG database tables.', 'cpg'));
         }
     }
 }
開發者ID:habari-extras,項目名稱:cpg,代碼行數:13,代碼來源:cpg.plugin.php

示例14: action_admin_theme_get_rules

 function action_admin_theme_get_rules($handler, $theme)
 {
     $handler_vars = $handler->handler_vars;
     if (isset($handler_vars['names'])) {
         foreach ($handler_vars['names'] as $key => $name) {
             $changes = array('name' => $name, 'parse_regex' => $handler_vars['regexes'][$key], 'action' => $handler_vars['actions'][$key], 'priority' => $handler_vars['priorities'][$key], 'description' => $handler_vars['descriptions'][$key]);
             self::add_rewrite_rule($key, $changes);
         }
         Session::notice(_t('Rewrite rules updated.'));
         Utils::redirect();
     }
     $theme->display('rules');
     exit;
 }
開發者ID:habari-extras,項目名稱:rewriter,代碼行數:14,代碼來源:rewriter.plugin.php

示例15: action_template_header

 function action_template_header($theme)
 {
     // Add the HTML5 shiv for IE < 9
     Stack::add('template_header_javascript', array('http://cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.js', null, '<!--[if lt IE 9]>%s<![endif]-->'), 'html5_shiv');
     // Add this line to your config.php to show an error and a notice, and
     // to process the raw LESS code via javascript instead of the rendered CSS:  define('DEBUG_THEME', 1);
     if (defined('DEBUG_THEME')) {
         Session::error('This is a <b>sample error</b>');
         Session::notice('This is a <b>sample notice</b> for ' . $_SERVER['REQUEST_URI']);
         Stack::add('template_header_javascript', $theme->get_url('/less/less-1.3.0.min.js'), 'less');
         Stack::add('template_stylesheet', array($theme->get_url('/less/style.less'), null, array('type' => null, 'rel' => 'stylesheet/less')), 'style');
     } else {
         Stack::add('template_stylesheet', $theme->get_url('/css/style.css'), 'style');
     }
 }
開發者ID:wwxgitcat,項目名稱:habari,代碼行數:15,代碼來源:theme.php


注:本文中的Session::notice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。