Пример #1
0
    /**
     * Creates a general module to setup slider parameters
     * @param $prefix
     * @return string
     */
    function themify_generic_slider_controls($prefix)
    {
        /**
         * Associative array containing theme settings
         * @var array
         */
        $data = themify_get_data();
        $auto_options = apply_filters('themify_generic_slider_auto', array(__('4 Secs (default)', 'themify') => 4000, __('Off', 'themify') => 'off', __('1 Sec', 'themify') => 1000, __('2 Secs', 'themify') => 2000, __('3 Secs', 'themify') => 3000, __('4 Secs', 'themify') => 4000, __('5 Secs', 'themify') => 5000, __('6 Secs', 'themify') => 6000, __('7 Secs', 'themify') => 7000, __('8 Secs', 'themify') => 8000, __('9 Secs', 'themify') => 9000, __('10 Secs', 'themify') => 10000));
        $speed_options = apply_filters('themify_generic_slider_speed', array(__('Fast', 'themify') => 500, __('Normal', 'themify') => 1000, __('Slow', 'themify') => 1500));
        $effect_options = array(array('name' => __('Slide', 'themify'), 'value' => 'slide'), array('name' => __('Fade', 'themify'), 'value' => 'fade'));
        /**
         * Auto Play
         */
        $output = '<p>
						<span class="label">' . __('Auto Play', 'themify') . '</span>
						<select name="' . esc_attr($prefix) . 'autoplay">';
        foreach ($auto_options as $name => $val) {
            $output .= '<option value="' . esc_attr($val) . '" ' . selected(themify_get($prefix . 'autoplay'), themify_check($prefix . 'autoplay') ? $val : 4000, false) . '>' . esc_html($name) . '</option>';
        }
        $output .= '	</select>
					</p>';
        /**
         * Effect
         */
        $output .= '<p>
						<span class="label">' . __('Effect', 'themify') . '</span>
						<select name="' . esc_attr($prefix) . 'effect">' . themify_options_module($effect_options, $prefix . 'effect') . '
						</select>
					</p>';
        /**
         * Transition Speed
         */
        $output .= '<p>
						<span class="label">' . __('Transition Speed', 'themify') . '</span>
						<select name="' . esc_attr($prefix) . 'transition_speed">';
        foreach ($speed_options as $name => $val) {
            $output .= '<option value="' . esc_attr($val) . '" ' . selected(themify_get($prefix . 'transition_speed'), themify_check($prefix . 'transition_speed') ? $val : 500, false) . '>' . esc_html($name) . '</option>';
        }
        $output .= '	</select>
					</p>';
        return apply_filters('themify_generic_slider_controls', $output);
    }
    /**
     * Default Index Portfolio Layout
     * @param array $data
     * @return string
     */
    function themify_default_portfolio_index_layout($data = array())
    {
        /**
         * Associative array containing theme settings
         * @var array
         */
        $data = themify_get_data();
        /**
         * Variable prefix key
         * @var string
         */
        $prefix = 'setting-default_portfolio_index_';
        /**
         * Basic default options '', 'yes', 'no'
         * @var array
         */
        $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
        /**
         * Sidebar Layout
         * @var string
         */
        $layout = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : '';
        /**
         * Sidebar Layout Options
         * @var array
         */
        $sidebar_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'selected' => true, 'title' => __('No Sidebar', 'themify')));
        /**
         * Post Layout Options
         * @var array
         */
        $post_layout_options = array(array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify')), array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify')), array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')), array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')));
        /**
         * HTML for settings panel
         * @var string
         */
        $output = '<p>
						<span class="label">' . __('Portfolio Sidebar Option', 'themify') . '</span>';
        foreach ($sidebar_options as $option) {
            if (('' == $layout || !$layout || !isset($layout)) && (isset($option['selected']) && $option['selected'])) {
                $layout = $option['value'];
            }
            if ($layout == $option['value']) {
                $class = 'selected';
            } else {
                $class = '';
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '<input type="hidden" name="' . $prefix . 'layout" class="val" value="' . $layout . '" />';
        $output .= '</p>';
        /**
         * Post Layout
         */
        $output .= '<p>
						<span class="label">' . __('Portfolio Layout', 'themify') . '</span>';
        $val = isset($data[$prefix . 'post_layout']) ? $data[$prefix . 'post_layout'] : '';
        foreach ($post_layout_options as $option) {
            if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
                $val = $option['value'];
            }
            if ($val == $option['value']) {
                $class = "selected";
            } else {
                $class = "";
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '	<input type="hidden" name="' . $prefix . 'post_layout" class="val" value="' . $val . '" />
					</p>';
        /**
         * Display Content
         */
        $output .= '<p>
						<span class="label">' . __('Display Content', 'themify') . '</span>
						<select name="' . $prefix . 'display">' . themify_options_module(array(array('name' => __('None', 'themify'), 'value' => 'none'), array('name' => __('Full Content', 'themify'), 'value' => 'content'), array('name' => __('Excerpt', 'themify'), 'value' => 'excerpt')), $prefix . 'display') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Hide Portfolio Title', 'themify') . '</span>
						<select name="' . $prefix . 'title">' . themify_options_module($default_options, $prefix . 'title') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Unlink Portfolio Title', 'themify') . '</span>
						<select name="' . $prefix . 'unlink_post_title">' . themify_options_module($default_options, $prefix . 'unlink_post_title') . '
						</select>
					</p>';
        // Hide Post Meta /////////////////////////////////////////
        $output .= '<p>
						<span class="label">' . __('Hide Portfolio Meta', 'themify') . '</span>
						<select name="' . $prefix . 'post_meta_category">' . themify_options_module($default_options, $prefix . 'post_meta_category', true, 'yes') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Hide Portfolio Date', 'themify') . '</span>
						<select name="' . $prefix . 'post_date">' . themify_options_module($default_options, $prefix . 'post_date', true, 'yes') . '
						</select>
					</p>';
        /**
         * Image Dimensions
         */
        $output .= '<p>
						<span class="label">' . __('Image Size', 'themify') . '</span>
						<input type="text" class="width2" name="' . $prefix . 'image_post_width" value="' . $data[$prefix . 'image_post_width'] . '" /> ' . __('width', 'themify') . ' <small>(px)</small>
						<input type="text" class="width2" name="' . $prefix . 'image_post_height" value="' . $data[$prefix . 'image_post_height'] . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
					</p>';
        return $output;
    }
