Exemplo n.º 1
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('alt' => 'scan QR code', 'size' => '100', 'margin' => '4', 'click' => 'no', 'fgcolor' => '#000000', 'bgcolor' => '#FFFFFF'), $args);
     extract($defaults);
     self::$args = $defaults;
     $current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '';
     $qr_pre_output = "";
     $qr_output = "";
     $qr_post_output = "";
     !empty($content) ? $content = strip_tags(trim($content)) : ($content = $current_url);
     if ($click == "yes") {
         $qr_pre_output = '<a href="' . $content . '">';
         $qr_post_output = '</a>';
     }
     // check if GD is installed on the server
     if (extension_loaded('gd') && function_exists('gd_info')) {
         $fgcolor = str_replace('#', '', $fgcolor);
         $bgcolor = str_replace('#', '', $bgcolor);
         $qr_output = '<img src="' . plugins_url('inc/qrcode-image.php', dirname(__FILE__)) . '?size=' . $size . '&fgcolor=' . $fgcolor . '&bgcolor=' . $bgcolor . '&content=' . $content . '" alt="' . $alt . '" width="' . $size . '" height="' . $size . '" />';
     } else {
         $qr_image = 'https://chart.googleapis.com/chart?cht=qr&chs=' . $size . 'x' . $size . '&chl=' . $content . '&choe=UTF-8';
         $qr_output = '<img src="' . $qr_image . '" alt="' . $alt . '" width="' . $size . '" height="' . $size . '" />';
     }
     return $qr_pre_output . $qr_output . $qr_post_output;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'src' => '', 'link' => '', 'link_target' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '<div class="img-frame rounded">';
     $html .= '<div class="img-box figcaption-middle text-center fade-in">';
     if ($link != '') {
         $html .= '<a target="' . $link_target . '" href="' . $link . '">
                                                     <img src="' . $src . '" class="feature-img">
                                                     <div class="img-overlay dark">
                                                         <div class="img-overlay-container">
                                                             <div class="img-overlay-content">
                                                                 <i class="fa fa-link"></i>
                                                             </div>
                                                         </div>
                                                     </div>
                                                 </a>';
     } else {
         $html .= ' <img src="' . $src . '" class="feature-img">
                                                     <div class="img-overlay dark">
                                                         <div class="img-overlay-container">
                                                             <div class="img-overlay-content">
                                                             </div>
                                                         </div>
                                                     </div>';
     }
     $html .= '</div></div>';
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'top_icon' => '', 'left_icon' => '', 'left_text' => '', 'counter_num' => '', 'right_text' => '', 'title' => '', 'border' => '0'), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($border == '1') {
         $class .= ' box-border';
     }
     $html = '<div class="magee-counter-box ' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
     if ($top_icon) {
         $html .= '<div class="counter-top-icon"><i class="fa ' . esc_attr($top_icon) . '"></i></div>';
     }
     $html .= '<div class="counter">';
     if ($left_icon) {
         $html .= '<i class="fa ' . esc_attr($left_icon) . '"></i> ';
     }
     if ($left_text) {
         $html .= '<span class="unit">' . esc_attr($left_text) . '</span>';
     }
     if ($counter_num) {
         $html .= '<span class="counter-num">' . esc_attr($counter_num) . '</span>';
     }
     if ($right_text) {
         $html .= '<span class="unit">' . esc_attr($right_text) . '</span>';
     }
     $html .= '</div>';
     $html .= '<h3 class="counter-title">' . esc_attr($title) . '</h3>';
     $html .= '</div>';
     return $html;
 }
