Пример #1
0
 function azuramodule_sc($atts, $content = "")
 {
     extract(shortcode_atts(array('id' => '', 'class' => '', 'moduleid' => '', 'showtitle' => '', 'style' => 'none', 'layout' => ''), $atts));
     if ($moduleid == '0' || $moduleid == '') {
         return false;
     }
     $module = CthShortcodes::loadModule($moduleid, $style);
     $shortcodeTemp = false;
     if (stripos($layout, '_:') !== false) {
         $shortcodeTemp = JPATH_PLUGINS . '/system/cthshortcodes/shortcodes_template/' . substr($layout, 2) . '.php';
     } else {
         if (stripos($layout, ':') !== false) {
             $shortcodeTemp = CthShortcodes::templatePath() . '/html/com_azurapagebuilder/plugin/shortcodes_template/' . substr($layout, stripos($layout, ':') + 1) . '.php';
         } else {
             $shortcodeTemp = CthShortcodes::addShortcodeTemplate('azuramodule');
         }
     }
     $buffer = ob_get_clean();
     ob_start();
     if ($shortcodeTemp !== false) {
         require $shortcodeTemp;
     }
     $content = ob_get_clean();
     ob_start();
     echo $buffer;
     return $content;
 }
Пример #2
0
 function azuramodule_sc($atts, $content = "")
 {
     extract(shortcode_atts(array('id' => '', 'class' => '', 'moduleid' => '', 'showtitle' => '', 'layout' => ''), $atts));
     if ($moduleid == '0' || $moduleid == '') {
         return false;
     }
     $module = CthShortcodes::loadModule($moduleid);
     $styleArr = shortcode_atts(array('margin_top' => '', 'margin_right' => '', 'margin_bottom' => '', 'margin_left' => '', 'border_top_width' => '', 'border_right_width' => '', 'border_bottom_width' => '', 'border_left_width' => '', 'padding_top' => '', 'padding_right' => '', 'padding_bottom' => '', 'padding_left' => '', 'border_color' => '', 'border_style' => '', 'background_color' => '', 'background_image' => '', 'background_repeat' => '', 'background_attachment' => '', 'background_size' => '', 'additional_style' => '', 'simplified' => ''), $atts);
     $styleTextArr = CthShortcodes::parseStyle($styleArr);
     $modulestyle = '';
     $styleText = implode(" ", $styleTextArr);
     $styleTextTest = trim($styleText);
     if (!empty($styleTextTest)) {
         $modulestyle .= trim($styleText);
     }
     if (!empty($modulestyle)) {
         $modulestyle = 'style="' . $modulestyle . '"';
     }
     $animationArgs = shortcode_atts(array('animation' => '0', 'trigger' => 'animate-in', 'animationtype' => '', 'hoveranimationtype' => '', 'infinite' => '0', 'animationdelay' => '0'), $atts);
     $shortcodeTemp = false;
     if (stripos($layout, '_:') !== false) {
         $shortcodeTemp = JPATH_PLUGINS . '/system/cthshortcodes/shortcodes_template/' . substr($layout, 2) . '.php';
     } else {
         if (stripos($layout, ':') !== false) {
             $shortcodeTemp = JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/com_azurapagebuilder/plugin/shortcodes_template/' . substr($layout, stripos($layout, ':') + 1) . '.php';
         } else {
             $shortcodeTemp = CthShortcodes::addShortcodeTemplate('azuramodule');
         }
     }
     $buffer = ob_get_clean();
     ob_start();
     if ($shortcodeTemp !== false) {
         require $shortcodeTemp;
     }
     $content = ob_get_clean();
     ob_start();
     echo $buffer;
     return $content;
 }