Exemple #1
0
 /**
  * Editor Element
  */
 function editor_element($params)
 {
     extract($params);
     $name = $this->config['shortcode'];
     $data['shortcodehandler'] = $this->config['shortcode'];
     $data['modal_title'] = $this->config['name'];
     $data['modal_ajax_hook'] = $this->config['shortcode'];
     $data['dragdrop-level'] = $this->config['drag-level'];
     $data['allowed-shortcodes'] = $this->config['shortcode'];
     if (!empty($this->config['modal_on_load'])) {
         $data['modal_on_load'] = $this->config['modal_on_load'];
     }
     $dataString = AviaHelper::create_data_string($data);
     $output = "<div class='avia_layout_section avia_pop_class avia-no-visual-updates " . $name . " av_drag' " . $dataString . ">";
     $output .= "    <div class='avia_sorthandle menu-item-handle'>";
     $output .= "        <span class='avia-element-title'>" . $this->config['name'] . "</span>";
     $output .= "        <a class='avia-delete'  href='#delete' title='" . __('Delete Section', 'avia_framework') . "'>x</a>";
     if (!empty($this->config['popup_editor'])) {
         $output .= "    <a class='avia-edit-element'  href='#edit-element' title='" . __('Edit Section', 'avia_framework') . "'>edit</a>";
     }
     $output .= "        <a class='avia-clone'  href='#clone' title='" . __('Clone Section', 'avia_framework') . "' >" . __('Clone Section', 'avia_framework') . "</a></div>";
     $output .= "    <div class='avia_inner_shortcode avia_connect_sort av_drop' data-dragdrop-level='" . $this->config['drop-level'] . "'>";
     $output .= "<textarea data-name='text-shortcode' cols='20' rows='4'>" . ShortcodeHelper::create_shortcode_by_array($name, $content, $args) . "</textarea>";
     if ($content) {
         $content = $this->builder->do_shortcode_backend($content);
     }
     $output .= $content;
     $output .= "</div></div>";
     return $output;
 }
Exemple #2
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('email' => get_option('admin_email'), 'button' => __("Submit", 'avia_framework'), 'autorespond' => '', 'captcha' => '', 'subject' => '', 'on_send' => '', 'link' => '', 'sent' => __("Your message has been sent!", 'avia_framework'), 'title' => __("Send us mail", 'avia_framework')), $atts, $this->config['shortcode']);
     extract($atts);
     $post_id = function_exists('avia_get_the_id') ? avia_get_the_id() : get_the_ID();
     $redirect = !empty($on_send) ? AviaHelper::get_url($link) : "";
     $form_args = array("heading" => $title ? "<h3>" . $title . "</h3>" : "", "success" => "<h3 class='avia-form-success'>" . $sent . "</h3>", "submit" => $button, "myemail" => $email, "action" => get_permalink($post_id), "myblogname" => get_option('blogname'), "autoresponder" => $autorespond, "autoresponder_subject" => __('Thank you for your Message!', 'avia_framework'), "autoresponder_email" => $email, "subject" => $subject, "form_class" => $meta['el_class'], "multiform" => true, "label_first" => true, "redirect" => $redirect);
     if (trim($form_args['myemail']) == '') {
         $form_args['myemail'] = get_option('admin_email');
     }
     //form fields passed by the user
     $form_fields = $this->helper_array2form_fields(ShortcodeHelper::shortcode2array($content, 1));
     //fake username field that is not visible. if the field has a value a spam bot tried to send the form
     $elements['avia_username'] = array('type' => 'decoy', 'label' => '', 'check' => 'must_empty');
     //captcha field for the user to verify that he is real
     if ($captcha) {
         $elements['avia_age'] = array('type' => 'captcha', 'check' => 'captcha', 'label' => __('Please prove that you are human by solving the equation', 'avia_framework'));
     }
     //merge all fields
     $form_fields = apply_filters('avia_contact_form_elements', array_merge($form_fields, $elements));
     $form_args = apply_filters('avia_contact_form_args', $form_args, $post_id);
     $contact_form = new avia_form($form_args);
     $contact_form->create_elements($form_fields);
     $output = $contact_form->display_form(true);
     return $output;
 }
Exemple #3
0
 /**
  * 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)
 {
     extract($params);
     $name = $this->config['shortcode'];
     $drag = $this->config['drag-level'];
     $drop = $this->config['drop-level'];
     $size = array('av_cell_one_full' => '1/1', 'av_cell_one_half' => '1/2', 'av_cell_one_third' => '1/3', 'av_cell_one_fourth' => '1/4', 'av_cell_one_fifth' => '1/5', 'av_cell_two_third' => '2/3', 'av_cell_three_fourth' => '3/4', 'av_cell_two_fifth' => '2/5', 'av_cell_three_fifth' => '3/5', 'av_cell_four_fifth' => '4/5');
     $data['shortcodehandler'] = $this->config['shortcode'];
     $data['modal_title'] = __('Edit Cell', 'avia_framework');
     $data['modal_ajax_hook'] = $this->config['shortcode'];
     $data['dragdrop-level'] = $this->config['drag-level'];
     $data['allowed-shortcodes'] = $this->config['shortcode'];
     if (!empty($this->config['modal_on_load'])) {
         $data['modal_on_load'] = $this->config['modal_on_load'];
     }
     $dataString = AviaHelper::create_data_string($data);
     $output = "<div class='avia_layout_column avia_layout_cell avia_pop_class avia-no-visual-updates " . $name . " av_drag' {$dataString} data-width='{$name}'>";
     $output .= "<div class='avia_sorthandle'>";
     $output .= "<span class='avia-col-size'>" . $size[$name] . "</span>";
     $output .= "<a class='avia-delete'  href='#delete' title='" . __('Delete Cell', 'avia_framework') . "'>x</a>";
     $output .= "<a class='avia-clone'  href='#clone' title='" . __('Clone Cell', 'avia_framework') . "' >" . __('Clone Cell', 'avia_framework') . "</a>";
     if (!empty($this->config['popup_editor'])) {
         $output .= "    <a class='avia-edit-element'  href='#edit-element' title='" . __('Edit Cell', 'avia_framework') . "'>edit</a>";
     }
     $output .= "</div><div class='avia_inner_shortcode avia_connect_sort av_drop ' data-dragdrop-level='{$drop}'><span class='av-fake-cellborder'></span>";
     $output .= "<textarea data-name='text-shortcode' cols='20' rows='4'>" . ShortcodeHelper::create_shortcode_by_array($name, $content, $args) . "</textarea>";
     if ($content) {
         $content = $this->builder->do_shortcode_backend($content);
     }
     $output .= $content;
     $output .= "</div></div>";
     return $output;
 }
 /**
  * Meta Box initialization
  */
 function init_boxes()
 {
     //load the options array
     if (!empty($this->default_boxes) && !empty($this->box_elements)) {
         //loop over the box array
         foreach ($this->default_boxes as $key => $box) {
             foreach ($box['page'] as $area) {
                 //class filter for expanded items
                 if (!empty($box['expandable'])) {
                     if (!empty($_GET['avia-expanded']) && $_GET['avia-expanded'] === $box['id']) {
                         add_filter("postbox_classes_{$area}_{$box['id']}", array($this, 'add_meta_box_class'));
                         //postbox class filter
                     }
                 }
                 global $post_ID;
                 //class filter for hiden items
                 if ('avia_builder' === $box['id'] && isset($_GET['post']) && AviaHelper::builder_status($_GET['post']) != 'active' || 'avia_builder' === $box['id'] && empty($_GET['post'])) {
                     add_filter("postbox_classes_{$area}_{$box['id']}", array($this, 'add_meta_box_hidden'));
                     //postbox class filter
                 }
                 //meta box creation
                 $box['iteration'] = $key;
                 add_meta_box($box['id'], $box['title'], array(&$this, 'create_meta_box'), $area, $box['context'], $box['priority'], array('avia_current_box' => $box));
             }
         }
     }
 }
