public static function process() { theme_features::check_referer(); $post_id = isset($_GET['post-id']) && is_numeric($_GET['post-id']) ? (int) $_GET['post-id'] : false; if (!$post_id) { die(theme_features::json_format(['status' => 'error', 'code' => 'invaild_post_id', 'msg' => ___('Sorry, post id is invaild.')])); } global $post, $page; /** * post */ $post = theme_cache::get_post($post_id); if (!$post) { die(theme_features::json_format(['status' => 'error', 'code' => 'post_not_exist', 'msg' => ___('Sorry, the post does not exist.')])); } /** * page */ $page = isset($_GET['page']) && is_numeric($_GET['page']) ? (int) $_GET['page'] : false; if (!$page) { die(theme_features::json_format(['status' => 'error', 'code' => 'invaild_page_number', 'msg' => ___('Sorry, page number is invaild.')])); } set_query_var('page', $page); setup_postdata($post); ob_start(); if (class_exists('theme_img_lazyload')) { remove_filter('the_content', 'theme_img_lazyload::the_content'); } the_content(); $content = html_minify(ob_get_contents()); ob_end_clean(); die(theme_features::json_format(['status' => 'success', 'content' => $content])); }
public static function display($args = []) { global $post; $opt = self::get_options(); $img_url = theme_features::get_thumbnail_src($post->ID); $defaults = array('post_title_text' => theme_cache::get_the_title($post->ID), 'post_url' => theme_cache::get_permalink($post->ID), 'blog_name' => theme_cache::get_bloginfo('name'), 'blog_url' => theme_cache::home_url(), 'img_url' => esc_url($img_url), 'post_excerpt' => esc_attr(mb_substr(html_minify(strip_tags(get_the_excerpt())), 0, 120)), 'post_content' => esc_attr(mb_substr(html_minify(strip_tags(get_the_content())), 0, 120)), 'author' => theme_cache::get_the_author_meta('display_name', $post->post_author)); $output_keywords = array_merge($defaults, $args); $tpl_keywords = array('%post_title_text%', '%post_url%', '%blog_name%', '%blog_url%', '%img_url%', '%post_excerpt%', '%post_content%', '%author%'); $post_share_code = stripslashes(str_ireplace($tpl_keywords, $output_keywords, $opt['code'])); echo $post_share_code; }
/** * Выводит окончательный вид страницы в браузер */ public function renderPage() { $config = cmsConfig::getInstance(); $layout = $this->getLayout(); $template_file = $this->path . '/' . $layout . '.tpl.php'; if (file_exists($template_file)) { if (!$config->min_html) { include $template_file; } if ($config->min_html) { ob_start(); include $template_file; echo html_minify(ob_get_clean()); } } else { cmsCore::error(ERR_TEMPLATE_NOT_FOUND . ': ' . $this->name . ':' . $layout); } }
public static function the_homebox(array $args = []) { if (!class_exists('theme_custom_homebox')) { return false; } $opt = array_filter((array) theme_custom_homebox::get_options()); /** * cache */ $device = wp_is_mobile() ? 'mobile' : 'desktop'; $sign_status = theme_cache::is_user_logged_in() ? 'login' : 'logout'; $cache_id = $device . $sign_status; $cache = (array) theme_custom_homebox::get_cache(); if (isset($cache[$cache_id])) { echo $cache[$cache_id]; unset($cache); return; } ob_start(); if (empty($opt)) { ?> <div class="panel"> <div class="content"> <div class="page-tip"><?php echo status_tip('info', ___('Please add some homebox.')); ?> </div> </div> </div> <?php return false; } global $post; static $lazyload_i = 0; foreach ($opt as $k => $v) { /** display type */ $display_type = isset($v['display-type']) ? $v['display-type'] : 'all'; /** for login */ if ($display_type === 'login' && !theme_cache::is_user_logged_in()) { continue; } /** for logout */ if ($display_type === 'logout' && theme_cache::is_user_logged_in()) { continue; } if (!isset($v['title']) || trim($v['title']) === '') { continue; } $title = esc_html($v['title']); $link = isset($v['link']) && !empty($v['link']) ? esc_url($v['link']) : false; ?> <div id="homebox-<?php echo $k; ?> " class="homebox panel mod"> <div class="heading"> <h2 class="title"> <span class="bg"> <?php if ($link) { ?> <a href="<?php echo $link; ?> " title="<?php echo sprintf(___('More about %s'), $title); ?> "> <?php } ?> <?php if (!empty($v['icon'])) { ?> <i class="fa fa-<?php echo $v['icon']; ?> "></i> <?php } ?> <?php echo $title; ?> <?php if ($link) { ?> </a> <?php } ?> </span> </h2> <div class="extra"> <?php if (!empty($v['keywords'])) { ?> <div class="keywords"> <?php if (wp_is_mobile()) { $keyword_i = 0; foreach (theme_custom_homebox::keywords_to_html($v['keywords']) as $kw) { if ($keyword_i == 3) { break; } ?> <a href="<?php echo esc_url($kw['url']); ?> "><?php echo $kw['name']; ?> </a> <?php ++$keyword_i; } } else { foreach (theme_custom_homebox::keywords_to_html($v['keywords']) as $kw) { ?> <a href="<?php echo esc_url($kw['url']); ?> "><?php echo $kw['name']; ?> </a> <?php } } ?> </div> <?php } ?> </div> </div> <div class="row"> <?php $query = new WP_Query(['category__in' => isset($v['cats']) ? $v['cats'] : [], 'posts_per_page' => isset($v['number']) ? (int) $v['number'] : 8, 'ignore_sticky_posts' => false]); if ($query->have_posts()) { $i = 0; foreach ($query->posts as $post) { setup_postdata($post); self::archive_card_sm(['classes' => $i <= 2 ? 'g-tablet-1-3' : 'g-tablet-1-4', 'lazyload' => wp_is_mobile() && $lazyload_i < 1 ? false : true, 'category' => false]); ++$i; } wp_reset_postdata(); } else { echo status_tip('info', ___('No data yet.')); } unset($query); ?> </div> <a href="<?php echo $link; ?> " class="below-more btn btn-block btn-default" target="<?php echo theme_functions::$link_target; ?> "><?php echo sprintf(___('More about %s'), $title); ?> <i class="fa fa-caret-right"></i></a> <?php /** * ad */ if (isset($v['ad']) && !empty($v['ad'])) { ?> <div class="homebox-ad"><?php echo stripslashes($v['ad']); ?> </div> <?php } ?> </div> <?php ++$lazyload_i; } /** end foreach */ $cache[$cache_id] = html_minify(ob_get_contents()); ob_end_clean(); theme_custom_homebox::set_cache($cache); echo $cache[$cache_id]; unset($cache); }
public static function frontend_display($args = [], $instance = []) { $cache_id = md5(json_encode($instance)); $cache = theme_cache::get($cache_id); if ($cache) { echo $cache; unset($cache); return; } $smallest = 11; $largest = 20; $unit = 'pt'; $number = $instance['number']; $exclude_ids = isset($instance['ids']) ? $instance['ids'] : null; $tag_links = []; $sticky_links = []; if (!empty($exclude_ids)) { foreach ($exclude_ids as $k => $v) { $sticky_name = isset($sticky_names[$k]) ? esc_html($sticky_names[$k]) : null; $sticky_links[] = '<a href="' . get_tag_link($v) . '" class="sticky-tag">' . $sticky_name . '</a>'; } } $tags = get_terms('post_tag', array('orderby' => 'count', 'number' => $number, 'order' => 'desc', 'pad_counts' => true, 'exclude' => $exclude_ids)); if (!empty($tags)) { $counts = []; $real_counts = []; // For the alt tag foreach ((array) $tags as $key => $tag) { $real_counts[$key] = $tag->count; $counts[$key] = $tag->count; } $min_count = min($counts); $spread = max($counts) - $min_count; if ($spread <= 0) { $spread = 1; } $font_spread = $largest - $smallest; if ($font_spread < 0) { $font_spread = 1; } $font_step = $font_spread / $spread; foreach ($tags as $key => $tag) { $count = $counts[$key]; ob_start(); ?> <a class="hot-tag" href="<?php echo get_tag_link($tag->term_id); ?> " style=" font-size:<?php echo str_replace(',', '.', $smallest + ($count - $min_count) * $font_step), $unit; ?> ; color:rgb(<?php echo mt_rand(50, 200); ?> ,<?php echo mt_rand(50, 200); ?> ,<?php echo mt_rand(50, 200); ?> );" ><?php echo esc_html($tag->name); ?> </a><?php $tag_links[] = html_minify(ob_get_contents()); ob_end_clean(); } } $tags = array_filter(array_merge($tag_links, $sticky_links)); if (!empty($tags)) { //shuffle($tags); $cache = implode('', $tags); } else { $cache = status_tip('info', ___('No data yet.')); } theme_cache::set($cache_id, $cache, null, 3600 * 24); echo $cache; unset($cache); }
public static function get_comments_list($post_id, &$cpage = 1) { global $wp_query, $post; $wp_query = new WP_Query(['p' => $post_id, 'post_type' => ['post', 'page']]); $post = $wp_query->posts[0]; $comments = self::get_comments(['post_id' => $post_id]); if (!$comments) { return false; } $wp_query->comments = $comments; /** * set cpage */ $max_pages = theme_features::get_comment_pages_count($wp_query->comments); if ($cpage > $max_pages) { $cpage = $max_pages; } if ($cpage == 0) { $cpage = 1; } set_query_var('cpage', $cpage); $comment_list = wp_list_comments(array('callback' => 'theme_functions::theme_comment', 'page' => $cpage, 'echo' => false), $comments); return html_minify($comment_list); }
public static function the_page_pagination() { global $post, $page, $numpages; $cache_id = $post->ID . $page . $numpages; $cache_group = 'page-pagi'; $cache = theme_cache::get($cache_id, $cache_group); if (!empty($cache)) { echo $cache; unset($cache); return; } $page_pagination = self::smart_page_pagination(['same_category' => true]); if (!isset($page_pagination['numpages']) || $page_pagination['numpages'] <= 1) { return false; } ob_start(); ?> <nav class="page-pagination"> <?php $page_attr_str = $page_pagination['page'] . '/' . $page_pagination['numpages']; $page_str = '<span class="current-page">' . $page_pagination['page'] . '</span>' . '/' . $page_pagination['numpages']; if (isset($page_pagination['prev_page'])) { ?> <a href="<?php echo $page_pagination['prev_page']['url']; ?> " class="prev" title="<?php echo ___('Previous page'); ?> <?php echo $page_attr_str; ?> " data-number="<?php echo $page - 1; ?> " ><i class="fa fa-chevron-left"></i><span class="tx"><?php echo ___('Previous page'); ?> <?php echo $page_str; ?> </span></a> <?php } else { ?> <a href="javascript:;" class="prev" title="<?php echo ___('Previous page'); ?> <?php echo $page_attr_str; ?> " data-number="1" ><i class="fa fa-chevron-left"></i><span class="tx"><?php echo ___('Previous page'); ?> <?php echo $page_str; ?> </span></a> <?php } if (isset($page_pagination['next_page'])) { ?> <a href="<?php echo $page_pagination['next_page']['url']; ?> " class="next" title="<?php echo ___('Next page'); ?> <?php echo $page_attr_str; ?> " ><span class="tx"><?php echo $page_str; ?> <?php echo ___('Next page'); ?> </span><i class="fa fa-chevron-right"></i></a> <?php } else { ?> <a href="javascript:;" class="next" title="<?php echo ___('Next page'); ?> <?php echo $page_attr_str; ?> " ><span class="tx"><?php echo $page_str; ?> <?php echo ___('Next page'); ?> </span><i class="fa fa-chevron-right"></i></a> <?php } ?> </nav> <?php $cache = html_minify(ob_get_contents()); ob_end_clean(); theme_cache::set($cache_id, $cache, $cache_group, 3600); echo $cache; unset($cache); }
/** * wp nav menu from cache * * @param string The widget sidebar name/id * @param int Cache expire time * @return string * @version 2.1.1 */ public static function wp_nav_menu($args, $expire = 3600) { $cache_group_id = 'nav-menu'; $cache_id = md5(self::get_page_prefix() . json_encode($args)); $cache = self::get($cache_id, $cache_group_id); $exists_key = self::get_keys($cache_id, $cache_group_id); if ($exists_key && $cache) { echo $cache; unset($cache); return; } if (!$cache) { ob_start(); wp_nav_menu($args); $cache = html_minify(ob_get_contents()); ob_end_clean(); self::set($cache_id, $cache, $cache_group_id, $expire); } if (!$exists_key) { self::set_key($cache_id, $cache_group_id); } echo $cache; unset($cache); return; }
public static function display_frontend() { $device = wp_is_mobile() ? 'mobile' : 'desktop'; $type = wp_is_mobile() ? 'scroller' : self::get_type(); $cache = (array) theme_cache::get(__CLASS__); if (isset($cache[$device])) { echo $cache[$device]; unset($cache); return; } ob_start(); $type = 'display_frontend_' . $type; self::$type(); /** ad */ if (!empty(self::display_frontend_ad('below'))) { ?> <div class="g <?php echo __CLASS__; ?> -ad-below"><?php echo self::display_frontend_ad('below'); ?> </div> <?php } $cache[$device] = html_minify(ob_get_contents()); ob_end_clean(); theme_cache::set(__CLASS__, $cache); echo $cache[$device]; unset($cache); }
public static function get_tpl_meta_box($placeholder = '%placeholder%', array $meta = []) { $name = isset($meta[$placeholder]['name']) ? esc_attr($meta[$placeholder]['name']) : null; $url = isset($meta[$placeholder]['url']) ? esc_attr($meta[$placeholder]['url']) : null; $download_pwd = isset($meta[$placeholder]['download-pwd']) ? esc_attr($meta[$placeholder]['download-pwd']) : null; $extract_pwd = isset($meta[$placeholder]['extract-pwd']) ? esc_attr($meta[$placeholder]['extract-pwd']) : null; ob_start(); ?> <p class="<?php echo __CLASS__; ?> -item item" id="<?php echo __CLASS__; ?> -item-<?php echo $placeholder; ?> "> <?php if (self::is_enabled_display_name()) { ?> <input type="text" name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][name]" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -name" class="widefat" placeholder="<?php echo ___('Name (optional)'); ?> " title="<?php echo ___('Name (optional)'); ?> " value="<?php echo $name; ?> " > <?php } ?> <input type="text" name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][url]" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -url" class="widefat" placeholder="<?php echo ___('Download page URL (include http://)'); ?> " title="<?php echo ___('Download page URL (include http://)'); ?> " value="<?php echo $url; ?> " > <input type="text" name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][download-pwd]" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -download-pwd" class="widefat" placeholder="<?php echo ___('Download password (optional)'); ?> " title="<?php echo ___('Download password (optional)'); ?> " value="<?php echo $download_pwd; ?> " > <input type="text" name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][extract-pwd]" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -extract-pwd" class="widefat" placeholder="<?php echo ___('Extract password (optional)'); ?> " title="<?php echo ___('Extract password (optional)'); ?> " value="<?php echo $extract_pwd; ?> " > <a href="javascript:;" class="del" data-target="<?php echo __CLASS__; ?> -item-<?php echo $placeholder; ?> ">↑ <?php echo ___('Delete this item'); ?> </a> </p> <?php $html = html_minify(ob_get_contents()); ob_end_clean(); return $html; }
private static function get_preview(array $posts = []) { /** * check posts count number */ $count = count($posts); if ($count < self::get_posts_number('min')) { $output['status'] = 'error'; $output['code'] = 'not_enough_posts'; $output['msg'] = ___('Sorry, your posts are not enough, please add more posts.'); die(theme_features::json_format($output)); } if ($count > self::get_posts_number('max')) { $output['status'] = 'error'; $output['code'] = 'too_many_posts'; $output['msg'] = ___('Sorry, your post are too many, please reduce some posts and try again.'); die(theme_features::json_format($output)); } /** * template */ $tpl = ''; /** * check each posts value */ foreach ($posts as $k => $v) { /** post id */ $post_id = isset($v['post-id']) && is_string($v['post-id']) ? trim($v['post-id']) : null; if (empty($post_id)) { $output['status'] = 'error'; $output['code'] = 'invaild_post_content'; $output['list-id'] = $k; $output['msg'] = ___('Sorry, the post id is invaild, please try again.'); die(theme_features::json_format($output)); } /** title */ $title = isset($v['post-title']) && is_string($v['post-title']) ? strip_tags(trim($v['post-title'])) : null; if (empty($title)) { $output['status'] = 'error'; $output['code'] = 'invaild_post_title'; $output['list-id'] = $k; $output['msg'] = ___('Sorry, the post title is invaild, please try again.'); die(theme_features::json_format($output)); } /** content */ $content = isset($v['post-content']) && is_string($v['post-content']) ? trim($v['post-content']) : null; if (empty($content)) { $output['status'] = 'error'; $output['code'] = 'invaild_post_content'; $output['list-id'] = $k; $output['msg'] = ___('Sorry, the post content is invaild, please try again.'); die(theme_features::json_format($output)); } /** thumbmail */ $thumbnail = isset($v['thumbnail-url']) && is_string($v['thumbnail-url']) ? esc_url(trim($v['thumbnail-url'])) : null; if (empty($thumbnail)) { $output['status'] = 'error'; $output['code'] = 'invaild_post_thumbnail'; $output['list-id'] = $k; $output['msg'] = ___('Sorry, the post thumbnail is invaild, please try again.'); die(theme_features::json_format($output)); } /** check post exists */ $url = esc_url(theme_cache::get_permalink($v['post-id'])); if (empty($url)) { $output['status'] = 'error'; $output['code'] = 'post_not_exist'; $output['list-id'] = $k; $output['msg'] = ___('Sorry, the post do not exist, please try again.'); die(theme_features::json_format($output)); } /** * create template */ $tpl .= self::get_list_tpl(['post_id' => $post_id, 'preview' => false, 'hash' => $k, 'url' => $url, 'thumbnail' => $thumbnail, 'title' => $title, 'content' => $content]); } return '<div class="collection-list list-group">' . html_minify($tpl) . '</div>'; }
public static function display_frontend() { set_time_limit(0); $cache_id = 'display-frontend'; $cache = theme_cache::get($cache_id, __CLASS__); //$cache = false; if (!empty($cache)) { echo $cache; unset($cache); return; } ob_start(); $whitelist = (array) self::get_options('whitelist'); if (isset($whitelist['user-ids']) && !empty($whitelist['user-ids'])) { $whitelist = explode(',', $whitelist['user-ids']); } else { $whitelist = null; } global $post; $query = new WP_Query(['author__in' => $whitelist, 'ignore_sticky_posts' => true, 'nopaging' => true, 'post_type' => 'post']); if (!$query->have_posts()) { self::no_content(__('No posts found.')); return false; } //var_dump(count($query->posts));die; $pinyin_tags = self::get_tags($query->posts); unset($query); //var_dump($pinyin_tags);die; if (!$pinyin_tags) { self::no_content(__('No tags found.')); return false; } foreach ($pinyin_tags as $initial => $tags) { //var_dump($tags);die; ?> <div class="panel-tags-index mod panel"> <div class="heading"> <h2 class="title"> <span class="bg"> <span class="tx"><?php echo strtoupper($initial); ?> </span> <small> - <?php echo ___('Pinyin initial'); ?> </small> </span> </h2> </div> <div class="row"> <?php foreach ($tags as $tag_id => $tag) { ?> <div class="g-phone-1-2 g-tablet-1-3 g-desktop-1-4"> <a href="<?php echo esc_url(get_tag_link($tag_id)); ?> " class="tags-title" target="_blank"><?php echo $tag['name']; ?> </a> <small>(<?php echo count($tag['post_ids']); ?> )</small> </div> <?php } ?> </div> </div> <?php } unset($pinyin_tags); $cache = html_minify(ob_get_contents()); ob_end_clean(); wp_cache_set($cache_id, $cache, __CLASS__, 86400 * 7); /** 7days */ echo $cache; unset($cache); }
public static function the_recommend_posts(array $args = []) { $cache = theme_cache::get('recommend', 'page-rank'); if (!empty($cache)) { echo $cache; return $cache; } global $post; $args = array_merge(['posts_per_page ' => 100, 'paged' => 1, 'orderby' => 'rand', 'post__in' => theme_recommended_post::get_ids(), 'ignore_sticky_posts' => false], $args); $query = new WP_Query($args); ob_start(); if ($query->have_posts()) { ?> <div class="list-group"> <?php $i = 1; foreach ($query->posts as $post) { setup_postdata($post); self::rank_img_content(['index' => $i, 'lazyload' => $i <= 5 ? false : true]); ++$i; } ?> </div> <?php wp_reset_postdata(); } else { } $cache = html_minify(ob_get_contents()); ob_end_clean(); theme_cache::set('recommend', $cache, 'page-rank', 3600); echo $cache; return $cache; }
public static function get_tpl_backend($placeholder = '%placeholder%', array $item = []) { $name = isset($item[$placeholder]['name']) ? esc_attr($item[$placeholder]['name']) : null; $type = isset($item[$placeholder]['type']) ? $item[$placeholder]['type'] : 'standard'; $des = isset($item[$placeholder]['des']) ? esc_attr($item[$placeholder]['des']) : null; $question = isset($item[$placeholder]['question']) ? esc_attr($item[$placeholder]['question']) : null; $success = isset($item[$placeholder]['success']) ? esc_attr($item[$placeholder]['success']) : null; $comment = isset($item[$placeholder]['comment']) ? esc_attr($item[$placeholder]['comment']) : null; ob_start(); ?> <table id="<?php echo __CLASS__; ?> -item-<?php echo $placeholder; ?> " class="form-table item tpl-item" data-placeholder="<?php echo $placeholder; ?> "> <tbody> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -name"><?php echo ___('Name'); ?> - <?php echo $placeholder; ?> </label></th> <td> <input name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][name]" type="text" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -name" value="<?php echo $name; ?> " placeholder="<?php echo ___('The item name, short is better'); ?> " class="widefat"> </td> </tr> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -type"><?php echo ___('Type'); ?> </label></th> <td> <select name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][type]" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -type" class="widefat"> <?php the_option_list('standard', ___('Standard'), $type); ?> <?php the_option_list('custom', ___('Custom'), $type); ?> </select> </td> </tr> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -question"><?php echo ___('Question'); ?> </label></th> <td> <input name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][question]" type="text" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -question" value="<?php echo $question; ?> " placeholder="<?php echo ___('The item question, only shows in custom type'); ?> " class="widefat"> </td> </tr> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -des"><?php echo ___('Description'); ?> </label></th> <td> <input name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][des]" type="text" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -des" value="<?php echo $des; ?> " placeholder="<?php echo ___('The item description'); ?> " class="widefat"> </td> </tr> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -success"><?php echo ___('After successful reported'); ?> </label></th> <td> <input name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][success]" type="text" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -success" value="<?php echo $success; ?> " placeholder="<?php echo ___('The item after successful reported tip'); ?> " class="widefat"> </td> </tr> <tr> <th><label for="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -comment"><?php echo ___('Comment content'); ?> </label></th> <td> <input name="<?php echo __CLASS__; ?> [<?php echo $placeholder; ?> ][comment]" type="text" id="<?php echo __CLASS__; ?> -<?php echo $placeholder; ?> -comment" value="<?php echo $comment; ?> " placeholder="<?php echo ___('The item comment content'); ?> " class="widefat"> </td> </tr> <tr> <th><?php echo ___('Control'); ?> </th> <td> <a href="javascript:;" class="del" data-target="<?php echo __CLASS__; ?> -item-<?php echo $placeholder; ?> "><i class="fa fa-exclamation-circle"></i> <?php echo ___('Delete this item'); ?> </a> </td> </tr> </tbody> </table> <?php $html = html_minify(ob_get_contents()); ob_end_clean(); return $html; }
/** * Выводит окончательный вид страницы в браузер */ public function renderPage() { $config = $this->site_config; $layout = $this->getLayout(); $template_file = $this->getTplFilePath($layout . '.tpl.php'); $device_type = cmsRequest::getDeviceType(); if ($template_file) { if (!$config->min_html) { include $template_file; } if ($config->min_html) { ob_start(); include $template_file; echo html_minify(ob_get_clean()); } } else { cmsCore::error(ERR_TEMPLATE_NOT_FOUND . ': ' . $this->name . ':' . $layout); } }