Example #1
0
}
if (!empty($shortcode)) {
    $script = '';
    if (isset($init_tab) && $init_tab == 'appearance') {
        // Auto move to Styling tab if previous action
        // is coping style from other element.
        $script .= "\n\t\t\t(function (\$) {\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\tsetTimeout(function (){\n\t\t\t\t\t\t\$('[href=\"#appearance\"]').click();\n\t\t\t\t\t}, 500);\n\n\t\t\t\t});\n\t\t\t})(jQuery);";
    }
    if (@$_REQUEST['form_only']) {
        $script .= ' var wr_mm_modal_ajax = true;';
    }
    WR_Megamenu_Init_Assets::print_inline('js', $script, true);
    ?>

	<div id="wr-element-<?php 
    echo esc_attr(WR_Megamenu_Helpers_Shortcode::shortcode_name($shortcode));
    ?>
">
		<div class="wr-mm-form-container jsn-bootstrap3">
			<div id="modalOptions" class="form-horizontal <?php 
    echo esc_attr($submodal);
    ?>
">
	<?php 
    if (!empty($params)) {
        $params = stripslashes($params);
        $params = urldecode($params);
    }
    // elements
    if ($el_type == 'element') {
        // get shortcode class
Example #2
0
 /**
  * Wrap output html of a shortcode
  *
  * @param array $arr_params
  * @param string $html_element
  * @param string $extra_class
  * @return string
  */
 public function element_wrapper($html_element, $arr_params, $extra_class = '', $custom_style = '')
 {
     $shortcode_name = WR_Megamenu_Helpers_Shortcode::shortcode_name($this->config['shortcode']);
     // extract margin here then insert inline style to wrapper div
     $styles = array();
     if (!empty($arr_params['div_margin_top'])) {
         $styles[] = 'margin-top:' . intval($arr_params['div_margin_top']) . 'px';
     }
     if (!empty($arr_params['div_margin_bottom'])) {
         $styles[] = 'margin-bottom:' . intval($arr_params['div_margin_bottom']) . 'px';
     }
     $style = count($styles) ? implode('; ', $styles) : '';
     if (!empty($style) || !empty($custom_style)) {
         $style = "style='{$style} {$custom_style}'";
     }
     $class = "wr-element-container wr-element-{$shortcode_name}";
     $extra_class .= !empty($arr_params['css_suffix']) ? ' ' . esc_attr($arr_params['css_suffix']) : '';
     $class .= !empty($extra_class) ? ' ' . ltrim($extra_class, ' ') : '';
     $extra_id = !empty($arr_params['id_wrapper']) ? ' ' . esc_attr($arr_params['id_wrapper']) : '';
     $extra_id = !empty($extra_id) ? "id='" . ltrim($extra_id, ' ') . "'" : '';
     return "<div {$extra_id} class='{$class}' {$style}>" . $html_element . '</div>';
 }