Пример #3
0
/**
 * Default Single Post Layout
 * @param array $data Theme settings data
 * @return string Markup for module.
 * @since 1.0.0
 */
function themify_default_post_layout($data = array())
{
    $data = themify_get_data();
    /**
     * Theme Settings Option Key Prefix
     * @var string
     */
    $prefix = 'setting-default_page_';
    /**
     * Tertiary options <blank>|yes|no
     * @var array
     */
    $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    /**
     * Sidebar placement options
     * @var array
     */
    $sidebar_location_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
    /**
     * Image alignment options
     * @var array
     */
    $alignment_options = array(array('name' => '', 'value' => ''), array('name' => __('Left', 'themify'), 'value' => 'left'), array('name' => __('Right', 'themify'), 'value' => 'right'));
    /**
     * Module markup
     * @var string
     */
    $output = '';
    /**
     * Post sidebar placement
     */
    $output .= '<p>
					<span class="label">' . __('Post Sidebar Option', 'themify') . '</span>';
    $val = isset($data[$prefix . 'post_layout']) ? $data[$prefix . 'post_layout'] : '';
    foreach ($sidebar_location_options as $option) {
        if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = 'selected';
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
    }
    $output .= '	<input type="hidden" name="' . $prefix . 'post_layout" class="val" value="' . $val . '" />
				</p>';
    /**
     * Hide Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Title', 'themify') . '</span>
					<select name="' . $prefix . 'post_title">' . themify_options_module($default_options, $prefix . 'post_title') . '
					</select>
				</p>';
    /**
     * Unlink Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
					<select name="' . $prefix . 'unlink_post_title">' . themify_options_module($default_options, $prefix . 'unlink_post_title') . '
					</select>
				</p>';
    /**
     * Hide Post Meta
     */
    $output .= themify_post_meta_options($prefix . 'post_meta', $data);
    /**
     * Hide Post Date
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Date', 'themify') . '</span>
					<select name="' . $prefix . 'post_date">' . themify_options_module($default_options, $prefix . 'post_date') . '
					</select>
				</p>';
    /**
     * Hide Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
					<select name="' . $prefix . 'post_image">' . themify_options_module($default_options, $prefix . 'post_image') . '
					</select>
				</p>';
    /**
     * Unlink Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
					<select name="' . $prefix . 'unlink_post_image">' . themify_options_module($default_options, $prefix . 'unlink_post_image') . '
					</select>
				</p>';
    /**
     * Featured Image Sizes
     */
    $output .= themify_feature_image_sizes_select('image_post_single_feature_size');
    /**
     * Image dimensions
     */
    $output .= '<p>
			<span class="label">' . __('Image Size', 'themify') . '</span>
					<input type="text" class="width2" name="setting-image_post_single_width" value="' . themify_get('setting-image_post_single_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>
					<input type="text" class="width2" name="setting-image_post_single_height" value="' . themify_get('setting-image_post_single_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
				</p>';
    /**
     * Featured Image Alignment
     */
    $output .= '<p>
					<span class="label">' . __('Featured Image Alignment', 'themify') . '</span>
					<select name="setting-image_post_single_align">' . themify_options_module($alignment_options, 'setting-image_post_single_align') . '
					</select>
				</p>';
    /**
     * Disable comments
     */
    $pre = 'setting-comments_posts';
    $output .= '<p><span class="label">' . __('Post Comments', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . checked(themify_get($pre), 'on', false) . ' /> ' . __('Disable comments in all Posts', 'themify') . '</label></p>';
    /**
     * Show author box
     */
    $pre = 'setting-post_author_box';
    $output .= '<p><span class="label">' . __('Show Author Box', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . checked(themify_get($pre), 'on', false) . ' /> ' . __('Show author box in all Posts', 'themify') . '</label></p>';
    /**
     * Remove Post Navigation
     */
    $pre = 'setting-post_nav_';
    $output .= '<p>
					<span class="label">' . __('Post Navigation', 'themify') . '</span>
					<label for="' . $pre . 'disable">
						<input type="checkbox" id="' . $pre . 'disable" name="' . $pre . 'disable" ' . checked(themify_get($pre . 'disable'), 'on', false) . '/> ' . __('Remove Post Navigation', 'themify') . '
						</label>
					<span class="pushlabel vertical-grouped">
						<label for="' . $pre . 'same_cat">
							<input type="checkbox" id="' . $pre . 'same_cat" name="' . $pre . 'same_cat" ' . checked(themify_get($pre . 'same_cat'), 'on', false) . '/> ' . __('Show only posts in the same category', 'themify') . '
						</label>
					</span>
				</p>';
    return $output;
}
Пример #4
0
    /**
     * Default Single Team Layout
     * @param array $data
     * @return string
     */
    function themify_default_team_single_layout($data = array())
    {
        /**
         * Associative array containing theme settings
         * @var array
         */
        $data = themify_get_data();
        /**
         * Sidebar Layout Options
         * @var array
         */
        $sidebar_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify'), 'selected' => true));
        /**
         * Variable prefix key
         * @var string
         */
        $prefix = 'setting-default_team_single_';
        /**
         * Sidebar Layout
         * @var string
         */
        $layout = $data[$prefix . 'layout'];
        /**
         * Basic default options '', 'yes', 'no'
         * @var array
         */
        $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
        /**
         * HTML for settings panel
         * @var string
         */
        $output = '';
        /**
         * Sidebar Layout
         */
        $output .= '<p>
						<span class="label">' . __('Team Sidebar Option', 'themify') . '</span>';
        foreach ($sidebar_options as $option) {
            if (($layout == '' || !$layout || !isset($layout)) && $option['selected']) {
                $layout = $option['value'];
            }
            if ($layout == $option['value']) {
                $class = 'selected';
            } else {
                $class = '';
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '<input type="hidden" name="' . $prefix . 'layout" class="val" value="' . $layout . '" />';
        $output .= '</p>';
        /**
         * Hide Team Title
         */
        $output .= '<p>
						<span class="label">' . __('Hide Team Title', 'themify') . '</span>
						<select name="' . $prefix . 'hide_title">' . themify_options_module($default_options, $prefix . 'hide_title') . '
						</select>
					</p>';
        /**
         * Unlink Team Title
         */
        $output .= '<p>
						<span class="label">' . __('Unlink Team Title', 'themify') . '</span>
						<select name="' . $prefix . 'unlink_title">' . themify_options_module($default_options, $prefix . 'unlink_title') . '
						</select>
					</p>';
        /**
         * Hide Featured Image
         */
        $output .= '<p>
						<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
						<select name="' . $prefix . 'hide_image">' . themify_options_module($default_options, $prefix . 'hide_image') . '
						</select>
					</p>';
        /**
         * Unlink Featured Image
         */
        $output .= '<p>
						<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
						<select name="' . $prefix . 'unlink_image">' . themify_options_module($default_options, $prefix . 'unlink_image') . '
						</select>
					</p>';
        /**
         * Image Dimensions
         */
        $output .= '
			<p>
				<span class="label">' . __('Image Size', 'themify') . '</span>
				<input type="text" class="width2" name="' . $prefix . 'image_post_width" value="' . $data[$prefix . 'image_post_width'] . '" /> ' . __('width', 'themify') . ' <small>(px)</small>
				<input type="text" class="width2" name="' . $prefix . 'image_post_height" value="' . $data[$prefix . 'image_post_height'] . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
			</p>';
        return $output;
    }
Пример #5
0
    /**
     * Builder Settings
     * @param array $data
     * @return string
     * @since 1.2.7
     */
    function themify_manage_builder_active($data = array())
    {
        $pre = 'setting-page_builder_';
        $output = '';
        $options = array(array('name' => __('Enable', 'themify'), 'value' => 'enable'), array('name' => __('Disable', 'themify'), 'value' => 'disable'));
        $output .= '<p>
						<span class="label">' . __('Themify Builder:', 'themify') . '</span>
						<select name="' . $pre . 'is_active">' . themify_options_module($options, $pre . 'is_active') . '
						</select>
					</p>';
        return $output;
    }
/**
 * Default Page Layout Module
 * @param array $data Theme settings data
 * @return string Markup for module.
 * @since 1.0.0
 */
function themify_default_page_layout($data = array())
{
    $data = themify_get_data();
    /**
     * Theme Settings Option Key Prefix
     * @var string
     */
    $prefix = 'setting-default_page_';
    /**
     * Sidebar placement options
     * @var array
     */
    $sidebar_location_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
    /**
     * Tertiary options <blank>|yes|no
     * @var array
     */
    $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    /**
     * Module markup
     * @var string
     */
    $output = '';
    /**
     * Page sidebar placement
     */
    $output .= '<p>
					<span class="label">' . __('Page Sidebar Option', 'themify') . '</span>';
    $val = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : '';
    foreach ($sidebar_location_options as $option) {
        if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = "selected";
        } else {
            $class = "";
        }
        $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
    }
    $output .= '<input type="hidden" name="' . $prefix . 'layout" class="val" value="' . $val . '" /></p>';
    /**
     * Hide Title in All Pages
     */
    $output .= '<p>
					<span class="label">' . __('Hide Title in All Pages', 'themify') . '</span>
					<select name="setting-hide_page_title">' . themify_options_module($default_options, 'setting-hide_page_title') . '
					</select>
				</p>';
    /**
     * Page Comments
     */
    $pre = 'setting-comments_pages';
    $output .= '<p><span class="label">' . __('Page Comments', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . checked(themify_get($pre), 'on', false) . ' /> ' . __('Disable comments in all Pages', 'themify') . '</label></p>';
    return $output;
}
Пример #7
0
    /**
     * Default post layout settings module
     * @param array $data
     * @return string
     */
    function themify_default_post_layout($data = array())
    {
        $data = themify_get_data();
        $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
        $media_position = array(array('name' => __('Above Post Title', 'themify'), 'value' => 'above'), array('name' => __('Below Post Title', 'themify'), 'value' => 'below'));
        $val = isset($data['setting-default_page_post_layout']) ? $data['setting-default_page_post_layout'] : '';
        $output = '<p>
						<span class="label">' . __('Post Sidebar Option', 'themify') . '</span>';
        $options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify'), 'selected' => true), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
        foreach ($options as $option) {
            if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
                $val = $option['value'];
            }
            if ($val == $option['value']) {
                $class = "selected";
            } else {
                $class = '';
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '<input type="hidden" name="setting-default_page_post_layout" class="val" value="' . $val . '" />
					</p>';
        $output .= '<div class="themify_field_row">
						<span class="label">' . __('Hide Post Title', 'themify') . '</span>
						
						<select name="setting-default_page_post_title">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_page_post_title']) && $title_option['value'] == $data['setting-default_page_post_title']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</div>
					<div class="themify_field_row">
						<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
						
						<select name="setting-default_page_unlink_post_title">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_page_unlink_post_title']) && $title_option['value'] == $data['setting-default_page_unlink_post_title']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</div>';
        // Hide Post Meta /////////////////////////////////////////
        $output .= themify_post_meta_options('setting-default_page_post_meta', $data);
        $output .= '<p>
						<span class="label">' . __('Hide Post Date', 'themify') . '</span>
						
						<select name="setting-default_page_post_date">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_page_post_date']) && $title_option['value'] == $data['setting-default_page_post_date']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</p>
					<p>
						<span class="label">' . __('Media Position', 'themify') . '</span>
						<select name="setting-default_page_post_media_position">' . themify_options_module($media_position, 'setting-default_page_post_media_position') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
						
						<select name="setting-default_page_post_image">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_page_post_image']) && $title_option['value'] == $data['setting-default_page_post_image']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</p><p>
						<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
						
						<select name="setting-default_page_unlink_post_image">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_page_unlink_post_image']) && $title_option['value'] == $data['setting-default_page_unlink_post_image']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select></p>';
        $output .= themify_feature_image_sizes_select('image_post_single_feature_size');
        $output .= '<p>
				<span class="label">' . __('Image Size', 'themify') . '</span>
						<input type="text" class="width2" name="setting-image_post_single_width" value="' . themify_get('setting-image_post_single_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>  
						<input type="text" class="width2" name="setting-image_post_single_height" value="' . themify_get('setting-image_post_single_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
						<br /><span class="pushlabel"><small>' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '</small></span>
					</p>';
        // Disable post comments
        $comments_posts_checked = '';
        if (themify_check('setting-comments_posts')) {
            $comments_posts_checked = 'checked="checked"';
        }
        $output .= '<p><span class="label">' . __('Post Comments', 'themify') . '</span><label for="setting-comments_posts"><input type="checkbox" id="setting-comments_posts" name="setting-comments_posts" ' . checked(themify_get('setting-comments_posts'), 'on', false) . ' /> ' . __('Disable comments in all Posts', 'themify') . '</label></p>';
        // Show author box
        $author_box_checked = '';
        if (themify_check('setting-post_author_box')) {
            $author_box_checked = 'checked="checked"';
        }
        $output .= '<p><span class="label">' . __('Author Box', 'themify') . '</span><label for="setting-post_author_box"><input type="checkbox" id="setting-post_author_box" name="setting-post_author_box" ' . checked(themify_get('setting-post_author_box'), 'on', false) . ' /> ' . __('Show author box in all Posts', 'themify') . '</label></p>';
        // Post Navigation
        $pre = 'setting-post_nav_';
        $output .= '
			<p>
				<span class="label">' . __('Post Navigation', 'themify') . '</span>
				<label for="' . $pre . 'disable">
					<input type="checkbox" id="' . $pre . 'disable" name="' . $pre . 'disable" ' . checked(themify_get($pre . 'disable'), 'on', false) . '/> ' . __('Remove Post Navigation', 'themify') . '
				</label>
				<span class="pushlabel vertical-grouped">
				<label for="' . $pre . 'same_cat">
					<input type="checkbox" id="' . $pre . 'same_cat" name="' . $pre . 'same_cat" ' . checked(themify_get($pre . 'same_cat'), 'on', false) . '/> ' . __('Show only posts in the same category', 'themify') . '
				</label>
				</span>
			</p>';
        return $output;
    }
Пример #8
0
    /**
     * Default Index Layout Module - Action
     * @param array $data
     * @return string
     */
    function themify_default_layout($data = array())
    {
        $data = themify_get_data();
        $prefix = 'setting-default_';
        if (!isset($data['setting-default_more_text']) || '' == $data['setting-default_more_text']) {
            $more_text = __('More', 'themify');
        } else {
            $more_text = $data['setting-default_more_text'];
        }
        $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
        $media_position = array(array('name' => __('Above Post Title', 'themify'), 'value' => 'above'), array('name' => __('Below Post Title', 'themify'), 'value' => 'below'));
        $default_layout_options = array(array('name' => __('Full Content', 'themify'), 'value' => 'content'), array('name' => __('Excerpt', 'themify'), 'value' => 'excerpt'), array('name' => __('None', 'themify'), 'value' => 'none'));
        $default_post_layout_options = array(array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify'), "selected" => true), array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify')), array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')), array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')), array('value' => 'grid2-thumb', 'img' => 'images/layout-icons/grid2-thumb.png', 'title' => __('Grid 2 Thumb', 'themify')));
        $options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify'), "selected" => true));
        $val = isset($data['setting-default_layout']) ? $data['setting-default_layout'] : '';
        /**
         * HTML for settings panel
         * @var string
         */
        $output = '<p>
						<span class="label">' . __('Index Sidebar Option', 'themify') . '</span>';
        foreach ($options as $option) {
            if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
                $val = $option['value'];
            }
            if ($val == $option['value']) {
                $class = "selected";
            } else {
                $class = "";
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '<input type="hidden" name="setting-default_layout" class="val" value="' . $val . '" />';
        $output .= '</p>';
        $output .= '<p>
						<span class="label">' . __('Post Layout', 'themify') . '</span>';
        $val = isset($data['setting-default_post_layout']) ? $data['setting-default_post_layout'] : '';
        foreach ($default_post_layout_options as $option) {
            if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
                $val = $option['value'];
            }
            if ($val == $option['value']) {
                $class = "selected";
            } else {
                $class = "";
            }
            $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
        }
        $output .= '<input type="hidden" name="setting-default_post_layout" class="val" value="' . $val . '" />
					</p>
					<p>
						<span class="label">' . __('Display Content', 'themify') . '</span> 
						<select name="setting-default_layout_display">';
        foreach ($default_layout_options as $layout_option) {
            if (isset($data['setting-default_layout_display']) && $layout_option['value'] == $data['setting-default_layout_display']) {
                $output .= '<option selected="selected" value="' . $layout_option['value'] . '">' . $layout_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $layout_option['value'] . '">' . $layout_option['name'] . '</option>';
            }
        }
        $output .= '	</select>
					</p>';
        /**
         * More Text
         */
        $output .= '<p>
						<span class="label">' . __('More Text', 'themify') . '</span>
						<input type="text" name="setting-default_more_text" value="' . $more_text . '">
<span class="pushlabel vertical-grouped"><label for="setting-excerpt_more"><input type="checkbox" value="1" id="setting-excerpt_more" name="setting-excerpt_more" ' . checked(themify_get('setting-excerpt_more'), 1, false) . '/> ' . __('Display more link button in excerpt mode as well.', 'themify') . '</label></span>
					</p>';
        /**
         * Order & OrderBy Options
         */
        $output .= themify_post_sorting_options('setting-index_order', $data);
        /**
         * Hide Post Title
         */
        $output .= '<p>
						<span class="label">' . __('Hide Post Title', 'themify') . '</span>
						
						<select name="setting-default_post_title">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_post_title']) && $title_option['value'] == $data['setting-default_post_title']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '	</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
						
						<select name="setting-default_unlink_post_title">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_unlink_post_title']) && $title_option['value'] == $data['setting-default_unlink_post_title']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</p>';
        // Hide Post Meta /////////////////////////////////////////
        $output .= themify_post_meta_options('setting-default_post_meta', $data);
        /////////////////////////////////////////
        // Hide Post Date
        /////////////////////////////////////////
        $output .= '<p>
						<span class="label">' . __('Hide Post Date', 'themify') . '</span>
						
						<select name="setting-default_post_date">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_post_date']) && $title_option['value'] == $data['setting-default_post_date']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '	</select>
					</p>
					
					<p>
						<span class="label">' . __('Auto Featured Image', 'themify') . '</span>

						<label for="setting-auto_featured_image"><input type="checkbox" value="1" id="setting-auto_featured_image" name="setting-auto_featured_image" ' . checked(themify_get('setting-auto_featured_image'), 'on', false) . '/> ' . __('If no featured image is specified, display first image in content.', 'themify') . '</label>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Media Position', 'themify') . '</span>
						<select name="' . $prefix . 'media_position">' . themify_options_module($media_position, $prefix . 'media_position') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Hide Featured Image', 'themify') . '</span>

						<select name="setting-default_post_image">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_post_image']) && $title_option['value'] == $data['setting-default_post_image']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</p>
					<p>
						<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
						
						<select name="setting-default_unlink_post_image">';
        foreach ($default_options as $title_option) {
            if (isset($data['setting-default_unlink_post_image']) && $title_option['value'] == $data['setting-default_unlink_post_image']) {
                $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            } else {
                $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
            }
        }
        $output .= '</select>
					</p>';
        $output .= themify_feature_image_sizes_select('image_post_feature_size');
        $data = themify_get_data();
        $options = array('left', 'right');
        $output .= '<p>
						<span class="label">' . __('Image Size', 'themify') . '</span>  
						<input type="text" class="width2" name="setting-image_post_width" value="' . themify_get('setting-image_post_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>  
						<input type="text" class="width2" name="setting-image_post_height" value="' . themify_get('setting-image_post_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
						<br /><span class="pushlabel"><small>' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '</small></span>
					</p>
					<p>
						<span class="label">' . __('Featured Image Alignment', 'themify') . '</span>
						<select name="setting-image_post_align">
							<option></option>';
        foreach ($options as $option) {
            if (isset($data['setting-image_post_align']) && $option == $data['setting-image_post_align']) {
                $output .= '<option value="' . $option . '" selected="selected">' . $option . '</option>';
            } else {
                $output .= '<option value="' . $option . '">' . $option . '</option>';
            }
        }
        $output .= '	</select>
					</p>';
        return $output;
    }
