Exemplo n.º 1
0
 /**
  * Fields settings
  */
 static function field_settings()
 {
     $prefix = 'field-';
     $prefix2 = 'show-' . $prefix;
     $result = array(array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'width' => 12)), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_display_settings()))), !get_option('pt_cv_version_pro') ? PT_CV_Settings::get_cvpro(__('Display Title above Thumbnail ?', PT_CV_TEXTDOMAIN), 12, 'margin-top: -15px; margin-bottom: 5px;') : '', apply_filters(PT_CV_PREFIX_ . 'settings_title_display', array(), $prefix, $prefix2), array('label' => array('text' => __('Thumbnail settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('group-class' => PT_CV_PREFIX . 'field-setting', 'wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'thumbnail-setting' . ' ' . PT_CV_PREFIX . 'w50')), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_thumbnail_settings($prefix))), 'dependence' => array($prefix2 . 'thumbnail', 'yes')), array('label' => array('text' => __('Content settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'content-setting')), 'params' => array(array('type' => 'radio', 'name' => $prefix . 'content-show', 'options' => array('full' => __('Show Full Content', PT_CV_TEXTDOMAIN), 'excerpt' => __('Show Excerpt', PT_CV_TEXTDOMAIN)), 'std' => 'excerpt')), 'dependence' => array($prefix2 . 'content', 'yes')), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'excerpt-setting', 'wrap-id' => PT_CV_Html::html_group_id('excerpt-settings'))), 'params' => array(array('type' => 'group', 'params' => apply_filters(PT_CV_PREFIX_ . 'excerpt_settings', array(array('label' => array('text' => __('Excerpt settings', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'number', 'name' => $prefix . 'excerpt-length', 'std' => '20', 'placeholder' => 'e.g. 20', 'append_text' => 'words', 'desc' => __('Generating excerpt by selecting the first X words of the content', PT_CV_TEXTDOMAIN)))), !get_option('pt_cv_version_pro') ? PT_CV_Settings::get_cvpro(__('Use manual excerpt, change "Read More" text ?', PT_CV_TEXTDOMAIN), 9) : '', array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_PREFIX . 'full-fields')), 'params' => array(array('type' => 'checkbox', 'name' => $prefix . 'excerpt-allow_html', 'options' => PT_CV_Values::yes_no('yes', __('Allow HTML tags (a, br, strong, em, strike, i, ul, ol, li) in excerpt', PT_CV_TEXTDOMAIN)), 'std' => '')))), $prefix . 'excerpt-'))), 'dependence' => array(array($prefix . 'content-show', 'excerpt'))), array('label' => array('text' => __('Meta fields settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'metafield-setting', 'wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'meta-fields-settings')), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_meta_fields('meta-fields-'), 'desc' => apply_filters(PT_CV_PREFIX_ . 'settings_sort_text', ''))), 'dependence' => array($prefix2 . 'meta-fields', 'yes')), apply_filters(PT_CV_PREFIX_ . 'settings_taxonomies_display', array(), 'meta-fields-'));
     $result = apply_filters(PT_CV_PREFIX_ . 'field_settings', $result, $prefix2);
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Fields settings
  */
 static function field_settings()
 {
     $prefix = 'field-';
     $prefix2 = 'show-' . $prefix;
     $result = array(array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'width' => 12)), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_display_settings()))), !get_option('pt_cv_version_pro') ? array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'html', 'content' => sprintf('<p class="text-muted" style="margin-top: -10px; margin-bottom: 15px;">&rarr; %s</p>', __('Customize display order of above fields by a simple drag-and-drop ?', PT_CV_DOMAIN) . sprintf(' <a href="%s" target="_blank">%s</a>', esc_url('http://www.contentviewspro.com/pricing/?utm_source=client&utm_medium=view'), __('Please upgrade to Pro', PT_CV_DOMAIN)))))) : '', apply_filters(PT_CV_PREFIX_ . 'settings_title_display', array(), $prefix, $prefix2), array('label' => array('text' => __('Thumbnail settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'thumbnail-setting' . ' ' . PT_CV_PREFIX . 'w50')), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_thumbnail_settings($prefix))), 'dependence' => array($prefix2 . 'thumbnail', 'yes')), array('label' => array('text' => __('Content settings', PT_CV_DOMAIN)), 'params' => array(array('type' => 'radio', 'name' => $prefix . 'content-show', 'options' => array('full' => __('Show Full Content', PT_CV_DOMAIN), 'excerpt' => __('Show Excerpt', PT_CV_DOMAIN)), 'std' => 'excerpt')), 'dependence' => array($prefix2 . 'content', 'yes')), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-id' => PT_CV_Html::html_group_id('excerpt-settings'))), 'params' => array(array('type' => 'group', 'params' => apply_filters(PT_CV_PREFIX_ . 'excerpt_settings', array(array('label' => array('text' => __('Excerpt settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('width' => 9)), 'params' => array(array('type' => 'number', 'name' => $prefix . 'excerpt-length', 'std' => '20', 'placeholder' => 'e.g. 20', 'append_text' => 'words', 'desc' => __('Generating excerpt by selecting the first X words of the content', PT_CV_DOMAIN)))), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_PREFIX . 'full-fields', 'width' => 9)), 'params' => array(array('type' => 'checkbox', 'name' => $prefix . 'excerpt-allow_html', 'options' => PT_CV_Values::yes_no('yes', __('Allow HTML tags (a, br, strong, em, strike, i, ul, ol, li) in excerpt', PT_CV_DOMAIN)), 'std' => '', 'desc' => __('This option can cause broken HTML output. Please be careful when check it', PT_CV_DOMAIN))))), $prefix . 'excerpt-'))), 'dependence' => array(array($prefix . 'content-show', 'excerpt'))), array('label' => array('text' => __('Meta fields settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'meta-fields-settings')), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_meta_fields('meta-fields-'), 'desc' => apply_filters(PT_CV_PREFIX_ . 'settings_sort_text', ''))), 'dependence' => array($prefix2 . 'meta-fields', 'yes')), apply_filters(PT_CV_PREFIX_ . 'settings_taxonomies_display', array(), 'meta-fields-'));
     $result = apply_filters(PT_CV_PREFIX_ . 'field_settings', $result, $prefix2);
     return $result;
 }
Exemplo n.º 3
0
        /**
         * Print inline js
         */
        public static function print_js()
        {
            $toggle_data_js = json_encode(self::$dependence_info);
            ?>
			<script>
				( function ( $ ) {
					"use strict";

					$( function () {
						var _prefix = '<?php 
            echo esc_js(PT_CV_PREFIX);
            ?>
';
						var $pt_cv_admin_js = new $.PT_CV_Admin( { _prefix: _prefix } );
						var group_prefix = '<?php 
            echo esc_js(PT_CV_Html::html_group_class());
            ?>
' + '-';

						// Preview actions
						$pt_cv_admin_js.preview( '<?php 
            echo balanceTags(wp_create_nonce(PT_CV_PREFIX_ . 'ajax_nonce'));
            ?>
' );

						// Custom js
						$pt_cv_admin_js.custom();

						// Toggle Panel group of 'Advance Settings'
						$pt_cv_admin_js.toggle_group( '.' + _prefix + 'advanced-settings-item', group_prefix );
						// Toggle Panel group of 'Terms' (in "Taxonomy Settings")
						$pt_cv_admin_js.toggle_group( '.' + _prefix + 'taxonomy-item', group_prefix );
						// Toggle Panel group of 'Advanced Order by'
						$pt_cv_admin_js.toggle_group( '[name="' + _prefix + 'content-type' + '"]', group_prefix );
						// Toggle Panel group of 'View type settings'
						$pt_cv_admin_js.toggle_group( '[name="' + _prefix + 'view-type' + '"]', group_prefix );

						// Toggle dependence
						$pt_cv_admin_js.dependence_do_all( '<?php 
            echo balanceTags($toggle_data_js);
            ?>
' );

						$pt_cv_admin_js.multi_level_toggle();
					} );
				}( jQuery ) );
			</script>
			<?php 
        }
 /**
  * Register and enqueue admin-specific JavaScript.
  *
  * @since     1.0.0
  *
  * @return    null    Return early if no settings page is registered.
  */
 public function enqueue_admin_scripts()
 {
     if (!isset($this->plugin_screen_hook_suffix)) {
         return;
     }
     $screen = get_current_screen();
     if ($this->plugin_screen_hook_suffix == $screen->id || in_array($screen->id, $this->plugin_sub_screen_hook_suffix)) {
         // WP assets
         wp_enqueue_script('wp-color-picker');
         wp_enqueue_script('jquery-ui-sortable');
         // Main admin script
         PT_CV_Asset::enqueue('admin', 'script', array('src' => plugins_url('assets/js/admin.js', __FILE__), 'deps' => array('jquery')));
         // Localize strings
         PT_CV_Asset::localize_script('admin', PT_CV_PREFIX_UPPER . 'ADMIN', array('_prefix' => PT_CV_PREFIX, '_group_prefix' => PT_CV_Html::html_group_class() . '-', '_nonce' => wp_create_nonce(PT_CV_PREFIX_ . 'ajax_nonce'), 'supported_version' => PT_CV_Functions::wp_version_compare('3.5'), 'text' => array('no_taxonomy' => __('There is no taxonomy for selected content type', 'content-views-query-and-display-post-page'), 'pagination_disable' => __('Pagination is disabled when Limit = -1', 'content-views-query-and-display-post-page'), 'prevent_click' => __('Opening a link is prevented in preview box', 'content-views-query-and-display-post-page')), 'btn' => array('preview' => array('show' => __('Show Preview', 'content-views-query-and-display-post-page'), 'hide' => __('Hide Preview', 'content-views-query-and-display-post-page'), 'update' => __('Update Preview', 'content-views-query-and-display-post-page'))), 'data' => array('post_types_vs_taxonomies' => PT_CV_Values::post_types_vs_taxonomies())));
         // Bootstrap for Admin
         PT_CV_Asset::enqueue('bootstrap-admin', 'script', array('src' => plugins_url('assets/bootstrap/js/bootstrap.full.js', PT_CV_FILE)));
         // For Preview
         PT_CV_Html::frontend_scripts();
         PT_CV_Asset::enqueue('select2');
     }
 }
Exemplo n.º 5
0
?>
filter-settings">
				<?php 
$options = array(array('label' => array('text' => __('Content type', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'radio', 'name' => 'content-type', 'options' => PT_CV_Values::post_types(), 'std' => 'post'))), !get_option('pt_cv_version_pro') ? PT_CV_Settings::get_cvpro(__('Filter custom post type (product, event...) ?', PT_CV_TEXTDOMAIN), 10) : '', apply_filters(PT_CV_PREFIX_ . 'custom_filters', array()), array('label' => array('text' => __('Common filters', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => array(apply_filters(PT_CV_PREFIX_ . 'sticky_posts_setting', array()), array('label' => array('text' => __('Include only', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'text', 'name' => 'post__in', 'std' => '', 'desc' => apply_filters(PT_CV_PREFIX_ . 'setting_post_in', __('List of post IDs to display (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN))))), apply_filters(PT_CV_PREFIX_ . 'include_extra_settings', array()), array('label' => array('text' => __('Exclude', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'text', 'name' => 'post__not_in', 'std' => '', 'desc' => apply_filters(PT_CV_PREFIX_ . 'setting_post_not_in', __('List of post IDs to exclude (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN))))), apply_filters(PT_CV_PREFIX_ . 'exclude_extra_settings', array()), array('label' => array('text' => __('Parent page', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'number', 'name' => 'post_parent', 'std' => '', 'desc' => __('Enter ID of parent page to query child pages', PT_CV_TEXTDOMAIN))), 'dependence' => array('content-type', 'page')), apply_filters(PT_CV_PREFIX_ . 'post_parent_settings', array()), array('label' => array('text' => __('Limit', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'number', 'name' => 'limit', 'std' => '10', 'min' => '1', 'desc' => __('The number of posts to show. Set empty to show all found posts (which match all filter settings)', PT_CV_TEXTDOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'after_limit_option', PT_CV_Settings::get_cvpro(__('Skip some posts ?', PT_CV_TEXTDOMAIN), 12)))))), array('label' => array('text' => __('Advanced filters', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id('advanced-params'))), 'params' => array(array('type' => 'group', 'params' => array(array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'checkbox', 'name' => 'advanced-settings[]', 'options' => PT_CV_Values::advanced_settings(), 'std' => '', 'class' => 'advanced-settings-item'))))))), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_panel_group_class(), 'wrap-id' => PT_CV_Html::html_panel_group_id(PT_CV_Functions::string_random()))), 'params' => array(array('type' => 'panel_group', 'params' => apply_filters(PT_CV_PREFIX_ . 'advanced_settings_panel', array('taxonomy' => array(array('label' => array('text' => __('Taxonomies', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_PREFIX . 'taxonomies')), 'params' => array(array('type' => 'checkbox', 'name' => 'taxonomy[]', 'options' => PT_CV_Values::taxonomy_list(), 'std' => '', 'class' => 'taxonomy-item', 'desc' => __('Tick checkbox of taxonomies to filter posts by their terms', PT_CV_TEXTDOMAIN)))), !get_option('pt_cv_version_pro') ? PT_CV_Settings::get_cvpro(__('Filter by custom taxonomies ?', PT_CV_TEXTDOMAIN), 10) : '', array('label' => array('text' => __('Terms', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_panel_group_class() . ' terms', 'wrap-id' => PT_CV_Html::html_panel_group_id(PT_CV_Functions::string_random()))), 'params' => array(array('type' => 'panel_group', 'settings' => array('nice_name' => PT_CV_Values::taxonomy_list()), 'params' => PT_CV_Settings::terms_of_taxonomies()))), array('label' => array('text' => __('Relation', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'taxonomy-relation', 'options' => PT_CV_Values::taxonomy_relation(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::taxonomy_relation()), 'class' => 'taxonomy-relation', 'desc' => __('Select AND to show posts which match ALL settings of selected taxonomies.<br>Select OR to show posts which match settings of at least one selected taxonomy', PT_CV_TEXTDOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'taxonomies_custom_settings', array())), 'order' => array(array('label' => array('text' => __('Order by', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'panel_group', 'settings' => array('show_all' => 1), 'params' => PT_CV_Settings::orderby())))), 'author' => apply_filters(PT_CV_PREFIX_ . 'author_settings', array(array('label' => array('text' => __('Written by', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'author__in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0'))), $version_gt_37 ? array('label' => array('text' => __('Not written by', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'author__not_in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0'))) : array())), 'status' => array(array('label' => array('text' => __('Status', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'post_status', 'options' => PT_CV_Values::post_statuses(), 'std' => 'publish', 'class' => 'select2', 'multiple' => '1', 'desc' => __('Select status of posts', PT_CV_TEXTDOMAIN))))), 'search' => array(array('label' => array('text' => __('Keyword', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'text', 'name' => 's', 'std' => '', 'desc' => __('Enter the keyword to searching for posts.', PT_CV_TEXTDOMAIN) . apply_filters(PT_CV_PREFIX_ . 'searchby_keyword_desc', '')))))))))));
echo PT_Options_Framework::do_settings($options, $settings);
?>
			</div>
			<!-- end Filter Settings -->

			<!-- Display Settings -->
			<div class="tab-pane" id="<?php 
echo esc_attr(PT_CV_PREFIX);
?>
display-settings">
				<?php 
$options = array(array('label' => array('text' => __('View type (Layout)', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'radio', 'name' => 'view-type', 'options' => PT_CV_Values::view_type(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::view_type())))), array('label' => array('text' => __('View type settings', PT_CV_TEXTDOMAIN)), 'params' => array(array('type' => 'panel_group', 'settings' => array('no_panel' => 1, 'show_only_one' => 1), 'params' => PT_CV_Values::view_type_settings()))), apply_filters(PT_CV_PREFIX_ . 'responsive_settings', array()), array('label' => array('text' => __('Layout format', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => array(array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'radio', 'name' => 'layout-format', 'options' => PT_CV_Values::layout_format(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::layout_format()), 'desc' => __('This is layout format of output for each post', PT_CV_TEXTDOMAIN)))), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'checkbox', 'name' => 'lf-mobile-disable', 'options' => PT_CV_Values::yes_no('yes', __('Disable 2 columns format on mobile devices & extra small screens', PT_CV_TEXTDOMAIN)), 'std' => '')), 'dependence' => array('layout-format', '2-col')))))), array('label' => array('text' => __('Fields settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id('field-settings'))), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_settings()))), array('label' => array('text' => __('Pagination settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::settings_pagination()))), array('label' => array('text' => __('Other settings', PT_CV_TEXTDOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::settings_other()))));
$options = apply_filters(PT_CV_PREFIX_ . 'display_settings', $options);
echo PT_Options_Framework::do_settings($options, $settings);
?>
			</div>
			<!-- end Display Settings -->

			<?php 