Exemple #5
0
 /**
  * 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("name" => __("Do you want to display blog posts?", 'avia_framework'), "desc" => __("Do you want to display blog posts or entries from a custom taxonomy?", 'avia_framework'), "id" => "blog_type", "type" => "select", "std" => "posts", "subtype" => array(__('Display blog posts', 'avia_framework') => 'posts', __('Display entries from a custom taxonomy', 'avia_framework') => 'taxonomy')), array("name" => __("Which categories should be used for the blog?", 'avia_framework'), "desc" => __("You can select multiple categories here. The Page will then show posts from only those categories.", 'avia_framework'), "id" => "categories", "type" => "select", "multiple" => 6, "required" => array('blog_type', 'equals', 'posts'), "subtype" => "cat"), array("name" => __("Which Entries?", 'avia_framework'), "desc" => __("Select which entries should be displayed by selecting a taxonomy", 'avia_framework'), "id" => "link", "fetchTMPL" => true, "type" => "linkpicker", "subtype" => array(__('Display Entries from:', 'avia_framework') => 'taxonomy'), "multiple" => 6, "required" => array('blog_type', 'equals', 'taxonomy'), "std" => "category"), array("name" => __("Blog Style", 'avia_framework'), "desc" => __("Choose the default blog layout here.", 'avia_framework'), "id" => "blog_style", "type" => "select", "std" => "single-big", "no_first" => true, "subtype" => array(__('Multi Author Blog (displays Gravatar of the article author beside the entry and feature images above)', 'avia_framework') => 'multi-big', __('Single Author, small preview Pic (no author picture is displayed, feature image is small)', 'avia_framework') => 'single-small', __('Single Author, big preview Pic (no author picture is displayed, feature image is big)', 'avia_framework') => 'single-big', __('Grid Layout', 'avia_framework') => 'blog-grid')), array("name" => __("Blog Grid Columns", 'avia_framework'), "desc" => __("How many columns do you want to display?", 'avia_framework'), "id" => "columns", "type" => "select", "std" => "3", "required" => array('blog_style', 'equals', 'blog-grid'), "subtype" => AviaHtmlHelper::number_array(1, 5, 1)), array("name" => __("Define Blog Grid layout", 'avia_framework'), "desc" => __("Do you want to display a read more link?", 'avia_framework'), "id" => "contents", "type" => "select", "std" => "excerpt", "required" => array('blog_style', 'equals', 'blog-grid'), "subtype" => array(__('Title and Excerpt', 'avia_framework') => 'excerpt', __('Title and Excerpt + Read More Link', 'avia_framework') => 'excerpt_read_more', __('Only Title', 'avia_framework') => 'title', __('Only Title + Read More Link', 'avia_framework') => 'title_read_more', __('Only excerpt', 'avia_framework') => 'only_excerpt', __('Only excerpt + Read More Link', 'avia_framework') => 'only_excerpt_read_more', __('No Title and no excerpt', 'avia_framework') => 'no')), array("name" => __("Blog Content length", 'avia_framework'), "desc" => __("Should the full entry be displayed or just a small excerpt?", 'avia_framework'), "id" => "content_length", "type" => "select", "std" => "content", "required" => array('blog_style', 'not', 'blog-grid'), "subtype" => array(__('Full Content', 'avia_framework') => 'content', __('Excerpt', 'avia_framework') => 'excerpt', __('Excerpt With Read More Link', 'avia_framework') => 'excerpt_read_more')), array("name" => __("Preview Image Size", 'avia_framework'), "desc" => __("Set the image size of the preview images", 'avia_framework'), "id" => "preview_mode", "type" => "select", "std" => "auto", "subtype" => array(__('Set the preview image size automatically based on column or layout width', 'avia_framework') => 'auto', __('Choose the preview image size manually (select thumbnail size)', 'avia_framework') => 'custom')), array("name" => __("Select custom preview image size", 'avia_framework'), "desc" => __("Choose image size for Preview Image", 'avia_framework'), "id" => "image_size", "type" => "select", "required" => array('preview_mode', 'equals', 'custom'), "std" => "portfolio", "subtype" => AviaHelper::get_registered_image_sizes(array('logo'))), array("name" => __("Post Number", 'avia_framework'), "desc" => __("How many items should be displayed per page?", 'avia_framework'), "id" => "items", "type" => "select", "std" => "3", "subtype" => AviaHtmlHelper::number_array(1, 100, 1, array('All' => '-1'))), array("name" => __("Offset Number", 'avia_framework'), "desc" => __("The offset determines where the query begins pulling posts. Useful if you want to remove a certain number of posts because you already query them with another blog element.", 'avia_framework'), "id" => "offset", "type" => "select", "std" => "0", "subtype" => AviaHtmlHelper::number_array(1, 100, 1, array(__('Deactivate offset', 'avia_framework') => '0', __('Do not allow duplicate posts on the entire page (set offset automatically)', 'avia_framework') => 'no_duplicates'))), array("name" => __("Pagination", 'avia_framework'), "desc" => __("Should a pagination be displayed?", 'avia_framework'), "id" => "paginate", "type" => "select", "std" => "yes", "subtype" => array(__('yes', 'avia_framework') => 'yes', __('no', 'avia_framework') => 'no')));
     if (current_theme_supports('add_avia_builder_post_type_option')) {
         $element = array("name" => __("Select Post Type", 'avia_framework'), "desc" => __("Select which post types should be used. Note that your taxonomy will be ignored if you do not select an assign post type.\n                                      If yo don't select post type all registered post types will be used", 'avia_framework'), "id" => "post_type", "type" => "select", "required" => array('blog_type', 'equals', 'taxonomy'), "multiple" => 6, "std" => "", "subtype" => AviaHtmlHelper::get_registered_post_type_array());
         array_splice($this->elements, 2, 0, array($element));
     }
 }
Exemple #6
0
 /**
  * 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("name" => __("Which categories should be used for the portfolio?", 'avia_framework'), "desc" => __("You can select multiple categories here. The Page will then show posts from only those categories.", 'avia_framework'), "id" => "categories", "type" => "select", "multiple" => 6, "taxonomy" => "portfolio_entries", "subtype" => "cat"), array("name" => __("Columns", 'avia_framework'), "desc" => __("How many columns should be displayed?", 'avia_framework'), "id" => "columns", "type" => "select", "std" => "4", "subtype" => array(__('1 Column', 'avia_framework') => '1', __('2 Columns', 'avia_framework') => '2', __('3 Columns', 'avia_framework') => '3', __('4 Columns', 'avia_framework') => '4')), array("name" => __("1 Column layout", 'avia_framework'), "desc" => __("Choose the 1 column layout", 'avia_framework'), "id" => "one_column_template", "type" => "select", "required" => array('columns', 'equals', '1'), "std" => "special", "subtype" => array(__('Use special 1 column layout (side by side)', 'avia_framework') => 'special', __('Use default portfolio layout', 'avia_framework') => 'default')), array("name" => __("Post Number", 'avia_framework'), "desc" => __("How many items should be displayed per page?", 'avia_framework'), "id" => "items", "type" => "select", "std" => "16", "subtype" => AviaHtmlHelper::number_array(1, 100, 1, array('All' => '-1'))), array("name" => __("Excerpt", 'avia_framework'), "desc" => __("Display Excerpt and Title below the preview image?", 'avia_framework'), "id" => "contents", "type" => "select", "std" => "yes", "subtype" => array(__('Title and Excerpt', 'avia_framework') => 'excerpt', __('Only Title', 'avia_framework') => 'title', __('Only excerpt', 'avia_framework') => 'only_excerpt', __('No Title and no excerpt', 'avia_framework') => 'no')), array("name" => __("Portfolio Grid Image Size", 'avia_framework'), "desc" => __("Set the image size of the Portfolio Grid images", 'avia_framework'), "id" => "preview_mode", "type" => "select", "std" => "auto", "subtype" => array(__('Set the Portfolio Grid image size automatically based on column or layout width', 'avia_framework') => 'auto', __('Choose the Portfolio Grid image size manually (select thumbnail size)', 'avia_framework') => 'custom')), array("name" => __("Select custom image size", 'avia_framework'), "desc" => __("Choose image size for Portfolio Grid Images", 'avia_framework') . "<br/><small>" . __("(Note: Images will be scaled to fit for the amount of columns chosen above)", 'avia_framework') . "</small>", "id" => "image_size", "type" => "select", "required" => array('preview_mode', 'equals', 'custom'), "std" => "portfolio", "subtype" => AviaHelper::get_registered_image_sizes(array('logo', 'thumbnail', 'widget'))), array("name" => __("Link Handling", 'avia_framework'), "desc" => __("When clicking on a portfolio item you can choose to open the link to the single entry, open a preview (aka AJAX Portfolio) or show a bigger version of the image in a lightbox overlay", 'avia_framework'), "id" => "linking", "type" => "select", "std" => "", "subtype" => array(__('Open the entry on a new page', 'avia_framework') => '', __('Open a preview of the entry (known as AJAX Portfolio)', 'avia_framework') => 'ajax', __('Display the big image in a lightbox', 'avia_framework') => 'lightbox')), array("name" => __("Sortable?", 'avia_framework'), "desc" => __("Should the sorting options based on categories be displayed?", 'avia_framework'), "id" => "sort", "type" => "select", "std" => "yes", "subtype" => array(__('yes', 'avia_framework') => 'yes', __('no', 'avia_framework') => 'no')), array("name" => __("Pagination", 'avia_framework'), "desc" => __("Should a pagination be displayed?", 'avia_framework'), "id" => "paginate", "type" => "select", "std" => "yes", "subtype" => array(__('yes', 'avia_framework') => 'yes', __('no', 'avia_framework') => 'no')));
     if (current_theme_supports('avia_template_builder_custom_post_type_grid')) {
         $this->elements[0] = array("name" => __("Which Entries?", 'avia_framework'), "desc" => __("Select which entries should be displayed by selecting a taxonomy", 'avia_framework'), "id" => "link", "fetchTMPL" => true, "type" => "linkpicker", "subtype" => array(__('Display Entries from:', 'avia_framework') => 'taxonomy'), "multiple" => 6, "std" => "category");
         if (current_theme_supports('add_avia_builder_post_type_option')) {
             $element = array("name" => __("Select Post Type", 'avia_framework'), "desc" => __("Select which post types should be used. Note that your taxonomy will be ignored if you do not select an assign post type.\n\t\t\t\t\t\t                      If yo don't select post type all registered post types will be used", 'avia_framework'), "id" => "post_type", "type" => "select", "multiple" => 6, "std" => "", "subtype" => AviaHtmlHelper::get_registered_post_type_array());
             array_unshift($this->elements, $element);
         }
     }
 }
 /**
  * The get_custom_post function gets a custom post based on a post title. if no post cold be found it creates one
  * @param string $post_title the title of the post
  * @package 	AviaFramework
  */
 public static function get_custom_post($post_title)
 {
     $save_title = AviaHelper::save_string($post_title);
     $args = array('post_type' => 'avia_framework_post', 'post_title' => 'avia_' . $save_title, 'post_status' => 'draft', 'comment_status' => 'closed', 'ping_status' => 'closed');
     $avia_post = get_page_by_title($args['post_title'], 'ARRAY_A', 'avia_framework_post');
     if (!isset($avia_post['ID'])) {
         $avia_post_id = wp_insert_post($args);
     } else {
         $avia_post_id = $avia_post['ID'];
     }
     return $avia_post_id;
 }
Exemple #8
0
 /**
  * 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)
 {
     //fetch all registered sidebars
     $sidebars = AviaHelper::get_registered_sidebars();
     if (empty($params['args']['widget_area'])) {
         $params['args']['widget_area'] = reset($sidebars);
     }
     $element = array('subtype' => $sidebars, 'type' => 'select', 'std' => htmlspecialchars_decode($params['args']['widget_area']), 'class' => 'avia-recalc-shortcode', 'data' => array('attr' => 'widget_area'));
     $inner = "<img src='" . $this->config['icon'] . "' title='" . $this->config['name'] . "' />";
     $inner .= "<div class='avia-element-label'>" . $this->config['name'] . "</div>";
     $inner .= AviaHtmlHelper::render_element($element);
     $params['class'] = "";
     $params['content'] = NULL;
     $params['innerHtml'] = $inner;
     return $params;
 }
Exemple #9
0
 /**
  * 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['content'] = trim($params['content']);
     				if(empty($params['content'])) $params['content'] = "[av_cell_one_half first][/av_cell_one_half] [av_cell_one_half][/av_cell_one_half]";
     */
     extract($params);
     $name = $this->config['shortcode'];
     $data['shortcodehandler'] = $this->config['shortcode'];
     $data['modal_title'] = $this->config['name'];
     $data['modal_ajax_hook'] = $this->config['shortcode'];
     $data['dragdrop-level'] = $this->config['drag-level'];
     $data['allowed-shortcodes'] = $this->config['shortcode'];
     if (!empty($this->config['modal_on_load'])) {
         $data['modal_on_load'] = $this->config['modal_on_load'];
     }
     $dataString = AviaHelper::create_data_string($data);
     if ($content) {
         $final_content = $this->builder->do_shortcode_backend($content);
         $text_area = ShortcodeHelper::create_shortcode_by_array($name, $content, $args);
     } else {
         $cell = new avia_sc_cell_one_half($this->builder);
         $params = array('content' => "", 'args' => array(), 'data' => '');
         $final_content = "";
         $final_content .= $cell->editor_element($params);
         $final_content .= $cell->editor_element($params);
         $text_area = ShortcodeHelper::create_shortcode_by_array($name, '[av_cell_one_half first][/av_cell_one_half] [av_cell_one_half][/av_cell_one_half]', $args);
     }
     $output = "<div class='avia_layout_row avia_layout_section avia_pop_class avia-no-visual-updates " . $name . " av_drag' " . $dataString . ">";
     $output .= "    <a class='avia-add-cell avia-add'  href='#add-cell' title='" . __('Add Cell', 'avia_framework') . "'>Add Cell</a>";
     $output .= "    <a class='avia-set-cell-size avia-add'  href='#set-size' title='" . __('Set Cell Size', 'avia_framework') . "'>Set Cell Size</a>";
     $output .= "    <div class='avia_sorthandle menu-item-handle'>";
     $output .= "        <span class='avia-element-title'>" . $this->config['name'] . "</span>";
     $output .= "        <a class='avia-delete'  href='#delete' title='" . __('Delete Row', 'avia_framework') . "'>x</a>";
     if (!empty($this->config['popup_editor'])) {
         $output .= "    <a class='avia-edit-element'  href='#edit-element' title='" . __('Edit Row', 'avia_framework') . "'>edit</a>";
     }
     $output .= "<a class='avia-save-element'  href='#save-element' title='" . __('Save Element as Template', 'avia_framework') . "'>+</a>";
     $output .= "        <a class='avia-clone'  href='#clone' title='" . __('Clone Row', 'avia_framework') . "' >" . __('Clone Row', 'avia_framework') . "</a></div>";
     $output .= "    <div class='avia_inner_shortcode avia_connect_sort av_drop' data-dragdrop-level='" . $this->config['drop-level'] . "'>";
     $output .= "<textarea data-name='text-shortcode' cols='20' rows='4'>" . $text_area . "</textarea>";
     $output .= $final_content;
     $output .= "</div></div>";
     return $output;
 }