Пример #9
0
/**
 * Default Index Layout Module
 * @param array $data Theme settings data
 * @return string Markup for module.
 * @since 1.0.0
 */
function themify_default_layout($data = array())
{
    $data = themify_get_data();
    /**
     * Theme Settings Option Key Prefix
     * @var string
     */
    $prefix = 'setting-default_';
    if (!isset($data[$prefix . 'more_text']) || '' == $data[$prefix . 'more_text']) {
        $more_text = __('More', 'themify');
    } else {
        $more_text = $data[$prefix . 'more_text'];
    }
    /**
     * Tertiary options <blank>|yes|no
     * @var array
     */
    $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    /**
     * Post content display options
     * @var array
     */
    $default_display_options = array(array('name' => __('Full Content', 'themify'), 'value' => 'content'), array('name' => __('Excerpt', 'themify'), 'value' => 'excerpt'), array('name' => __('None', 'themify'), 'value' => 'none'));
    /**
     * Post layout options
     * @var array
     */
    $default_post_layout_options = array(array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify'), "selected" => true), array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify')), array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')), array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')), array('value' => 'list-large-image', 'img' => 'images/layout-icons/list-large-image.png', 'title' => __('List Large Image', 'themify')), array('value' => 'list-thumb-image', 'img' => 'images/layout-icons/list-thumb-image.png', 'title' => __('List Thumb Image', 'themify')), array('value' => 'grid2-thumb', 'img' => 'images/layout-icons/grid2-thumb.png', 'title' => __('Grid 2 Thumb', 'themify')));
    /**
     * Sidebar placement options
     * @var array
     */
    $sidebar_location_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
    /**
     * Image alignment options
     * @var array
     */
    $alignment_options = array(array('name' => '', 'value' => ''), array('name' => __('Left', 'themify'), 'value' => 'left'), array('name' => __('Right', 'themify'), 'value' => 'right'));
    /**
     * HTML for settings panel
     * @var string
     */
    $output = '<div class="themify-info-link">' . __('Here you can set the <a href="http://themify.me/docs/default-layouts">Default Layouts</a> for WordPress archive post layout (category, search, archive, tag pages, etc.), single post layout (single post page), and the static Page layout. The default single post and page layout can be override individually on the post/page > edit > Themify Custom Panel.', 'themify') . '</div>';
    /**
     * Index Sidebar Option
     */
    $output .= '<p>
					<span class="label">' . __('Index Sidebar Option', 'themify') . '</span>';
    $val = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : '';
    foreach ($sidebar_location_options as $option) {
        if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = 'selected';
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
    }
    $output .= '	<input type="hidden" name="' . $prefix . 'layout" class="val" value="' . $val . '" />
				</p>';
    /**
     * Post Layout
     */
    $output .= '<p>
					<span class="label">' . __('Post Layout', 'themify') . '</span>';
    $val = isset($data[$prefix . 'post_layout']) ? $data[$prefix . 'post_layout'] : '';
    foreach ($default_post_layout_options as $option) {
        if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = 'selected';
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
    }
    $output .= '	<input type="hidden" name="' . $prefix . 'post_layout" class="val" value="' . $val . '" />
				</p>';
    /**
     * Display Content
     */
    $output .= '<p>
					<span class="label">' . __('Display Content', 'themify') . '</span> 
					<select name="' . $prefix . 'layout_display">' . themify_options_module($default_display_options, $prefix . 'layout_display') . '
					</select>
				</p>';
    /**
     * More Text
     */
    $output .= '<p>
					<span class="label">' . __('More Text', 'themify') . '</span>
					<input type="text" name="' . $prefix . 'more_text" value="' . $more_text . '">
				</p>';
    /**
     * Display more link in excerpt mode
     */
    $output .= '<span class="pushlabel vertical-grouped"><label for="setting-excerpt_more"><input type="checkbox" value="1" id="setting-excerpt_more" name="setting-excerpt_more" ' . checked(themify_get('setting-excerpt_more'), 1, false) . '/> ' . __('Display more link button in excerpt mode as well.', 'themify') . '</label></span>';
    /**
     * Order & OrderBy Options
     */
    if (function_exists('themify_post_sorting_options')) {
        $output .= themify_post_sorting_options('setting-index_order', $data);
    }
    /**
     * Hide Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Title', 'themify') . '</span>
					<select name="' . $prefix . 'post_title">' . themify_options_module($default_options, $prefix . 'post_title') . '
					</select>
				</p>';
    /**
     * Unlink Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
					<select name="' . $prefix . 'unlink_post_title">' . themify_options_module($default_options, $prefix . 'unlink_post_title') . '
					</select>
				</p>';
    /**
     * Hide Post Meta
     */
    $output .= themify_post_meta_options($prefix . 'post_meta', $data);
    /**
     * Hide Post Date
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Date', 'themify') . '</span>
					<select name="' . $prefix . 'post_date">' . themify_options_module($default_options, $prefix . 'post_date') . '
					</select>
				</p>';
    /**
     * Auto Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Auto Featured Image', 'themify') . '</span>
					<label for="setting-auto_featured_image"><input type="checkbox" value="1" id="setting-auto_featured_image" name="setting-auto_featured_image" ' . checked(themify_get('setting-auto_featured_image'), 1, false) . '/> ' . __('If no featured image is specified, display first image in content.', 'themify') . '</label>
				</p>';
    /**
     * Hide Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
					<select name="' . $prefix . 'post_image">' . themify_options_module($default_options, $prefix . 'post_image') . '
					</select>
				</p>';
    /**
     * Unlink Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
					<select name="' . $prefix . 'unlink_post_image">' . themify_options_module($default_options, $prefix . 'unlink_post_image') . '
					</select>
				</p>';
    /**
     * Featured Image Sizes
     */
    $output .= themify_feature_image_sizes_select('image_post_feature_size');
    /**
     * Image Dimensions
     */
    $output .= '<p>
					<span class="label">' . __('Image Size', 'themify') . '</span>  
					<input type="text" class="width2" name="setting-image_post_width" value="' . themify_get('setting-image_post_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>  
					<input type="text" class="width2" name="setting-image_post_height" value="' . themify_get('setting-image_post_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
				</p>';
    /**
     * Featured Image Alignment
     */
    $output .= '<p>
					<span class="label">' . __('Featured Image Alignment', 'themify') . '</span>
					<select name="setting-image_post_align">' . themify_options_module($alignment_options, 'setting-image_post_align') . '
					</select>
				</p>';
    return $output;
}
Пример #10
0
/**
 * Default Index Layout Module
 * @param array $data Theme settings data
 * @return string Markup for module.
 * @since 1.0.0
 */