Exemplo n.º 4
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'direction' => 'horizontal', 'front_paddings' => '', 'front_background' => '', 'front_color' => '', 'back_paddings' => '', 'back_background' => '', 'back_color' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $uniq_class = uniqid('flip_box-');
     $class .= ' ' . $uniq_class;
     $class .= ' ' . $direction;
     $html = '';
     if ($content) {
         $contentsplit = explode("|||", $content);
         $front_content = isset($contentsplit[0]) ? $contentsplit[0] : '';
         $back_content = isset($contentsplit[1]) ? $contentsplit[1] : '';
         $html = '<style type="text/css" scoped="scoped">.' . $uniq_class . ' .flipbox-front{background-color:' . $front_background . ';}.' . $uniq_class . ' .flipbox-front .flipbox-content{padding:' . $front_paddings . ';}.' . $uniq_class . ' .flipbox-back{background-color:' . $back_background . ';}.' . $uniq_class . ' .flipbox-back .flipbox-content{padding:' . $back_paddings . ';}</style>';
         $html .= '<div class="magee-flipbox-wrap ' . $class . '" id="' . $id . '">
                                             <div class="magee-flipbox">
                                                 <div class="flipbox-front">
                                                     <div class="flipbox-content">
                                                         ' . do_shortcode(Magee_Core::fix_shortcodes($front_content)) . '
                                                     </div>
                                                 </div>
                                                 <div class="flipbox-back">
                                                     <div class="flipbox-content">
                                                        ' . do_shortcode(Magee_Core::fix_shortcodes($back_content)) . '
                                                     </div>
                                                 </div>
                                             </div>
                                         </div>';
     }
     return $html;
 }
Exemplo n.º 5
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'style' => '', 'border_color' => '', 'border_width' => '0', 'border_position' => 'left', 'background_color' => '', 'button_color' => '', 'button_link' => '#', 'button_icon' => '', 'button_text' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $uniq_class = uniqid('promo_box-');
     $class .= ' ' . $uniq_class;
     $html = '';
     $textstyle = sprintf('.' . $uniq_class . '.boxed{border-' . esc_attr($border_position) . '-width: %s; background-color:%s;border-' . esc_attr($border_position) . '-color:%s;}', $border_width, $background_color, $border_color);
     $css_style = '';
     if ($button_color != '') {
         $css_style .= sprintf('.' . $uniq_class . ' .promo-action a{ background-color:%s;', $button_color);
     }
     if ($style == 'boxed') {
         $class .= ' boxed';
         $html .= sprintf('<style type="text/css" scoped="scoped">%s </style>', $textstyle);
     }
     if ($css_style != '') {
         $html .= sprintf('<style type="text/css" scoped="scoped">%s </style>', $css_style);
     }
     $html .= '<div class="magee-promo-box ' . esc_attr($class) . '" id="' . esc_attr($id) . '">
                                     <div class="promo-info">
                                         ' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '
                                     </div>
                                     <div class="promo-action">
                                         <a href="' . esc_url($button_link) . '" class="btn-normal btn-lg"><i class="fa ' . esc_attr($button_icon) . '"></i> ' . esc_attr($button_text) . '</a>
                                     </div>
                                 </div>';
     return $html;
 }
