config['type'] = 'layout'; $this->config['self_closing'] = 'no'; $this->config['contains_text'] = 'no'; $this->config['name'] = __('Color Section', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-section.png"; $this->config['tab'] = __('Layout Elements', 'avia_framework' ); $this->config['order'] = 20; $this->config['shortcode'] = 'av_section'; $this->config['html_renderer'] = false; $this->config['tinyMCE'] = array('disable' => "true"); $this->config['tooltip'] = __('Creates a section with unique background image and colors', 'avia_framework' ); $this->config['drag-level'] = 1; $this->config['drop-level'] = 1; $this->config['preview'] = false; } /** * 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']; $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']; $data['preview'] = !empty($this->config['preview']) ? $this->config['preview'] : 0; $title_id = !empty($args['id']) ? ": ".ucfirst($args['id']) : ""; // add background color or gradient to indicator $el_bg = ""; if( empty( $args['background'] ) || ( $args['background'] == 'bg_color' ) ) { $el_bg = !empty($args['custom_bg']) ? " style='background:".$args['custom_bg'].";'" : ""; } else { if ($args['background_gradient_color1'] && $args['background_gradient_color2']) { $el_bg = "style='background:linear-gradient(".$args['background_gradient_color1'].",".$args['background_gradient_color2'].");'"; } } $hidden_el_active = !empty($args['av_element_hidden_in_editor']) ? "av-layout-element-closed" : ""; if(!empty($this->config['modal_on_load'])) { $data['modal_on_load'] = $this->config['modal_on_load']; } $dataString = AviaHelper::create_data_string($data); $output = "