当前位置: 首页>>代码示例>>PHP>>正文


PHP ThemeHelper::removeUIndex方法代码示例

本文整理汇总了PHP中ThemeHelper::removeUIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemeHelper::removeUIndex方法的具体用法?PHP ThemeHelper::removeUIndex怎么用?PHP ThemeHelper::removeUIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThemeHelper的用法示例。


在下文中一共展示了ThemeHelper::removeUIndex方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPost

 function getPost()
 {
     global $fable_parentPost;
     $Validation = new ThemeValidation();
     $argument = array();
     $s = get_query_var('s');
     $tag = get_query_var('tag');
     $year = (int) get_query_var('year');
     $month = (int) get_query_var('monthnum');
     $categoryId = (int) get_query_var('cat');
     if ($Validation->isNotEmpty($s)) {
         $argument['s'] = $s;
     }
     if ($Validation->isNotEmpty($tag)) {
         $argument['tag'] = $tag;
     }
     if ($categoryId > 0) {
         $argument['cat'] = (int) $categoryId;
     } elseif ($year > 0 && $month > 0) {
         $argument['year'] = $year;
         $argument['monthnum'] = $month;
     }
     if (!($categoryId > 0)) {
         $option = ThemeOption::getPostMeta($fable_parentPost->post);
         ThemeHelper::removeUIndex($option, 'page_post_category');
         if (is_array($option['page_post_category'])) {
             if (count($option['page_post_category'])) {
                 $argument['cat'] = implode(',', array_map('intval', $option['page_post_category']));
             }
         }
     }
     $default = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => (int) get_option('posts_per_page'), 'paged' => (int) ThemeHelper::getPageNumber(), 'orderby' => ThemeOption::getOption('blog_sort_field'), 'order' => ThemeOption::getOption('blog_sort_direction'));
     $query = new WP_Query(array_merge($argument, $default));
     return $query;
 }
开发者ID:slavai,项目名称:sadick,代码行数:35,代码来源:Theme.Blog.class.php

示例2: form

 function form($instance)
 {
     $data = array();
     if (is_array($instance['_data']['field'])) {
         foreach ($instance['_data']['field'] as $value) {
             ThemeHelper::removeUIndex($instance, $value);
             ThemeHelper::removeUIndex($data['option'][$value], 'id', 'name', 'value');
             $data['option'][$value]['id'] = $this->get_field_id($value);
             $data['option'][$value]['name'] = $this->get_field_name($value);
             $data['option'][$value]['value'] = $instance[$value];
         }
     }
     $Template = new ThemeTemplate($data, THEME_PATH_TEMPLATE . 'admin/' . $instance['_data']['file']);
     echo $Template->output(true);
 }
开发者ID:annguyenit,项目名称:fable.local,代码行数:15,代码来源:Theme.Widget.class.php

示例3: ThemeValidation