Exemplo n.º 6
0
    /**
     * Render the child shortcode
     * @param  array $args     Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string          HTML output
     */
    function render_child($args, $content = '')
    {
        $defaults = Magee_Core::set_shortcode_defaults(array('title' => '', 'status' => '', 'icon' => ''), $args);
        extract($defaults);
        self::$args = $defaults;
        if ($status == "open") {
            $status = "in";
            $expanded = "true";
            $collapse = "";
        } else {
            $status = "";
            $expanded = "false";
            $collapse = "collapsed";
        }
        $itemId = 'collapse' . $this->id . "-" . $this->num;
        $html = '<div class="panel panel-default">
                                                    <div class="panel-heading" role="tab" id="heading' . $itemId . '">
                                                        <a class="accordion-toggle ' . $collapse . '" data-toggle="collapse" data-parent="#' . $this->id . '" href="#' . $itemId . '" aria-expanded="' . $expanded . '" aria-controls="' . $itemId . '">
                                                            <h4 class="panel-title">
                                                                <i class="fa ' . $icon . '"></i> ' . esc_attr($title) . '
                                                            </h4>
                                                        </a>
                                                    </div>
                                                    <div id="' . $itemId . '" class="panel-collapse collapse ' . $status . '" role="tabpanel" aria-labelledby="heading' . $itemId . '" aria-expanded="' . $expanded . '">
                                                        <div class="panel-body">
                                                          ' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '
														  <div class="clear"></div>
                                                        </div>
                                                    </div>
                                                </div>';
        $this->num++;
        return $html;
    }
    /**
     * Render the shortcode
     * @param  array $args     Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string          HTML output
     */
    function render($args, $content = '')
    {
        $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'style' => 'border', 'color' => '', 'border_color' => '', 'text_align' => '', 'font_weight' => '400', 'font_size' => '36px', 'margin_top' => '', 'margin_bottom' => '', 'border_width' => '5px'), $args);
        extract($defaults);
        self::$args = $defaults;
        $uniqid = uniqid('heading-');
        $class .= ' ' . $uniqid;
        $html = '<style type="text/css">
		                          
                                    .' . $uniqid . '.magee-heading{
                                        font-size:' . $font_size . ';
                                        font-weight:' . $font_weight . ';
                                        margin-top:' . $margin_top . ';
                                        margin-bottom:' . $margin_bottom . ';
                                        color: ' . $color . ';
                                        border-color: ' . $border_color . ';
                                        text-align: ' . $text_align . ';
                                    }
                                    .' . $uniqid . '.heading-border .heading-inner {
                                        border-width: ' . $border_width . ';
                                    }
								.' . $uniqid . '.heading-doubleline .heading-inner:before,
								.' . $uniqid . '.heading-doubleline .heading-inner:after {
									    border-color: ' . $border_color . ';
									    border-width: ' . $border_width . ';
									}
                                </style>';
        $html .= '<h1 class="magee-heading heading-' . $style . ' ' . $class . '" id="' . $id . '"><span class="heading-inner">' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '</span></h1>';
        return $html;
    }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => 'magee-social', 'class' => '', 'icon_size' => '', 'effect_3d' => 'no', 'title' => '', 'icon' => '', 'iconlink' => '#', 'iconcolor' => '#A0A0A0', 'backgroundcolor' => 'transparent', 'iconboxedradius' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $uniqid = uniqid('social-');
     $this->id = $id . $uniqid;
     $uqid = uniqid('tab');
     $sty3d = '';
     $textstyle = sprintf(' .%s_social_icon_acolor{ color: %s !important ; background-color: %s !important; font-size: %s; }', $uqid, $iconcolor, $backgroundcolor, $icon_size);
     $styles = sprintf('<style type="text/css" scoped="scoped">%s </style>', $textstyle);
     if ($effect_3d == 'yes') {
         $sty3d .= ' icon-3d';
     }
     switch ($iconboxedradius) {
         case 'normal':
             break;
         case 'boxed':
             $sty3d .= ' icon-boxed';
             break;
         case 'rounded':
             $sty3d .= ' icon-boxed rounded';
             break;
         case 'circle':
             $sty3d .= ' icon-boxed circle';
             break;
     }
     $html = sprintf(' %s <a href="%s" Id="%s" class="fa %s magee-icon  %s %s %s_social_icon_acolor" data-toggle="tooltip" data-placement="top" title="" data-original-title="%s"></a>', $styles, $iconlink, $id, $icon, $sty3d, $class, $uqid, $title);
     return $html;
 }
Exemplo n.º 9
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'title' => '', 'border_color' => '', 'title_background_color' => '', 'title_color' => '', 'border_radius' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $add_class = uniqid('panel-');
     $class .= ' ' . $add_class;
     $css_style = '';
     if (is_numeric($border_radius)) {
         $border_radius = $border_radius . 'px';
     }
     if ($title_color) {
         $css_style .= '.' . $add_class . ' h3.panel-title{color:' . esc_attr($title_color) . ';}';
     }
     if ($border_color) {
         $css_style .= '.' . $add_class . '{border-color:' . esc_attr($border_color) . ';}';
     }
     if ($title_background_color) {
         $css_style .= '.' . $add_class . ' .panel-heading{background-color:' . esc_attr($title_background_color) . ';}';
     }
     if ($border_radius) {
         $css_style .= '.' . $add_class . '{border-radius:' . esc_attr($border_radius) . ';}';
     }
     $styles = sprintf('<style type="text/css" scoped="scoped">%s </style>', $css_style);
     $content = do_shortcode(Magee_Core::fix_shortcodes($content));
     $html = sprintf('%s<div class="panel magee-panel %s" id="%s">
                                     <div class="panel-heading">
                                         <h3 class="panel-title">%s</h3>
                                     </div>
                                     <div class="panel-body">
                                         %s
                                     </div>
                                 </div>', $styles, esc_attr($class), esc_attr($id), esc_attr($title), $content);
     return $html;
 }