Exemple #10
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('label' => 'Click me', 'link' => '', 'link_target' => '', 'color' => 'theme-color', 'custom_bg' => '#444444', 'custom_font' => '#ffffff', 'size' => 'small', 'position' => 'center', 'icon_select' => 'yes', 'icon' => '', 'font' => ''), $atts);
     $display_char = av_icon($atts['icon'], $atts['font']);
     $style = "";
     if ($atts['color'] == "custom") {
         $style .= "style='background-color:" . $atts['custom_bg'] . "; border-color:" . $atts['custom_bg'] . "; color:" . $atts['custom_font'] . "; '";
     }
     $blank = strpos($atts['link_target'], '_blank') !== false ? ' target="_blank" ' : "";
     $blank .= strpos($atts['link_target'], 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = AviaHelper::get_url($atts['link']);
     $link = $link == "http://" ? "" : $link;
     $output = "";
     $output .= "<a href='{$link}' class='avia-button " . $this->class_by_arguments('icon_select, color, size, position', $atts, true) . "' {$blank} {$style} >";
     $output .= "<span class='avia_button_icon' {$display_char}></span>";
     $output .= "<span class='avia_iconbox_title' >" . $atts['label'] . "</span>";
     $output .= "</a>";
     $output = "<div class='avia-button-wrap avia-button-" . $atts['position'] . " " . $meta['el_class'] . "'>" . $output . "</div>";
     return $output;
 }
Exemple #11
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('style' => "grid", 'columns' => "2", "autoplay" => true, "interval" => 5), $atts);
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     extract($atts);
     $output = "";
     switch ($columns) {
         case 1:
             $columnClass = "av_one_full flex_column no_margin";
             break;
         case 2:
             $columnClass = "av_one_half flex_column no_margin";
             break;
         case 3:
             $columnClass = "av_one_third flex_column no_margin";
             break;
         case 4:
             $columnClass = "av_one_fourth flex_column no_margin";
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => 'fade', 'hoverpause' => true));
     $output .= "<div {$data} class='avia-testimonial-wrapper avia-{$style}-testimonials avia-{$style}-{$columns}-testimonials avia_animate_when_almost_visible {$custom_class}'>";
     avia_sc_testimonial::$counter = 1;
     avia_sc_testimonial::$rows = 1;
     avia_sc_testimonial::$columnClass = $columnClass;
     avia_sc_testimonial::$columns = $columns;
     avia_sc_testimonial::$style = $style;
     //if we got a slider we only need a single row wrpper
     if ($style == "slider") {
         avia_sc_testimonial::$columns = 100000;
     }
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     //close unclosed wrapper containers
     if (avia_sc_testimonial::$counter != 1) {
         $output .= "</div>";
     }
     $output .= "</div>";
     return $output;
 }
Exemple #12
0
 public function html()
 {
     global $avia_config;
     $output = "";
     if (empty($this->entries) || empty($this->entries->posts)) {
         return $output;
     }
     avia_post_slider::$slide++;
     extract($this->atts);
     if ($preview_mode == 'auto') {
         $image_size = 'portfolio';
     }
     $extraClass = 'first';
     $grid = 'one_third';
     $post_loop_count = 1;
     $loop_counter = 1;
     $autoplay = $autoplay == "no" ? false : true;
     $total = $columns % 2 ? "odd" : "even";
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             if ($preview_mode == 'auto') {
                 $image_size = 'large';
             }
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
         case "5":
             $grid = 'av_one_fifth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'show_slide_delay' => 90));
     $thumb_fallback = "";
     $markup = avia_markup_helper(array('context' => 'blog', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<div {$data} class='avia-content-slider avia-content-{$type}-active avia-content-slider" . avia_post_slider::$slide . " avia-content-slider-{$total} {$class}' {$markup}>";
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($this->entries->posts as $entry) {
         $the_id = $entry->ID;
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $this->entries->post_count == $post_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry post-entry-{$the_id} slide-entry-overview slide-loop-{$post_loop_count} slide-parity-{$parity} {$last}";
         $link = get_permalink($the_id);
         $excerpt = "";
         $title = '';
         $show_meta = !is_post_type_hierarchical($entry->post_type);
         $commentCount = get_comments_number($the_id);
         $thumbnail = get_the_post_thumbnail($the_id, $image_size);
         $format = get_post_format($the_id);
         if (empty($format)) {
             $format = "standard";
         }
         if ($thumbnail) {
             $thumb_fallback = $thumbnail;
             $thumb_class = "real-thumbnail";
         } else {
             $thumbnail = "<span class=' fallback-post-type-icon' " . av_icon_string($format) . "></span><span class='slider-fallback-image'>{{thumbnail}}</span>";
             $thumb_class = "fake-thumbnail";
         }
         $permalink = '<div class="read-more-link"><a href="' . get_permalink($the_id) . '" class="more-link">' . __('Read more', 'avia_framework') . '<span class="more-link-arrow">  &rarr;</span></a></div>';
         $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters('avf_postgrid_excerpt_length', 60), apply_filters('avf_postgrid_excerpt_delimiter', " "), "…", true, '');
         if ($format == 'link') {
             $current_post = array();
             $current_post['content'] = $entry->post_content;
             $current_post['title'] = $entry->post_title;
             if (function_exists('avia_link_content_filter')) {
                 $current_post = avia_link_content_filter($current_post);
             }
             $link = $current_post['url'];
         }
         switch ($contents) {
             case "excerpt":
                 $excerpt = $prepare_excerpt;
                 $title = $entry->post_title;
                 break;
             case "excerpt_read_more":
                 $excerpt = $prepare_excerpt;
                 $excerpt .= $permalink;
                 $title = $entry->post_title;
                 break;
             case "title":
                 $excerpt = '';
                 $title = $entry->post_title;
                 break;
             case "title_read_more":
                 $excerpt = $permalink;
                 $title = $entry->post_title;
                 break;
             case "only_excerpt":
                 $excerpt = $prepare_excerpt;
                 $title = '';
                 break;
             case "only_excerpt_read_more":
                 $excerpt = $prepare_excerpt;
                 $excerpt .= $permalink;
                 $title = '';
                 break;
             case "no":
                 $excerpt = '';
                 $title = '';
                 break;
         }
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap'>";
         }
         $post_format = get_post_format($the_id) ? get_post_format($the_id) : 'standard';
         $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $output .= "<article class='slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' {$markup}>";
         $output .= $thumbnail ? "<a href='{$link}' data-rel='slide-" . avia_post_slider::$slide . "' class='slide-image' title=''>{$thumbnail}</a>" : "";
         if ($post_format == "audio") {
             $current_post = array();
             $current_post['content'] = $entry->post_content;
             $current_post['title'] = $entry->post_title;
             $current_post = apply_filters('post-format-' . $post_format, $current_post);
             if (!empty($current_post['before_content'])) {
                 $output .= '<div class="big-preview single-big audio-preview">' . $current_post['before_content'] . '</div>';
             }
         }
         $output .= "<div class='slide-content'>";
         $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $output .= '<header class="entry-content-header">';
         $output .= !empty($title) ? "<h3 class='slide-entry-title entry-title' {$markup}><a href='{$link}' title='" . esc_attr(strip_tags($title)) . "'>" . $title . "</a></h3>" : '';
         $output .= '</header>';
         if ($show_meta && !empty($excerpt)) {
             $output .= "<div class='slide-meta'>";
             if ($commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') {
                 $link_add = $commentCount === "0" ? "#respond" : "#comments";
                 $text_add = $commentCount === "1" ? __('Comment', 'avia_framework') : __('Comments', 'avia_framework');
                 $output .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a></div><div class='slide-meta-del'>/</div>";
             }
             $markup = avia_markup_helper(array('context' => 'entry_time', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
             $output .= "<time class='slide-meta-time updated' {$markup}>" . get_the_time(get_option('date_format'), $the_id) . "</time>";
             $output .= "</div>";
         }
         $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $excerpt = apply_filters('avf_post_slider_entry_excerpt', $excerpt, $prepare_excerpt, $permalink, $entry);
         $output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' {$markup}>" . $excerpt . "</div>" : "";
         $output .= "</div>";
         $output .= '<footer class="entry-footer"></footer>';
         $output .= "</article>";
         $loop_counter++;
         $post_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     if ($post_loop_count - 1 > $columns && $type == 'slider') {
         $output .= $this->slide_navigation_arrows();
     }
     if ($use_main_query_pagination == 'yes' && $paginate == "yes") {
         global $wp_query;
         $avia_pagination = avia_pagination($wp_query->max_num_pages, 'nav');
     } else {
         if ($paginate == "yes") {
             $avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav');
         }
     }
     if (!empty($avia_pagination)) {
         $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>";
     }
     $output .= "</div>";
     $output = str_replace('{{thumbnail}}', $thumb_fallback, $output);
     wp_reset_query();
     return $output;
 }
 function av_rotator_item($atts, $content = "", $shortcodename = "")
 {
     $atts = shortcode_atts(array('title' => '', 'link' => '', 'linktarget' => '', 'custom_title' => ''), $atts, 'av_rotator_item');
     extract($atts);
     $this->count++;
     $style = AviaHelper::style_string($atts, 'custom_title', 'color');
     $style = AviaHelper::style_string($style);
     $link = AviaHelper::get_url($link);
     $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $tags = !empty($link) ? array("a href='{$link}' {$blank} ", 'a') : array('span', 'span');
     $output = "";
     $output .= "<{$tags[0]} {$style} class='av-rotator-text-single av-rotator-text-single-{$this->count}'>";
     $output .= ShortcodeHelper::avia_remove_autop($title, true);
     $output .= "</{$tags[1]}>";
     return $output;
 }
Exemple #14
0
 function html()
 {
     $output = "";
     $class = !empty($this->atts['first_big_pos']) ? " av-magazine-hero-" . $this->atts['first_big_pos'] : "";
     $class .= " " . $this->atts['top_bar'];
     if (!empty($this->atts['tabs'])) {
         $class .= " av-magazine-tabs-active";
     }
     $output .= "<div id='av-magazine-" . self::$magazine . "' class='av-magazine " . $this->atts['class'] . " {$class}' >";
     if ($this->atts['top_bar']) {
         $link = AviaHelper::get_url($this->atts['heading_link']);
         $heading = $this->atts['heading'];
         $b_class = "";
         $b_style = "";
         if ($this->atts['heading_color'] != "theme-color") {
             if ($this->atts['heading_color'] == "custom") {
                 $b_style = "style='color: " . $this->atts['heading_custom_color'] . ";'";
             }
             $b_class .= "avia-font-color-" . $this->atts['heading_color'] . " avia-inherit-font-color";
         }
         $output .= "<div class='av-magazine-top-bar {$b_class}' {$b_style}>";
         if ($heading) {
             $output .= "<a href='{$link}' class='av-magazine-top-heading'>{$heading}</a>";
         }
         if (!empty($this->atts['tabs'])) {
             $output .= $this->sort_buttons();
         }
         $output .= "</div>";
     }
     //magazine main loop
     $output .= $this->magazine_loop($this->entries);
     //magazine sub loops
     $output .= $this->magazine_sub_loop();
     $output .= "</div>";
     return $output;
 }
 /**
  *calls external classes that are needed for the script to operate
  **/
 public function call_classes()
 {
     //create the meta boxes
     new MetaBoxBuilder($this->paths['configPath']);
     // save button
     $this->builderTemplate = new AviaSaveBuilderTemplate($this);
     //activate helper function hooks
     AviaHelper::backend();
     //create tiny mce button
     $tiny = array('id' => 'avia_builder_button', 'title' => __('Insert Theme Shortcode', 'avia_framework'), 'image' => $this->paths['imagesURL'] . 'tiny-button.png', 'js_plugin_file' => $this->paths['assetsURL'] . 'js/avia-tinymce-buttons.js', 'shortcodes' => array_map(array($this, 'fetch_configs'), $this->shortcode_class));
     //if we are using tinymce 4 or higher change the javascript file
     global $tinymce_version;
     if (version_compare($tinymce_version[0], 4, ">=")) {
         $tiny['js_plugin_file'] = $this->paths['assetsURL'] . 'js/avia-tinymce-buttons-4.js';
     }
     new avia_tinyMCE_button($tiny);
     //activate iconfont manager
     new avia_font_manager();
     //fetch all Wordpress pointers that help the user to use the builder
     include $this->paths['configPath'] . "pointers.php";
     $myPointers = new AviaPointer($pointers);
 }
Exemple #16
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $atts = shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'attachment_size' => '', 'target' => 'no', 'styling' => '', 'caption' => '', 'font_size' => '', 'appearance' => '', 'hover' => '', 'align' => 'center', 'overlay_opacity' => '0.4', 'overlay_color' => '#444444', 'overlay_text_color' => '#ffffff'), $atts, $this->config['shortcode']);
     extract($atts);
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if (!empty($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-styling-" . $styling . " " . $hover;
         if (is_numeric($src)) {
             //$output = wp_get_attachment_image($src,'large');
             $output = wp_get_attachment_image($src, 'large', false, array('class' => "avia_image {$class} " . $this->class_by_arguments('align', $atts, true)));
         } else {
             $link = aviaHelper::get_url($link, $attachment);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $overlay = "";
             $style = "";
             $style .= AviaHelper::style_string($atts, 'overlay_text_color', 'color');
             if ($font_size) {
                 // $style = "style='font-size: {$font_size}px;'";
                 $style .= AviaHelper::style_string($atts, 'font_size', 'font-size', 'px');
             }
             $style = AviaHelper::style_string($style);
             if ($caption == "yes") {
                 $caption_style = "";
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_opacity', 'opacity');
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_color', 'background-color');
                 $caption_style = AviaHelper::style_string($caption_style);
                 $overlay_bg = "<div class='av-caption-image-overlay-bg' {$caption_style}></div>";
                 $content = ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
                 $overlay = "<div class='av-image-caption-overlay'>{$overlay_bg}<div class='av-image-caption-overlay-position'><div class='av-image-caption-overlay-center' {$style}>{$content}</div></div></div>";
                 $class .= " noHover ";
                 if (empty($appearance)) {
                     $appearance = "hover-deactivate";
                 }
                 if ($appearance) {
                     $class .= " av-overlay-" . $appearance;
                 }
             }
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $output .= "<div class='avia-image-container {$class} " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$markup} >";
             $output .= "<div class='avia-image-container-inner'>";
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image'  {$blank}>{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} /></a>";
             } else {
                 $output .= "{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
             }
             $output .= "</div>";
             $output .= "</div>";
         }
     }
     return $output;
 }
