示例#1
0
     $model = $this->__get_module('__model_list', 'models', $model_name);
     if (!$model) {
         return Loader::get_model($model_name);
     }
     return $model;
 }
 public function widget($name, $options, $return = FALSE)
 {
     if (empty($name)) {
         return '';
     }
     $widget_name = (string) str_replace('/', '__', $name);
     $widget_path = $name;
     if (!function_exists($widget_name)) {
         $path = APPPATH . 'widgets/' . $widget_path . EXT;
         include_once $path;
         if (!function_exists($widget_name)) {
             Log::log_error("Widget does not exist. widgets:[{$widget_name}], path:[{$path}]");
             return '';
         }
     }
     if (!in_array($widget_name, self::$__widget_call_list)) {
         self::$__widget_call_list[] = $widget_name;
         //$path = Builder::get_style_path("/widgets/{$widget_path}");
         //Builder::set_head($path, 'css');
         $widget_path = str_replace('/', '-', $widget_path);
         Builder::add_css("widgets/{$widget_path}");
         Builder::add_js("widgets/{$widget_path}");
         //Builder::set_head($path.'_noscript', 'css');
         //Builder::set_head("./widgets/{$widget_path}", 'js', TRUE);
     }
     $result = $widget_name($options);
示例#2
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());
 }
示例#3
0
 public function main($opt = array())
 {
     Builder::add_css('pages/frontend-home');
     Builder::add_meta('robots', 'noindex', TRUE);
     Builder::set_title(get_string('pages', 'main_title'));
     $nav = array();
     $nav[get_string('url_naming', 'home')] = '';
     //------------------Total page------------
     $page = array();
     $page['nav'] =& $nav;
     $page['content'] = $this->view(get_article_path('home'), array(), TRUE);
     $this->view('frontend/frontend', $page);
 }
示例#4
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);
 }
示例#5
0
 public function log($opt = array())
 {
     if (empty($opt)) {
         $model = $this->model('error_model');
     } else {
         $model = $this->model('cron_model');
     }
     Builder::add_css('pages/backend-error_list');
     $current_interval = 1;
     if (!empty($opt)) {
         $current_interval = intval(reset($opt));
     }
     $contents['interval'] = array('link' => base_url(Buffer::get(URL_CONTROLLER) . '/' . Buffer::get(URL_METHOD), TRUE), 'interval' => $model->get_interval(), 'selected' => $current_interval);
     $contents['info_list'] = $model->get_list($current_interval);
     $page = array();
     $page['content'] = $this->view('system_browser', $contents, TRUE);
     $this->view('backend/backend', $page);
 }
示例#6
0
/**
 * Created by JetBrains PhpStorm.
 * User: Администратор
 * Date: 28.06.14
 * Time: 0:43
 * To change this template use File | Settings | File Templates.
 */
function slider__full(array $options)
{
    if (!is_array($options)) {
        return '';
    }
    Builder::add_js("widgets/slider/full");
    Builder::add_js('system/jquery.easing.1.3');
    Builder::add_css("widgets/slider/full");
    $large = '';
    $thumbs = '';
    foreach ($options as $key => $item) {
        $large .= '<li><img src="' . base_url($item['image_large']) . '" alt="large image"/><div class="ei-title"><h2>' . $item['title'] . '</h2><h3>' . $item['subtitle'] . '</h3></div></li>';
        $thumbs .= '<li><a href="#">' . $key . '</a><img src="' . base_url($item['image_thumb']) . '" alt="thumb image" /></li>';
    }
    return <<<EOT
    <div id="ei-slider" class="ei-slider"><ul class="ei-slider-large">{$large}</ul><ul class="ei-slider-thumbs"><li class="ei-slider-element">Current</li>{$thumbs}</ul></div><div style="clear: both;"></div>
EOT;
}
示例#7
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);
 }
示例#8
0
function list__poly_block(array $options = array())
{
    Builder::add_css("widgets/list/poly_block");
    if (empty($options)) {
        return '';
    }
    $body = '';
    foreach ($options as $item) {
        $img_link = '#';
        $total_link = '#';
        $header = '';
        $content = '';
        if (!empty($item['content'])) {
            $content = $item['content'];
        }
        if (!empty($item['header'])) {
            $header = $item['header'];
        }
        if (!empty($item['img_title'])) {
            $img_link = image_url($item['img_title']);
        }
        if (!empty($item['link'])) {
            $total_link = base_url($item['link']);
        }
        $body .= <<<EOT
            <div class="view view-tenth">
                    <img src="{$img_link}" />
                    <div class="mask">
                        <h2>{$header}</h2>
                        <p>{$content}</p>
                        <a href="{$total_link}" class="info">Подробнее</a>
                    </div>
                </div>
EOT;
    }
    return "<article class=\"list-poly_block\">{$body}<div class=\"clear\"></div></article>";
}
示例#9
0
 public function __construct()
 {
     Builder::add_css('pages/backend-error_list');
     Builder::add_css('pages/backend-article_list');
 }