function __construct($id = 'default_list', $settings = array(), $field_options = array(), $areas = array())
 {
     $rtl = is_rtl() ? '-rtl' : '';
     $list_settings = array('slug' => 'list', 'type' => 'custom', 'label' => __('List (default)', 'gravityview'), 'description' => __('Display items in a listing view.', 'gravityview'), 'logo' => plugins_url('includes/presets/default-list/logo-default-list.png', GRAVITYVIEW_FILE), 'css_source' => gravityview_css_url('list-view' . $rtl . '.css', GRAVITYVIEW_DIR . 'templates/css/'));
     $settings = wp_parse_args($settings, $list_settings);
     $field_options = array('show_as_link' => array('type' => 'checkbox', 'label' => __('Link to single entry', 'gravityview'), 'value' => false, 'context' => 'directory'));
     $areas = array(array('1-1' => array(array('areaid' => 'list-title', 'title' => __('Listing Title', 'gravityview'), 'subtitle' => ''), array('areaid' => 'list-subtitle', 'title' => __('Subheading', 'gravityview'), 'subtitle' => __('Data placed here will be bold.', 'gravityview'))), '1-3' => array(array('areaid' => 'list-image', 'title' => __('Image', 'gravityview'), 'subtitle' => __('Leave empty to remove.', 'gravityview'))), '2-3' => array(array('areaid' => 'list-description', 'title' => __('Other Fields', 'gravityview'), 'subtitle' => __('Below the subheading, a good place for description and other data.', 'gravityview')))), array('1-2' => array(array('areaid' => 'list-footer-left', 'title' => __('Footer Left', 'gravityview'), 'subtitle' => '')), '2-2' => array(array('areaid' => 'list-footer-right', 'title' => __('Footer Right', 'gravityview'), 'subtitle' => ''))));
     parent::__construct($id, $settings, $field_options, $areas);
 }
 function __construct($id = 'default_table_edit', $settings = array(), $field_options = array(), $areas = array())
 {
     $edit_settings = array('slug' => 'edit', 'type' => 'internal', 'label' => __('Edit Table', 'gravityview'), 'description' => __('Display items in a table view.', 'gravityview'), 'logo' => plugins_url('includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE), 'css_source' => gravityview_css_url('table-view.css', GRAVITYVIEW_DIR . 'templates/css/'));
     $settings = wp_parse_args($settings, $edit_settings);
     /**
      * @see  GravityView_Admin_Views::get_default_field_options() for Generic Field Options
      * @var array
      */
     $field_options = array();
     $areas = array(array('1-1' => array(array('areaid' => 'edit-fields', 'title' => __('Visible Edit Fields', 'gravityview')))));
     parent::__construct($id, $settings, $field_options, $areas);
 }
 function __construct($id = 'default_table', $settings = array(), $field_options = array(), $areas = array())
 {
     $table_settings = array('slug' => 'table', 'type' => 'custom', 'label' => __('Table (default)', 'gravityview'), 'description' => __('Display items in a table view.', 'gravityview'), 'logo' => plugins_url('includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE), 'css_source' => gravityview_css_url('table-view.css', GRAVITYVIEW_DIR . 'templates/css/'));
     $settings = wp_parse_args($settings, $table_settings);
     /**
      * @see  GravityView_Admin_Views::get_default_field_options() for Generic Field Options
      * @var array
      */
     $field_options = array('show_as_link' => array('type' => 'checkbox', 'label' => __('Link to single entry', 'gravityview'), 'value' => false, 'context' => 'directory'));
     $areas = array(array('1-1' => array(array('areaid' => 'table-columns', 'title' => __('Visible Table Columns', 'gravityview'), 'subtitle' => __('Each field will be displayed as a column in the table.', 'gravityview')))));
     parent::__construct($id, $settings, $field_options, $areas);
 }
 /**
  * Register scripts and styles used by the Notes field
  *
  * @since 1.17
  *
  * @return void
  */
 public function register_scripts()
 {
     $css_file = gravityview_css_url('entry-notes.css', GravityView_Field_Notes::$path . 'assets/css/');
     wp_register_style('gravityview-notes', $css_file, array(), GravityView_Plugin::version);
     wp_register_script('gravityview-notes', plugins_url('/assets/js/entry-notes.js', GravityView_Field_Notes::$file), array('jquery'), GravityView_Plugin::version, true);
 }
Exemplo n.º 5
0
 /**
  * Handle enqueuing the `gravityview_default_style` stylesheet
  *
  * @since 1.17
  *
  * @param array $css_dependencies Dependencies for the `gravityview_default_style` stylesheet
  *
  * @return void
  */
 private function enqueue_default_style($css_dependencies = array())
 {
     /**
      * @filter `gravityview_use_legacy_search_css` Should GravityView use the legacy Search Bar stylesheet (from before Version 1.17)?
      * @since 1.17
      * @param bool $use_legacy_search_style If true, loads `gv-legacy-search(-rtl).css`. If false, loads `gv-default-styles(-rtl).css`. `-rtl` is added on RTL websites. Default: `false`
      */
     $use_legacy_search_style = apply_filters('gravityview_use_legacy_search_style', false);
     $rtl = is_rtl() ? '-rtl' : '';
     $css_file_base = $use_legacy_search_style ? 'gv-legacy-search' : 'gv-default-styles';
     $path = gravityview_css_url($css_file_base . $rtl . '.css');
     wp_enqueue_style('gravityview_default_style', $path, $css_dependencies, GravityView_Plugin::version, 'all');
 }