예제 #1
0
	
	CSS-стили: 
			>	@import url('components/logo-block.less');
		
	PHP-связи: 
			>	if ($fn = mso_fe('components/logo-block/logo-block.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// если в опции явно указан адрес лого, то берем его
$logo = trim(mso_get_option('default_header_logo_custom', 'templates', false));
if (!$logo) {
    $logo = getinfo('stylesheet_url') . 'images/logos/' . mso_get_option('default_header_logo', 'templates', 'logo01.png');
}
$logo = '<img src="' . $logo . '" alt="' . getinfo('name_site') . '" title="' . getinfo('name_site') . '">';
if (!is_type('home')) {
    $logo = $pt->link(getinfo('siteurl'), $logo);
}
// вывод
$pt->div_start('logo-block', 'wrap');
$pt->div_start('r1');
$pt->html($logo);
$pt->div_end('r1');
$pt->div_start('r2');
if (function_exists('ushka')) {
    echo ushka('logo-block');
}
$pt->div_end('r2');
$pt->clearfix();
$pt->div_end('logo-block', 'wrap');
# end file
예제 #2
0
파일: page.php 프로젝트: buyvolov/cms
     require $f;
 } else {
     $p->div_start('mso-page-content mso-type-' . getinfo('type') . '-content');
     if ($f = mso_page_foreach('content')) {
         require $f;
     } else {
         // если show_thumb_type_ТИП вернул false, то картинку не ставим
         // show_thumb - если нужно отключить для всех типов
         if (mso_get_val('show_thumb', true) and mso_get_val('show_thumb_type_' . getinfo('type'), true)) {
             // вывод миниатюры перед записью
             if ($image_for_page = thumb_generate($p->meta_val('image_for_page'), mso_get_option('image_for_page_width', 'templates', 280), mso_get_option('image_for_page_height', 'templates', 210))) {
                 echo $p->img($image_for_page, mso_get_option('image_for_page_css_class', 'templates', 'image_for_page'), '', $p->val('page_title'));
             }
         }
         $p->content('', '');
         $p->clearfix();
     }
     // для page возможен свой info-bottom
     if ($f = mso_page_foreach('mso-info-bottom-page')) {
         require $f;
     } elseif ($f = mso_page_foreach('info-bottom')) {
         require $f;
     }
     $p->html('<aside>');
     mso_page_content_end();
     $p->clearfix();
     if ($f = mso_page_foreach('page-content-end')) {
         require $f;
     }
     // связанные страницы по родителям
     if ($page_nav = mso_page_nav($p->val('page_id'), $p->val('page_id_parent'))) {
예제 #3
0
파일: page-out.php 프로젝트: Kmartynov/cms
 public function output($r = array())
 {
     if (!$this->pages) {
         return;
     }
     // нет записей, выходим
     // дефолтный формат вывода
     $default = array('title_start' => '<h3 class="home-last-page">', 'title_end' => '</h3>', 'date' => 'D, j F Y г. в H:i', 'date_start' => '<span class="date"><time datetime="[page_date_publish_iso]">', 'date_end' => '</time></span>', 'cat_start' => ' | <span class="cat">', 'cat_end' => '</span>', 'cat_sep' => ', ', 'tag_start' => ' | <span class="tag">', 'tag_end' => '</span>', 'tag_sep' => ', ', 'author_start' => '', 'author_end' => '', 'read' => '»»»', 'read_start' => '', 'read_end' => '', 'comments_count_start' => '', 'comments_count_end' => '', 'thumb' => true, 'thumb_width' => 320, 'thumb_height' => 180, 'thumb_class' => 'thumb left', 'placehold' => false, 'placehold_path' => 'http://placehold.it/', 'placehold_pattern' => '[W]x[H].png', 'placehold_file' => false, 'placehold_data_bg' => '#CCCCCC', 'block_start' => '', 'block_end' => '', 'line1' => '[thumb]', 'line1_start' => '', 'line1_end' => '', 'line2' => '[title]', 'line2_start' => '', 'line2_end' => '', 'line3' => '[date] [cat]', 'line3_start' => '<p class="home-last-page-info">', 'line3_end' => '</p>', 'line4' => '', 'line4_start' => '', 'line4_end' => '', 'line5' => '', 'line5_start' => '', 'line5_end' => '', 'content' => true, 'content_chars' => 0, 'content_words' => 0, 'content_cut' => ' ...', 'content_start' => '<div class="mso-page-content">', 'content_end' => '</div>', 'columns' => 0, 'columns_class_row' => 'onerow', 'columns_class_cell' => 'col w1-2', 'clearfix' => false, 'page_start' => '', 'page_end' => '', 'pagination_start' => '', 'pagination_end' => '', 'box_grid' => 0, 'box_grid_class' => 'w50', 'box_grid_box_class' => 'table-box', 'exclude_page_add' => true);
     $r = array_merge($default, $r);
     // объединяем
     // $r = array_map('trim', $r);
     $p = new Page_out();
     // шаблонизатор
     // echo $r['block_start'];
     eval(mso_tmpl_prepare($r['block_start'], false));
     // формат записи
     $p->format('title', $r['title_start'], $r['title_end']);
     $p->format('date', $r['date'], $r['date_start'], $r['date_end']);
     $p->format('author', $r['author_start'], $r['author_end']);
     $p->format('cat', $r['cat_sep'], $r['cat_start'], $r['cat_end']);
     $p->format('tag', $r['tag_sep'], $r['tag_start'], $r['tag_end']);
     $p->format('read', $r['read'], $r['read_start'], $r['read_end']);
     $p->format('comments_count', $r['comments_count_start'], $r['comments_count_end']);
     if ($r['exclude_page_add']) {
         $exclude_page_id = mso_get_val('exclude_page_id');
     }
     if ($r['columns']) {
         $my_columns = new Columns($r['columns'], count($this->pages), $r['columns_class_row']);
     }
     if ($r['box_grid']) {
         $p->box_grid($r['box_grid']);
     }
     foreach ($this->pages as $page) {
         $p->load($page);
         // загружаем данные записи
         if ($r['box_grid']) {
             $p->box_grid_cell($r['box_grid_class'], $r['box_grid_box_class']);
         }
         if ($r['columns']) {
             $my_columns->out($r['columns_class_cell']);
         }
         // echo $r['page_start'];
         eval(mso_tmpl_prepare($r['page_start'], false));
         if ($r['thumb']) {
             // плейсхолд
             if ($r['placehold']) {
                 if ($r['placehold_file']) {
                     if ($r['placehold_file'] == 'data') {
                         // сами генерируем плейсхолд
                         // mso_holder($width = 100, $height = 100, $text = true, $background_color = '#CCCCCC', $text_color = '#777777', $font_size = 5)
                         $t_placehold = mso_holder($r['thumb_width'], $r['thumb_height'], false, $r['placehold_data_bg']);
                     } else {
                         $t_placehold = $r['placehold_path'] . $r['placehold_file'];
                     }
                 } else {
                     $t_placehold_pattern = str_replace('[W]', $r['thumb_width'], $r['placehold_pattern']);
                     $t_placehold_pattern = str_replace('[H]', $r['thumb_height'], $t_placehold_pattern);
                     $t_placehold_pattern = str_replace('[RND]', rand(1, 10), $t_placehold_pattern);
                     $t_placehold = $r['placehold_path'] . $t_placehold_pattern;
                 }
             } else {
                 $t_placehold = false;
             }
             if ($thumb = thumb_generate($p->meta_val('image_for_page'), $r['thumb_width'], $r['thumb_height'], $t_placehold)) {
                 $p->thumb = '<a href="' . mso_page_url($p->val('page_slug')) . '" title="' . htmlspecialchars($p->val('page_title')) . '"><img src="' . $thumb . '" class="' . $r['thumb_class'] . '" alt="' . htmlspecialchars($p->val('page_title')) . '"></a>';
             }
         }
         $p->line($r['line1'], $r['line1_start'], $r['line1_end']);
         $p->line($r['line2'], $r['line2_start'], $r['line2_end']);
         $p->line($r['line3'], $r['line3_start'], $r['line3_end']);
         if ($r['content']) {
             if ($r['content_chars']) {
                 $p->content_chars($r['content_chars'], $r['content_cut'], $r['content_start'], $r['content_end']);
                 // текст обрезанный
             } elseif ($r['content_words']) {
                 $p->content_words($r['content_words'], $r['content_cut'], $r['content_start'], $r['content_end']);
                 // текст обрезанный
             } else {
                 $p->content($r['content_start'], $r['content_end']);
             }
         }
         $p->line($r['line4'], $r['line4_start'], $r['line4_end']);
         $p->line($r['line5'], $r['line5_start'], $r['line5_end']);
         if ($r['clearfix']) {
             $p->clearfix();
         }
         // echo $r['page_end'];
         eval(mso_tmpl_prepare($r['page_end'], false));
         if ($r['columns']) {
             $my_columns->next();
         }
         if ($r['box_grid']) {
             $p->box_grid_next();
         }
         // сохраняем id записей, чтобы их исключить из вывода
         if ($r['exclude_page_add']) {
             $exclude_page_id[] = $p->val('page_id');
         }
     }
     if ($r['columns']) {
         $my_columns->close();
     }
     if ($r['box_grid']) {
         $p->box_grid_end();
     }
     if ($r['exclude_page_add']) {
         mso_set_val('exclude_page_id', $exclude_page_id);
     }
     if ($this->param['pagination']) {
         if (mso_hook_present('pagination')) {
             // echo $r['pagination_start'];
             eval(mso_tmpl_prepare($r['pagination_start'], false));
             mso_hook('pagination', $this->pagination);
             // echo $r['pagination_end'];
             eval(mso_tmpl_prepare($r['pagination_end'], false));
         }
     }
     // echo $r['block_end'];
     eval(mso_tmpl_prepare($r['block_end'], false));
 }