Файловый менеджер - Редактировать - /home/lmsyaran/public_html/pusher/carousel.zip
Назад
PK T>�[��� A A admin.phpnu �[��� <?php /** * @package SP Page Builder * @author JoomShaper https://www.joomshaper.com * @copyright Copyright (c) 2010 - 2023 JoomShaper * @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later */ //no direct access defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Language\Text; SpAddonsConfig::addonConfig([ 'type' => 'repeatable', 'addon_name' => 'carousel', 'category' => 'Slider', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_DESC'), 'icon' => '<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23 5H9v22h14V5zM9 3c-1.1 0-2 .9-2 2v22c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H9z" fill="currentColor"/><path d="M27.9 19.5v-6.9c0-.5.5-.7.8-.4l3.1 3.5c.2.2.2.6 0 .8L28.7 20c-.2.2-.8-.1-.8-.5zM4.1 12.5v6.9c0 .5-.5.7-.8.4L.2 16.3c-.2-.2-.2-.6 0-.8L3.3 12c.3-.2.8.1.8.5z" fill="currentColor"/><g opacity=".5" fill-rule="evenodd" clip-rule="evenodd" fill="currentColor"><path d="M25 16.2L20.9 20c-1.8 1.7-5 1.5-6.5-.4-.8-1-2.4-1.1-3.4-.2L8.6 22 7 20.8l2.5-2.5c1.8-1.8 5.1-1.7 6.6.3.8 1 2.4 1.1 3.3.2l4.1-3.8 1.5 1.2zM17.5 9c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5S18.3 9 17.5 9zM14 10.5C14 8.6 15.6 7 17.5 7S21 8.6 21 10.5 19.4 14 17.5 14 14 12.4 14 10.5z"/></g></svg>', 'settings' => [ 'carousel_items' => [ 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEMS'), 'fields' => [ 'sp_carousel_item' => [ 'type' => 'repeatable', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEMS'), 'attr' => [ 'title' => [ 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TITLE'), 'fields' => [ 'title' => [ 'type' => 'text', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TITLE'), 'std' => 'Where Art and Technology Collide', ], 'title_padding' => [ 'type' => 'padding', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEM_TITLE_PADDING'), 'std' => ['xl' => '0px 0px 0px 0px', 'lg' => '', 'md' => '', 'sm' => '', 'xs' => ''], 'responsive' => true ], 'title_margin' => [ 'type' => 'margin', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEM_TITLE_MARGIN'), 'std' => ['xl' => '0px 0px 0px 0px', 'lg' => '', 'md' => '', 'sm' => '', 'xs' => ''], 'responsive' => true ], ], ], 'content' => [ 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CONTENT'), 'fields' => [ 'content' => [ 'type' => 'editor', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CONTENT'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEM_CONTENT_DESC'), 'std' => 'You might remember the Dell computer commercials in which a youth reports this exciting news to his friends.<br />That they are about to get their new computer.' ], 'content_padding' => [ 'type' => 'padding', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEM_CONTENT_PADDING'), 'std' => ['xl' => '20px 0px 30px 0px', 'lg' => '', 'md' => '', 'sm' => '', 'xs' => ''], 'responsive' => true ], 'content_margin' => [ 'type' => 'margin', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CONTENT_MARGIN'), 'std' => ['xl' => '0px 0px 0px 0px', 'lg' => '', 'md' => '', 'sm' => '', 'xs' => ''], 'responsive' => true ], 'bg' => [ 'type' => 'media', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_IMAGE'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_ITEM_IMAGE_DESC'), 'format' => 'image', 'std' => ['src' => 'https://sppagebuilder.com/addons/carousel/carousel-bg.jpg'] ], ], ], 'button' => [ 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON'), 'fields' => [ 'button_text' => [ 'type' => 'text', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_TEXT'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_TEXT_DESC'), 'std' => 'Learn More', ], 'button_url' => [ 'type' => 'link', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_URL'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_URL_DESC'), ], 'button_icon' => [ 'type' => 'icon', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_ICON'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_ICON_DESC'), ], 'button_icon_position' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_ICON_POSITION'), 'values' => [ 'left' => Text::_('COM_SPPAGEBUILDER_GLOBAL_LEFT'), 'right' => Text::_('COM_SPPAGEBUILDER_GLOBAL_RIGHT'), ], ], ], ], ], ], 'alignment_separator' => [ 'type' => 'separator', ], 'alignment' => [ 'type' => 'alignment', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_ALIGNMENT'), 'std' => 'center', ], ], ], 'slider_options' => [ 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_SLIDER_OPTIONS'), 'fields' => [ 'autoplay' => [ 'type' => 'checkbox', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_AUTOPLAY'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_AUTOPLAY_DESC'), 'values' => [ 1 => Text::_('JYES'), 0 => Text::_('JNO'), ], 'std' => 1, ], 'interval' => [ 'type' => 'slider', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_INTERVAL'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_INTERVAL_DESC'), 'std' => 5, 'depends' => [['autoplay', '=', 1]] ], 'speed' => [ 'type' => 'slider', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_SPEED'), 'desc' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_SPEED_DESC'), 'std' => 600, ], 'controllers' => [ 'type' => 'checkbox', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_SHOW_CONTROLLERS'), 'values' => [ 1 => Text::_('JYES'), 0 => Text::_('JNO'), ], 'std' => 1, ], 'arrows' => [ 'type' => 'checkbox', 'title' => Text::_('COM_SPPAGEBUILDER_ADDON_CAROUSEL_SHOW_ARROWS'), 'values' => [ 1 => Text::_('JYES'), 0 => Text::_('JNO'), ], 'std' => 1, ], ], ], 'options' => [ 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_OPTIONS'), 'fields' => [ 'options_tab' => [ 'type' => 'buttons', 'std' => 'normal', 'values' => [ ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TYPOGRAPHY'), 'value' => 'typography'], ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_COLOR'), 'value' => 'color'], ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON'), 'value' => 'button'], ], 'std' => 'typography', 'tabs' => true, ], // typography 'item_title_typography' => [ 'type' => 'typography', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TITLE'), 'depends' => [['options_tab', '=', 'typography']], ], 'item_content_typography' => [ 'type' => 'typography', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CONTENT'), 'depends' => [['options_tab', '=', 'typography']], ], // color 'item_title_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TITLE'), 'depends' => [['options_tab', '=', 'color']], ], 'item_content_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CONTENT'), 'depends' => [['options_tab', '=', 'color']], ], // button 'button_typography' => [ 'type' => 'typography', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_TYPOGRAPHY'), 'depends' => [['options_tab', '=', 'button']], ], 'button_type' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_STYLE'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_STYLE_DESC'), 'values' => [ 'default' => Text::_('COM_SPPAGEBUILDER_GLOBAL_DEFAULT'), 'primary' => Text::_('COM_SPPAGEBUILDER_GLOBAL_PRIMARY'), 'secondary' => Text::_('COM_SPPAGEBUILDER_GLOBAL_SECONDARY'), 'success' => Text::_('COM_SPPAGEBUILDER_GLOBAL_SUCCESS'), 'info' => Text::_('COM_SPPAGEBUILDER_GLOBAL_INFO'), 'warning' => Text::_('COM_SPPAGEBUILDER_GLOBAL_WARNING'), 'danger' => Text::_('COM_SPPAGEBUILDER_GLOBAL_DANGER'), 'dark' => Text::_('COM_SPPAGEBUILDER_GLOBAL_DARK'), 'link' => Text::_('COM_SPPAGEBUILDER_GLOBAL_LINK'), 'custom' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CUSTOM'), ], 'std' => 'custom', 'depends' => [['options_tab', '=', 'button']], ], 'link_button_padding_bottom' => [ 'type' => 'slider', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_PADDING_BOTTOM'), 'max' => 100, 'depends' => [ ['button_type', '=', 'link'], ['options_tab', '=', 'button'] ], ], 'button_appearance' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_APPEARANCE'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_APPEARANCE_DESC'), 'values' => [ '' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_APPEARANCE_FLAT'), 'gradient' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_APPEARANCE_GRADIENT'), 'outline' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_APPEARANCE_OUTLINE'), ], 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '!=', 'link'], ], ], 'button_shape' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SHAPE'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SHAPE_DESC'), 'values' => [ 'rounded' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SHAPE_ROUNDED'), 'square' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SHAPE_SQUARE'), 'round' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SHAPE_ROUND'), ], 'std' => 'rounded', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '!=', 'link'], ], ], 'button_size' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE'), 'desc' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_DESC'), 'values' => [ '' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_DEFAULT'), 'lg' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_LARGE'), 'xlg' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_XLARGE'), 'sm' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_SMALL'), 'xs' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_SIZE_EXTRA_SAMLL'), 'custom' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CUSTOM'), ], 'depends' => [['options_tab', '=', 'button']], ], 'button_padding' => [ 'type' => 'padding', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_PADDING'), 'responsive' => true, 'std' => ['xl' => '8px 22px 10px 22px', 'lg' => '', 'md' => '', 'sm' => '', 'xs' => ''], 'depends' => [ ['button_size', '=', 'custom'], ['options_tab', '=', 'button'] ], ], 'button_block' => [ 'type' => 'select', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BUTTON_BLOCK'), 'values' => [ '' => Text::_('JNO'), 'sppb-btn-block' => Text::_('JYES'), ], 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '!=', 'link'], ], ], 'button_colors_tab' => [ 'type' => 'buttons', 'std' => 'normal', 'values' => [ ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_NORMAL'), 'value' => 'normal'], ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_HOVER'), 'value' => 'hover'], ], 'std' => 'typography', 'tabs' => true, 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ], ], 'button_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_COLOR'), 'std' => '#FFFFFF', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_colors_tab', '!=', 'hover'], ], ], 'button_color_hover' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_COLOR'), 'std' => '#FFFFFF', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_colors_tab', '=', 'hover'], ], ], 'button_background_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BACKGROUND'), 'std' => '#3366FF', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_appearance', '!=', 'gradient'], ['button_colors_tab', '!=', 'hover'], ], ], 'button_background_color_hover' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BACKGROUND'), 'std' => '#0037DD', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_appearance', '!=', 'gradient'], ['button_colors_tab', '=', 'hover'], ], ], 'button_background_gradient' => [ 'type' => 'gradient', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BACKGROUND'), 'std' => [ "color" => "#3366FF", "color2" => "#0037DD", "deg" => "45", "type" => "linear" ], 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_appearance', '=', 'gradient'], ['button_colors_tab', '!=', 'hover'], ], ], 'button_background_gradient_hover' => [ 'type' => 'gradient', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BACKGROUND'), 'std' => [ "color" => "#0037DD", "color2" => "#3366FF", "deg" => "45", "type" => "linear" ], 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'custom'], ['button_appearance', '=', 'gradient'], ['button_colors_tab', '=', 'hover'], ], ], // Link style button 'link_button_colors_tab' => [ 'type' => 'buttons', 'std' => 'normal', 'values' => [ ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_NORMAL'), 'value' => 'normal'], ['label' => Text::_('COM_SPPAGEBUILDER_GLOBAL_HOVER'), 'value' => 'hover'], ], 'std' => 'typography', 'tabs' => true, 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ], ], 'link_button_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_COLOR'), 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ['link_button_colors_tab', '!=', 'hover'], ], ], 'link_button_border_width' => [ 'type' => 'slider', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BORDER_WIDTH'), 'max' => 30, 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ['link_button_colors_tab', '!=', 'hover'], ], ], 'link_button_border_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BORDER_COLOR'), 'std' => '', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ['link_button_colors_tab', '!=', 'hover'], ], ], //Link Hover 'link_button_hover_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_COLOR'), 'std' => '', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ['link_button_colors_tab', '=', 'hover'], ], ], 'link_button_border_hover_color' => [ 'type' => 'color', 'title' => Text::_('COM_SPPAGEBUILDER_GLOBAL_BORDER_COLOR'), 'std' => '', 'depends' => [ ['options_tab', '=', 'button'], ['button_type', '=', 'link'], ['link_button_colors_tab', '=', 'hover'], ], ], ], ], ], ]); PK T>�[�B\�F �F site.phpnu �[��� <?php /** * @package SP Page Builder * @author JoomShaper http://www.joomshaper.com * @copyright Copyright (c) 2010 - 2023 JoomShaper * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later */ //no direct access defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\FileLayout; /** * Carousel addon class * * @since 1.0.0 */ class SppagebuilderAddonCarousel extends SppagebuilderAddons { /** * The addon frontend render method. * The returned HTML string will render to the frontend page. * * @return string The HTML string. * @since 1.0.0 */ public function render() { $settings = $this->addon->settings; $class = (isset($settings->class) && $settings->class) ? ' ' . $settings->class : ''; //Addons option $autoplay = (isset($settings->autoplay) && $settings->autoplay) ? 1 : 0; $controllers = (isset($settings->controllers) && $settings->controllers) ? $settings->controllers : 0; $arrows = (isset($settings->arrows) && $settings->arrows) ? $settings->arrows : 0; $interval = (isset($settings->interval) && $settings->interval) ? ((int) $settings->interval * 1000) : 5000; $carousel_autoplay = ($autoplay) ? ' data-sppb-ride="sppb-carousel"' : ''; if ($autoplay == 0) { $interval = 'false'; } $output = '<div id="sppb-carousel-' . $this->addon->id . '" data-interval="' . $interval . '" class="sppb-carousel sppb-slide' . $class . '"' . $carousel_autoplay . '>'; if ($controllers) { $output .= '<ol class="sppb-carousel-indicators">'; foreach ($settings->sp_carousel_item as $key1 => $value) { $output .= '<li data-sppb-target="#sppb-carousel-' . $this->addon->id . '" ' . (($key1 == 0) ? ' class="active"' : '') . ' data-sppb-slide-to="' . $key1 . '"></li>' . "\n"; } $output .= '</ol>'; } $output .= '<div class="sppb-carousel-inner">'; if (isset($settings->sp_carousel_item) && count((array) $settings->sp_carousel_item)) { foreach ($settings->sp_carousel_item as $key => $value) { list($button_url, $button_target) = AddonHelper::parseLink($value, 'button_url', ['url' => 'button_url', 'new_tab' => 'button_target']); $bg_image = (isset($value->bg) && $value->bg) ? $value->bg : ''; $bg_image_src = isset($bg_image->src) ? $bg_image->src : $bg_image; $output .= '<div class="sppb-item sppb-item-' . $this->addon->id . $key . ' ' . ($bg_image_src ? ' sppb-item-has-bg' : '') . (($key == 0) ? ' active' : '') . '">'; $alt_text = isset($value->title) ? $value->title : ''; $output .= $bg_image_src ? '<img src="' . $bg_image_src . '" alt="' . $alt_text . '">' : ''; $output .= '<div class="sppb-carousel-item-inner">'; $output .= '<div class="sppb-carousel-caption">'; $output .= '<div class="sppb-carousel-text">'; if ((isset($value->title) && $value->title) || (isset($value->content) && $value->content)) { $output .= (isset($value->title) && $value->title) ? '<h2>' . $value->title . '</h2>' : ''; $output .= (isset($value->content) && $value->content) ? '<div class="sppb-carousel-content">' . $value->content . '</div>' : ''; if (isset($value->button_text) && $value->button_text) { $button_class = (isset($settings->button_type) && $settings->button_type) ? ' sppb-btn-' . $settings->button_type : ' sppb-btn-default'; $button_class .= (isset($settings->button_size) && $settings->button_size) ? ' sppb-btn-' . $settings->button_size : ''; $button_class .= (isset($settings->button_shape) && $settings->button_shape) ? ' sppb-btn-' . $settings->button_shape : ' sppb-btn-rounded'; $button_class .= (isset($settings->button_appearance) && $settings->button_appearance) ? ' sppb-btn-' . $settings->button_appearance : ''; $button_class .= (isset($settings->button_block) && $settings->button_block) ? ' ' . $settings->button_block : ''; $button_icon = (isset($value->button_icon) && $value->button_icon) ? $value->button_icon : ''; $button_icon_position = (isset($value->button_icon_position) && $value->button_icon_position) ? $value->button_icon_position : 'left'; $icon_arr = array_filter(explode(' ', $button_icon)); if (count($icon_arr) === 1) { $button_icon = 'fa ' . $button_icon; } if ($button_icon_position == 'left') { $value->button_text = ($button_icon) ? '<i aria-hidden="true" class="' . $button_icon . '" aria-hidden="true"></i> ' . $value->button_text : $value->button_text; } else { $value->button_text = ($button_icon) ? $value->button_text . ' <i aria-hidden="true" class="' . $button_icon . '" aria-hidden="true"></i>' : $value->button_text; } $href = !empty($button_url) ? 'href="' . $button_url . '" ' : ''; $output .= '<a ' . $href . ' ' . $button_target . ' id="btn-' . ($this->addon->id . $key) . '" class="sppb-btn' . $button_class . '">' . $value->button_text . '</a>'; } } $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; } } $output .= '</div>'; if ($arrows) { $output .= '<a href="#sppb-carousel-' . $this->addon->id . '" class="sppb-carousel-arrow left sppb-carousel-control" data-slide="prev" aria-label="' . Text::_('COM_SPPAGEBUILDER_ARIA_PREVIOUS') . '"><i class="fa fa-chevron-left" aria-hidden="true"></i></a>'; $output .= '<a href="#sppb-carousel-' . $this->addon->id . '" class="sppb-carousel-arrow right sppb-carousel-control" data-slide="next" aria-label="' . Text::_('COM_SPPAGEBUILDER_ARIA_NEXT') . '"><i class="fa fa-chevron-right" aria-hidden="true"></i></a>'; } $output .= '</div>'; return $output; } /** * Generate the CSS string for the frontend page. * * @return string The CSS string for the page. * @since 1.0.0 */ public function css() { $addon_id = '#sppb-addon-' . $this->addon->id; $layout_path = JPATH_ROOT . '/components/com_sppagebuilder/layouts'; $cssHelper = new CSSHelper($addon_id); $settings = $this->addon->settings; $settings->alignment = CSSHelper::parseAlignment($settings, 'alignment'); $css = ''; // Buttons style foreach ($this->addon->settings->sp_carousel_item as $key => $value) { $options = new stdClass; $options->button_type = (isset($settings->button_type) && $settings->button_type) ? $settings->button_type : ''; $options->button_appearance = (isset($settings->button_appearance) && $settings->button_appearance) ? $settings->button_appearance : ''; $options->button_color = (isset($settings->button_color) && $settings->button_color) ? $settings->button_color : ''; $options->button_color_hover = (isset($settings->button_color_hover) && $settings->button_color_hover) ? $settings->button_color_hover : ''; $options->button_background_color = (isset($settings->button_background_color) && $settings->button_background_color) ? $settings->button_background_color : ''; $options->button_background_color_hover = (isset($settings->button_background_color_hover) && $settings->button_background_color_hover) ? $settings->button_background_color_hover : ''; $options->button_padding = null; if (isset($settings->button_padding_original)) { $options->button_padding = $settings->button_padding_original; } elseif (isset($settings->button_padding)) { $options->button_padding = $settings->button_padding; } $options->button_size = !empty($settings->button_size) ? $settings->button_size : null; $options->button_typography = !empty($settings->button_typography) ? $settings->button_typography : null; $css_path = new FileLayout('addon.css.button', $layout_path); $css .= $css_path->render(array('addon_id' => $addon_id, 'options' => $options, 'id' => 'btn-' . ($this->addon->id . $key))); // Title Margin $itemTitleMarginStyle = $cssHelper->generateStyle('.sppb-carousel-text h2', $value, ['title_margin' => 'margin', 'title_padding' => 'padding'], ['title_margin' => false, 'title_padding' => false], ['title_margin' => 'spacing', 'title_padding' => 'spacing']); $css .= $itemTitleMarginStyle; // Content Margin $itemContentMarginStyle = $cssHelper->generateStyle('.sppb-carousel-text .sppb-carousel-content', $value, ['content_margin' => 'margin', 'content_padding' => 'padding'], ['content_margin' => false, 'content_padding' => 'padding'], ['content_margin' => 'spacing', 'content_padding' => 'spacing']); $css .= $itemContentMarginStyle; } $speed = $cssHelper->generateStyle('.sppb-carousel-inner > .sppb-item', $settings, ['speed' => '-webkit-transition-duration', 'speed' => 'transition-duration'], 'ms'); $css .= $speed; // Title Color $itemAlignment = $cssHelper->generateStyle('.sppb-carousel-text', $settings, ['alignment' => 'text-align'], ['alignment' => false]); $css .= $itemAlignment; // Title $titleFontStyle = $cssHelper->typography('.sppb-carousel-text h2', $settings, 'item_title_typography'); $css .= $titleFontStyle; // Title Color $itemTitleColorStyle = $cssHelper->generateStyle('.sppb-carousel-text h2', $settings, ['item_title_color' => 'color'], ['item_title_color' => false]); $css .= $itemTitleColorStyle; // Content $contentTypography = $cssHelper->typography('.sppb-carousel-text .sppb-carousel-content', $settings, 'item_content_typography'); $css .= $contentTypography; // Content Color $itemContentColorStyle = $cssHelper->generateStyle('.sppb-carousel-text .sppb-carousel-content', $settings, ['item_content_color' => 'color'], ['item_content_color' => false]); $css .= $itemContentColorStyle; return $css; } /** * Generate the lodash template string for the frontend editor. * * @return string The lodash template string. * @since 1.0.0 */ public static function getTemplate() { $lodash = new Lodash('#sppb-addon-{{ data.id }}'); $output = ' <# let interval = data.interval ? parseInt(data.interval) * 1000 : 5000; if (data.autoplay==0) { interval = "false"; } let autoplay = data.autoplay ? \'data-sppb-ride="sppb-carousel"\' : ""; #> <style type="text/css">'; // Alignment $output .= $lodash->alignment('text-align', '.sppb-carousel-caption .sppb-carousel-text', 'data.alignment'); $output .= ' #sppb-addon-{{ data.id }} .sppb-carousel-inner > .sppb-item{ -webkit-transition-duration: {{ data.speed }}ms; transition-duration: {{ data.speed }}ms; } <# _.each(data.sp_carousel_item, function (carousel_item, key){ #>'; // Custom $output .= '<# if (data.button_type == "custom") { #>'; $output .= '<# if (data.button_appearance == "outline") { #>'; $output .= $lodash->border('border-color', '.sppb-btn-custom', 'data.button_background_color'); $output .= $lodash->border('border-color', '.sppb-btn-custom:hover', 'data.button_background_color_hover'); $output .= '<# } else if (data.button_appearance == "gradient") { #>'; $output .= '#sppb-addon-{{ data.id }} .sppb-btn-custom { border: none; }'; $output .= $lodash->color('background-color', '.sppb-btn-custom', 'data.button_background_gradient'); $output .= $lodash->color('background-color', '.sppb-btn-custom:hover', 'data.button_background_gradient_hover'); $output .= '<# } else { #>'; $output .= $lodash->color('background-color', '.sppb-btn-custom', 'data.button_background_color'); $output .= '<# } #>'; $output .= $lodash->color('color', '.sppb-btn-custom', 'data.button_color'); $output .= $lodash->color('color', '.sppb-btn-custom:hover', 'data.button_color_hover'); $output .= $lodash->color('background-color', '.sppb-btn-custom:hover', 'data.button_background_color_hover'); $output .= '<# } #>'; // Typography $output .= $lodash->typography('.sppb-btn-{{ data.button_type }}', 'data.button_typography'); $output .= $lodash->typography('.sppb-carousel-caption h2', 'data.item_title_typography'); $output .= $lodash->typography('.sppb-carousel-caption .sppb-carousel-content', 'data.item_content_typography'); // Color $output .= $lodash->color('color', '.sppb-carousel-caption h2', 'data.item_title_color '); $output .= $lodash->color('color', '.sppb-carousel-caption .sppb-carousel-content', 'data.item_content_color'); // Spacing $output .= $lodash->spacing('margin', '.sppb-carousel-caption h2', 'carousel_item.title_margin'); $output .= $lodash->spacing('margin', '.sppb-carousel-caption .sppb-carousel-content', 'carousel_item.content_margin'); $output .= $lodash->spacing('padding', '.sppb-carousel-caption h2', 'carousel_item.title_padding'); $output .= $lodash->spacing('padding', '.sppb-carousel-caption .sppb-carousel-content', 'carousel_item.content_padding'); $output .= '<# if (data.button_size == "custom") { #>'; $output .= $lodash->spacing('padding', '.sppb-btn-{{ data.button_type }}', 'data.button_padding'); $output .= '<# } #>'; $output .= ' <# }); #> </style> <div class="sppb-carousel sppb-slide {{ data.class }}" id="sppb-carousel-{{ data.id }}" data-interval="{{ interval }}" {{{ autoplay }}}> <# if(data.controllers){ #> <ol class="sppb-carousel-indicators"> <# _.each(data.sp_carousel_item, function (carousel_item, key){ #> <# var active = (key == 0) ? "active" : ""; #> <li data-sppb-target="#sppb-carousel-{{ data.id }}" class="{{ active }}" data-sppb-slide-to="{{ key }}"></li> <# }); #> </ol> <# } #> <div class="sppb-carousel-inner"> <# _.each(data.sp_carousel_item, function (carousel_item, key){ var carouselBg = {} if (typeof carousel_item.bg !== "undefined" && typeof carousel_item.bg.src !== "undefined") { carouselBg = carousel_item.bg } else { carouselBg = {src: carousel_item.bg} } var classNames = (key == 0) ? "active" : ""; classNames += carouselBg.src ? " sppb-item-has-bg" : ""; classNames += " sppb-item-"+data.id+""+key; #> <div class="sppb-item {{ classNames }}"> <# if(carouselBg.src && carouselBg.src.indexOf("http://") == -1 && carouselBg.src.indexOf("https://") == -1){ #> <img src=\'{{ pagebuilder_base + carouselBg.src }}\' alt="{{ carousel_item.title }}"> <# } else if(carouselBg.src){ #> <img src=\'{{ carouselBg.src }}\' alt="{{ carousel_item.title }}"> <# } #> <div class="sppb-carousel-item-inner"> <div class="sppb-carousel-caption"> <div class="sppb-carousel-text"> <# if(carousel_item.title || carousel_item.content) { #> <# if(carousel_item.title) { #> <h2 class="sp-editable-content" id="addon-title-{{data.id}}-{{key}}" data-id={{data.id}} data-fieldName="sp_carousel_item-{{key}}-title">{{ carousel_item.title }}</h2> <# } #> <div class="sppb-carousel-content sp-editable-content" id="addon-content-{{data.id}}-{{key}}" data-id={{data.id}} data-fieldName="sp_carousel_item-{{key}}-content">{{{ carousel_item.content }}}</div> <# if(carousel_item.button_text) { #> <# var btnClass = ""; btnClass += data.button_type ? " sppb-btn-"+data.button_type : " sppb-btn-default" ; btnClass += data.button_size ? " sppb-btn-"+data.button_size : "" ; btnClass += data.button_shape ? " sppb-btn-"+data.button_shape : " sppb-btn-rounded" ; btnClass += data.button_appearance ? " sppb-btn-"+data.button_appearance : "" ; btnClass += data.button_block ? " "+data.button_block : "" ; var button_text = carousel_item.button_text; let icon_arr = (typeof carousel_item.button_icon !== "undefined" && carousel_item.button_icon) ? carousel_item.button_icon.split(" ") : ""; let icon_name = icon_arr.length === 1 ? "fa "+carousel_item.button_icon : carousel_item.button_icon; if(carousel_item.button_icon_position == "left"){ button_text = (carousel_item.button_icon) ? \'<i class="\'+icon_name+\'"></i> \'+carousel_item.button_text : carousel_item.button_text ; }else{ button_text = (carousel_item.button_icon) ? carousel_item.button_text+\' <i class="\'+icon_name+\'"></i>\' : carousel_item.button_text ; } #> <# const {button_url} = carousel_item; const isUrlObject = _.isObject(button_url) && (!!button_url.url || !!button_url.menu || !!button_url.page); const isUrlString = _.isString(button_url) && button_url !== ""; let target; let href; let rel; let relData=""; if(isUrlObject || isUrlString){ const urlObj = button_url?.url ? button_url : window.getSiteUrl(button_url, data.button_target); const {url, new_tab, nofollow, noopener, noreferrer, type} = urlObj; const buttonUrl = (type === "url" && url) || (type === "menu" && urlObj.menu) || ( (type === "page" && !!urlObj.page) && "index.php/component/sppagebuilder/index.php?option=com_sppagebuilder&view=page&id=" + urlObj.page) || ""; target = new_tab ? `target=_blank` : ""; relData += nofollow ? "nofollow" : ""; relData += noopener ? " noopener" : ""; relData += noreferrer ? " noreferrer" : ""; rel = `rel="${relData}"`; href = buttonUrl ? `href=${buttonUrl}`: ""; } #> <a {{href}} {{target}} rel="{{rel}}" id="btn-{{ data.id + "" + key}}" class="sppb-btn{{ btnClass }}">{{{ button_text }}}</a> <# } #> <# } #> </div> </div> </div> </div> <# }); #> </div> <# if(data.arrows) { #> <a href="#sppb-carousel-{{ data.id }}" class="sppb-carousel-arrow left sppb-carousel-control" data-slide="prev"><i class="fa fa-chevron-left"></i></a> <a href="#sppb-carousel-{{ data.id }}" class="sppb-carousel-arrow right sppb-carousel-control" data-slide="next"><i class="fa fa-chevron-right"></i></a> <# } #> </div> '; return $output; } } PK T>�[��� A A admin.phpnu �[��� PK T>�[�B\�F �F YA site.phpnu �[��� PK � T�
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка