config['self_closing'] = 'no';
$this->config['auto_repair'] = 'no';
$this->config['name'] = __('Table', 'avia_framework' );
$this->config['tab'] = __('Content Elements', 'avia_framework' );
$this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-table.png";
$this->config['order'] = 35;
$this->config['target'] = 'avia-target-insert';
$this->config['shortcode'] = 'av_table';
$this->config['modal_data'] = array('modal_class' => 'bigscreen', 'before_save' => 'before_table_save');
$this->config['shortcode_nested'] = array('av_row', 'av_cell','av_button');
$this->config['tooltip'] = __('Creates a data or pricing table', 'avia_framework' );
$this->config['preview'] = false;
$this->config['disabling_allowed'] = true;
}
function admin_assets()
{
$ver = AviaBuilder::VERSION;
wp_enqueue_script('avia_table_js' , AviaBuilder::$path['assetsURL'].'js/avia-table.js' , array('avia_modal_js'), $ver, TRUE );
}
function extra_assets()
{
//load css
wp_enqueue_style( 'avia-module-table' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/table/table.css' , array('avia-layout'), false );
}
/**
* Popup Elements
*
* If this function is defined in a child class the element automatically gets an edit button, that, when pressed
* opens a modal window that allows to edit the element properties
*
* @return void
*/
function popup_elements()
{
$this->elements = array(
array(
"type" => "tab_container", 'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Edit Table" , 'avia_framework'),
'nodescription' => true
),
array(
"name" => __("Table Builder", 'avia_framework' ),
"desc" => __("Start by adding columns and rows, then add content and styling to each.", 'avia_framework' ),
"id" => "table",
'container_class' =>"avia-element-fullwidth",
"type" => "table",
"row_style" => array( __('Default Row', 'avia_framework' ) => '',
__('Heading Row', 'avia_framework' ) => 'avia-heading-row',
__('Pricing Row', 'avia_framework' ) => 'avia-pricing-row',
__('Button Row', 'avia_framework' ) => 'avia-button-row'
),
"column_style" => array(__('Default Column', 'avia_framework' ) => '',
__('Highlight Column', 'avia_framework' ) => 'avia-highlight-col',
__('Description Column', 'avia_framework' ) => 'avia-desc-col',
__('Center Text Column', 'avia_framework' ) => 'avia-center-col'
)
),
array(
"type" => "close_div", 'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Table Options" , 'avia_framework'),
'nodescription' => true
),
array(
"name" => __("Table Purpose", 'avia_framework' ),
"desc" => __("Choose if the table should be used to display tabular data or to display pricing options. (Difference: Pricing tables are flashier and try to stand out)", 'avia_framework' ),
"id" => "purpose",
"type" => "select",
"std" => "pricing",
"subtype" => array(
__('Use the table as a Pricing Table', 'avia_framework' ) =>'pricing',
__('Use the table to display tabular data', 'avia_framework' ) =>'tabular')),
array(
"name" => __("Table Design", 'avia_framework' ),
"desc" => __("Use either the default or minimal design", 'avia_framework' ),
"id" => "pricing_table_design",
"type" => "select",
"std" => "avia_pricing_default",
"subtype" => array(
__('Default', 'avia_framework') => 'avia_pricing_default',
__('Minimal', 'avia_framework') => 'avia_pricing_minimal')
),
array(
"name" => __("Empty Cells", 'avia_framework' ),
"desc" => __("Empty Cells are by default hidden. If you want to force equal height across all columns set them to display", 'avia_framework' ),
"id" => "pricing_hidden_cells",
"type" => "select",
"std" => "",
"required" => array("purpose","equals","pricing"),
"subtype" => array(
__('Hide empty Cells', 'avia_framework') => '',
__('Show empty Cells', 'avia_framework') => 'avia_show_empty_cells')
),
array(
"name" => __("Table Caption", 'avia_framework' ),
"desc" => __("Add a short caption to the table so visitors know what the data is about", 'avia_framework' ),
"id" => "caption",
"type" => "input",
"std" => "",
"required" => array("purpose","equals","tabular")
),
array(
"name" => __("Responsive Styling", 'avia_framework' ),
"desc" => __("Select which table styling should be used if the screen is too small for the table.", 'avia_framework' ),
"id" => "responsive_styling",
"type" => "select",
"std" => "avia_responsive_table",
"required" => array("purpose","equals","tabular"),
"subtype" => array(
__('Adjust table to screen size', 'avia_framework') => 'avia_responsive_table',
__('Make entire table scrollable', 'avia_framework') => 'avia_scrollable_table')),
array(
"type" => "close_div", 'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Screen Options",'avia_framework' ),
'nodescription' => true
),
array(
"name" => __("Element Visibility",'avia_framework' ),
"desc" => __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ),
"type" => "heading",
"description_class" => "av-builder-note av-neutral",
),
array(
"desc" => __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'),
"id" => "av-desktop-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'),
"id" => "av-medium-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'),
"id" => "av-small-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'),
"id" => "av-mini-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "close_div", 'nodescription' => true
),
);
}
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_element($params)
{
$params['innerHtml'] = "";
$params['innerHtml'].= "