do_action(PT_CV_PREFIX_ . 'setting_tabs_content', $settings);
?>

		</div>

		<div class="clearfix"></div>
		<hr>
		<!-- Save -->
Exemplo n.º 6
0
?>
filter-settings">
				<?php 
$options = array(array('label' => array('text' => __('Content type', PT_CV_DOMAIN)), 'params' => array(array('type' => 'radio', 'name' => 'content-type', 'options' => PT_CV_Values::post_types(), 'std' => 'post'))), !get_option('pt_cv_version_pro') ? array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 10)), 'params' => array(array('type' => 'html', 'content' => sprintf('<p class="text-muted">&rarr; %s</p>', __('Filter custom content type (or post type) ?', PT_CV_DOMAIN) . sprintf(' <a href="%s" target="_blank">%s</a>', esc_url('http://www.contentviewspro.com/pricing/?utm_source=client&utm_medium=view'), __('Please upgrade to Pro', PT_CV_DOMAIN)))))) : '', apply_filters(PT_CV_PREFIX_ . 'custom_filters', array()), array('label' => array('text' => __('Common filters', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => array(apply_filters(PT_CV_PREFIX_ . 'sticky_posts_setting', array()), array('label' => array('text' => __('In list', PT_CV_DOMAIN)), 'params' => array(array('type' => 'text', 'name' => 'post__in', 'std' => '', 'desc' => __('List of post ids to retrieve (comma-separated values, e.g. 1,2,3)<br>A post is displayed only if its ID is equal to any of the values IN this list', PT_CV_DOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'include_extra_settings', array()), array('label' => array('text' => __('Excludes', PT_CV_DOMAIN)), 'params' => array(array('type' => 'text', 'name' => 'post__not_in', 'std' => '', 'desc' => __('List of post ids to exclude (comma-separated values, e.g. 1,2,3)', PT_CV_DOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'exclude_extra_settings', array()), array('label' => array('text' => __('Parent page', PT_CV_DOMAIN)), 'params' => array(array('type' => 'number', 'name' => 'post_parent', 'std' => '', 'desc' => __('Enter ID of parent page to query child pages', PT_CV_DOMAIN))), 'dependence' => array('content-type', 'page')), apply_filters(PT_CV_PREFIX_ . 'post_parent_settings', array()), array('label' => array('text' => __('Limit', PT_CV_DOMAIN)), 'params' => array(array('type' => 'number', 'name' => 'limit', 'std' => '10', 'min' => '1', 'append_text' => '1 &rarr; 999', 'desc' => __('The number of posts to show. Set empty to show all found posts (which match all filter settings)', PT_CV_DOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'after_limit_option', array()))))), array('label' => array('text' => __('Advanced filters', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id('advanced-params'))), 'params' => array(array('type' => 'group', 'params' => array(array('label' => array('text' => ''), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'checkbox', 'name' => 'advanced-settings[]', 'options' => PT_CV_Values::advanced_settings(), 'std' => '', 'class' => 'advanced-settings-item'))))))), array('label' => array('text' => ''), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_panel_group_class(), 'wrap-id' => PT_CV_Html::html_panel_group_id(PT_CV_Functions::string_random()))), 'params' => array(array('type' => 'panel_group', 'params' => apply_filters(PT_CV_PREFIX_ . 'advanced_settings_panel', array('taxonomy' => array(array('label' => array('text' => __('Taxonomies', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_PREFIX . 'taxonomies')), 'params' => array(array('type' => 'checkbox', 'name' => 'taxonomy[]', 'options' => PT_CV_Values::taxonomy_list(), 'std' => '', 'class' => 'taxonomy-item', 'desc' => __('Check checkbox of taxonomies to filter posts by their terms', PT_CV_DOMAIN)))), array('label' => array('text' => __('Terms', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_panel_group_class() . ' terms', 'wrap-id' => PT_CV_Html::html_panel_group_id(PT_CV_Functions::string_random()))), 'params' => array(array('type' => 'panel_group', 'settings' => array('nice_name' => PT_CV_Values::taxonomy_list()), 'params' => PT_CV_Settings::terms_of_taxonomies()))), array('label' => array('text' => __('Relation', PT_CV_DOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'taxonomy-relation', 'options' => PT_CV_Values::taxonomy_relation(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::taxonomy_relation()), 'class' => 'taxonomy-relation', 'desc' => __('Select AND to show posts which match ALL settings of selected taxonomies<br>Select OR to show posts which match settings of at least one selected taxonomy', PT_CV_DOMAIN)))), apply_filters(PT_CV_PREFIX_ . 'taxonomies_custom_settings', array())), 'order' => array(array('label' => array('text' => __('Order by', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('width' => 12)), 'params' => array(array('type' => 'panel_group', 'settings' => array('show_all' => 1), 'params' => PT_CV_Settings::orderby())))), 'author' => apply_filters(PT_CV_PREFIX_ . 'author_settings', array(array('label' => array('text' => __('Written by', PT_CV_DOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'author__in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0'))), $version_gt_37 ? array('label' => array('text' => __('Not written by', PT_CV_DOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'author__not_in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0'))) : array())), 'status' => array(array('label' => array('text' => __('Status', PT_CV_DOMAIN)), 'params' => array(array('type' => 'select', 'name' => 'post_status', 'options' => PT_CV_Values::post_statuses(), 'std' => 'publish', 'class' => 'select2', 'multiple' => '1', 'desc' => __('Select status of posts', PT_CV_DOMAIN))))), 'search' => array(array('label' => array('text' => __('Keyword', PT_CV_DOMAIN)), 'params' => array(array('type' => 'text', 'name' => 's', 'std' => '', 'desc' => __('Enter the keyword to searching for posts', PT_CV_DOMAIN) . apply_filters(PT_CV_PREFIX_ . 'searchby_keyword_desc', '')))))))))));
echo balanceTags(PT_Options_Framework::do_settings($options, $settings));
?>
			</div>
			<!-- end Filter Settings -->

			<!-- Display Settings -->
			<div class="tab-pane" id="<?php 
echo esc_attr(PT_CV_PREFIX);
?>
display-settings">
				<?php 
$options = array(array('label' => array('text' => __('View type', PT_CV_DOMAIN)), 'params' => array(array('type' => 'radio', 'name' => 'view-type', 'options' => PT_CV_Values::view_type(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::view_type())))), array('label' => array('text' => __('View type settings', PT_CV_DOMAIN)), 'params' => array(array('type' => 'panel_group', 'settings' => array('no_panel' => 1, 'no_animation' => 1, 'show_only_one' => 1), 'params' => PT_CV_Values::view_type_settings()))), apply_filters(PT_CV_PREFIX_ . 'responsive_settings', array()), array('label' => array('text' => __('Layout format', PT_CV_DOMAIN)), 'params' => array(array('type' => 'radio', 'name' => 'layout-format', 'options' => PT_CV_Values::layout_format(), 'std' => PT_CV_Functions::array_get_first_key(PT_CV_Values::layout_format()), 'desc' => __('This is layout format of output for each post', PT_CV_DOMAIN)))), array('label' => array('text' => __('Fields settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id('field-settings'))), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::field_settings()))), array('label' => array('text' => __('Pagination settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::settings_pagination()))), array('label' => array('text' => __('Other settings', PT_CV_DOMAIN)), 'extra_setting' => array('params' => array('wrap-class' => PT_CV_Html::html_group_class())), 'params' => array(array('type' => 'group', 'params' => PT_CV_Settings::settings_other()))));
$options = apply_filters(PT_CV_PREFIX_ . 'display_settings', $options);
echo balanceTags(PT_Options_Framework::do_settings($options, $settings));
?>
			</div>
			<!-- end Display Settings -->

			<?php 
do_action(PT_CV_PREFIX_ . 'setting_tabs_content', $settings);
?>

		</div>

		<div class="clearfix"></div>
		<hr>
		<!-- Save -->
Exemplo n.º 7
0
 /**
  * HTML for group of params inside Panel group
  *
  * @param string $key
  * @param array  $param_group Array of setting options in a group
  * @param array  $data        Stored data of settings
  * @param string $parent_id
  * @param bool   $settings    : array of custom settings
  *
  * @return string
  */
 static function sub_panel_group($key, $param_group, $data, $parent_id, $settings = array())
 {
     // Content for body
     $content = self::do_settings($param_group, $data);
     // Class for wrapper
     $class = PT_CV_Html::html_group_class();
     $class .= isset($settings['show_all']) ? '' : ' hidden';
     $class .= isset($settings['show_only_one']) ? ' ' . PT_CV_PREFIX . 'only-one' : '';
     $class .= isset($settings['no_panel']) ? ' ' . PT_CV_PREFIX . 'no-panel' : '';
     // Id for wrapper
     $id = PT_CV_Html::html_group_id($key);
     if (!isset($settings['no_panel'])) {
         if (!empty($param_group['parent_label'])) {
             $heading = $param_group['parent_label'];
         } else {
             $heading = isset($settings['nice_name'][$key]) ? $settings['nice_name'][$key] : PT_CV_Functions::string_slug_to_text($key);
         }
         $html = PT_CV_Html::html_collapse_one($parent_id, $id . '-child', $heading, $content, true);
     } else {
         $html = $content;
     }
     return "<div class='{$class}' id='{$id}'>{$html}</div>";
 }