Exemple #17
0
 public function html()
 {
     global $woocommerce, $woocommerce_loop;
     $output = "";
     global $avia_config;
     $output = "";
     avia_post_slider::$slide++;
     extract($this->atts);
     $extraClass = 'first';
     $grid = 'one_third';
     $image_size = 'portfolio';
     $post_loop_count = 1;
     $loop_counter = 1;
     $autoplay = $autoplay == "no" ? false : true;
     $total = $columns % 2 ? "odd" : "even";
     $woocommerce_loop['columns'] = $columns;
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             $image_size = 'large';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             $image_size = 'portfolio_small';
             break;
         case "5":
             $grid = 'av_one_fifth';
             $image_size = 'portfolio_small';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'hoverpause' => 1));
     ob_start();
     if (have_posts()) {
         echo "<div {$data} class='template-shop avia-content-slider avia-content-{$type}-active avia-content-slider" . avia_post_slider::$slide . " avia-content-slider-{$total} {$class} shop_columns_{$columns}' >";
         if ($sort == "dropdown") {
             avia_woocommerce_frontend_search_params();
         }
         echo "<div class='avia-content-slider-inner'>";
         if ($type == 'grid') {
             echo '<ul class="products">';
         }
         while (have_posts()) {
             the_post();
             if ($loop_counter == 1 && $type == 'slider') {
                 echo '<ul class="products slide-entry-wrap">';
             }
             woocommerce_get_template_part('content', 'product');
             $loop_counter++;
             $post_loop_count++;
             if ($loop_counter > $columns) {
                 $loop_counter = 1;
             }
             if ($loop_counter == 1 && $type == 'slider') {
                 echo '</ul>';
             }
         }
         // end of the loop.
         if ($loop_counter != 1 || $type == 'grid') {
             echo '</ul>';
         }
         echo "</div>";
         if ($post_loop_count - 1 > $columns && $type == 'slider') {
             echo $this->slide_navigation_arrows();
         }
         echo "</div>";
     } else {
         if (!woocommerce_product_subcategories(array('before' => '<ul class="products">', 'after' => '</ul>'))) {
             echo "<p>" . __('No products found which match your selection.', 'woocommerce') . "</p>";
         }
     }
     echo '<div class="clear"></div>';
     $products = ob_get_clean();
     $output .= $products;
     if ($paginate == "yes" && ($avia_pagination = avia_pagination('', 'nav'))) {
         $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>";
     }
     wp_reset_query();
     return $output;
 }
Exemple #18
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     global $avia_config;
     avia_sc_section::$section_count++;
     $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'min_height_px' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => '', 'bottom_border' => '', 'overlay_enable' => '', 'overlay_opacity' => '', 'overlay_color' => '', 'overlay_pattern' => '', 'overlay_custom_pattern' => '', 'scroll_down' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow;
     $background = "";
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     $params['custom_markup'] = $meta['custom_markup'];
     $params['attach'] = "";
     if (!empty($attachment) && !empty($attachment_size)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     /*set background image*/
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
         if ($attach == 'parallax') {
             $attachment_class = "";
             if ($repeat == 'stretch' || $repeat == 'no-repeat') {
                 $attachment_class .= " avia-full-stretch";
             }
             $class .= " av-parallax-section";
             $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']);
             $params['attach'] .= "<div class='av-parallax' data-avia-parallax-ratio='{$speed}' >";
             $params['attach'] .= "<div class='av-parallax-inner {$color} {$attachment_class}' style = '{$background}' >";
             $params['attach'] .= "</div>";
             $params['attach'] .= "</div>";
             $background = "";
         }
         $params['data'] = "data-section-bg-repeat='{$repeat}'";
     } else {
         $attach = "scroll";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     /*check/create overlay*/
     $overlay = "";
     $pre_wrap = "<div class='av-section-color-overlay-wrap'>";
     if (!empty($overlay_enable)) {
         $overlay_src = "";
         $overlay = "opacity: {$overlay_opacity}; ";
         if (!empty($overlay_color)) {
             $overlay .= "background-color: {$overlay_color}; ";
         }
         if (!empty($overlay_pattern)) {
             if ($overlay_pattern == "custom") {
                 $overlay_src = $overlay_custom_pattern;
             } else {
                 $overlay_src = str_replace('{{AVIA_BASE_URL}}', AVIA_BASE_URL, $overlay_pattern);
             }
         }
         if (!empty($overlay_src)) {
             $overlay .= "background-image: url({$overlay_src}); background-repeat: repeat;";
         }
         $overlay = "<div class='av-section-color-overlay' style='{$overlay}'></div>";
         $class .= " av-section-color-overlay-active";
         $params['attach'] .= $pre_wrap . $overlay;
     }
     if (!empty($scroll_down)) {
         if (!$overlay) {
             $params['attach'] .= $pre_wrap;
         }
         $params['attach'] .= "<a href='#next-section' title='' class='scroll-down-link' " . av_icon_string('scrolldown') . "></a>";
     }
     $class .= " avia-bg-style-" . $attach;
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['min_height'] = $min_height;
     $params['min_height_px'] = $min_height_px;
     $params['video'] = $video;
     $params['video_ratio'] = $video_ratio;
     $params['video_mobile_disabled'] = $video_mobile_disabled;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0) {
             $params['main_container'] = true;
         }
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
             $params['close'] = false;
         }
     }
     $avia_config['layout_container'] = "section";
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     /*set extra arrow element*/
     if (strpos($bottom_border, 'border-extra') !== false) {
         $backgroundEl = "";
         $backgroundElColor = !empty($custom_bg) ? $custom_bg : $avia_config['backend_colors']['color_set'][$color]['bg'];
         if ($backgroundElColor) {
             $backgroundEl = " style='background-color:{$backgroundElColor};' ";
         }
         avia_sc_section::$add_to_closing = "<div class='av-extra-border-element {$bottom_border}'><div class='av-extra-border-outer'><div class='av-extra-border-inner' {$backgroundEl}></div></div></div>";
     } else {
         avia_sc_section::$add_to_closing = "";
     }
     //next section needs an extra closing tag if overlay with wrapper was added:
     if ($overlay || !empty($scroll_down)) {
         avia_sc_section::$close_overlay = "</div>";
     } else {
         avia_sc_section::$close_overlay = "";
     }
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     unset($avia_config['layout_container']);
     return $output;
 }
