Your IP : 216.73.216.171


Current Path : /home/ereika83/www/wp-content/plugins/genesis-club-pro/classes/
Upload File :
Current File : /home/ereika83/www/wp-content/plugins/genesis-club-pro/classes/class-post-pro-admin.php

<?php
class Genesis_Club_Post_Pro_Admin extends Genesis_Club_Post_Admin {

	private $title_tips = array(
         'short_title' => array('heading' => 'Alternative Title', 'tip' => 'Enter a value here to override the post title in widgets'),
         'subtitle' => array('heading' => 'Post Subtitle', 'tip' => 'Enter a value here to display the title on two lines; the normal title and this entry as a subtitle'),
	);
	
	private $icon_tips = array(
			'icon_title' => array('heading' => 'Icon Title', 'tip' => 'Short title that appears with the icon.'),
			'icon_alt' => array('heading' => 'Icon Alt', 'tip' => 'Screen reader text that describes the icon. E.g. Phone symbol.'),
			'icon_class' => array('heading' => 'Icon Class', 'tip' => 'Font Awesome class that identifies the icon. E.g. fa-phone.'),
			'icon_color' => array('heading' => 'Icon Color', 'tip' => 'Color to apply to the icon if you want to override the default widget setting.'),
			'icon_custom' => array('heading' => 'Custom Code', 'tip' => 'Shortcode or HTML to produce an "icon" which can be an layered icon, an image, a map, a slider, a video, etc. This replaces the simple icon defined by the settings above.'),
	);  

	function save_post($post_id) {
        if ( wp_is_post_revision( $post_id ) ) return;
        parent::save_post($post_id);
		$keys = array(  'genesis_club_icon' => Genesis_Club_Post_Icons_Widget::ICON_META_KEY,
         'genesis_club_short_title' => Genesis_Club_Post::SHORT_TITLE_META_KEY,
         'genesis_club_subtitle' => Genesis_Club_Post::SUBTITLE_META_KEY);
		$defaults = array('genesis_club_icon' => Genesis_Club_Post_Icons_Widget::get_post_icon_defaults(),
         'genesis_club_short_title' => array(),
         'genesis_club_subtitle' => array()
		 );		
        $this->save_postmeta($post_id, $keys, $defaults);
	}

	function add_post_panel($content, $post) {
		$content = $content + array ('Post Icon' => $this->icon_panel($post), 'Post Title' => $this->title_panel($post),) ;
        return parent::add_post_panel($content, $post);
	}	 

	function icon_panel($post) {
		$form_data = $this->get_meta_form_data(Genesis_Club_Post_Icons_Widget::ICON_META_KEY, 'icon_', Genesis_Club_Post_Icons_Widget::get_post_icon_defaults());
		$this->set_tooltips($this->icon_tips);
		return sprintf ('<div class="diy-wrap">%1$s%2$s%3$s%4$s%5$s<p class="meta-options"><input type="hidden" name="genesis_club_icon" value="1" /></p></div>',
			$this->meta_form_field($form_data, 'class', 'text', array(), array('size' => 20)),
			$this->meta_form_field($form_data, 'title', 'text', array(), array('size' => 20)),
			$this->meta_form_field($form_data, 'alt', 'text', array(), array('size' => 20)),
			$this->meta_form_field($form_data, 'color', 'text', array(), array('class' => 'color-picker')),
			$this->meta_form_field($form_data, 'custom', 'textarea', array(), array('cols' => 40, 'rows' => 4, 'class' => 'large-text'))
		);      
    }

	function title_panel($post) {
		$this->set_tooltips($this->title_tips);
		$s = '';
		if ($form_data = $this->get_meta_form_data(Genesis_Club_Post::SHORT_TITLE_META_KEY, 'short_title'))
            $s .= sprintf ('<div class="diy-wrap">%1$s<p class="meta-options"><input type="hidden" name="genesis_club_short_title" value="1" /></p></div>',
			   $this->meta_form_field($form_data, '', 'text', array(), array('class' => 'large-text')));      
		if ($form_data = $this->get_meta_form_data(Genesis_Club_Post::SUBTITLE_META_KEY, 'subtitle'))
            $s .=  sprintf ('<div class="diy-wrap">%1$s<p class="meta-options"><input type="hidden" name="genesis_club_subtitle" value="1" /></p></div>',
			   $this->meta_form_field($form_data, '', 'text', array(), array('class' => 'large-text')));      
        return $s;
   }

}