예제 #1
0
 function display($tpl)
 {
     header('Content-type: text/html;charset=' . CHARSET);
     $this->assign('lang', Lang::get());
     $this->assign('charset', CHARSET);
     parent::display($tpl);
 }
예제 #2
0
 /**
  * The constructer
  */
 public function __construct($id = '')
 {
     parent::__construct();
     if (!empty($id)) {
         $this->id = $id;
         $this->get();
     }
 }
예제 #3
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $object = __CLASS__;
         self::$instance = new $object();
     }
     return self::$instance;
 }
예제 #4
0
 function _config_view()
 {
     parent::_config_view();
     $this->_view->template_dir = APP_ROOT . '/templates';
     $this->_view->res_base = site_url() . '/templates';
     $this->_view->direct_output = true;
     $this->_view->lib_base = dirname(site_url()) . '/includes/libraries/javascript';
 }
예제 #5
0
 /**
  * The constructer
  */
 public function __construct($kid = '')
 {
     if (!isset($this->db)) {
         $this->db = parent::getInstance();
     }
     if (!empty($kid)) {
         $this->kid = $kid;
         $this->get();
     }
 }
예제 #6
0
파일: App.php 프로젝트: i4j5/burgermaniya
 public static function instance()
 {
     if (self::$slim === null) {
         $configuration = ['settings' => ['displayErrorDetails' => true]];
         $c = new \Slim\Container($configuration);
         $app = new \Slim\App($c);
         $container = $app->getContainer();
         $container['view'] = function ($c) {
             $view = new \Slim\Views\Twig(DOCROOT . 'app/views', []);
             $view->addExtension(new \Slim\Views\TwigExtension($c['router'], $c['request']->getUri()));
             return $view;
         };
         $container['flash'] = function () {
             return new \Slim\Flash\Messages();
         };
         self::$slim = $app;
     }
     return self::$slim;
 }
예제 #7
0
 /**
  * The constructer
  */
 public function __construct($fid = '')
 {
     if (!isset($this->db)) {
         $this->db = parent::getInstance();
     }
     if (!empty($fid)) {
         $this->fid = $fid;
         //try to get data from memcache
         $this->cache = parent::memcache_connect();
         if ($this->cache->get("Firma_Table" . $fid)) {
             foreach ($this->cache->get("Firma_Table" . $fid) as $key => $value) {
                 $this->{$key} = $value;
             }
             if (!isset($this->db)) {
                 $this->db = parent::getInstance();
             }
             return;
         }
         $this->get();
         unset($this->db);
         $this->cache->set("Firma_Table" . $fid, $this);
         $this->db = parent::getInstance();
     }
 }
예제 #8
0
 function display($tpl)
 {
     header('Content-type: text/html;charset=' . CHARSET);
     $map = $this->_get_map();
     $this->assign('lang', Lang::get());
     $this->assign('charset', CHARSET);
     $this->assign('done', $this->_done);
     $this->assign('doing', $this->_doing);
     $this->assign('step_num', array_search($this->_doing, $map) + 1);
     $this->assign('step_name', Lang::get("{$this->_doing}_title"));
     $this->assign('step_desc', Lang::get("{$this->_doing}_desc"));
     $this->assign('hiddens', $this->_hiddens);
     $this->assign('map', $map);
     parent::display($tpl);
 }
예제 #9
0
 function display($f)
 {
     if ($this->_hook('on_display', array('display_file' => &$f))) {
         return;
     }
     $this->assign('site_url', SITE_URL);
     $this->assign('random_number', rand());
     /* 语言项 */
     $this->assign('lang', Lang::get());
     /* 用户信息 */
     $this->assign('visitor', isset($this->visitor) ? $this->visitor->info : array());
     /* 新消息 */
     $this->assign('new_message', isset($this->visitor) ? $this->_get_new_message() : array());
     $this->assign('charset', CHARSET);
     $this->assign('price_format', Conf::get('price_format'));
     $this->assign('async_sendmail', $this->_async_sendmail());
     $this->_assign_query_info();
     /*LLL 开启客服守候链接 */
     $user_id = $this->visitor->get('user_id');
     if ($user_id) {
         $mod_user =& m('member');
         $user_info = $mod_user->get(array('conditions' => "user_id = '{$user_id}'", 'join' => 'has_store', 'fields' => 'user_id, user_name, reg_time, last_login, last_ip, store_id'));
         $my_store = empty($user_info['store_id']) ? 0 : $user_info['store_id'];
         if (!$my_store == 0) {
             $this->assign('chat_host_url', SITE_URL . "/index.php?app=message&act=talk");
         } else {
             $this->assign('chat_host_url', '');
         }
     }
     parent::display($f);
     if ($this->_hook('end_display', array('display_file' => &$f))) {
         return;
     }
 }
예제 #10
0
 function display($f)
 {
     if ($this->_hook('on_display', array('display_file' => &$f))) {
         return;
     }
     $this->assign('site_url', SITE_URL);
     $this->assign('real_site_url', defined('IN_BACKEND') ? dirname(site_url()) : site_url());
     $this->assign('ecmall_version', VERSION);
     $this->assign('random_number', rand());
     /* 语言项 */
     $this->assign('lang', Lang::get());
     /* 用户信息 */
     $this->assign('visitor', isset($this->visitor) ? $this->visitor->info : array());
     $this->assign('charset', CHARSET);
     $this->assign('price_format', Conf::get('price_format'));
     $this->assign('async_sendmail', $this->_async_sendmail());
     $this->_assign_query_info();
     parent::display($f);
     if ($this->_hook('end_display', array('display_file' => &$f))) {
         return;
     }
 }
예제 #11
0
 function display($f)
 {
     if ($this->_hook('on_display', array('display_file' => &$f))) {
         return;
     }
     $this->assign('site_url', SITE_URL);
     $this->assign('random_number', rand());
     /* 语言项 */
     $this->assign('lang', Lang::get());
     /* 用户信息 */
     $this->assign('visitor', isset($this->visitor) ? $this->visitor->info : array());
     /* 新消息 */
     $this->assign('new_message', isset($this->visitor) ? $this->_get_new_message() : array());
     $this->assign('charset', CHARSET);
     $this->assign('price_format', Conf::get('price_format'));
     $this->assign('async_sendmail', $this->_async_sendmail());
     $this->_assign_query_info();
     parent::display($f);
     if ($this->_hook('end_display', array('display_file' => &$f))) {
         return;
     }
 }
예제 #12
0
 function display($f, $cache_id = "")
 {
     //        if ($this->_hook('on_display', array('display_file' => & $f)))
     //        {
     //            return;
     //        }
     $this->assign('site_url', SITE_URL);
     $this->assign('real_site_url', defined('IN_BACKEND') ? dirname(site_url()) : site_url());
     /* 语言项 */
     $this->assign('lang', Lang::get());
     /* 用户信息 */
     $this->assign('visitor', isset($this->visitor) ? $this->visitor->info : array());
     $this->assign('charset', CHARSET);
     $this->assign('price_format', Conf::get('price_format'));
     $this->assign('async_sendmail', $this->_async_sendmail());
     $this->_assign_query_info();
     parent::display($f, $cache_id);
     if ($this->_hook('end_display', array('display_file' => &$f))) {
         return;
     }
 }