Exemple #19
0
 static function set_video_slide($video_url, $service = false, $meta = false)
 {
     $video = "";
     if (empty($service)) {
         $service = self::which_video_service($video_url);
     }
     $uid = 'player_' . get_the_ID() . '_' . mt_rand() . '_' . mt_rand();
     $controls = empty($meta['video_controls']) ? 1 : 0;
     $loop = empty($meta['video_loop']) ? 0 : 1;
     switch ($service) {
         case "html5":
             $video = "<div class='av-click-overlay'></div>" . avia_html5_video_embed($video_url);
             break;
         case "iframe":
             $video = $video_url;
             break;
         case "youtube":
             $explode_at = strpos($video_url, 'youtu.be/') !== false ? "/" : "v=";
             $video_url = explode($explode_at, trim($video_url));
             $video_url = end($video_url);
             $video_id = $video_url;
             //if parameters are appended make sure to create the correct video id
             if (strpos($video_url, '?') !== false || strpos($video_url, '?') !== false) {
                 preg_match('!(.+)[&?]!', $video_url, $video_id);
                 $video_id = isset($video_id[1]) ? $video_id[1] : $video_id[0];
             }
             $video_data = apply_filters('avf_youtube_video_data', array('autoplay' => 0, 'videoid' => $video_id, 'hd' => 1, 'rel' => 0, 'wmode' => 'opaque', 'playlist' => $uid, 'loop' => 0, 'version' => 3, 'autohide' => 1, 'color' => 'white', 'controls' => $controls, 'showinfo' => 0));
             $data = AviaHelper::create_data_string($video_data);
             $video = "<div class='av-click-overlay'></div><div class='mejs-mediaelement'><div height='1600' width='900' class='av_youtube_frame' id='{$uid}' {$data}></div></div>";
             break;
         case "vimeo":
             $color = ltrim(avia_get_option('colorset-main_color-primary'), '#');
             $autopause = empty($meta['video_section_bg']) ? 1 : 0;
             //pause if another vimeo video plays?
             $video_url = explode('/', trim($video_url));
             $video_url = end($video_url);
             $video_url = add_query_arg(array('portrait' => 0, 'byline' => 0, 'title' => 0, 'badge' => 0, 'loop' => $loop, 'autopause' => $autopause, 'api' => 1, 'rel' => 0, 'player_id' => $uid, 'color' => $color), 'http://player.vimeo.com/video/' . $video_url);
             $video_url = apply_filters('avf_vimeo_video_url', $video_url);
             $video = "<div class='av-click-overlay'></div><div class='mejs-mediaelement'><iframe src='{$video_url}' height='1600' width='900'  frameborder='' class='av_vimeo_frame' id='{$uid}'></iframe></div>";
             break;
     }
     return $video;
 }
Exemple #20
0
 public function html()
 {
     $output = "";
     $counter = 0;
     avia_partner_logo::$slider++;
     if ($this->slide_count == 0) {
         return $output;
     }
     extract($this->config);
     $extraClass = 'first';
     $grid = 'one_third';
     $slide_loop_count = 1;
     $loop_counter = 1;
     $total = $columns % 2 ? "odd" : "even";
     $heading = !empty($this->config['heading']) ? '<h3>' . $this->config['heading'] . '</h3>' : "&nbsp;";
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             break;
         case "5":
             $grid = 'av_one_fifth';
             break;
         case "6":
             $grid = 'av_one_sixth';
             break;
         case "7":
             $grid = 'av_one_seventh';
             break;
         case "8":
             $grid = 'av_one_eighth';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation));
     $thumb_fallback = "";
     $output .= "<div {$data} class='avia-logo-element-container {$border} avia-logo-{$type} avia-content-slider avia-smallarrow-slider avia-content-{$type}-active noHover avia-content-slider" . avia_partner_logo::$slider . " avia-content-slider-{$total} {$class}' >";
     $heading_class = '';
     if ($navigation == 'no') {
         $heading_class .= ' no-logo-slider-navigation ';
     }
     if ($heading == '&nbsp;') {
         $heading_class .= ' no-logo-slider-heading ';
     }
     $output .= "<div class='avia-smallarrow-slider-heading {$heading_class}'>";
     if ($heading != '&nbsp;' || $navigation != 'no') {
         $output .= "<div class='new-special-heading'>" . $heading . "</div>";
     }
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'arrows') {
             $output .= $this->slide_navigation_arrows();
         }
     }
     $output .= "</div>";
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $custom_markup));
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($this->id_array as $key => $id) {
         if (isset($this->slides[$id])) {
             $slide = $this->slides[$id];
             $meta = array_merge(array('link' => '', 'link_target' => '', 'linktitle' => '', 'hover' => '', 'custom_markup' => ''), $this->subslides[$key]['attr']);
             extract($meta);
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $img = wp_get_attachment_image($slide->ID, $size);
             $link = aviaHelper::get_url($link, $slide->ID);
             $blank = strpos($link_target, '_blank') !== false || $link_target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         }
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $this->slide_count == $slide_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}";
         $thumb_class = "real-thumbnail";
         $single_data = empty($hover) ? '' : 'data-avia-tooltip="' . $hover . '"';
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap' {$markup}>";
         }
         $img = str_replace('<img ', "<img {$markup_url} ", $img);
         $output .= "<div {$single_data} class='slide-entry flex_column no_margin {$post_class} {$grid} {$extraClass} {$thumb_class}'>";
         $output .= !empty($link) ? "<a href='{$link}' data-rel='slide-" . avia_partner_logo::$slider . "' class='slide-image' title='{$linktitle}' {$blank} >{$img}</a>" : $img;
         $output .= "</div>";
         $loop_counter++;
         $slide_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'dots') {
             $output .= $this->slide_navigation_dots();
         }
     }
     $output .= "</div>";
     return $output;
 }
Exemple #21
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_section::$section_count++;
     $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow . " avia-bg-style-" . $attach;
     $background = "";
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     $params['custom_markup'] = $meta['custom_markup'];
     if (!empty($attachment) && !empty($attachment_size)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
         if ($attach == 'parallax') {
             $attachment_class = "";
             if ($repeat == 'stretch' || $repeat == 'no-repeat') {
                 $attachment_class .= " avia-full-stretch";
             }
             $class .= " av-parallax-section";
             $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']);
             $params['attach'] = "<div class='av-parallax {$attachment_class}' data-avia-parallax-ratio='{$speed}' style = '{$background}' ></div>";
             $background = "";
         }
         $params['data'] = "data-section-bg-repeat='{$repeat}'";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['min_height'] = $min_height;
     $params['video'] = $video;
     $params['video_ratio'] = $video_ratio;
     $params['video_mobile_disabled'] = $video_mobile_disabled;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0) {
             $params['main_container'] = true;
         }
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
             $params['close'] = false;
         }
     }
     global $avia_config;
     $avia_config['layout_container'] = "section";
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     unset($avia_config['layout_container']);
     return $output;
 }
 function avia_woocommerce_default_page($query)
 {
     if (current_theme_supports('avia_custom_shop_page')) {
         if (!$query->is_admin && $query->is_main_query() && !$query->is_tax && $query->is_archive && $query->is_post_type_archive) {
             $vars = $query->query_vars;
             if (isset($vars['post_type']) && 'product' == $vars['post_type']) {
                 $shop_page_id = wc_get_page_id('shop');
                 $builder_active = AviaHelper::builder_status($shop_page_id);
                 if ($builder_active == "active") {
                     $query->set('post_type', 'page');
                     $query->set('p', $shop_page_id);
                     $query->set('meta_query', array());
                     $query->is_singular = true;
                     $query->is_page = true;
                     $query->is_archive = false;
                     $query->is_post_type_archive = false;
                     $query->query = array('p' => $shop_page_id, 'post_type' => 'page');
                 }
             }
         }
     }
     return $query;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $params['class'] = "main_color " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     if ($atts['gap'] == 'no' && $atts['sort'] == "no" || $meta['index'] == 0) {
         $params['class'] .= " avia-no-border-styling";
     }
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " masonry-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " masonry-not-first";
     }
     $masonry = new avia_masonry($atts);
     $masonry->extract_terms();
     $masonry->query_entries();
     $masonry_html = $masonry->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $masonry_html;
     }
     $output .= avia_new_section($params);
     $output .= $masonry_html;
     $output .= avia_section_after_element_content($meta, 'after_masonry');
     return $output;
 }
 /**
  * default code to create a sortable item for your editor
  */
 public function create_sortable_editor_element($params)
 {
     $extraClass = "";
     $defaults = array('class' => 'avia_default_container', 'innerHtml' => '');
     $params = array_merge($defaults, $params);
     extract($params);
     $data['shortcodehandler'] = $this->config['shortcode'];
     $data['modal_title'] = $this->config['name'];
     $data['modal_ajax_hook'] = $this->config['shortcode'];
     $data['dragdrop-level'] = $this->config['drag-level'];
     $data['allowed-shortcodes'] = $this->config['shortcode'];
     if (isset($this->config['shortcode_nested'])) {
         $data['allowed-shortcodes'] = $this->config['shortcode_nested'];
         $data['allowed-shortcodes'][] = $this->config['shortcode'];
         $data['allowed-shortcodes'] = implode(",", $data['allowed-shortcodes']);
     }
     if (!empty($this->config['modal_on_load'])) {
         $data['modal_on_load'] = $this->config['modal_on_load'];
     }
     $dataString = AviaHelper::create_data_string($data);
     $output = "<div class='avia_sortable_element avia_pop_class " . $class . " " . $this->config['shortcode'] . " av_drag' " . $dataString . ">";
     $output .= "<div class='avia_sorthandle menu-item-handle'>";
     if (!empty($this->config['popup_editor'])) {
         $extraClass = 'avia-edit-element';
         $output .= "<a class='{$extraClass}'  href='#edit-element' title='" . __('Edit Element', 'avia_framework') . "'>edit</a>";
     }
     //$output .= "<a class='avia-new-target'  href='#new-target' title='".__('Move Element','avia_framework' )."'>+</a>";
     $output .= "<a class='avia-delete'  href='#delete' title='" . __('Delete Element', 'avia_framework') . "'>x</a>";
     $output .= "<a class='avia-clone'  href='#clone' title='" . __('Clone Element', 'avia_framework') . "' >" . __('Clone Element', 'avia_framework') . "</a></div>";
     $output .= "<div class='avia_inner_shortcode {$extraClass}'>";
     $output .= $innerHtml;
     $output .= "<textarea data-name='text-shortcode' cols='20' rows='4'>" . ShortcodeHelper::create_shortcode_by_array($this->config['shortcode'], $content, $args) . "</textarea>";
     $output .= "</div></div>";
     return $output;
 }
