Exemplo n.º 1
0
 /**
  * Register tinymce assets
  *
  * @param array $scripts
  * @return array
  */
 static function register_assets_register_modal($assets)
 {
     $assets['ig-pb-wysiwyg-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/jquery.wysiwyg.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/jquery.wysiwyg.css', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-0.9-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/jquery.wysiwyg-0.9.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-0.9-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/jquery.wysiwyg-0.9.css', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-colorpicker-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/controls/wysiwyg.colorpicker.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-table-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/controls/wysiwyg.table.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-cssWrap-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/controls/wysiwyg.cssWrap.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-image-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/controls/wysiwyg.image.js', 'ver' => '1.0.0');
     $assets['ig-pb-wysiwyg-link-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-jwysiwyg') . '/controls/wysiwyg.link.js', 'ver' => '1.0.0');
     return $assets;
 }
Exemplo n.º 2
0
 /**
  * Register custom assets to use on Modal
  *
  * @param array $assets
  *
  * @return array
  */
 public function apply_assets($assets)
 {
     IG_Pb_Helper_Functions::load_bootstrap_3($assets);
     $assets['ig-pb-handlesetting-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/js/handle_setting.js', 'ver' => '1.0.0');
     if (IG_Pb_Helper_Functions::is_preview()) {
         $assets['ig-pb-frontend-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/css/front_end.css', 'ver' => '1.0.0');
     }
     $assets['ig-pb-modal-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/innogears') . '/css/modal.css', 'ver' => '1.0.0');
     $assets['ig-pb-codemirror-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/') . '/codemirror/codemirror.css', 'ver' => '1.0.0');
     $assets['ig-pb-codemirror-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/') . '/codemirror/codemirror.js', 'ver' => '1.0.0');
     $assets['ig-pb-codemirrormode-css-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/') . '/codemirror/mode/css.js', 'ver' => '1.0.0');
     $assets = apply_filters('ig_pb_assets_register_modal', $assets);
     return $assets;
 }