$Validation = new ThemeValidation();
$WidgetArea = new ThemeWidgetArea();
$widgetAreaData = $WidgetArea->getWidgetAreaByPost($fable_parentPost->post, true, true);
$query = $Blog->getPost();
$postCount = count($query->posts);
if ($postCount) {
    ?>
		<div class="theme-clear-fix">
			
			<ul class="theme-reset-list theme-clear-fix theme-blog">
<?php 
    while ($query->have_posts()) {
        $query->the_post();
        $excerpt = apply_filters('the_content', get_the_excerpt());
        $option = ThemeOption::getPostMeta($post);
        ThemeHelper::removeUIndex($option, 'post_type');
        $visibleOption = array();
        $visibleOption['post_tag_visible'] = ThemeOption::getGlobalOption($post, 'post_tag_visible');
        $visibleOption['post_author_visible'] = ThemeOption::getGlobalOption($post, 'post_author_visible');
        $visibleOption['post_category_visible'] = ThemeOption::getGlobalOption($post, 'post_category_visible');
        $visibleOption['post_comment_count_visible'] = ThemeOption::getGlobalOption($post, 'post_comment_count_visible') && comments_open(get_the_id());
        ?>
				<li id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class('theme-clear-fix theme-post theme-post-type-' . (is_sticky() ? 'sticky' : $option['post_type']));
        ?>
>
<?php 
        $Post->formatPostDate($post->post_date, $day, $month, $year);
开发者ID:slavai,项目名称:sadick,代码行数:31,代码来源:blog-content.php

示例4: setWidgetAreaLayout

 function setWidgetAreaLayout($postId)
 {
     $Layout = new ThemeLayout();
     $option = ThemeOption::getPostMeta($postId);
     ThemeHelper::removeUIndex($option, 'widget_area_footer_layout');
     $this->widgetAreaLayout = $option['widget_area_footer_layout'];
     return $Layout->getLayoutCSSClass($this->widgetAreaLayout);
 }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:8,代码来源:Theme.WidgetArea.class.php

示例5: displayHeader

    function displayHeader($post)
    {
        $html = null;
        if (is_home()) {
            return $html;
        }
        $option = ThemeOption::getPostMeta($post);
        $Validation = new ThemeValidation();
        if (ThemeOption::getGlobalOption($post, 'header_enable')) {
            ThemeHelper::removeUIndex($option, 'header_background_color', 'header_background_image_src', 'header_background_image_position', 'header_background_image_size_1', 'header_background_image_size_2', 'header_text_color', 'header_subheader_text_color', 'header_subheader');
            $subheaderHTML = null;
            $style = array(array(), array(), array());
            if ($Validation->isColor($option['header_background_color'])) {
                $style[0]['background-color'] = ThemeColor::getColor($option['header_background_color']);
            }
            if (!in_array($option['header_background_image_src'], array('-1', 'none'))) {
                if ($Validation->isNotEmpty($option['header_background_image_src'])) {
                    $style[0]['background-image'] = 'url(\'' . $option['header_background_image_src'] . '\')';
                } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_src'))) {
                    $style[0]['background-image'] = 'url(\'' . ThemeOption::getGlobalOption(null, 'header_background_image_src') . '\')';
                }
            }
            if (array_key_exists('background-image', $style[0])) {
                $style[0]['background-repeat'] = ThemeOption::getGlobalOption($post, 'header_background_image_repeat');
                if ($Validation->isNotEmpty($option['header_background_image_position'])) {
                    $style[0]['background-position'] = $option['header_background_image_position'];
                } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_position'))) {
                    $style[0]['background-position'] = ThemeOption::getGlobalOption(null, 'header_background_image_position');
                }
                $style[0]['background-size'] = ThemeOption::getGlobalOption($post, 'header_background_image_size_1');
                if (in_array($style[0]['background-size'], array('length', 'percentage'))) {
                    if ($Validation->isNotEmpty($option['header_background_image_size_2'])) {
                        $style[0]['background-size'] = $option['header_background_image_size_2'];
                    } elseif ($Validation->isNotEmpty(ThemeOption::getGlobalOption(null, 'header_background_image_size_2'))) {
                        $style[0]['background-size'] = ThemeOption::getGlobalOption(null, 'header_background_image_size_2');
                    }
                }
            }
            if ($Validation->isColor($option['header_text_color'])) {
                $style[1]['color'] = ThemeColor::getColor($option['header_text_color']);
            }
            if ($Validation->isColor($option['header_subheader_text_color'])) {
                $style[2]['color'] = ThemeColor::getColor($option['header_subheader_text_color']);
            }
            if ($Validation->isNotEmpty($option['header_subheader'])) {
                $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $option['header_subheader'] . '</h6>';
            } elseif ($post->post_type == 'post') {
                $Post = new ThemePost();
                $Post->formatPostDate($post->post_date, $day, $month, $year);
                $subheaderHTML = '<h6' . ThemeHelper::createStyleAttribute($style[2]) . '>' . $month . ' ' . $day . ', ' . $year . '</h6>';
            }
            $html = '
				<div class="theme-page-header" ' . ThemeHelper::createStyleAttribute($style[0]) . '>
					<div class="theme-main">
						<h1 ' . ThemeHelper::createStyleAttribute($style[1]) . '>' . $post->post_title . '</h1>
						' . $subheaderHTML . '
					</div>
				</div>
			';
        }
        return $html;
    }
