Esempio n. 1
0
 public function login()
 {
     Builder::add_meta('robots', 'none', TRUE);
     Builder::add_js(array('system/jquery-1.8.3', 'system/wx'));
     Builder::add_css(array('system/reset', 'pages/frontend'));
     Builder::add_css('pages/frontend-contacts');
     Builder::add_constant(array('command' => 'user', 'action' => 'login'));
     $this->view('login', array());
 }
Esempio n. 2
0
 public function sitemap()
 {
     Builder::add_meta('robots', 'noindex', TRUE);
     Builder::add_css('pages/frontend-sitemap');
     Builder::set_title(get_string('pages', 'sitemap_title'));
     $nav = array();
     $nav[get_string('url_naming', 'home')] = '';
     $nav[get_string('url_naming', 'sitemap')] = 'special/sitemap';
     $page = array();
     $page['nav'] =& $nav;
     $page['content'] = $this->view('frontend/sitemap', array(), TRUE);
     $this->view('frontend/frontend', $page);
 }
Esempio n. 3
0
 public function about()
 {
     Builder::set_title(get_string('pages', 'about_title'));
     Builder::add_meta('robots', 'none', TRUE);
     $nav = array();
     $nav[get_string('url_naming', 'home')] = '';
     $nav[get_string('url_naming', 'about')] = 'home/about';
     //------------------Total page------------
     $path = get_article_path('about');
     $page = array();
     $page['nav'] =& $nav;
     $page['content'] = $this->view($path, array(), TRUE);
     $this->view('frontend/frontend', $page);
 }
Esempio n. 4
0
 public function read($opt = NULL)
 {
     Builder::add_plugin('jQuery-slimScroll');
     Builder::add_js('system/wx');
     Builder::add_css('pages/frontend-article');
     Builder::add_css(array('pages/home-about', 'system/github'));
     $article_id = reset($opt);
     if (empty($article_id)) {
         throw new Exception_wx(4040004, $article_id);
     }
     $article_meta = $this->model('articles_model')->get($article_id);
     $content['id'] = $article_id;
     $content['type'] =& $article_meta['type'];
     $content['header'] =& $article_meta['header'];
     $content['creation'] =& $article_meta['creation'];
     Builder::set_title(get_string('url_naming', $article_meta['type']) . ' — ' . $article_meta['header']);
     $left['list'] = $this->model('articles_model')->get_articles_by_type($content['type']);
     $left['current'] = base_url("articles/read/{$article_id}");
     $content['previous'] = NULL;
     $content['following'] = NULL;
     $index = 0;
     foreach ($left['list'] as $key => &$item) {
         if ($left['current'] == $item['link']) {
             $index = $key;
             break;
         }
     }
     if ($index > 0) {
         $content['previous'] =& $left['list'][$index - 1]['link'];
     }
     if ($index < count($left['list']) - 1) {
         $content['following'] =& $left['list'][$index + 1]['link'];
     }
     if (isset($article_meta['description'])) {
         Builder::add_meta('description', $article_meta['description']);
     }
     if (isset($article_meta['keywords'])) {
         Builder::add_meta('keywords', $article_meta['keywords']);
     }
     $page = array();
     $page['content'] = $this->view('article_read', $content, TRUE);
     $this->view('frontend/frontend', $page);
 }