Exemplo n.º 3
0
 /**
  * Generate HTML code from shortcode content.
  *
  * @param   array   $atts     Shortcode attributes.
  * @param   string  $content  Current content.
  *
  * @return  string
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     $arr_params = shortcode_atts($this->config['params'], $atts);
     extract($arr_params);
     $html_elemments = $script = '';
     $alt_text = $image_alt ? " alt='{$image_alt}'" : '';
     $image_styles = array();
     if ($image_margin_top) {
         $image_styles[] = "margin-top:{$image_margin_top}px";
     }
     if ($image_margin_bottom) {
         $image_styles[] = "margin-bottom:{$image_margin_bottom}px";
     }
     if ($image_margin_right) {
         $image_styles[] = "margin-right:{$image_margin_right}px";
     }
     if ($image_margin_left) {
         $image_styles[] = "margin-left:{$image_margin_left}px";
     }
     $styles = count($image_styles) ? ' style="' . implode(';', $image_styles) . '"' : '';
     $class_img = $image_container_style != 'no-styling' ? $image_container_style : '';
     $class_img = $image_effect == 'yes' ? $class_img . ' image-scroll-fade' : $class_img;
     $class_img = !empty($class_img) ? ' class="' . $class_img . '"' : '';
     if ($image_file) {
         $image_id = IG_Pb_Helper_Functions::get_image_id($image_file);
         $attachment = wp_prepare_attachment_for_js($image_id);
         $image_file = !empty($attachment['sizes'][$image_size]['url']) ? $attachment['sizes'][$image_size]['url'] : $image_file;
         $html_elemments .= "<img src='{$image_file}'{$alt_text}{$styles}{$class_img} />";
         $script = '';
         $target = '';
         if ($image_effect == 'yes' and !isset($_POST['action'])) {
             $data = getimagesize($image_file);
             $width = $data[0];
             $height = $data[1];
             $html_elemments = "<img src='" . IG_Pb_Helper_Functions::path('assets/3rd-party') . '/jquery-lazyload/grey.gif' . "' data-original='{$image_file}' width='{$width}' height='{$height}' {$alt_text}{$styles} {$class_img}/>";
         }
         if ($open_in) {
             switch ($open_in) {
                 case 'current_browser':
                     $target = '';
                     break;
                 case 'new_browser':
                     $target = ' target="_blank"';
                     break;
                 case 'lightbox':
                     $cls_button_fancy = 'ig-image-fancy';
                     break;
             }
         }
         $class = isset($cls_button_fancy) && !empty($cls_button_fancy) ? " class='{$cls_button_fancy}'" : '';
         // get Single Item and check type to get right link
         $single_item = explode('__#__', $single_item);
         $single_item = $single_item[0];
         $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies();
         $post_types = IG_Pb_Helper_Type::get_post_types();
         // single post
         if (array_key_exists($link_type, $post_types)) {
             $permalink = home_url() . "/?p={$single_item}";
             $html_elemments = "<a href='{$permalink}'{$target}{$class}>" . $html_elemments . '</a>';
         } else {
             if (array_key_exists($link_type, $taxonomies)) {
                 $permalink = get_term_link(intval($single_item), $link_type);
                 if (!is_wp_error($permalink)) {
                     $html_elemments = "<a href='{$permalink}'{$target}{$class}>" . $html_elemments . '</a>';
                 }
             } else {
                 switch ($link_type) {
                     case 'url':
                         $html_elemments = "<a href='{$image_type_url}'{$target}{$class}>" . $html_elemments . '</a>';
                         break;
                     case 'large_image':
                         $image_id = IG_Pb_Helper_Functions::get_image_id($image_file);
                         $attachment = wp_prepare_attachment_for_js($image_id);
                         $image_url = !empty($attachment['sizes'][$image_image_size]['url']) ? $attachment['sizes'][$image_image_size]['url'] : $image_file;
                         $html_elemments = "<a href='{$image_url}'{$target}{$class}>" . $html_elemments . '</a>';
                         break;
                 }
             }
         }
         if (strtolower($image_alignment) != 'inherit') {
             if (strtolower($image_alignment) == 'left') {
                 $cls_alignment = 'pull-left';
             }
             if (strtolower($image_alignment) == 'right') {
                 $cls_alignment = 'pull-right';
             }
             if (strtolower($image_alignment) == 'center') {
                 $cls_alignment = 'text-center';
             }
             $html_elemments = "<div class='{$cls_alignment}'>" . $html_elemments . '</div>';
         }
     }
     return $this->element_wrapper($html_elemments . $script, $arr_params);
 }
Exemplo n.º 4
0
 /**
  * Load bootstrap 3, replace bootstrap 2
  *
  * @param type $assets
  *
  * @return string
  */
 static function load_bootstrap_3(&$assets)
 {
     if (!is_admin() || IG_Pb_Helper_Functions::is_preview()) {
         $assets['ig-pb-bootstrap-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/bootstrap3') . '/css/bootstrap_frontend.min.css', 'ver' => '3.0.2');
         $assets['ig-pb-bootstrap-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/bootstrap3') . '/js/bootstrap_frontend.min.js', 'ver' => '3.0.2', 'deps' => array('jquery'));
     }
 }
Exemplo n.º 5
0
 /**
  * Register jquery-te assets
  *
  * @param array $scripts
  * @return array
  */
 static function register_assets_register_modal($assets)
 {
     $assets['ig-pb-jquery-te-js'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-te') . '/jquery-te-1.4.0.min.js', 'ver' => '1.4.0');
     $assets['ig-pb-jquery-te-css'] = array('src' => IG_Pb_Helper_Functions::path('assets/3rd-party/jquery-te') . '/jquery-te-1.4.0.css', 'ver' => '1.4.0');
     return $assets;
 }
Exemplo n.º 6
0
 /**
  * Gravatar : use default avatar
  *
  * @param type $avatar
  * @param type $id_or_email
  * @param type $size
  * @param string $default
  * @return type
  */
 function get_gravatar($avatar, $id_or_email, $size, $default)
 {
     $default = IG_Pb_Helper_Functions::path('assets/innogears') . '/images/default_avatar.png';
     return '<img src="' . $default . '" alt="avatar" class="avatar" width="60" height="60" />';
 }