Exemplo n.º 10
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'icon' => '', 'color' => '', 'size' => '', 'icon_box' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     if (is_numeric($size)) {
         $size = $size . 'px';
     }
     $html = '';
     $css_style = '';
     $uniqid = ' magee-fa-icon icon-boxed';
     if ($size) {
         $css_style .= 'font-size:' . $size . ';';
     }
     if ($icon_box == 'yes') {
         $icon .= $uniqid;
         if ($color) {
             $css_style .= 'background:' . $color . ';';
         }
         if ($icon != '') {
             $html = sprintf('<i id="%s" class="%s fa %s" style="%s"></i>', $id, $class, $icon, $css_style);
         }
     } else {
         if ($color) {
             $css_style .= 'color:' . $color . ';';
         }
         if ($icon != '') {
             $html = sprintf('<i id="%s" class="%s fa %s" style="%s"></i>', $id, $class, $icon, $css_style);
         }
     }
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('type' => '', 'alternative' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '';
     switch (esc_attr($type)) {
         case 'private':
             if (current_user_can('publish_posts')) {
                 $html .= '<div class="content-private">' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '</div>';
             } else {
                 $html .= '<div class="content-private-no">' . esc_attr($alternative) . '</div>';
             }
             break;
         case 'members':
             if (is_user_logged_in()) {
                 $html .= '<div class="content-members">' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '</div>';
             } else {
                 $html .= '<div class="content-members-no">' . esc_attr($alternative) . '</div>';
             }
             break;
         case 'guests':
             if (!is_user_logged_in()) {
                 $html .= '<div class="content-guests">' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '</div>';
             } else {
                 $html .= '<div class="content-guests-no">' . esc_attr($alternative) . '</div>';
             }
             break;
     }
     return $html;
 }
