diff --git a/usr/module/widget/config/config.php b/usr/module/widget/config/config.php index 28c6ba79e7..cf775a4ad5 100644 --- a/usr/module/widget/config/config.php +++ b/usr/module/widget/config/config.php @@ -85,4 +85,12 @@ 'filter' => 'int', 'value' => 0, ), + + 'circle_image' => array( + 'title' => _t('Circle image'), + 'description' => _t('Make images circle'), + 'edit' => 'checkbox', + 'filter' => 'int', + 'value' => 0, + ), ); diff --git a/usr/module/widget/config/module.php b/usr/module/widget/config/module.php index af5f97266a..ca0260b47f 100644 --- a/usr/module/widget/config/module.php +++ b/usr/module/widget/config/module.php @@ -15,7 +15,7 @@ // Description, for admin, optional 'description' => _a('Management of custom blocks/widgets.'), // Version number, required - 'version' => '2.1.2', + 'version' => '2.1.3', // Distribution license, required 'license' => 'BSD 3-Clause', // Logo image, for admin, optional diff --git a/usr/module/widget/src/Api/Block.php b/usr/module/widget/src/Api/Block.php index 82ec3b0247..41be153b0b 100644 --- a/usr/module/widget/src/Api/Block.php +++ b/usr/module/widget/src/Api/Block.php @@ -126,6 +126,12 @@ public function getConfig($type = null) 'filter' => 'int', 'value' => $config['target_new'], ); + $circleImage = array( + 'title' => _a('Circle image'), + 'edit' => 'checkbox', + 'filter' => 'int', + 'value' => $config['circle_image'], + ); $configs = array( 'list' => array( 'max_rows' => $maxRows, @@ -136,6 +142,7 @@ public function getConfig($type = null) 'height' => $imgHeight($config['image_height_media']), 'max_rows' => $maxRows, 'target_new' => $targetNew, + 'circle_image' => $circleImage, ), 'spotlight' => array( 'width' => $imgWidth($config['image_width_spotlight']), diff --git a/usr/module/widget/template/block/carousel/bootstrap.phtml b/usr/module/widget/template/block/carousel/bootstrap.phtml index a2f2aec955..1a3a2461d9 100644 --- a/usr/module/widget/template/block/carousel/bootstrap.phtml +++ b/usr/module/widget/template/block/carousel/bootstrap.phtml @@ -2,11 +2,13 @@ $options = (array) $block['options']; $items = $block['items'] ?: array(); $count = count($items); -$target = empty($options['target_new']) ? '_self' : '_blank'; +$imgStyle = ''; +$locale = Pi::service('i18n')->getLocale(); +$target = $options['target_new'] ? '_self' : '_blank'; $ellipsis = empty($options['max_rows']) ? 'pi-ellipsis' : 'pi-ellipsis pi-ellipsis-' . intval($options['max_rows']); -$imgStyle = ''; + if (!empty($options['width'])) { $imgStyle .= 'width: ' . $options['width'] . 'px;'; } @@ -138,11 +140,11 @@ EOT; 1) { ?> - - + + - - + + diff --git a/usr/module/widget/template/block/carousel/owl-carousel.phtml b/usr/module/widget/template/block/carousel/owl-carousel.phtml index 0170511dd0..680e31265c 100644 --- a/usr/module/widget/template/block/carousel/owl-carousel.phtml +++ b/usr/module/widget/template/block/carousel/owl-carousel.phtml @@ -2,9 +2,11 @@ $options = (array) $block['options']; $items = $block['items']; $class = isset($block['class']) ? $block['class'] : ''; -$target = empty($options['target_new']) ? '_self' : '_blank'; +$target = $options['target_new'] ? '_self' : '_blank'; $number = empty($options['max_rows']) ? 3 : $options['max_rows']; $carouselId = uniqid('carousel-'); +$locale = Pi::service('i18n')->getLocale(); + // Set style $imgStyle = ''; @@ -19,16 +21,14 @@ if (!empty($imgStyle)) { } // Get local -$locale = Pi::service('i18n')->getLocale(); $rtl = (in_array($locale, array('fa', 'ar'))) ? 'true' : 'false'; -//$loop = (in_array($locale, array('fa', 'ar'))) ? 'false' : 'true'; $loop = 'true'; // Set arrow -$iconOwlLeft = ''; -$iconOwlRight = ''; +$iconOwlLeft = in_array($locale, array('fa', 'ar')) ? '' : ''; +$iconOwlRight = in_array($locale, array('fa', 'ar')) ? '' : ''; -// Set srcipt 2 +// Set script $script = <<<'EOT' $(document).ready(function($) { $('#%s').owlCarousel({ diff --git a/usr/module/widget/template/block/carousel/parallax.phtml b/usr/module/widget/template/block/carousel/parallax.phtml index 4196287c33..583f497078 100644 --- a/usr/module/widget/template/block/carousel/parallax.phtml +++ b/usr/module/widget/template/block/carousel/parallax.phtml @@ -24,7 +24,7 @@ $this->HeadLink(array( // Options: interval, pause, height $options = (array) $block['options']; -$target = empty($options['target_new']) ? '_self' : '_blank'; +$target = $options['target_new'] ? '_self' : '_blank'; $ellipsis = empty($options['max_rows']) ? 'pi-ellipsis' : 'pi-ellipsis pi-ellipsis-' . intval($options['max_rows']); diff --git a/usr/module/widget/template/block/list/social-network.phtml b/usr/module/widget/template/block/list/social-network.phtml index 953ee674c0..797c49ab43 100644 --- a/usr/module/widget/template/block/list/social-network.phtml +++ b/usr/module/widget/template/block/list/social-network.phtml @@ -1,7 +1,7 @@