function themify_default_layout($data = array())
{
    $data = themify_get_data();
    /**
     * Theme Settings Option Key Prefix
     * @var string
     */
    $prefix = 'setting-default_';
    if (!isset($data[$prefix . 'more_text']) || '' == $data[$prefix . 'more_text']) {
        $more_text = __('More', 'themify');
    } else {
        $more_text = $data[$prefix . 'more_text'];
    }
    /**
     * Tertiary options <blank>|yes|no
     * @var array
     */
    $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    /**
     * Default options 'yes', 'no'
     * @var array
     */
    $binary_options = array(array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    /**
     * Post content display options
     * @var array
     */
    $default_display_options = array(array('name' => __('Full Content', 'themify'), 'value' => 'content'), array('name' => __('Excerpt', 'themify'), 'value' => 'excerpt'), array('name' => __('None', 'themify'), 'value' => 'none'));
    /**
     * Post layout options
     * @var array
     */
    $default_post_layout_options = array(array('value' => 'list-post', 'img' => 'images/layout-icons/list-post.png', 'title' => __('List Post', 'themify'), "selected" => true), array('value' => 'grid4', 'img' => 'images/layout-icons/grid4.png', 'title' => __('Grid 4', 'themify')), array('value' => 'grid3', 'img' => 'images/layout-icons/grid3.png', 'title' => __('Grid 3', 'themify')), array('value' => 'grid2', 'img' => 'images/layout-icons/grid2.png', 'title' => __('Grid 2', 'themify')), array('value' => 'slider', 'img' => 'images/layout-icons/slider-default.png', 'title' => __('Slider', 'themify')));
    /**
     * Sidebar placement options
     * @var array
     */
    $sidebar_location_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
    /**
     * Image alignment options
     * @var array
     */
    $alignment_options = array(array('name' => '', 'value' => ''), array('name' => __('Left', 'themify'), 'value' => 'left'), array('name' => __('Right', 'themify'), 'value' => 'right'));
    /**
     * Entry media position, above or below the title
     */
    $media_position = array(array('name' => __('Above Post Title', 'themify'), 'value' => 'above'), array('name' => __('Below Post Title', 'themify'), 'value' => 'below'));
    /**
     * HTML for settings panel
     * @var string
     */
    $output = '<div class="themify-info-link">' . __('Here you can set the <a href="http://themify.me/docs/default-layouts">Default Layouts</a> for WordPress archive post layout (category, search, archive, tag pages, etc.), single post layout (single post page), and the static Page layout. The default single post and page layout can be override individually on the post/page > edit > Themify Custom Panel.', 'themify') . '</div>';
    /**
     * Index Sidebar Option
     */
    $output .= '<p>
					<span class="label">' . __('Index Sidebar Option', 'themify') . '</span>';
    $val = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : '';
    foreach ($sidebar_location_options as $option) {
        if (($val == '' || !$val || !isset($val)) && $option['selected']) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = 'selected';
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . esc_attr($class) . '" title="' . esc_attr($option['title']) . '"><img src="' . esc_url(THEME_URI . '/' . $option['img']) . '" alt="' . esc_attr($option['value']) . '"  /></a>';
    }
    $output .= '	<input type="hidden" name="' . esc_attr($prefix) . 'layout" class="val" value="' . esc_attr($val) . '" />
				</p>';
    /**
     * Post Layout
     */
    $output .= '<p>
					<span class="label">' . __('Post Layout', 'themify') . '</span>';
    $val = isset($data[$prefix . 'post_layout']) ? $data[$prefix . 'post_layout'] : '';
    foreach ($default_post_layout_options as $option) {
        if (($val == '' || !$val || !isset($val)) && $option['selected']) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = 'selected';
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . esc_attr($class) . '" title="' . esc_attr($option['title']) . '"><img src="' . esc_url(THEME_URI . '/' . $option['img']) . '" alt="' . esc_attr($option['value']) . '"  /></a>';
    }
    $output .= '	<input type="hidden" name="' . esc_attr($prefix) . 'post_layout" class="val" value="' . esc_attr($val) . '" />
				</p>';
    /**
     * Post Content Layout
     */
    $output .= '<p>
					<span class="label">' . __('Post Content Layout', 'themify') . '</span>
					<select name="setting-post_content_layout">' . themify_options_module(array(array('name' => __('Default', 'themify'), 'value' => ''), array('name' => __('Overlay', 'themify'), 'value' => 'overlay'), array('name' => __('Polaroid', 'themify'), 'value' => 'polaroid')), 'setting-post_content_layout') . '
					</select>
				</p>';
    /**
     * Enable Masonry
     */
    $output .= '<p>
					<span class="label">' . __('Post Masonry', 'themify') . '</span>
					<select name="setting-disable_masonry">' . themify_options_module($binary_options, 'setting-disable_masonry') . '
					</select>
				</p>';
    /**
     * Post Gutter
     */
    $output .= '<p>
					<span class="label">' . __('Post Gutter', 'themify') . '</span>
					<select name="setting-post_gutter">' . themify_options_module(array(array('name' => __('Default', 'themify'), 'value' => 'gutter'), array('name' => __('No gutter', 'themify'), 'value' => 'no-gutter')), 'setting-post_gutter') . '
					</select>
				</p>';
    /**
     * Infinite scroll or pagination
     */
    $output .= '<p>
					<span class="label">' . __('Pagination Option', 'themify') . '</span>';
    //Infinite Scroll
    $output .= '<input ' . checked(themify_check('setting-more_posts') ? themify_get('setting-more_posts') : 'infinite', 'infinite', false) . ' type="radio" name="setting-more_posts" value="infinite" /> ';
    $output .= __('Infinite Scroll (posts are loaded on the same page)', 'themify');
    $output .= '<br/>';
    $output .= '<label for="setting-autoinfinite"><input class="disable-autoinfinite" type="checkbox" id="setting-autoinfinite" name="setting-autoinfinite" ' . checked(themify_check('setting-autoinfinite'), true, false) . '/> ' . __('Disable automatic infinite scroll', 'themify') . '</label>';
    $output .= '<br/><br/>';
    //Numbered pagination
    $output .= '<span class="pushlabel"><input ' . checked(themify_get('setting-more_posts'), 'pagination', false) . ' type="radio" name="setting-more_posts" value="pagination" /> ';
    $output .= __('Standard Pagination', 'themify') . '</span>';
    $output .= '</p>';
    /**
     * Display Content
     */
    $output .= '<p>
					<span class="label">' . __('Display Content', 'themify') . '</span> 
					<select name="' . esc_attr($prefix) . 'layout_display">' . themify_options_module($default_display_options, $prefix . 'layout_display') . '
					</select>
				</p>';
    /**
     * More Text
     */
    $output .= '<p>
					<span class="label">' . __('More Text', 'themify') . '</span>
					<input type="text" name="' . esc_attr($prefix) . 'more_text" value="' . esc_attr($more_text) . '">
					
					<span class="pushlabel vertical-grouped"><label for="setting-excerpt_more"><input type="checkbox" value="1" id="setting-excerpt_more" name="setting-excerpt_more" ' . checked(themify_get('setting-excerpt_more'), 1, false) . '/> ' . __('Display more link button in excerpt mode as well.', 'themify') . '</label></span>
				</p>';
    /**
     * Order & OrderBy Options
     */
    $output .= themify_post_sorting_options('setting-index_order', $data);
    /**
     * Hide Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Title', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'post_title">' . themify_options_module($default_options, $prefix . 'post_title') . '
					</select>
				</p>';
    /**
     * Unlink Post Title
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'unlink_post_title">' . themify_options_module($default_options, $prefix . 'unlink_post_title') . '
					</select>
				</p>';
    /**
     * Hide Post Meta
     */
    $output .= themify_post_meta_options($prefix . 'post_meta', $data);
    /**
     * Hide Post Date
     */
    $output .= '<p>
					<span class="label">' . __('Hide Post Date', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'post_date">' . themify_options_module($default_options, $prefix . 'post_date') . '
					</select>
				</p>';
    /**
     * Auto Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Auto Featured Image', 'themify') . '</span>
					<label for="setting-auto_featured_image"><input type="checkbox" value="1" id="setting-auto_featured_image" name="setting-auto_featured_image" ' . checked(themify_get('setting-auto_featured_image'), 1, false) . '/> ' . __('If no featured image is specified, display first image in content.', 'themify') . '</label>
				</p>';
    /**
     * Media Position
     */
    $output .= '<p>
					<span class="label">' . __('Featured Image Position', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'media_position">' . themify_options_module($media_position, $prefix . 'media_position') . '
					</select>
				</p>';
    /**
     * Hide Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'post_image">' . themify_options_module($default_options, $prefix . 'post_image') . '
					</select>
				</p>';
    /**
     * Unlink Featured Image
     */
    $output .= '<p>
					<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
					<select name="' . esc_attr($prefix) . 'unlink_post_image">' . themify_options_module($default_options, $prefix . 'unlink_post_image') . '
					</select>
				</p>';
    /**
     * Featured Image Sizes
     */
    $output .= themify_feature_image_sizes_select('image_post_feature_size');
    /**
     * Image Dimensions
     */
    $output .= '<p>
					<span class="label">' . __('Image Size', 'themify') . '</span>  
					<input type="text" class="width2" name="setting-image_post_width" value="' . themify_get('setting-image_post_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>
					<input type="text" class="width2" name="setting-image_post_height" value="' . themify_get('setting-image_post_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
					<br /><span class="pushlabel"><small>' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '</small></span>
				</p>';
    return $output;
}
Пример #11
0
    function themify_gallery_slider()
    {
        /**
         * Associative array containing theme settings
         * @var array
         */
        $data = themify_get_data();
        /**
         * Variable prefix key
         * @var string
         */
        $prefix = 'setting-portfolio_slider_';
        /**
         * Basic default options '', 'yes', 'no'
         * @var array
         */
        $default_options = array(array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
        $auto_options = array(__('4 Secs (default)', 'themify') => 4000, __('Off', 'themify') => 'off', __('1 Sec', 'themify') => 1000, __('2 Secs', 'themify') => 2000, __('3 Secs', 'themify') => 3000, __('4 Secs', 'themify') => 4000, __('5 Secs', 'themify') => 5000, __('6 Secs', 'themify') => 6000, __('7 Secs', 'themify') => 7000, __('8 Secs', 'themify') => 8000, __('9 Secs', 'themify') => 9000, __('10 Secs', 'themify') => 10000);
        $speed_options = array(__('Fast', 'themify') => 500, __('Normal', 'themify') => 1000, __('Slow', 'themify') => 1500);
        $effect_options = array(array('name' => __('Slide', 'themify'), 'value' => 'slide'), array('name' => __('Fade', 'themify'), 'value' => 'fade'));
        $output = '<p>
						<span class="label">' . __('Auto Play', 'themify') . '</span>
						<select name="' . $prefix . 'autoplay">';
        foreach ($auto_options as $name => $val) {
            $output .= '<option value="' . $val . '" ' . selected($data[$prefix . 'autoplay'], $data[$prefix . 'autoplay'] ? $val : 4000, false) . '>' . $name . '</option>';
        }
        $output .= '	</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Effect', 'themify') . '</span>
						<select name="' . $prefix . 'effect">' . themify_options_module($effect_options, $prefix . 'effect') . '
						</select>
					</p>';
        $output .= '<p>
						<span class="label">' . __('Transition Speed', 'themify') . '</span>
						<select name="' . $prefix . 'transition_speed">';
        foreach ($speed_options as $name => $val) {
            $output .= '<option value="' . $val . '" ' . selected($data[$prefix . 'transition_speed'], $data[$prefix . 'transition_speed'] ? $val : 500, false) . '>' . $name . '</option>';
        }
        $output .= '	</select>
					</p>';
        return $output;
    }
Пример #12
0
 /**
  * Builder Settings
  * @param array $data
  * @return string
  * @since 1.2.7
  */
 function themify_manage_builder_active($data = array())
 {
     $pre = 'setting-page_builder_';
     $output = '';
     $options = array(array('name' => __('Enable', 'themify'), 'value' => 'enable'), array('name' => __('Disable', 'themify'), 'value' => 'disable'));
     $output .= sprintf('<p><span class="label">%s</span><select id="%s" name="%s">%s</select></p>', esc_html__('Themify Builder:', 'themify'), esc_attr($pre . 'is_active'), esc_attr($pre . 'is_active'), themify_options_module($options, $pre . 'is_active'));
     if ('disable' != themify_get($pre . 'is_active')) {
         $output .= sprintf('<p><label for="%s"><input type="checkbox" id="%s" name="%s"%s> %s</label></p>', esc_attr($pre . 'disable_shortcuts'), esc_attr($pre . 'disable_shortcuts'), esc_attr($pre . 'disable_shortcuts'), checked(true, themify_check($pre . 'disable_shortcuts'), false), wp_kses_post(__('Disable Builder shortcuts (eg. disable shortcut like Cmd+S = save)', 'themify')));
     }
     return $output;
 }
Пример #13
0
function themify_default_page_layout($data = array())
{
    $data = themify_get_data();
    $options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify'), "selected" => true), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
    $default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
    $val = isset($data['setting-default_page_layout']) ? $data['setting-default_page_layout'] : '';
    /**
     * HTML for settings panel
     * @var string
     */
    $output = '<p>
						<span class="label">' . __('Page Sidebar Option', 'themify') . '</span>';
    foreach ($options as $option) {
        if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $option['selected'])) {
            $val = $option['value'];
        }
        if ($val == $option['value']) {
            $class = "selected";
        } else {
            $class = '';
        }
        $output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '"  /></a>';
    }
    $output .= '<input type="hidden" name="setting-default_page_layout" class="val" value="' . $val . '" /></p>';
    $output .= '<p>
						<span class="label">' . __('Hide Title in All Pages', 'themify') . '</span>
						
						<select name="setting-hide_page_title">';
    foreach ($default_options as $title_option) {
        if (isset($data['setting-hide_page_title']) && $title_option['value'] == $data['setting-hide_page_title']) {
            $output .= '<option selected="selected" value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
        } else {
            $output .= '<option value="' . $title_option['value'] . '">' . $title_option['name'] . '</option>';
        }
    }
    $output .= '</select>
					</p>';
    /**
     * Hide Feauted images in All Pages
     */
    $output .= '<p>
                    <span class="label">' . __('Hide Featured Image', 'themify') . '</span>
                    <select name="setting-hide_page_image">' . themify_options_module($default_options, 'setting-hide_page_image') . '
                    </select>
                </p>';
    $output .= '<p><span class="label">' . __('Page Comments', 'themify') . '</span><label for="setting-comments_pages"><input type="checkbox" id="setting-comments_pages" name="setting-comments_pages" ' . checked(themify_get('setting-comments_pages'), 'on', false) . ' /> ' . __('Disable comments in all Pages', 'themify') . '</label></p>';
    return $output;
}