Exemplo n.º 12
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('url' => '', 'number' => 3, 'class' => '', 'id' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '';
     //$html = '<h2>'._e( 'Recent news from Some-Other Blog:', 'my-text-domain' ).'<h2>';
     if ($url !== '') {
         include_once ABSPATH . WPINC . '/feed.php';
         $rss = fetch_feed(esc_url($url));
         $maxitems = 0;
         if (!is_wp_error($rss)) {
             $maxitems = $rss->get_item_quantity(esc_attr($number));
             $rss_items = $rss->get_items(0, $maxitems);
         }
         $html = '<ul class="' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
         if ($maxitems == 0) {
             $html .= '<li>' . _e('No items', 'magee-shortcodes') . '</li>';
         } else {
             foreach ($rss_items as $item) {
                 $html .= '<li>';
                 $html .= '<a target="_blank" href="' . esc_url($item->get_permalink()) . '" ';
                 $html .= 'title="' . __('Posted ' . $item->get_date('j F Y | g:i a'), 'magee-shortcodes') . '">';
                 $html .= $item->get_title();
                 $html .= '</a>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_modal_content($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array(), $args);
     extract($defaults);
     self::$args = $defaults;
     $this->modal_content = do_shortcode(Magee_Core::fix_shortcodes($content));
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'percent' => '50', 'text' => '', 'height' => 30, 'color' => '', 'direction' => 'left', 'textposition' => 'on', 'number' => 'yes', 'rounded' => 'on', 'striped' => 'none'), $args);
     extract($defaults);
     self::$args = $defaults;
     $percent = str_replace('%', '', $percent);
     $percent = esc_attr($percent) . '%';
     $css_style = 'width: ' . esc_attr($percent) . ';';
     if (is_numeric($height)) {
         $height = $height . 'px';
     }
     $line_height = '';
     $bar_height = '';
     if ($height) {
         $bar_height = 'height:' . esc_attr($height) . ';';
         $line_height = 'line-height:' . esc_attr($height) . '';
     }
     if ($direction == 'left') {
         $a = 'left';
         $b = 'right';
     } else {
         $a = 'right';
         $b = 'left';
     }
     $progress = '';
     $progress_bar = '';
     if ($textposition == 'above') {
         $progress .= ' progress-sm';
     }
     if ($number == 'no') {
         $percent = '';
     }
     if ($rounded == 'on') {
         $progress .= ' rounded';
     }
     if ($striped == 'none') {
         $progress_bar .= ' none-striped';
     }
     if ($striped == 'striped') {
         $progress_bar .= ' progress-bar-striped';
     }
     if ($striped == 'striped animated') {
         $progress_bar .= ' progress-bar-striped animated hinge infinite';
     }
     if ($color) {
         $css_style .= 'background-color:' . esc_attr($color) . ';';
     }
     $html = '<div class="magee-progress-box ' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
     if ($textposition == '2') {
         $html .= '<div class="porgress-title text-' . $a . ' clearfix">' . esc_textarea($text) . ' <div class="pull-' . $b . '">' . esc_attr($percent) . '</div></div>';
     }
     $html .= '<div class="progress ' . $progress . '" style="' . $bar_height . '">
                                                 <div class="progress-bar pull-' . $a . ' ' . esc_attr($progress_bar) . '" role="progressbar" aria-valuenow="' . esc_textarea($text) . '" aria-valuemin="0" aria-valuemax="100" style="' . $css_style . '">';
     if ($textposition == '1') {
         $html .= '<div class="progress-title text-' . $a . ' clearfix" style="' . $line_height . '">' . esc_textarea($text) . ' <div class="pull-' . $b . '">' . esc_attr($percent) . '</div></div>';
     }
     $html .= ' </div></div>';
     $html .= '</div>';
     return $html;
 }
Exemplo n.º 15
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('background_color' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span class="label magee-label" style="background-color:%s;">%s</span>', $background_color, do_shortcode($content));
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'title' => '', 'trigger' => 'click', 'placement' => 'top'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span class="%s tooltip-text" id="%s" data-toggle="tooltip" data-trigger="%s" data-placement="%s" data-original-title="%s" >%s</span>', $class, $id, $trigger, $placement, $title, do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
Exemplo n.º 17
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array(), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<li><i class="fa %s"></i> %s</li>', $this->icon_a, do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'color' => '', 'boxed' => 'yes', 'boxed_radius' => '0'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span %s>%s</span>', Magee_Core::attributes('dropcap-shortcode'), do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => '#007005', 'border_radius' => '0'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span %s>%s</span>', Magee_Core::attributes('highlight-shortcode'), do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
Exemplo n.º 20
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('style' => '', 'class' => '', 'id' => '', 'amount' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $source = simplexml_load_file('http://www.lipsum.com/feed/xml?what=' . esc_attr($style) . '&amount=' . esc_attr($amount) . '&start=0');
     $html = '<div class="' . esc_attr($class) . '" id="' . esc_attr($id) . '">' . wpautop(str_replace("\n", "\n\n", $source->lipsum)) . '</div>';
     return $html;
 }
Exemplo n.º 21
0
        /**
         * Render the shortcode
         * @param  array $args     Shortcode paramters
         * @param  string $content Content between shortcode
         * @return string          HTML output
         */
        function render($args, $content = '')
        {
            $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'style' => '', 'border_color' => '', 'border_width' => '0', 'border_position' => 'left', 'background_color' => '', 'button_color' => '', 'button_link' => '#', 'button_icon' => '', 'button_text' => '', 'button_text_color' => ''), $args);
            extract($defaults);
            self::$args = $defaults;
            if (is_numeric($border_width)) {
                $border_width = $border_width . 'px';
            }
            $uniq_class = uniqid('promo_box-');
            $action_class = uniqid('promo-action-');
            $class .= ' ' . $uniq_class;
            $html = '';
            if ($button_text == '') {
                $html .= '<style type="text/css" scoped="scoped">.' . $action_class . '{display:none;}</style>';
            }
            $textstyle = sprintf('.' . $uniq_class . '.boxed{border-' . esc_attr($border_position) . '-width: %s; background-color:%s;border-' . esc_attr($border_position) . '-color:%s;}', $border_width, $background_color, $border_color);
            $css_style = '';
            if ($button_color != '') {
                $css_style .= sprintf('.' . $uniq_class . ' .promo-action a{background-color:%s;', $button_color);
            }
            if ($button_text_color != '') {
                $css_style .= sprintf('.' . $uniq_class . ' .promo-action a{color:%s;', $button_text_color);
            }
            if ($style == 'boxed') {
                $class .= ' boxed';
                $html .= sprintf('<style type="text/css" scoped="scoped">%s </style>', $textstyle);
            }
            if ($css_style != '') {
                $html .= sprintf('<style type="text/css" scoped="scoped">%s </style>', $css_style);
            }
            $html .= '<div class="magee-promo-box ' . esc_attr($class) . '" id="' . esc_attr($id) . '">
                                        <div class="promo-info">
                                            ' . do_shortcode(Magee_Core::fix_shortcodes($content)) . '
                                        </div>								
                                        <div class="promo-action ' . $action_class . '">
                                            <a href="' . esc_url($button_link) . '" class="btn-normal btn-lg">';
            if (stristr($button_icon, 'fa-')) {
                $html .= '<i class="fa ' . esc_attr($button_icon) . '"></i>';
            } else {
                $html .= '<img src="' . esc_attr($button_icon) . '" class="image_instead"/>';
            }
            $html .= esc_attr($button_text) . '</a>
                                        </div>
                                    </div>';
            $html .= '<script>
	    jQuery(function($) {
	      if($("#magee-sc-form-preview").length>0){
				 $("#magee-sc-form-preview").contents().find(".promo-action a").on("click",function(e){
				    if($(this).attr("href") == "#"){
					   e.preventDefault();
				    }
				 });
		      }
		  });           
		</script>';
            return $html;
        }