Exemple #25
0
<?php

global $builder;
$boxes = array(array('title' => __('Avia Layout Builder', 'avia_framework'), 'id' => 'avia_builder', 'page' => array('portfolio', 'page'), 'context' => 'normal', 'priority' => 'high', 'expandable' => true), array('title' => __('Layout', 'avia_framework'), 'id' => 'layout', 'page' => array('portfolio', 'page', 'post'), 'context' => 'side', 'priority' => 'low'), array('title' => __('Additional Portfolio Settings', 'avia_framework'), 'id' => 'preview', 'page' => array('portfolio'), 'context' => 'normal', 'priority' => 'high'), array('title' => __('Breadcrumb Hierarchy', 'avia_framework'), 'id' => 'hierarchy', 'page' => array('portfolio'), 'context' => 'side', 'priority' => 'low'));
$boxes = apply_filters('avf_builder_boxes', $boxes);
$elements = array(array("slug" => "avia_builder", "name" => __("Visual layout editor", 'avia_framework'), "id" => "layout_editor", "type" => array($builder, 'visual_editor'), "tab_order" => array(__('Layout Elements', 'avia_framework'), __('Content Elements', 'avia_framework'), __('Media Elements', 'avia_framework')), "desc" => '<h4>' . __('Quick Info & Hotkeys', 'avia_framework') . "</h4>" . '<strong>' . __('General Info', 'avia_framework') . '</strong>' . "<ul>" . '   <li>' . __('To insert an Element either click the insert button for that element or drag the button onto the canvas', 'avia_framework') . '</li>' . '   <li>' . __('If you place your mouse above the insert button a short info tooltip will appear', 'avia_framework') . '</li>' . '   <li>' . __('To sort and arrange your elements just drag them to a position of your choice and release them', 'avia_framework') . '</li>' . '   <li>' . __('Valid drop targets will be highlighted. Some elements like fullwidth sliders and color section can not be dropped onto other elements', 'avia_framework') . '</li>' . "</ul>" . '<strong>' . __('Edit Elements in Popup Window:', 'avia_framework') . '</strong>' . "<ul>" . '   <li>' . __('Most elements open a popup window if you click them', 'avia_framework') . '</li>' . '   <li>' . __('Press TAB to navigate trough the various form fields of a popup window.', 'avia_framework') . '</li>' . '   <li>' . __('Press ESC on your keyboard or the Close Button to close popup window.', 'avia_framework') . '</li>' . '   <li>' . __('Press ENTER on your keyboard or the Save Button to save current state of a popup window', 'avia_framework') . '</li>' . "</ul>"), array("container_class" => "av_2columns av_col_1 avia-style", "slug" => "preview", "name" => __("Overwrite Portfolio Link setting", 'avia_framework'), "desc" => __("If this entry is displayed in a portfolio grid, it will use the grids link settings (open either in lightbox, or open link url). You may overwrite this setting here", 'avia_framework'), "id" => "_portfolio_custom_link", "type" => "select", "std" => "", "subtype" => array("Use default setting" => '', "Define custom link" => 'custom')), array("slug" => "preview", "name" => __("Link portfolio item to external URL", 'avia_framework'), "desc" => __("You can add a link to any (external) page here. <br/> If you add a link to a video that video will open in a lightbox", 'avia_framework'), "id" => "_portfolio_custom_link_url", "type" => "input", "required" => array('_portfolio_custom_link', 'equals', 'custom'), "container_class" => "avia-style av_2columns av_col_2", "std" => "http://"), array("slug" => "preview", "id" => "_portfolio_hr", "type" => "hr", "std" => ""), array("slug" => "preview", "name" => __("Ajax Portfolio Preview Settings", 'avia_framework'), "desc" => __("If you have selected to display your portfolio grid as an 'Ajax Portfolio' please choose preview images here and write some preview text. Once the user clicks on the portfolio item a preview element with those images and info will open.", 'avia_framework'), "id" => "_preview_heading", "type" => "heading", "std" => ""), array("slug" => "preview", "container_class" => "av_2columns av_col_1", "name" => __("Add Preview Images", 'avia_framework'), "desc" => __("Create a new Preview Gallery or Slideshow by selecting existing or uploading new images", 'avia_framework'), "id" => "_preview_ids", "type" => "gallery", "title" => __("Add Preview Images", 'avia_framework'), "delete" => __("Remove Images", 'avia_framework'), "button" => __("Insert Images", 'avia_framework'), "std" => ""), array("container_class" => "av_2columns av_col_2", "slug" => "preview", "name" => __("Display Preview Images", 'avia_framework'), "desc" => __("Display Images as either gallery, slideshow or as a list below each other", 'avia_framework'), "id" => "_preview_display", "type" => "select", "std" => "gallery", "class" => "avia-style", "subtype" => array(__("Gallery", 'avia_framework') => 'gallery', __("Slideshow", 'avia_framework') => 'slideshow', __("Image List", 'avia_framework') => 'list', __("Don't show the images at all and display the preview text only", 'avia_framework') => 'no')), array("container_class" => "av_2columns av_col_2", "slug" => "preview", "name" => __("Autorotation", 'avia_framework'), "desc" => __("Slideshow autorotation Settings in Seconds", 'avia_framework'), "id" => "_preview_autorotation", "type" => "select", "std" => "disabled", "class" => "avia-style", "required" => array('_preview_display', 'equals', 'slideshow'), "subtype" => array(__("Disabled", 'avia_framework') => 'disabled', "3" => '3', "4" => '4', "5" => '5', "6" => '6', "7" => '7', "8" => '8', "9" => '9', "10" => '10', "15" => '15', "20" => '20')), array("container_class" => "av_2columns av_col_2", "slug" => "preview", "name" => __("Gallery Thumbnail Columns", 'avia_framework'), "desc" => __("How many Thumbnails should be displayed beside each other", 'avia_framework'), "id" => "_preview_columns", "type" => "select", "std" => "6", "class" => "avia-style", "required" => array('_preview_display', 'equals', 'gallery'), "subtype" => array("2" => '2', "3" => '3', "4" => '4', "5" => '5', "6" => '6', "7" => '7', "8" => '8', "9" => '9', "10" => '10', "11" => '11', "12" => '12')), array("slug" => "preview", "container_class" => "avia_clear", "name" => __("Add Preview Text", 'avia_framework'), "desc" => __("The text will appear beside your gallery/slideshow", 'avia_framework'), "id" => "_preview_text", "type" => "tiny_mce", "std" => ""), array("slug" => "layout", "name" => __("Layout", 'avia_framework'), "desc" => __("Select the desired Page layout", 'avia_framework'), "id" => "layout", "type" => "select", "std" => "", "class" => "avia-style", "subtype" => array(__("Default Layout - set in", 'avia_framework') . " " . THEMENAME . " > " . __('Sidebar', 'avia_framework') => '', __("No Sidebar", 'avia_framework') => 'fullsize', __("Left Sidebar", 'avia_framework') => 'sidebar_left', __("Right Sidebar", 'avia_framework') => 'sidebar_right')), array("slug" => "layout", "name" => __("Sidebar Setting", 'avia_framework'), "desc" => __("Choose a custom sidebar for this entry", 'avia_framework'), "id" => "sidebar", "type" => "select", "std" => "", "class" => "avia-style", "required" => array('layout', 'not', 'fullsize'), "subtype" => AviaHelper::get_registered_sidebars(array('Default Sidebars' => ""), array('Displayed Everywhere'))), array("slug" => "layout", "name" => __("Footer Settings", 'avia_framework'), "desc" => __("Display the footer widgets?", 'avia_framework'), "id" => "footer", "type" => "select", "std" => "", "class" => "avia-style", "subtype" => array(__("Default Layout - set in", 'avia_framework') . " " . THEMENAME . " > " . __('Footer', 'avia_framework') => '', __('Display the footer widgets & socket', 'avia_framework') => 'all', __('Display only the footer widgets (no socket)', 'avia_framework') => 'nosocket', __('Display only the socket (no footer widgets)', 'avia_framework') => 'nofooterwidgets', __('Don\'t display the socket & footer widgets', 'avia_framework') => 'nofooterarea')), array("slug" => "layout", "notice" => __("These settings are only available for layouts with a main menu placed at the top", 'avia_framework') . " - <a href='" . admin_url('admin.php?page=avia#goto_general_layout') . "'>" . __("Change layout", 'avia_framework') . "</a>", "id" => "conditional_header", "type" => "condition", "class" => "avia-style", "condition" => array('option' => 'header_position', 'compare' => "equal_or_empty", "value" => "header_top"), "nodescription" => true), array("slug" => "layout", "name" => __("Title Bar Settings", 'avia_framework'), "desc" => __("Display the Title Bar with Page Title and Breadcrumb Navigation?", 'avia_framework'), "id" => "header_title_bar", "type" => "select", "std" => "", "class" => "avia-style", "subtype" => array(__("Default Layout - set in", 'avia_framework') . " " . THEMENAME . " > " . __('Header', 'avia_framework') => '', __('Display title and breadcrumbs', 'avia_framework') => 'title_bar_breadcrumb', __('Display only title', 'avia_framework') => 'title_bar', __('Hide both', 'avia_framework') => 'hidden_title_bar')), array("slug" => "layout", "name" => __("Header visibility and transparency", 'avia_framework'), "desc" => __("Several options to change the header transparency and visibility on this page.", 'avia_framework'), "id" => "header_transparency", "type" => "select", "std" => "", "class" => "avia-style", "subtype" => array(__("No transparency", 'avia_framework') => '', __('Transparent Header', 'avia_framework') => 'header_transparent', __('Transparent & Glassy Header', 'avia_framework') => 'header_transparent header_glassy ', __('Header is invisible and appears once the users scrolls down ', 'avia_framework') => 'header_transparent header_scrolldown ', __('Hide Header on this page ', 'avia_framework') => 'header_transparent header_hidden ')), array("slug" => "layout", "id" => "conditional_header_end", "type" => "condition_end", "nodescription" => true), array("slug" => "hierarchy", "name" => __("Breadcrumb parent page", 'avia_framework'), "desc" => __("Select a parent page for this entry. If no page is selected the them will use session data to build the breadcrumb.", 'avia_framework'), "id" => "breadcrumb_parent", "type" => "select", "subtype" => 'page', "with_first" => true, "std" => "", "class" => "avia-style"));
$elements = apply_filters('avf_builder_elements', $elements);
/*
array(

        "slug"  => "avia_builder",
        "name"  => "Layout",
        "desc"  => "Select the desired Page layout",
        "id"    => "layout",
        "type"  => "radio",
        "class" => "image_radio image_radio_layout",
        "std"   => "fullwidth",
        "options" => array( 'default'       => "Default layout",
                            'sidebar_left'  => "Left Sidebar",
                            'sidebar_right' => "Right Sidebar",
                            'fullwidth'     => "No Sidebar"
        ),

        "images" => array(  'default'       => AviaBuilder::$path['imagesURL']."layout-slideshow.png",
                            'sidebar_left'  => AviaBuilder::$path['imagesURL']."layout-left.png",
                            'sidebar_right' => AviaBuilder::$path['imagesURL']."layout-right.png",
                            'fullwidth'     => AviaBuilder::$path['imagesURL']."layout-fullwidth.png",
        ),
    ),
*/
 /**
  * Helper function that prints all the javascript templates
  *
  * @return void
  */
 static function print_templates()
 {
     foreach (self::$templates as $key => $template) {
         echo "\n<script type='text/html' id='avia-tmpl-{$key}'>\n";
         echo $template;
         echo "\n</script>\n\n";
     }
     //reset the array
     self::$templates = array();
 }