开发者ID:annguyenit,项目名称:fable.local,代码行数:62,代码来源:Theme.Page.class.php

示例6: ob_start

ob_start();
?>
<!DOCTYPE html>
<?php 
global $post, $fable_parentPost;
$Theme = new Theme();
$Post = new ThemePost();
$Page = new ThemePage();
$Menu = new ThemeMenu();
$Validation = new ThemeValidation();
if (($fable_parentPost = $Post->getPost()) === false) {
    $fable_parentPost = new stdClass();
    $fable_parentPost->post = $post;
}
$meta = ThemeOption::getPostMeta($post);
ThemeHelper::removeUIndex($meta, 'page_background_color');
?>
		<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes();
?>
>

			<head>
				<title><?php 
wp_title('|');
?>
</title> 
				<meta http-equiv="Content-Type" content="<?php 
bloginfo('html_type');
?>
; charset=<?php 
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:31,代码来源:header.php

示例7: validateProperty

 function validateProperty($property)
 {
     $data = array();
     $Validation = new ThemeValidation();
     foreach ($property as $name => $value) {
         $unit = 'px';
         if (is_array($value)) {
             if (isset($value['unit'])) {
                 $unit = $value['unit'];
             }
             if (isset($value['value'])) {
                 $value = $value['value'];
             }
         }
         switch ($name) {
             case 'left':
             case 'width':
             case 'height':
             case 'font-size':
             case 'padding-top':
             case 'padding-left':
             case 'padding-right':
             case 'padding-bottom':
             case 'border-width':
                 if ($Validation->isNumber($value, 0, 9999)) {
                     $data[$name] = $value . $unit;
                 }
                 break;
             case 'top':
             case 'margin-top':
             case 'margin-left':
             case 'margin-right':
             case 'margin-bottom':
                 if ($Validation->isNumber($value, -9999, 9999)) {
                     $data[$name] = $value . $unit;
                 }
                 break;
             case 'color':
             case 'border-color':
             case 'border-top-color':
             case 'border-right-color':
             case 'border-bottom-color':
             case 'border-left-color':
             case 'outline-color':
             case 'background-color':
                 $value = ThemeColor::getColor($value);
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = $value;
                 }
                 break;
             case 'font-family':
                 foreach ((array) $value as $family) {
                     if ($Validation->isNotEmpty($family)) {
                         ThemeHelper::removeUIndex($data, $name);
                         if ($Validation->isNotEmpty($data[$name])) {
                             $data[$name] .= ',';
                         }
                         $data[$name] .= '\'' . $family . '\'';
                     }
                 }
                 break;
             case 'font-style':
                 if (isset($this->fontStyle[$value])) {
                     $data[$name] = $value;
                 }
                 break;
             case 'font-weight':
                 if (isset($this->fontWeight[$value])) {
                     $data[$name] = $value;
                 }
                 break;
             case 'display':
             case 'border-style':
             case 'line-height':
             case 'background':
             case 'background-repeat':
             case 'background-position':
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = $value;
                 }
                 break;
             case 'background-image':
                 if ($Validation->isNotEmpty($value)) {
                     $data[$name] = 'url(\'' . $value . '\',THEME_CONTEXT)';
                 }
                 break;
         }
     }
     return $data;
 }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:90,代码来源:Theme.CSS.class.php

示例8: setupNavigationMenuItemField

 function setupNavigationMenuItemField($menu_item)
 {
     $meta = get_post_meta($menu_item->ID, 'pb_meta', true);
     ThemeHelper::removeUIndex($meta, 'menu_item_icon', 'menu_item_mega_menu_enable', 'menu_item_mega_menu_layout');
     $menu_item->icon = $meta['menu_item_icon'];
     $menu_item->mega_menu_enable = $meta['menu_item_mega_menu_enable'];
     $menu_item->mega_menu_layout = $meta['menu_item_mega_menu_layout'];
     return $menu_item;
 }
开发者ID:slavai,项目名称:sadick,代码行数:9,代码来源:Theme.Menu.class.php