Exemplo n.º 22
0
        /**
         * Render the shortcode
         * @param  array $args     Shortcode paramters
         * @param  string $content Content between shortcode
         * @return string          HTML output
         */
        function render($args, $content = '')
        {
            $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'icon' => '', 'background_color' => '', 'text_color' => '', 'border_width' => '', 'border_radius' => '', 'dismissable' => '', 'box_shadow' => ''), $args);
            extract($defaults);
            self::$args = $defaults;
            $add_class = uniqid('alert-');
            $class .= ' ' . $add_class;
            $css_style = '';
            $icon_str = '';
            if (is_numeric($border_width)) {
                $border_width = $border_width . 'px';
            }
            if (is_numeric($border_radius)) {
                $border_radius = $border_radius . 'px';
            }
            if ($background_color) {
                $css_style .= 'background-color:' . esc_attr($background_color) . ';';
            }
            if ($text_color) {
                $css_style .= 'color:' . esc_attr($text_color) . ';';
                $css_style .= 'border-color:' . esc_attr($text_color) . ';';
            }
            if ($border_width) {
                $css_style .= 'border-width:' . esc_attr($border_width) . ';';
            }
            if ($border_radius) {
                $css_style .= 'border-radius:' . esc_attr($border_radius) . ';';
            }
            if ($box_shadow == 'yes') {
                $class .= ' box-shadow';
            }
            if ($dismissable == 'yes') {
                $icon_str .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>';
                $class .= ' alert-dismissible';
            }
            if (stristr($icon, 'fa-')) {
                $icon_str .= '<i class="fa ' . esc_attr($icon) . '"></i>';
            } else {
                $icon_str .= '<img class="image-instead" src="' . esc_attr($icon) . '" style="padding-right:10px"/>';
            }
            $styles = sprintf('<style type="text/css" scoped="scoped">.%s{%s} </style>', $add_class, $css_style);
            $content = $icon_str . do_shortcode(Magee_Core::fix_shortcodes($content));
            $script = '<script>
         jQuery(function($){
						if($("#magee-sc-form-preview").length>0){
								$("#magee-sc-form-preview").contents().find(".close").on("click",function(){
								   $("#magee-sc-form-preview").contents().find(".' . $add_class . '").remove();
								});
						}
				});		
		</script>';
            $html = sprintf(' %s<div class="alert magee-alert %s " role="alert" id= "%s">%s</div>%s', $styles, $class, $id, $content, $script);
            return $html;
        }
