Skip to content

Commit 16f6309

Browse files
Merge pull request #7 from hiteshaggarwal/master
Bug fixes and optimization
2 parents 7b36b48 + 505e640 commit 16f6309

File tree

24 files changed

+531
-223
lines changed

24 files changed

+531
-223
lines changed

astroid/astroid-framework/astroid.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<libraryname>astroid</libraryname>
66
<author>JoomDev</author>
77
<creationDate>July 2018</creationDate>
8-
<version>1.1.0</version>
8+
<version>1.1.1</version>
99
<url>http://astroidframework.com</url>
1010
<copyright>Copyright (C) 2018 Joomdev, Inc. All rights reserved.</copyright>
1111
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

astroid/astroid-framework/framework/constants.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class AstroidFrameworkConstants {
1111

12-
public static $astroid_version = '1.1.0';
12+
public static $astroid_version = '1.1.1';
1313
public static $fontawesome_version = '5.1.0';
1414
public static $animatecss_version = '3.6';
1515
public static $animations = [
@@ -219,6 +219,7 @@ class AstroidFrameworkConstants {
219219
['title' => 'Dribbble', 'link' => '', 'icons' => ['fab fa-dribbble', 'fab fa-dribbble-square'], 'color' => '#F10A77', 'enabled' => false, 'icon' => 'fab fa-dribbble'],
220220
['title' => 'Spotify', 'link' => '', 'icons' => ['fab fa-spotify'], 'color' => '#00E155', 'enabled' => false, 'icon' => 'fab fa-spotify'],
221221
['title' => 'Flickr', 'link' => '', 'icons' => ['fab fa-flickr'], 'color' => '#0054E3', 'enabled' => false, 'icon' => 'fab fa-flickr'],
222+
['title' => 'vk', 'link' => '', 'icons' => ['fab fa-vk'], 'color' => '#4273AD', 'enabled' => false, 'icon' => 'fab fa-vk'],
222223
];
223224
public static $system_fonts = [
224225
"Arial, Helvetica, sans-serif" => 'Arial, Helvetica',

astroid/astroid-framework/framework/element.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct($type = '', $data = [], $template = null) {
3434
if (!empty($data)) {
3535
$this->id = $data['id'];
3636
$this->data = $data['params'];
37+
$this->raw_data = $data;
3738
}
3839
$this->app = JFactory::getApplication();
3940

@@ -209,6 +210,12 @@ public function getClass() {
209210
$params = $this->getParams();
210211
$classes = [];
211212
$classes[] = $this->template->slugify('astroid-' . $this->type);
213+
if ($this->type == 'section') {
214+
$section_classes = $this->getSectionClasses();
215+
if (!empty($section_classes)) {
216+
$classes[] = $section_classes;
217+
}
218+
}
212219
$customclass = $params->get('customclass', '');
213220
if (!empty($customclass)) {
214221
$classes[] = $customclass;
@@ -238,6 +245,63 @@ public function getClass() {
238245
return implode(' ', $classes);
239246
}
240247

248+
public function getSectionClasses() {
249+
$data = $this->raw_data;
250+
$classes = [];
251+
252+
$header_module_position = $this->template->params->get('header_module_position', '');
253+
$footer_module_position = $this->template->params->get('footer_module_position', '');
254+
255+
// check section has component
256+
foreach ($data['rows'] as $row) {
257+
foreach ($row['cols'] as $colIndex => $col) {
258+
foreach ($col['elements'] as $element) {
259+
if ($element['type'] == 'component') {
260+
$classes[] = 'astroid-component-section';
261+
break;
262+
}
263+
}
264+
}
265+
}
266+
267+
// check section has header
268+
if (!empty($header_module_position)) {
269+
foreach ($data['rows'] as $row) {
270+
foreach ($row['cols'] as $colIndex => $col) {
271+
foreach ($col['elements'] as $element) {
272+
if ($element['type'] == 'module_position') {
273+
$el = new AstroidElement('module_position', $element, $this->template);
274+
$position = $el->getValue('position', '');
275+
if ($position == $header_module_position) {
276+
$classes[] = 'astroid-header-section';
277+
}
278+
}
279+
break;
280+
}
281+
}
282+
}
283+
}
284+
285+
// check section has footer
286+
if (!empty($header_module_position)) {
287+
foreach ($data['rows'] as $row) {
288+
foreach ($row['cols'] as $colIndex => $col) {
289+
foreach ($col['elements'] as $element) {
290+
if ($element['type'] == 'module_position') {
291+
$el = new AstroidElement('module_position', $element, $this->template);
292+
$position = $el->getValue('position', '');
293+
if ($position == $footer_module_position) {
294+
$classes[] = 'astroid-footer-section';
295+
}
296+
}
297+
break;
298+
}
299+
}
300+
}
301+
}
302+
return implode(' ', $classes);
303+
}
304+
241305
public function getAnimation() {
242306
$params = $this->getParams();
243307
$animation = $params->get('animation', '');

astroid/astroid-framework/framework/template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function renderLayout() {
131131
$renderedHTML .= $el->render();
132132
}
133133
if (empty($renderedHTML)) {
134-
$bufferSize = $col['size'];
134+
$bufferSize += $col['size'];
135135
} else {
136136
if ($hasComponent) {
137137
$row['cols'][$componentIndex]['size'] = $row['cols'][$componentIndex]['size'] + $bufferSize;

astroid/astroid-framework/plugins/astroid/astroid.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>Astroid Plugin</name>
44
<author>JoomDev</author>
55
<creationDate>June 2018</creationDate>
6-
<version>1.1.0</version>
6+
<version>1.1.1</version>
77
<url>http://www.joomdev.com</url>
88
<copyright>Copyright (C) 2018 Joomdev, Inc. All rights reserved.</copyright>
99
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

astroid/astroid-template-zero/astroid/options/colors.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<field astroidgroup="body" name="body_link_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_LINK_COLOR_COLOR_LABEL" description="TPL_ASTROID_LINK_COLOR_COLOR_DESC">
1818
</field>
1919
<field astroidgroup="body" name="body_link_hover_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_LINK_HOVER_COLOR_COLOR_LABEL" description="TPL_ASTROID_LINK_HOVER_COLOR_COLOR_DESC">
20-
</field>
20+
</field>
2121
<field astroidgroup="header_colors" name="header_bg" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_HEADER_BACKGROUND_COLOR_LABEL" description="TPL_ASTROID_COLOURS_HEADER_BACKGROUND_COLOR_DESC">
2222
</field>
2323
<field astroidgroup="header_colors" name="header_text_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_HEADER_TEXT_COLOR_LABEL" description="TPL_ASTROID_COLOURS_HEADER_TEXT_COLOR_DESC">
@@ -30,22 +30,22 @@
3030
</field>
3131
<field astroidgroup="main_menu" name="main_menu_link_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_MENU_LINK_COLOR_LABEL" description="TPL_ASTROID_COLOURS_MENU_LINK_COLOR_DESC">
3232
</field>
33-
<field astroidgroup="main_menu" name="main_menu_link_hover_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_MENU_LINK_HOVER_COLOR_LABEL" description="TPL_ASTROID_COLOURS_MENU_LINK_HOVER_COLOR_DESC">
34-
</field>
3533
<field astroidgroup="main_menu" name="main_menu_link_active_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_MENU_LINK_ACTIVE_COLOR_LABEL" description="TPL_ASTROID_COLOURS_MENU_LINK_ACTIVE_COLOR_DESC">
3634
</field>
35+
<field astroidgroup="main_menu" name="main_menu_link_hover_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_MENU_LINK_HOVER_COLOR_LABEL" description="TPL_ASTROID_COLOURS_MENU_LINK_HOVER_COLOR_DESC">
36+
</field>
3737
<field astroidgroup="dropdown_menu" name="dropdown_bg_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_BACKGROUND_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_BACKGROUND_COLOR_DESC">
3838
</field>
3939
<field astroidgroup="dropdown_menu" name="dropdown_link_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_LINK_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_LINK_COLOR_DESC">
4040
</field>
41-
<field astroidgroup="dropdown_menu" name="dropdown_menu_link_hover_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_LINK_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_LINK_COLOR_DESC">
42-
</field>
43-
<field astroidgroup="dropdown_menu" name="dropdown_menu_hover_bg_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_BACKGROUND_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_BACKGROUND_COLOR_DESC">
44-
</field>
4541
<field astroidgroup="dropdown_menu" name="dropdown_menu_active_link_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_ACTIVE_LINK_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_ACTIVE_LINK_COLOR_DESC">
4642
</field>
4743
<field astroidgroup="dropdown_menu" name="dropdown_menu_active_bg_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_ACTIVE_BACKGROUND_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_ACTIVE_BACKGROUND_COLOR_DESC">
4844
</field>
45+
<field astroidgroup="dropdown_menu" name="dropdown_menu_link_hover_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_LINK_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_LINK_COLOR_DESC">
46+
</field>
47+
<field astroidgroup="dropdown_menu" name="dropdown_menu_hover_bg_color" type="astroidcolor" large="true" default="" label="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_BACKGROUND_COLOR_LABEL" description="TPL_ASTROID_COLOURS_DROPDOWN_HOVER_BACKGROUND_COLOR_DESC">
48+
</field>
4949
<field astroidgroup="off_canvas" name="mobile_backgroundcolor" type="astroidcolor" default="" label="TPL_ASTROID_OFF_CANVAS_BACKGROUND_LABEL" description="TPL_ASTROID_OFF_CANVAS_BACKGROUND_DESC">
5050
</field>
5151
<field astroidgroup="off_canvas" name="mobile_menu_text_color" type="astroidcolor" default="" label="TPL_ASTROID_COLOURS_OFF_CANVAS_TEXT_LABEL" description="TPL_ASTROID_COLOURS_OFF_CANVAS_TEXT_DESC">

astroid/astroid-template-zero/astroid/options/miscellaneous.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
<option value="before">TPL_ASTROID_BEFORE_MODULE</option>
1919
</field>
2020

21-
<field astroidgroup="contact_info" name="contact_address" type="astroidtext" label="TPL_ASTROID_MISCELL_ADDRESS_LABEL" default="15 Barnes Wallis Way, West Road, Chorley, USA" description="TPL_ASTROID_MISCELL_ADDRESS_DESC" hint="15 Barnes Wallis Way, West Road, Chorley, USA" ngShow="contact_details=='1'" class="form-control">
21+
<field astroidgroup="contact_info" name="contact_address" type="astroidtext" label="TPL_ASTROID_MISCELL_ADDRESS_LABEL" description="TPL_ASTROID_MISCELL_ADDRESS_DESC" hint="15 Barnes Wallis Way, West Road, Chorley, USA" ngShow="contact_details=='1'" class="form-control">
2222
</field>
2323

24-
<field astroidgroup="contact_info" name="contact_phone_number" type="astroidtext" label="TPL_ASTROID_MISCELL_PHONE_NUMBER_LABEL" description="TPL_ASTROID_MISCELL_PHONE_NUMBER_DESC" default="(888) 888-1234" hint="+1 123 456 7890" ngShow="contact_details=='1'" class="form-control">
24+
<field astroidgroup="contact_info" name="contact_phone_number" type="astroidtext" label="TPL_ASTROID_MISCELL_PHONE_NUMBER_LABEL" description="TPL_ASTROID_MISCELL_PHONE_NUMBER_DESC" hint="+1 123 456 7890" ngShow="contact_details=='1'" class="form-control">
2525
</field>
2626

2727
<field astroidgroup="contact_info" name="contact_mobile_number" type="astroidtext" label="TPL_ASTROID_MISCELL_MOBILE_NUMBER_LABEL" description="TPL_ASTROID_MISCELL_MOBILE_NUMBER_DESC" hint="+1 123 456 7890" ngShow="contact_details=='1'" class="form-control">

astroid/astroid-template-zero/frontend/colors.php

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package Astroid Framework
45
* @author JoomDev https://www.joomdev.com
@@ -28,7 +29,7 @@
2829
$main_link_hover_color = $template->params->get('main_menu_link_hover_color', '');
2930
$main_link_active_color = $template->params->get('main_menu_link_active_color', '');
3031

31-
// Dropdowns
32+
// Dropdown Menu
3233
$dropdown_main_background_color = $template->params->get('dropdown_bg_color', '');
3334
$dropdown_main_link_color = $template->params->get('dropdown_link_color', '');
3435
$dropdown_main_hover_link_color = $template->params->get('dropdown_menu_link_hover_color', '');
@@ -44,7 +45,7 @@
4445
$mobile_active_link_color = $template->params->get('mobile_menu_active_link_color', '');
4546
$mobile_active_background_color = $template->params->get('mobile_menu_active_bg_color', '');
4647

47-
//Footer
48+
// Footer
4849
$footer_background_color = $template->params->get('footer_bg_color', '');
4950
$footer_text_color = $template->params->get('footer_text_color', '');
5051
$footer_link_color = $template->params->get('footer_link_color', '');
@@ -71,28 +72,13 @@
7172

7273
<?php
7374

74-
// Main Menu Coloring
75-
$main_menu_styles = [];
76-
if (!empty($main_link_color)) {
77-
$main_menu_styles[] = '.astroid-nav .nav-link,.astroid-nav .nav-link{ color: ' . $main_link_color . ' !important;}';
78-
}
79-
if (!empty($main_link_hover_color)) {
80-
$main_menu_styles[] = '.astroid-nav .nav-link:hover, .astroid-nav .nav-link:hover{ color: ' . $main_link_hover_color . ' !important;}';
81-
}
82-
if (!empty($main_link_active_color)) {
83-
$main_menu_styles[] = '.astroid-nav .nav-link.active, .astroid-nav .nav-link.active{ color: ' . $main_link_active_color . ' !important;}';
84-
}
85-
?>
86-
87-
<?php
88-
8975
// Header Coloring
9076
$header_styles = [];
9177
if (!empty($header_background_color)) {
92-
$header_styles[] = 'header{ background-color: ' . $header_background_color . ' !important;}';
78+
$header_styles[] = '.astroid-header-section{ background-color: ' . $header_background_color . ' !important;}';
9379
}
9480
if (!empty($header_text_color)) {
95-
$header_styles[] = 'header *{ color: ' . $header_text_color . ' !important;}';
81+
$header_styles[] = 'header{ color: ' . $header_text_color . ' !important;}';
9682
}
9783
if (!empty($header_logo_text_color)) {
9884
$header_styles[] = '.astroid-logo-text .site-title{ color: ' . $header_logo_text_color . ' !important;}';
@@ -107,10 +93,25 @@
10793

10894
<?php
10995

96+
// Main Menu Coloring
97+
$main_menu_styles = [];
98+
if (!empty($main_link_color)) {
99+
$main_menu_styles[] = '.astroid-nav .nav-link{ color: ' . $main_link_color . ' !important;}';
100+
}
101+
if (!empty($main_link_hover_color)) {
102+
$main_menu_styles[] = '.astroid-nav .nav-link:hover, .astroid-nav .nav-link:focus{ color: ' . $main_link_hover_color . ' !important;}';
103+
}
104+
if (!empty($main_link_active_color)) {
105+
$main_menu_styles[] = '.astroid-nav .nav-link.active{ color: ' . $main_link_active_color . ' !important;}';
106+
}
107+
?>
108+
109+
<?php
110+
110111
// Dropdown Coloring
111112
$dropdown_styles = [];
112113
if (!empty($dropdown_main_background_color)) {
113-
$dropdown_styles[] = '.astroid-nav .navbar-subnav,.astroid-nav .has-subnav.nav-item-level-1.hovered:after,.astroid-nav .has-subnav.nav-item-level-1.hovered:before{ background: ' . $dropdown_main_background_color . ' !important;}';
114+
$dropdown_styles[] = '.astroid-nav .navbar-subnav, .astroid-nav .has-subnav.nav-item-level-1.hovered:after, .astroid-nav .has-subnav.nav-item-level-1.hovered:before{ background: ' . $dropdown_main_background_color . ' !important;}';
114115
$dropdown_styles[] = '.astroid-nav .megamenu-container,.astroid-nav .has-megamenu.nav-item-level-1.hovered:after,.astroid-nav .has-megamenu.nav-item-level-1.hovered:before{ background: ' . $dropdown_main_background_color . ' !important;}';
115116
}
116117
if (!empty($dropdown_main_link_color)) {
@@ -137,7 +138,7 @@
137138

138139
<?php
139140

140-
// MobilemenuColoring
141+
// Mobile Menu Coloring
141142
$mobilemenu_styles = [];
142143
if (!empty($mobile_background_color)) {
143144
$mobilemenu_styles[] = '.astroid-mobilemenu-container .astroid-mobilemenu-inner .menu-item a,.astroid-mobilemenu-container .astroid-mobilemenu-inner .menu-item .menu-indicator,.astroid-mobilemenu-container .astroid-mobilemenu-inner .menu-indicator-back{ background-color: ' . $mobile_background_color . ' !important;}';
@@ -161,10 +162,10 @@
161162

162163
<?php
163164

164-
// MobilemenuColoring
165+
// Footer Coloring
165166
$footer_styles = [];
166167
if (!empty($footer_background_color)) {
167-
$footer_styles[] = '#astroid-footer{ background-color: ' . $footer_background_color . ' !important;}';
168+
$footer_styles[] = '.astroid-footer-section{ background-color: ' . $footer_background_color . ' !important;}';
168169
}
169170
if (!empty($footer_text_color)) {
170171
$footer_styles[] = '#astroid-footer{ color: ' . $footer_text_color . ' !important;}';
@@ -182,8 +183,8 @@
182183
$document = JFactory::getDocument();
183184
$document->addStyledeclaration(implode('', $body_styles));
184185
$document->addStyledeclaration(implode('', $header_styles));
186+
$document->addStyledeclaration(implode('', $main_menu_styles));
185187
$document->addStyledeclaration(implode('', $dropdown_styles));
186188
$document->addStyledeclaration(implode('', $mobilemenu_styles));
187-
$document->addStyledeclaration(implode('', $main_menu_styles));
188189
$document->addStyledeclaration(implode('', $footer_styles));
189190
?>

0 commit comments

Comments
 (0)