示例9: adminOptionPanelSave

 function adminOptionPanelSave()
 {
     $option = ThemeHelper::getPostOption();
     ThemeHelper::removeUIndex($option, 'maintenance_mode_user_id');
     $response = array('global' => array('error' => 1));
     $CSS = new ThemeCSS();
     $Blog = new ThemeBlog();
     $Notice = new ThemeNotice();
     $Easing = new ThemeEasing();
     $FancyBox = new ThemeFancybox();
     $Background = new ThemeBackground();
     $Validation = new ThemeValidation($Notice);
     $ResponsiveMode = new ThemeResponsiveMode($this->responsiveMode);
     $media = $ResponsiveMode->getMedia();
     $invalidValue = esc_html__('Invalid value', THEME_DOMAIN);
     /* Main */
     $Validation->notice('isNumber', array($option['header_enable'], 0, 1), array(ThemeHelper::getFormName('header_enable', false), $invalidValue));
     if (!array_key_exists($option['header_background_image_repeat'], $Background->backgroundRepeat)) {
         $Notice->addError(ThemeHelper::getFormName('header_background_image_repeat', false), $invalidValue);
     }
     if (!array_key_exists($option['header_background_image_size_1'], $Background->backgroundSize)) {
         $Notice->addError(ThemeHelper::getFormName('header_background_image_size_1', false), $invalidValue);
     }
     /* Blog */
     if (!in_array($option['blog_sort_field'], array_keys($Blog->sortPostBlogField))) {
         $Notice->addError(ThemeHelper::getFormName('blog_sort_field', false), $invalidValue);
     }
     if (!in_array($option['blog_sort_direction'], array_keys($Blog->sortDirection))) {
         $Notice->addError(ThemeHelper::getFormName('blog_sort_direction', false), $invalidValue);
     }
     $Validation->notice('isNumber', array($option['blog_automatic_excerpt_length'], 0, 999), array(ThemeHelper::getFormName('blog_automatic_excerpt_length', false), $invalidValue));
     /* Post */
     $Validation->notice('isNumber', array($option['post_category_visible'], 0, 1), array(ThemeHelper::getFormName('post_category_visible', false), $invalidValue));
     $Validation->notice('isNumber', array($option['post_author_visible'], 0, 1), array(ThemeHelper::getFormName('post_author_visible', false), $invalidValue));
     $Validation->notice('isNumber', array($option['post_tag_visible'], 0, 1), array(ThemeHelper::getFormName('post_tag_visible', false), $invalidValue));
     $Validation->notice('isNumber', array($option['post_comment_count_visible'], 0, 1), array(ThemeHelper::getFormName('post_comment_count_visible', false), $invalidValue));
     $Validation->notice('isNumber', array($option['post_navigation_visible'], 0, 1), array(ThemeHelper::getFormName('post_navigation_visible', false), $invalidValue));
     /* Plugins / Menu top */
     if (!in_array($option['menu_responsive_mode'], $this->responsiveMode)) {
         $Notice->addError(ThemeHelper::getFormName('menu_responsive_mode', false), $invalidValue);
     }
     $Validation->notice('isNumber', array($option['menu_sticky_enable'], 0, 1), array(ThemeHelper::getFormName('menu_sticky_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_hide_scroll_enable'], 0, 1), array(ThemeHelper::getFormName('menu_hide_scroll_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_animation_enable'], 0, 1), array(ThemeHelper::getFormName('menu_animation_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_animation_speed_open'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_speed_open', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_animation_speed_close'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_speed_close', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_animation_delay'], 0, 99999), array(ThemeHelper::getFormName('menu_animation_delay', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_scroll_animation_enable'], 0, 1), array(ThemeHelper::getFormName('menu_scroll_animation_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['menu_scroll_animation_speed'], 0, 99999), array(ThemeHelper::getFormName('menu_scroll_animation_speed', false), $invalidValue));
     if (!in_array($option['menu_scroll_animation_easing'], array_keys($Easing->easingType))) {
         $Notice->addError(ThemeHelper::getFormName('menu_scroll_animation_easing', false), $invalidValue);
     }
     /* Footer */
     $Validation->notice('isNumber', array($option['footer_enable'], 0, 1), array(ThemeHelper::getFormName('footer_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['footer_sticky_enable'], 0, 1), array(ThemeHelper::getFormName('footer_sticky_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['footer_top_enable'], 0, 1), array(ThemeHelper::getFormName('footer_top_enable', false), $invalidValue));
     if (!array_key_exists($option['footer_top_background_image_repeat'], $Background->backgroundRepeat)) {
         $Notice->addError(ThemeHelper::getFormName('footer_top_background_image_repeat', false), $invalidValue);
     }
     if (!array_key_exists($option['footer_top_background_image_size_1'], $Background->backgroundSize)) {
         $Notice->addError(ThemeHelper::getFormName('footer_top_background_image_size_1', false), $invalidValue);
     }
     $Validation->notice('isNumber', array($option['footer_bottom_enable'], 0, 1), array(ThemeHelper::getFormName('footer_bottom_enable', false), $invalidValue));
     /* Content copying */
     $Validation->notice('isNumber', array($option['right_click_enable'], 0, 1), array(ThemeHelper::getFormName('right_click_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['copy_selection_enable'], 0, 1), array(ThemeHelper::getFormName('copy_selection_enable', false), $invalidValue));
     /* Responsive mode */
     $Validation->notice('isNumber', array($option['responsive_mode_enable'], 0, 1), array(ThemeHelper::getFormName('responsive_mode_enable', false), $invalidValue));
     /* Go to page to */
     $Validation->notice('isNumber', array($option['go_to_page_top_enable'], 0, 1), array(ThemeHelper::getFormName('go_to_page_top_enable', false), $invalidValue));
     $Validation->notice('isNotEmpty', array($option['go_to_page_top_hash']), array(ThemeHelper::getFormName('go_to_page_top_hash', false), $invalidValue));
     $Validation->notice('isNumber', array($option['go_to_page_top_animation_enable'], 0, 1), array(ThemeHelper::getFormName('go_to_page_top_animation_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['go_to_page_top_animation_duration'], 0, 99999), array(ThemeHelper::getFormName('go_to_page_top_animation_duration', false), $invalidValue));
     if (!in_array($option['go_to_page_top_animation_easing'], array_keys($Easing->easingType))) {
         $Notice->addError(ThemeHelper::getFormName('go_to_page_top_animation_easing', false), $invalidValue);
     }
     /* Font */
     $font = array('base', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6');
     foreach ($font as $value) {
         foreach ($media as $mediaIndex => $mediaValue) {
             $Validation->notice('isNumber', array($option['font_' . $value . '_size_' . $mediaIndex], 1, 100), array(ThemeHelper::getFormName('font_' . $value . '_size_' . $mediaIndex, false), $invalidValue));
         }
         if (!in_array($option['font_' . $value . '_style'], array_keys($CSS->fontStyle))) {
             $Notice->addError(ThemeHelper::getFormName('font_' . $value . '_style', false), $invalidValue);
         }
         if (!in_array($option['font_' . $value . '_weight'], array_keys($CSS->fontWeight))) {
             $Notice->addError(ThemeHelper::getFormName('font_' . $value . '_weight', false), $invalidValue);
         }
     }
     /* Plugin / Fancybox for images */
     $Validation->notice('isNumber', array($option['fancybox_image_padding'], 0, 999), array(ThemeHelper::getFormName('fancybox_image_padding', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_margin'], 0, 999), array(ThemeHelper::getFormName('fancybox_image_margin', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_min_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_min_width', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_min_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_min_height', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_max_width'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_max_width', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_max_height'], 1, 9999), array(ThemeHelper::getFormName('fancybox_image_max_height', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_helper_button_enable'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_helper_button_enable', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_autoresize'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_autoresize', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_autocenter'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_autocenter', false), $invalidValue));
     $Validation->notice('isNumber', array($option['fancybox_image_fittoview'], 0, 1), array(ThemeHelper::getFormName('fancybox_image_fittoview', false), $invalidValue));
//.........这里部分代码省略.........
开发者ID:slavai,项目名称:sadick,代码行数:101,代码来源:Theme.class.php


注:本文中的ThemeHelper::removeUIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。