Exemplo n.º 23
0
        /**
         * Render the child shortcode
         * @param  array $args     Shortcode paramters
         * @param  string $content Content between shortcode
         * @return string          HTML output
         */
        function render_child($args, $content = '')
        {
            $defaults = Magee_Core::set_shortcode_defaults(array('value' => '', 'color' => ''), $args);
            extract($defaults);
            self::$args = $defaults;
            $html = '{
				value: ' . esc_attr($value) . ',
				color : "' . esc_attr($color) . '",
			    },';
            return $html;
        }
Exemplo n.º 24
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'no_padding' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($no_padding == 'yes') {
         $class .= ' no-padding';
     }
     $html = sprintf('<div id="%s" class="%s row">%s</div>', $id, $class, do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
Exemplo n.º 25
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('menu' => '', 'class' => '', 'id' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     if (isset($menu)) {
         $menus = array('menu' => esc_attr($menu), 'items_wrap' => '<ul id="%1$s ' . esc_attr($id) . '" class="%2$s ' . esc_attr($class) . '">%3$s</ul>');
         $html = wp_nav_menu($menus);
         return $html;
     }
 }
    /**
     * Render the shortcode
     * @param  array $args     Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string          HTML output
     */
    function render($args, $content = '')
    {
        $defaults = Magee_Core::set_shortcode_defaults(array('id' => 'magee-popover', 'class' => '', 'title' => '', 'triggering_text' => '', 'trigger' => 'click', 'placement' => 'top'), $args);
        extract($defaults);
        self::$args = $defaults;
        $uniqid = uniqid('popover-');
        $this->id = $id . $uniqid;
        $html = sprintf('<span class="%s" id="%s" data-toggle="popover" data-trigger="%s" data-placement="%s" 
		data-content="%s" data-original-title="%s" >%s</span>', $class, $id, $trigger, $placement, do_shortcode(Magee_Core::fix_shortcodes($content)), $title, $triggering_text);
        return $html;
    }
Exemplo n.º 27
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'padding' => '', 'backgroundimage' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $uniqid = uniqid('custom_box-');
     $textstyle = sprintf(' .custom-box-1 {padding: %s; background-image: url(%s); } ', $padding, $backgroundimage);
     $styles = sprintf('<style type="text/css" scoped="scoped">%s </style>', $textstyle);
     $html = sprintf(' %s<div class="custom-box-1 %s" id="%s">%s </div>', $styles, $class, $id, do_shortcode(Magee_Core::fix_shortcodes($content)));
     return $html;
 }
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('style' => '', 'class' => '', 'id' => '', 'width' => '', 'height' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($style == 'any') {
         $style = rand(0, 10);
     }
     $link = 'http://lorempixel.com/' . esc_attr($width) . '/' . esc_attr($height) . '/' . esc_attr($style) . '/';
     $html = '<div class="' . esc_attr($class) . '" id="' . esc_attr($id) . '"><img src="' . $link . '" width="' . $width . 'px" height="' . $height . 'px"/></div>';
     return $html;
 }
Exemplo n.º 29
0
        /**
         * Render the shortcode
         * @param  array $args     Shortcode paramters
         * @param  string $content Content between shortcode
         * @return string          HTML output
         */
        function render($args, $content = '')
        {
            $defaults = Magee_Core::set_shortcode_defaults(array('id' => 'magee-popover', 'class' => '', 'title' => '', 'triggering_text' => '', 'trigger' => 'click', 'placement' => 'top'), $args);
            extract($defaults);
            self::$args = $defaults;
            $uniqid = uniqid('popover-');
            $this->id = $id . $uniqid;
            $html = sprintf('<span class="popover-preview %s" id="%s" data-toggle="popover" data-trigger="%s" data-placement="%s" 
		data-content="%s" data-original-title="%s" >%s</span>', $class, $id, $trigger, $placement, do_shortcode(Magee_Core::fix_shortcodes($content)), $title, $triggering_text);
            $html .= "<script>\r\n\t\tjQuery(function(\$){\r\n\t\t\tif(jQuery('#magee-sc-form-preview').length>0){\r\n\t\t\t\t\$('#magee-sc-form-preview').ready(function(){\r\n\t\t\t\t\t\$('#magee-sc-form-preview').contents().find('.popover-preview').css({\"position\":\"relative\",\"top\":\"100px\",\"left\":\"200px\"});\r\n\t\t\t\t\t\$('#magee-sc-form-preview').contents().find('.popover-preview').on('" . $trigger . "',function(){\r\n\t\t\t\t\t\tif(\$('#magee-sc-form-preview').contents().find('.popover').length>0){\r\n\t\t\t\t\t\t\$('#magee-sc-form-preview').contents().find('.popover').remove();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar html = '<div class=\"popover-preview-hidden popover fade " . $placement . " in\" role=\"tooltip\" id=\"{$uniqid}\" style=\"display: block;\"><div class=\"arrow\"></div><h3 class=\"popover-title\">" . $title . "</h3><div class=\"popover-content\">" . do_shortcode(Magee_Core::fix_shortcodes($content)) . "</div></div>';\t\t\t\r\n\t\t\t\t\t\t\$('#magee-sc-form-preview').contents().find('span').after(html);\t\r\n\t\t\t\t\t\tvar hidden = \$('#magee-sc-form-preview').contents().find('.popover-preview-hidden');\r\n\t\t\t\t\t\t\tif(hidden.attr('class').indexOf('top')>=0){\r\n\t\t\t\t\t\t\t\tsize = (\$('#magee-sc-form-preview').contents().find('.popover-preview').width()/2+200-hidden.width()/2).toString();\r\n\t\t\t\t\t\t\t\thidden.css({\"position\":\"absolute\",\"top\":\"25px\",\"left\":size+\"px\"});}\r\n\t\t\t\t\t\t\tif(hidden.attr('class').indexOf('bottom')>=0){\r\n\t\t\t\t\t\t\t\tsize = (\$('#magee-sc-form-preview').contents().find('.popover-preview').width()/2+200-hidden.width()/2).toString();\r\n\t\t\t\t\t\t\t\thidden.css({\"position\":\"absolute\",\"top\":\"116px\",\"left\":size+\"px\"});}\r\n\t\t\t\t\t\t\tif(hidden.attr('class').indexOf('left')>=0){\r\n\t\t\t\t\t\t\t\tsize_width = (200-(hidden.width()+10)).toString();\r\n\t\t\t\t\t\t\t\tsize_height = (\$('#magee-sc-form-preview').contents().find('.popover-preview').height()/2+100-hidden.height()/2).toString();\r\n\t\t\t\t\t\t\t\thidden.css({\"position\":\"absolute\",\"top\":size_height+\"px\",\"left\":size_width+\"px\"});}\r\n\t\t\t\t\t\t\tif(hidden.attr('class').indexOf('Right')>=0){\r\n\t\t\t\t\t\t\t\tsize_width = (200+\$('#magee-sc-form-preview').contents().find('.popover-preview').width()).toString();\r\n\t\t\t\t\t\t\t\tsize_height = (\$('#magee-sc-form-preview').contents().find('.popover-preview').height()/2+100-hidden.height()/2).toString();\r\n\t\t\t\t\t\t\t\thidden.css({\"position\":\"absolute\",\"top\":size_height+\"px\",\"left\":size_width+\"px\"});}\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t</script>";
            return $html;
        }
Exemplo n.º 30
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array(), $args);
     extract($defaults);
     self::$args = $defaults;
     if (stristr($this->icon_a, 'fa-')) {
         $html = sprintf('<li><i class="fa %s"></i> %s</li>', $this->icon_a, do_shortcode(Magee_Core::fix_shortcodes($content)));
     } else {
         $html = sprintf('<li><img src="%s" class="image_instead"/> %s</li>', $this->icon_a, do_shortcode(Magee_Core::fix_shortcodes($content)));
     }
     return $html;
 }