Exemple #27
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $src = "";
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $hotspots = ShortcodeHelper::shortcode2array($content, 1);
     extract(shortcode_atts(array('animation' => 'no-animation', 'attachment' => '', 'attachment_size' => '', 'hotspot_layout' => 'numbered', 'hotspot_mobile' => '', 'hotspot_tooltip_display' => ''), $atts, $this->config['shortcode']));
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     }
     //no src? return
     if (!empty($src)) {
         if (!ShortcodeHelper::is_top_level()) {
             $meta['el_class'] .= " av-non-fullwidth-hotspot-image";
         }
         $hotspot_html = "";
         $tooltip_html = "";
         $counter = 1;
         foreach ($hotspots as $hotspot) {
             if (!empty($hotspot_mobile)) {
                 $tooltip_html .= $this->add_fallback_tooltip($hotspot, $counter);
             }
             $extraClass = !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
             $extraClass .= !empty($hotspot_tooltip_display) ? " {$hotspot_tooltip_display}-single " : "";
             $hotspot_html .= $this->add_hotspot($hotspot, $counter, $extraClass);
             $counter++;
         }
         //some custom classes
         $class .= $animation == "no-animation" ? "" : " avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-hotspot-" . $hotspot_layout;
         $class .= !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
         $class .= " " . $hotspot_tooltip_display;
         $output .= "<div class='av-hotspot-image-container avia_animate_when_almost_visible {$class} " . $meta['el_class'] . " ' {$markup} >";
         $output .= "<div class='av-hotspot-container'>";
         $output .= "<div class='av-hotspot-container-inner-cell'>";
         $output .= "<div class='av-hotspot-container-inner-wrap'>";
         $output .= $hotspot_html;
         $output .= "<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
         $output .= "</div>";
         $output .= "</div>";
         $output .= "</div>";
         $output .= $tooltip_html;
         $output .= "</div>";
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $skipSecond = false;
     $params['class'] = "main_color av-fullwidth-hotspots " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $image = $output;
     $output = avia_new_section($params);
     $output .= $image;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_image_hotspots"));
     }
     return $output;
 }
        /**
         * 
         * The multi_image method allows us to insert many images into a modal template at once
         * @param array $element the array holds data like type, value, id, class, description which are necessary to render the whole option-section
         * @return string $output the string returned contains the html code generated within the method
         */
        static function multi_image($element)
        {
            if (empty($element['data'])) {
                $fetch = isset($element['fetch']) ? $element['fetch'] : "template";
                $state = isset($element['state']) ? $element['state'] : "avia_insert_multi";
                $class = $fetch == "template" ? "avia-media-img-only-no-sidebars" : "avia-media-img-only";
                $element['data'] = array('target' => $element['id'], 'title' => $element['title'], 'type' => $element['type'], 'button' => $element['button'], 'class' => 'media-frame ' . $class . ' ' . $element['container_class'], 'frame' => 'select', 'state' => $state, 'fetch' => $fetch);
            }
            $data = AviaHelper::create_data_string($element['data']);
            $class = 'button aviabuilder-image-upload avia-builder-image-insert ' . $element['class'];
            $output = '	<a href="#" class="' . $class . '" ' . $data . ' title="' . esc_attr($element['title']) . '">
						<span class="wp-media-buttons-icon"></span>' . $element['title'] . '</a>';
            return $output;
        }
        /**
         * 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" => "modal_group", "id" => "content", 'container_class' => "avia-element-fullwidth avia-multi-img", "modal_title" => __("Edit Form Element", 'avia_framework'), "add_label" => __("Add single image or video", 'avia_framework'), "std" => array(), 'creator' => array("name" => __("Add Images", 'avia_framework'), "desc" => __("Here you can add new Images to the slideshow.", 'avia_framework'), "id" => "id", "type" => "multi_image", "title" => __("Add multiple Images", 'avia_framework'), "button" => __("Insert Images", 'avia_framework'), "std" => ""), 'subelements' => array(array("name" => __("Which type of slide is this?", 'avia_framework'), "id" => "slide_type", "type" => "select", "std" => "", "subtype" => array(__('Image Slide', 'avia_framework') => 'image', __('Video Slide', 'avia_framework') => 'video')), array("name" => __("Choose another Image", 'avia_framework'), "desc" => __("Either upload a new, or choose an existing image from your media library", 'avia_framework'), "id" => "id", "fetch" => "id", "type" => "image", "required" => array('slide_type', 'is_empty_or', 'image'), "title" => __("Change Image", 'avia_framework'), "button" => __("Change Image", 'avia_framework'), "std" => ""), array("name" => __("Video URL", 'avia_framework'), "desc" => __('Enter the URL to the Video. Currently supported are Youtube, Vimeo and direct linking of web-video files (mp4, webm, ogv)', 'avia_framework') . '<br/><br/>' . __('Working examples Youtube & Vimeo:', 'avia_framework') . '<br/>
								<strong>http://vimeo.com/1084537</strong><br/> 
								<strong>http://www.youtube.com/watch?v=5guMumPFBag</strong><br/><br/>', "required" => array('slide_type', 'equals', 'video'), "id" => "video", "std" => "http://", "type" => "video", "title" => __("Upload Video", 'avia_framework'), "button" => __("Use Video", 'avia_framework')), array("name" => __("Choose fallback image for mobile devices", 'avia_framework'), "desc" => __("Either upload a new, or choose an existing image from your media library", 'avia_framework') . "<br/><small>" . __("Video on most mobile devices can't be controlled properly with JavaScript, which is mandatory here, therefore you are required to select a fallback image which can be displayed instead", 'avia_framework') . "</small>", "id" => "mobile_image", "fetch" => "id", "type" => "image", "required" => array('slide_type', 'equals', 'video'), "title" => __("Choose Image", 'avia_framework'), "button" => __("Choose Image", 'avia_framework'), "std" => ""), array("name" => __("Video Size", 'avia_framework'), "desc" => __("By default the video will try to match the default slideshow size that was selected in the slider settings at 'Slideshow Image and Video Size'", 'avia_framework'), "id" => "video_format", "type" => "select", "std" => "", "required" => array('slide_type', 'equals', 'video'), "subtype" => array(__('Try to match the default slideshow size (Video will not be cropped, but black borders will be visible at each side)', 'avia_framework') => '', __('Try to match the default slideshow size but stretch the video to fill the whole slider (video will be cropped at top and bottom)', 'avia_framework') => 'stretch', __('Show the full Video without cropping', 'avia_framework') => 'full')), array("name" => __("Video Aspect Ratio", 'avia_framework'), "desc" => __("In order to calculate the correct height and width for the video slide you need to enter a aspect ratio (width:height). usually: 16:9 or 4:3.", 'avia_framework') . "<br/>" . __("If left empty 16:9 will be used", 'avia_framework'), "id" => "video_ratio", "required" => array('video_format', 'not', ''), "std" => "16:9", "type" => "input"), array("name" => __("Hide Video Controls", 'avia_framework'), "desc" => __("Check if you want to hide the controls (works for youtube and self hosted videos)", 'avia_framework'), "id" => "video_controls", "required" => array('slide_type', 'equals', 'video'), "std" => "", "type" => "checkbox"), array("name" => __("Mute Video Player", 'avia_framework'), "desc" => __("Check if you want to mute the video", 'avia_framework'), "id" => "video_mute", "required" => array('slide_type', 'equals', 'video'), "std" => "", "type" => "checkbox"), array("name" => __("Loop Video Player", 'avia_framework'), "desc" => __("Check if you want to loop the video (instead of showing the next slide the video will play from the beginning again)", 'avia_framework'), "id" => "video_loop", "required" => array('slide_type', 'equals', 'video'), "std" => "", "type" => "checkbox"), array("name" => __("Disable Autoplay", 'avia_framework'), "desc" => __("Check if you want to disable video autoplay when this slide shows", 'avia_framework'), "id" => "video_autoplay", "required" => array('slide_type', 'equals', 'video'), "std" => "", "type" => "checkbox"), array("name" => __("Caption Title", 'avia_framework'), "desc" => __("Enter a caption title for the slide here", 'avia_framework'), "id" => "title", "std" => "", "type" => "input"), array("name" => __("Caption Text", 'avia_framework'), "desc" => __("Enter some additional caption text", 'avia_framework'), "id" => "content", "type" => "textarea", "std" => ""), array("name" => __("Caption Positioning", 'avia_framework'), "id" => "caption_pos", "type" => "select", "std" => "caption_bottom", "subtype" => array('Right Framed' => 'caption_right caption_right_framed caption_framed', 'Left Framed' => 'caption_left caption_left_framed caption_framed', 'Bottom Framed' => 'caption_bottom caption_bottom_framed caption_framed', 'Center Framed' => 'caption_center caption_center_framed caption_framed', 'Right without Frame' => 'caption_right', 'Left without Frame' => 'caption_left', 'Bottom without Frame' => 'caption_bottom', 'Center without Frame' => 'caption_center')), array("name" => __("Apply a link or buttons to the slide?", 'avia_framework'), "desc" => __("You can choose to apply the link to the whole image or to add 'Call to Action Buttons' that get appended to the caption", 'avia_framework'), "id" => "link_apply", "type" => "select", "std" => "", "subtype" => array(__('No Link for this slide', 'avia_framework') => '', __('Apply Link to Image', 'avia_framework') => 'image', __('Attach one button', 'avia_framework') => 'button', __('Attach two buttons', 'avia_framework') => 'button button-two')), array("name" => __("Image Link?", 'avia_framework'), "desc" => __("Where should the Image link to?", 'avia_framework'), "id" => "link", "required" => array('link_apply', 'equals', 'image'), "type" => "linkpicker", "fetchTMPL" => true, "subtype" => array(__('Open Image in Lightbox', 'avia_framework') => 'lightbox', __('Set Manually', 'avia_framework') => 'manually', __('Single Entry', 'avia_framework') => 'single', __('Taxonomy Overview Page', 'avia_framework') => 'taxonomy'), "std" => ""), array("name" => __("Open Link in new Window?", 'avia_framework'), "desc" => __("Select here if you want to open the linked page in a new window", 'avia_framework'), "id" => "link_target", "type" => "select", "std" => "", "required" => array('link', 'not_empty_and', 'lightbox'), "subtype" => AviaHtmlHelper::linking_options()), array("name" => __("Button 1 Label", 'avia_framework'), "desc" => __("This is the text that appears on your button.", 'avia_framework'), "id" => "button_label", "type" => "input", "container_class" => 'av_half av_half_first', "required" => array('link_apply', 'contains', 'button'), "std" => "Click me"), array("name" => __("Button 1 Color", 'avia_framework'), "desc" => __("Choose a color for your button here", 'avia_framework'), "id" => "button_color", "type" => "select", "std" => "light", "container_class" => 'av_half', "required" => array('link_apply', 'contains', 'button'), "subtype" => array(__('Translucent Buttons', 'avia_framework') => array(__('Light Transparent', 'avia_framework') => 'light', __('Dark Transparent', 'avia_framework') => 'dark'), __('Colored Buttons', 'avia_framework') => array(__('Theme Color', 'avia_framework') => 'theme-color', __('Theme Color Subtle', 'avia_framework') => 'theme-color-subtle', __('Blue', 'avia_framework') => 'blue', __('Red', 'avia_framework') => 'red', __('Green', 'avia_framework') => 'green', __('Orange', 'avia_framework') => 'orange', __('Aqua', 'avia_framework') => 'aqua', __('Teal', 'avia_framework') => 'teal', __('Purple', 'avia_framework') => 'purple', __('Pink', 'avia_framework') => 'pink', __('Silver', 'avia_framework') => 'silver', __('Grey', 'avia_framework') => 'grey', __('Black', 'avia_framework') => 'black'))), array("name" => __("Button 1 Link?", 'avia_framework'), "desc" => __("Where should the Button link to?", 'avia_framework'), "id" => "link1", "container_class" => 'av_half av_half_first', "required" => array('link_apply', 'contains', 'button'), "type" => "linkpicker", "fetchTMPL" => true, "subtype" => array(__('Set Manually', 'avia_framework') => 'manually', __('Single Entry', 'avia_framework') => 'single', __('Taxonomy Overview Page', 'avia_framework') => 'taxonomy'), "std" => ""), array("name" => __("Button 1 Link Target?", 'avia_framework'), "desc" => __("Select here if you want to open the linked page in a new window", 'avia_framework'), "id" => "link_target1", "type" => "select", "std" => "", "container_class" => 'av_half', "required" => array('link_apply', 'contains', 'button'), "subtype" => AviaHtmlHelper::linking_options()), array("name" => __("Button 2 Label", 'avia_framework'), "desc" => __("This is the text that appears on your second button.", 'avia_framework'), "id" => "button_label2", "type" => "input", "container_class" => 'av_half av_half_first', "required" => array('link_apply', 'contains', 'button-two'), "std" => "Click me"), array("name" => __("Button 2 Color", 'avia_framework'), "desc" => __("Choose a color for your second button here", 'avia_framework'), "id" => "button_color2", "type" => "select", "std" => "light", "container_class" => 'av_half', "required" => array('link_apply', 'contains', 'button-two'), "subtype" => array(__('Translucent Buttons', 'avia_framework') => array(__('Light Transparent', 'avia_framework') => 'light', __('Dark Transparent', 'avia_framework') => 'dark'), __('Colored Buttons', 'avia_framework') => array(__('Theme Color', 'avia_framework') => 'theme-color', __('Theme Color Subtle', 'avia_framework') => 'theme-color-subtle', __('Blue', 'avia_framework') => 'blue', __('Red', 'avia_framework') => 'red', __('Green', 'avia_framework') => 'green', __('Orange', 'avia_framework') => 'orange', __('Aqua', 'avia_framework') => 'aqua', __('Teal', 'avia_framework') => 'teal', __('Purple', 'avia_framework') => 'purple', __('Pink', 'avia_framework') => 'pink', __('Silver', 'avia_framework') => 'silver', __('Grey', 'avia_framework') => 'grey', __('Black', 'avia_framework') => 'black'))), array("name" => __("Button 2 Link?", 'avia_framework'), "desc" => __("Where should the Button link to?", 'avia_framework'), "id" => "link2", "container_class" => 'av_half av_half_first', "required" => array('link_apply', 'contains', 'button-two'), "type" => "linkpicker", "fetchTMPL" => true, "subtype" => array(__('Set Manually', 'avia_framework') => 'manually', __('Single Entry', 'avia_framework') => 'single', __('Taxonomy Overview Page', 'avia_framework') => 'taxonomy'), "std" => ""), array("name" => __("Button 2 Link Target?", 'avia_framework'), "desc" => __("Select here if you want to open the linked page in a new window", 'avia_framework'), "id" => "link_target2", "type" => "select", "std" => "", "container_class" => 'av_half', "required" => array('link_apply', 'contains', 'button-two'), "subtype" => AviaHtmlHelper::linking_options()))), array("name" => __("Slideshow Image and Video Size", 'avia_framework'), "desc" => __("Choose image and Video size for your slideshow.", 'avia_framework'), "id" => "size", "type" => "select", "std" => "featured", "subtype" => AviaHelper::get_registered_image_sizes(1000)), array("name" => __("Stretch image to fit the slideshow size?", 'avia_framework'), "desc" => __("By default the image stretches across the full width of the screen. You can deactivate this behavior and simply align it in the center of the slider", 'avia_framework'), "id" => "stretch", "type" => "select", "std" => "", "subtype" => array(__('Yes, stretch the image', 'avia_framework') => '', __('No, dont stretch the image. If the browser window is bigger than the image simply align it centered', 'avia_framework') => 'image_no_stretch')), array("name" => __("Slideshow Transition", 'avia_framework'), "desc" => __("Choose the transition for your Slideshow.", 'avia_framework'), "id" => "animation", "type" => "select", "std" => "slide", "subtype" => array(__('Slide sidewards', 'avia_framework') => 'slide', __('Slide up/down', 'avia_framework') => 'slide_up', __('Fade', 'avia_framework') => 'fade')), array("name" => __("Autorotation active?", 'avia_framework'), "desc" => __("Check if the slideshow should rotate by default", 'avia_framework'), "id" => "autoplay", "type" => "select", "std" => "false", "subtype" => array(__('Yes', 'avia_framework') => 'true', __('No', 'avia_framework') => 'false')), array("name" => __("Slideshow autorotation duration", 'avia_framework'), "desc" => __("Images will be shown the selected amount of seconds.", 'avia_framework'), "id" => "interval", "type" => "select", "std" => "5", "subtype" => array('3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '15' => '15', '20' => '20', '30' => '30', '40' => '40', '60' => '60', '100' => '100')), array("name" => __("Slideshow Background Image", 'avia_framework'), "desc" => __("If you are displaying transparent images like pngs you can set a static background image or pattern that will appear behind those pngs.", 'avia_framework'), "id" => "src", "type" => "image", "title" => __("Insert Image", 'avia_framework'), "button" => __("Insert", 'avia_framework'), "std" => ""), array("name" => __("Background Image Position", 'avia_framework'), "id" => "position", "type" => "select", "std" => "top left", "required" => array('src', 'not', ''), "subtype" => array(__('Top Left', 'avia_framework') => 'top left', __('Top Center', 'avia_framework') => 'top center', __('Top Right', 'avia_framework') => 'top right', __('Bottom Left', 'avia_framework') => 'bottom left', __('Bottom Center', 'avia_framework') => 'bottom center', __('Bottom Right', 'avia_framework') => 'bottom right', __('Center Left', 'avia_framework') => 'center left', __('Center Center', 'avia_framework') => 'center center', __('Center Right', 'avia_framework') => 'center right')), array("name" => __("Background Repeat", 'avia_framework'), "id" => "repeat", "type" => "select", "std" => "no-repeat", "required" => array('src', 'not', ''), "subtype" => array(__('No Repeat', 'avia_framework') => 'no-repeat', __('Repeat', 'avia_framework') => 'repeat', __('Tile Horizontally', 'avia_framework') => 'repeat-x', __('Tile Vertically', 'avia_framework') => 'repeat-y', __('Stretch to fit', 'avia_framework') => 'stretch')), array("name" => __("Background Attachment", 'avia_framework'), "id" => "attach", "type" => "select", "std" => "scroll", "required" => array('src', 'not', ''), "subtype" => array(__('Scroll', 'avia_framework') => 'scroll', __('Fixed', 'avia_framework') => 'fixed')));
        }
Exemple #30
0
 function load_more_button()
 {
     $data_string = AviaHelper::create_data_string($this->atts);
     $output = "";
     $output .= "<a class='av-masonry-pagination av-masonry-load-more' href='#load-more' {$data_string}>" . __('Load more', 'avia_framework') . "</a>";
     return $output;
 }