Exemple #1
0
 /**
  * Registers meta boxes
  *
  * @param G1_Post_Meta_Box_Manager $manager
  */
 public function g1_post_meta_manager_register(G1_Post_Meta_Manager $manager)
 {
     $post_type = $this->get_post_type();
     // Configuration meta_box
     $manager->add_section(new G1_Post_Meta_Section('simple_sliderconfig', array('title' => __('Configuration', 'g1_theme'))));
     $defaults = $this->get_default_config();
     // Layout
     $manager->add_setting('_g1[simple_slider_layout]', array('apply' => $post_type, 'default' => $defaults['layout'], 'view' => new G1_Form_Image_Choice_Control('_g1[simple_slider_layout]', array('label' => __('Layout', 'g1_theme'), 'choices_cb' => array($this, 'get_layout_choices'), 'default' => $defaults['layout'])), 'section' => 'simple_sliderconfig', 'priority' => 90));
     // Width
     $manager->add_setting('_g1[simple_slider_width]', array('apply' => $post_type, 'default' => $defaults['width'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_width]', array('label' => __('Width', 'g1_theme'), 'default' => $defaults['width'], 'help' => '<p>' . __('The recommended image width', 'g1_theme') . '</p>' . '<ul>' . '<li>' . __('<strong>wide</strong> - ANY', 'g1_theme') . '</li>' . '<li>' . __('<strong>semi</strong> - ' . self::get_slider_width_in_pixels('g1_simple_slider_semi') . 'px', 'g1_theme') . '</li>' . '<li>' . __('<strong>standard</strong> - ' . self::get_slider_width_in_pixels('g1_simple_slider_standard') . 'px', 'g1_theme') . '</li>' . '<li>' . __('<strong>narrow</strong> - ' . self::get_slider_width_in_pixels('g1_simple_slider_narrow') . 'px', 'g1_theme') . '</li>' . '</ul>', 'choices_cb' => array($this, 'get_width_choices'))), 'section' => 'simple_sliderconfig', 'priority' => 100));
     // Height
     $manager->add_setting('_g1[simple_slider_height]', array('apply' => $post_type, 'default' => '', 'view' => new G1_Form_Text_Control('_g1[simple_slider_height]', array('label' => __('Height', 'g1_theme'), 'hint' => __('The image height in pixels (optional)', 'g1_theme'), 'default' => '', 'help' => '<p>' . __('If you leave this value empty, the height will be computed proportionally to the width', 'g1_theme') . '</p>')), 'section' => 'simple_sliderconfig', 'priority' => 105));
     // Transition
     //        $manager->add_setting( '_g1[simple_slider_animation]', array(
     //            'apply'	   	=> $post_type,
     //            'default'	=> $defaults['animation'],
     //            'view'      => new G1_Form_Choice_Control( '_g1[simple_slider_animation]', array(
     //                'label'         => __( 'Transition', 'g1_theme' ),
     //                'hint'			=> __( 'Transition effect', 'g1_theme' ),
     //                'choices_cb'	=> array($this, 'get_fx_choices'),
     //                'default'       => $defaults['animation']
     //            )),
     //            'section'	=> 'simple_sliderconfig',
     //            'priority'	=> 110,
     //        ));
     // Transition speed
     $manager->add_setting('_g1[simple_slider_animation_duration]', array('apply' => $post_type, 'default' => $defaults['animationDuration'], 'view' => new G1_Form_Range_Control('_g1[simple_slider_animation_duration]', array('label' => __('Transition speed', 'g1_theme'), 'min' => 0, 'max' => 5, 'step' => 0.1, 'default' => $defaults['animationDuration'])), 'section' => 'simple_sliderconfig', 'priority' => 120));
     // Pause time
     $manager->add_setting('_g1[simple_slider_slideshow_speed]', array('apply' => $post_type, 'default' => $defaults['slideshowSpeed'], 'view' => new G1_Form_Range_Control('_g1[simple_slider_slideshow_speed]', array('label' => __('Pause time', 'g1_theme'), 'min' => 0, 'max' => 10, 'step' => 0.1, 'default' => $defaults['slideshowSpeed'])), 'section' => 'simple_sliderconfig', 'priority' => 130));
     // Autoplay
     $manager->add_setting('_g1[simple_slider_autoplay]', array('apply' => $post_type, 'default' => $defaults['autoplay'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_autoplay]', array('label' => __('Autoplay', 'g1_theme'), 'choices_cb' => array($this, 'get_on_off_choices'), 'default' => $defaults['autoplay'])), 'section' => 'simple_sliderconfig', 'priority' => 140));
     // Fullscreen mode
     $manager->add_setting('_g1[simple_slider_fullscreen]', array('apply' => $post_type, 'default' => $defaults['fullscreen'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_fullscreen]', array('label' => __('Fullscreen', 'g1_theme'), 'hint' => __('Allow to display slides in fullscreen mode', 'g1_theme'), 'choices_cb' => array($this, 'get_on_off_choices'), 'default' => $defaults['fullscreen'])), 'section' => 'simple_sliderconfig', 'priority' => 140));
     // Coin navigation
     $manager->add_setting('_g1[simple_slider_coin_navigation]', array('apply' => $post_type, 'default' => $defaults['coinNavigation'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_coin_navigation]', array('label' => __('Coin navigation', 'g1_theme'), 'choices_cb' => array($this, 'get_coin_nav_choices'), 'default' => $defaults['coinNavigation'])), 'section' => 'simple_sliderconfig', 'priority' => 150));
     // Direction navigation
     $manager->add_setting('_g1[simple_slider_direction_navigation]', array('apply' => $post_type, 'default' => $defaults['directionNavigation'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_direction_navigation]', array('label' => __('Direction Navigation', 'g1_theme'), 'hint' => __('Allow to navigate using next/prev buttons', 'g1_theme'), 'choices_cb' => array($this, 'get_on_off_choices'), 'default' => $defaults['directionNavigation'])), 'section' => 'simple_sliderconfig', 'priority' => 160));
     // Progress bar
     $manager->add_setting('_g1[simple_slider_progress_bar]', array('apply' => $post_type, 'default' => $defaults['progressBar'], 'view' => new G1_Form_Choice_Control('_g1[simple_slider_progress_bar]', array('label' => __('Progress bar', 'g1_theme'), 'choices_cb' => array($this, 'get_on_off_choices'), 'default' => $defaults['progressBar'])), 'section' => 'simple_sliderconfig', 'priority' => 170));
 }
Exemple #2
0
 /**
  * @param G1_Post_Meta_Manager $manager
  */
 protected function register_audio_format($manager, $post_types)
 {
     $manager->add_section(new G1_Post_Meta_Section('g1_post_formats_audio_config', array('title' => __('Audio', 'g1_theme'))));
     $setting_id = '_format_audio_embed';
     $manager->add_setting($setting_id, array('apply' => $post_types, 'view' => new G1_Form_Long_Text_Control($setting_id, array('label' => __('Audio Url (oEmbed or mp3) or Embed Code', 'g1_theme'))), 'section' => 'g1_post_formats_audio_config', 'priority' => 10));
 }