Skip to content

Commit 5b53b9d

Browse files
Merge branch 'dev'
2 parents 90e31d4 + 90b6181 commit 5b53b9d

File tree

35 files changed

+492
-419
lines changed

35 files changed

+492
-419
lines changed

astroid/astroid-framework/framework/article.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ public static function getVimeoThumbnailByID($vid) {
391391
public static function getVideoId($url, $type) {
392392
$parts = parse_url($url);
393393
if ($type == "youtube") {
394-
return (isset($parts['path']) ? $parts['path'] : '');
394+
//return (isset($parts['path']) ? $parts['path'] : '');
395+
parse_str($parts['query'], $query);
396+
return (isset($query['v']) ? $query['v'] : '');
395397
} else {
396398
return (isset($parts['path']) ? str_replace('/', '', $parts['path']) : '');
397399
}

astroid/astroid-framework/framework/constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class AstroidFrameworkConstants {
1212

13-
public static $astroid_version = '2.1.0';
13+
public static $astroid_version = '2.1.0-dev';
1414
public static $fontawesome_version = '5.7.2';
1515
public static $animatecss_version = '3.7.0';
1616
public static $forum_link = 'https://www.joomdev.com/forum/astroid-framework';

astroid/astroid-framework/framework/element.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public function __construct($type = '', $data = [], $template = null) {
5656
case 'column':
5757
$this->default_xml_file = $library_elements_directory . 'column-default.xml';
5858
break;
59+
case 'row':
60+
$this->default_xml_file = $library_elements_directory . 'row-default.xml';
61+
break;
5962
default:
6063
$this->default_xml_file = $library_elements_directory . 'default.xml';
6164
break;
@@ -442,6 +445,11 @@ public function Style() {
442445
}
443446
if ($background_setting == "image") {
444447
$background_image = $params->get('background_image', '');
448+
449+
$img_background_color = $params->get('img_background_color', '');
450+
$img_background_color = empty($img_background_color) ? 'inherit' : $img_background_color;
451+
$Style[] = 'background-color:' . $img_background_color;
452+
445453
if (!empty($background_image)) {
446454
$Style[] = 'background-image: url(' . JURI::root() . 'images/' . $background_image . ')';
447455
$background_repeat = $params->get('background_repeat', '');

astroid/astroid-framework/framework/elements/banner/banner.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
$jinput = $app->input;
66
$menuId = $jinput->get('Itemid', 0, 'INT');
77

8-
98
$menu = $app->getMenu();
109
$item = $menu->getItem($menuId);
1110
if (empty($item)) {
1211
return;
1312
}
13+
14+
if ((isset($item->query['option']) && $item->query['option'] != $jinput->get('option', '')) || (isset($item->query['view']) && $item->query['view'] != $jinput->get('view', '')) || (isset($item->query['layout']) && $item->query['layout'] != $jinput->get('layout', ''))) {
15+
return;
16+
}
17+
1418
$params = new JRegistry();
1519
$params->loadString($item->params);
1620
$astroid_banner_enabled = $params->get('astroid_banner_enabled');
@@ -26,10 +30,10 @@
2630
$astroid_banner_bgimage = $params->get('astroid_banner_bgimage', '');
2731
$astroid_banner_class = $params->get('astroid_banner_class', '');
2832
$astroid_banner_wrapper = $params->get('astroid_banner_wrapper', '');
29-
$astroid_banner_textcolor = $params->get('astroid_banner_textcolor', '');
30-
33+
$astroid_banner_textcolor = $params->get('astroid_banner_textcolor', '');
34+
35+
3136

32-
3337

3438
$style = [];
3539
if (!empty($astroid_banner_bgcolor)) {
@@ -49,9 +53,9 @@
4953
echo '<div class="' . $astroid_banner_wrapper . '">';
5054
}
5155
if ($astroid_banner_title_enabled) {
52-
echo '<' . $astroid_banner_title_tag . ' class="astroid-banner-title"'.$styletext . '>' . $astroid_banner_title . '</' . $astroid_banner_title_tag . '>';
56+
echo '<' . $astroid_banner_title_tag . ' class="astroid-banner-title"' . $styletext . '>' . $astroid_banner_title . '</' . $astroid_banner_title_tag . '>';
5357
if (!empty($astroid_banner_subtitle)) {
54-
echo '<span class="astroid-banner-subtitle"'. $styletext .'>' . $astroid_banner_subtitle . '</span>';
58+
echo '<span class="astroid-banner-subtitle"' . $styletext . '>' . $astroid_banner_subtitle . '</span>';
5559
}
5660
}
5761
if (!empty($astroid_banner_wrapper)) {

astroid/astroid-framework/framework/elements/column-default.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<fieldset name="design-settings" label="ASTROID_ELEMENT_HEAD_DESIGN_SEETINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields">
1111
<field name="animation" type="astroidanimations" label="ASTROID_ANIMATION"></field>
1212
<field ngShow="animation AND animation!=''" name="animation_delay" class="form-control" type="astroidtext" hint="500" default="500" label="ASTROID_ANIMATION_DELAY" description="ASTROID_ANIMATION_DELAY_DESC"></field>
13-
<field description="TPL_ASTROID_ADVANCED_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_LAYOUT_SELECT">
13+
<field description="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_LABEL">
1414
<option value="0">JNONE</option>
1515
<option value="color">TPL_ASTROID_COLOR</option>
1616
<option value="image">TPL_ASTROID_IMAGE</option>
@@ -19,6 +19,8 @@
1919
</field>
2020

2121
<field ngShow="background_setting =='color'" description="ASTROID_SELECT_BACKGROUND_COLOR_DESC" name="background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL" />
22+
23+
<field ngShow="background_setting =='image'" name="img_background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL"/>
2224

2325
<field ngShow="background_setting =='image'" name="background_image" type="astroidmedia" label="TPL_ASTROID_BACKGROUND_IMAGE_LABEL"/>
2426

@@ -53,7 +55,7 @@
5355
<field ngShow="background_setting =='video'" name="background_video" type="astroidmedia" media="videos" label="TPL_ASTROID_BACKGROUND_VIDEO_LABEL" description="TPL_ASTROID_BACKGROUND_VIDEO_DESC"/>
5456

5557
<field ngShow="background_setting =='gradient'" description="ASTROID_SELECT_BACKGROUND_COLOR_DESC" name="background_gradient" type="astroidgradient" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL"></field>
56-
<field name="colors_settings" type="astroidheading" title="ASTROID_ELEMENT_HEAD_COLOR_OPTIONS_LABEL" />
58+
5759

5860
<field name="custom_colors" type="astroidtext" astroid-switch="true" default="0" label="ASTROID_ELEMENT_CUSTOM_COLORS_LABEL" />
5961

astroid/astroid-framework/framework/elements/default.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
<fieldset name="design-settings" label="ASTROID_ELEMENT_HEAD_DESIGN_SEETINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields">
1111
<field name="animation" type="astroidanimations" label="ASTROID_ANIMATION" ></field>
1212
<field ngShow="animation AND animation!=''" name="animation_delay" class="form-control" type="astroidtext" hint="500" default="500" label="ASTROID_ANIMATION_DELAY" description="ASTROID_ANIMATION_DELAY_DESC"></field>
13-
<field name="background_settings" type="astroidheading" title="ASTROID_ELEMENT_HEAD_BACKGROUND_OPTIONS_LABEL" />
14-
<field name="background_settings" type="astroidheading" title="ASTROID_ELEMENT_HEAD_BACKGROUND_OPTIONS_LABEL" />
1513

16-
<field description="TPL_ASTROID_ADVANCED_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_LAYOUT_SELECT">
14+
<field description="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_LABEL">
1715
<option value="0">JNONE</option>
1816
<option value="color">TPL_ASTROID_COLOR</option>
1917
<option value="image">TPL_ASTROID_IMAGE</option>
@@ -23,6 +21,8 @@
2321

2422
<field ngShow="background_setting =='color'" description="ASTROID_SELECT_BACKGROUND_COLOR_DESC" name="background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL" />
2523

24+
<field ngShow="background_setting =='image'" name="img_background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL"/>
25+
2626
<field ngShow="background_setting =='image'" name="background_image" type="astroidmedia" label="TPL_ASTROID_BACKGROUND_IMAGE_LABEL"/>
2727

2828
<field ngShow="background_setting =='image'" name="background_repeat" type="astroidlist" label="TPL_ASTROID_BACKGROUND_REPEAT_LABEL" hint="Background Repeat">
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<element>
3+
<form>
4+
<fields>
5+
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields">
6+
<field type="astroidtext" class="form-control" label="ASTROID_CUSTOM_CLASS" name="customclass"></field>
7+
<field type="astroidtext" class="form-control" label="ASTROID_CUSTOM_ID" name="customid"></field>
8+
</fieldset>
9+
</fields>
10+
</form>
11+
</element>

astroid/astroid-framework/framework/elements/section-default.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
<field name="animation" type="astroidanimations" label="ASTROID_ANIMATION" ></field>
2121
<field ngShow="animation AND animation!=''" name="animation_delay" class="form-control" type="astroidtext" hint="500" default="500" label="ASTROID_ANIMATION_DELAY" description="ASTROID_ANIMATION_DELAY_DESC"></field>
2222

23-
<field name="background_settings" type="astroidheading" title="ASTROID_ELEMENT_HEAD_BACKGROUND_OPTIONS_LABEL" />
23+
2424

25-
<field description="TPL_ASTROID_ADVANCED_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_LAYOUT_SELECT">
25+
<field description="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_DESC" name="background_setting" type="astroidradio" default="0" label="TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_LABEL">
2626
<option value="0">JNONE</option>
2727
<option value="color">TPL_ASTROID_COLOR</option>
2828
<option value="image">TPL_ASTROID_IMAGE</option>
@@ -32,6 +32,8 @@
3232

3333
<field ngShow="background_setting =='color'" description="ASTROID_SELECT_BACKGROUND_COLOR_DESC" name="background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL" />
3434

35+
<field ngShow="background_setting =='image'" name="img_background_color" type="astroidcolor" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL"/>
36+
3537
<field ngShow="background_setting =='image'" name="background_image" type="astroidmedia" label="TPL_ASTROID_BACKGROUND_IMAGE_LABEL"/>
3638

3739
<field ngShow="background_setting =='image'" name="background_repeat" type="astroidlist" label="TPL_ASTROID_BACKGROUND_REPEAT_LABEL" hint="Background Repeat">
@@ -65,7 +67,7 @@
6567
<field ngShow="background_setting =='video'" name="background_video" type="astroidmedia" media="videos" label="TPL_ASTROID_BACKGROUND_VIDEO_LABEL" description="TPL_ASTROID_BACKGROUND_VIDEO_DESC"/>
6668

6769
<field ngShow="background_setting =='gradient'" description="ASTROID_SELECT_BACKGROUND_COLOR_DESC" name="background_gradient" type="astroidgradient" label="TPL_ASTROID_BACKGROUND_COLOR_LABEL"></field>
68-
<field name="colors_settings" type="astroidheading" title="ASTROID_ELEMENT_HEAD_COLOR_OPTIONS_LABEL" />
70+
6971

7072
<field name="custom_colors" type="astroidtext" astroid-switch="true" default="0" label="ASTROID_ELEMENT_CUSTOM_COLORS_LABEL" />
7173

astroid/astroid-framework/framework/helper.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -374,26 +374,28 @@ public static function getFAIcons($html = false) {
374374
return $icons;
375375
}
376376

377-
public static function clearCache($template = '') {
377+
public static function clearCache($template = '', $prefix = 'style') {
378378
$template_dir = JPATH_SITE . '/' . 'templates' . '/' . $template . '/' . 'css';
379379
$version = new \JVersion;
380380
$version->refreshMediaVersion();
381381
if (!file_exists($template_dir)) {
382382
throw new \Exception("Template not found.", 404);
383383
}
384-
$styles = preg_grep('~^style-.*\.(css)$~', scandir($template_dir));
385-
foreach ($styles as $style) {
386-
unlink($template_dir . '/' . $style);
387-
}
388-
$custom_styles = preg_grep('~^custom-.*\.(css)$~', scandir($template_dir));
389-
foreach ($custom_styles as $style) {
390-
unlink($template_dir . '/' . $style);
391-
}
392-
$astroid_styles = preg_grep('~^astroid-.*\.(css)$~', scandir($template_dir));
393-
foreach ($astroid_styles as $style) {
394-
unlink($template_dir . '/' . $style);
384+
385+
if (is_array($prefix)) {
386+
foreach ($prefix as $pre) {
387+
$styles = preg_grep('~^' . $pre . '-.*\.(css)$~', scandir($template_dir));
388+
foreach ($styles as $style) {
389+
unlink($template_dir . '/' . $style);
390+
}
391+
}
392+
} else {
393+
$styles = preg_grep('~^' . $prefix . '-.*\.(css)$~', scandir($template_dir));
394+
foreach ($styles as $style) {
395+
unlink($template_dir . '/' . $style);
396+
}
395397
}
396-
return $styles;
398+
return true;
397399
}
398400

399401
public static function getAstroidFieldsets($form) {

astroid/astroid-framework/framework/layouts/fields/astroidlayout.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@
107107
<span data-astroid-tooltip="<?php echo JText::_('TPL_ASTROID_NEW_SECTION'); ?>" class="ezlb-action" ng-click="addSection(sectionIndex)"><i class="fa fa-plus"></i> <span class="hidein-live-preview"><?php echo JText::_('TPL_ASTROID_NEW_SECTION'); ?></span></span>
108108
</span>
109109
<div class="col-12 ezlb-content" ng-sortable="{draggable:'.ezlb-row', animation: 100, handle: '.ezlb-row-handle'}">
110-
<div ng-repeat="row in section.rows track by $index" class="ezlb-row row ezlb-row-{{ sectionIndex}}-{{ rowIndex}}" ng-init="rowIndex = $index">
110+
<div ng-repeat="row in section.rows track by $index" class="ezlb-row row ezlb-row-{{ sectionIndex}}-{{ rowIndex}}" ng-init="rowIndex = $index; row.type = 'row'">
111111
<span class="ezlb-toolbar">
112112
<span data-astroid-tooltip="<?php echo JText::_('TPL_ASTROID_EDIT_GRID_ROW'); ?>" class="ezlb-action" ng-click="editRow(rowIndex, sectionIndex)"><i class="fa fa-columns"></i></span>
113113
<span data-astroid-tooltip="<?php echo JText::_('TPL_ASTROID_DUPLICATE_ROW'); ?>" ng-click="duplicateRow(rowIndex, sectionIndex)" class="ezlb-action"><i class="fa fa-copy"></i></span>
114+
<span data-astroid-tooltip="<?php echo JText::_('TPL_ASTROID_EDIT_ROW'); ?>" ng-click="editElement(row)" class="ezlb-action"><i class="fa fa-pencil-alt"></i></span>
114115
<span data-astroid-tooltip="<?php echo JText::_('TPL_ASTROID_REMOVE_ROW'); ?>" ng-show="section.rows.length > 1" ng-click="removeRow(rowIndex, sectionIndex)" class="ezlb-action text-danger"><i class="fa fa-trash"></i></span>
115116
</span>
116117
<span class="ezlb-toolbar toolbar-left">
@@ -177,6 +178,11 @@
177178
<?php echo $sectionElement->renderForm(); ?>
178179
</script>
179180

181+
<?php $rowElement = new AstroidElement('row'); ?>
182+
<script type="text/ng-template" id="element-form-template-row">
183+
<?php echo $rowElement->renderForm(); ?>
184+
</script>
185+
180186
<?php $columnElement = new AstroidElement('column'); ?>
181187
<script type="text/ng-template" id="element-form-template-column">
182188
<?php echo $columnElement->renderForm(); ?>

0 commit comments

Comments
 (0)