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-landing-admin.php

<?php
class Genesis_Club_Landing_Admin extends Genesis_Club_Admin {
    private $landing;
	protected $tips = array(
		'landing_enabled' => array('heading' => 'Use Our Stylesheet', 'tip' => 'Click to disable the theme&#39s stylesheet and use our landing page styling.'),
		'landing_size' => array('heading' => 'Page Size', 'tip' => 'Choose the size of your landing page. This determines how much real estate is given to your form and how much is for the video'),
		'landing_align' => array('heading' => 'Alignment', 'tip' => 'Choose whether you want the form on the left, middle or right'),
		'landing_bullets' => array('heading' => 'List Bullets', 'tip' => 'Choose a style for any bullet points you have on your form '),
		'landing_colors' => array('heading' => 'Color Scheme', 'tip' => 'Choose a color scheme for the headings, text and button'),
		'landing_css' => array('heading' => 'Custom CSS', 'tip' => 'Enter any Custom CSS you want to apply to this landing page '),
		);

	function init() {
      $this->landing = $this->plugin->get_module('landing');
		$this->slug = 'edit.php';
		add_action('do_meta_boxes', array( $this, 'do_meta_boxes'), 20, 2 );
		add_action('save_post', array(  $this, 'save_post'));	
	}

	function admin_menu() {}

	function page_content() {} 

	function load_page() {}
	
	function do_meta_boxes( $post_type, $context) {
		if ($this->is_metabox_active($post_type, $context)) {
			$post_id = array_key_exists('post', $_REQUEST) ? $_REQUEST['post'] : 
				(array_key_exists('post_ID', $_REQUEST) ? $_REQUEST['post_ID'] : '') ;
			if ($post_id 
			&& ($template_file = get_post_meta($post_id,'_wp_page_template',TRUE))
			&& $this->utils->is_landing_page($template_file)) {
            add_filter( 'genesis_club_post_settings', array($this, 'add_post_panel'), 10, 2);	//add to plugin metabox		    	
         }
      }
	}	

	function add_post_panel($content, $post) {
		return $content + array ('Landing Page' => $this->landing_panel($post)) ;
	}	 
	
	function save_post($post_id) {
        if ( wp_is_post_revision( $post_id ) ) return;	
        $this->save_postmeta( $post_id, array('genesis_club_landing' => $this->landing->get_metakey()), array('genesis_club_landing' => $this->landing->get_defaults())) ;
	}

	function landing_panel($post) {
		$form_data = $this->get_meta_form_data($this->landing->get_metakey(), 'landing_', $this->landing->get_defaults());
		$this->set_tooltips($this->tips);
		return sprintf ('<div class="diy-wrap">%1$s%2$s%3$s%4$s%5$s%6$s<p class="meta-options"><input type="hidden" name="genesis_club_landing" value="1" /></p></div>',
			$this->meta_form_field($form_data, 'enabled',  'checkbox'),
			$this->meta_form_field($form_data, 'size',  'select', $this->landing->get_sizes()),
			$this->meta_form_field($form_data, 'align', 'select', $this->landing->get_alignments()),
			$this->meta_form_field($form_data, 'colors',  'select', $this->landing->get_colors()),
			$this->meta_form_field($form_data, 'bullets', 'select', $this->landing->get_bullets()),
			$this->meta_form_field($form_data, 'css', 'textarea', array(), array('cols'=> 50, 'rows' => 10, 'class' => 'large-text')));      
    }

}