Skip to content

Commit e54f34a

Browse files
Merge pull request #13 from hiteshaggarwal/master
v1.2.1
2 parents 4d466fa + b8c59d6 commit e54f34a

File tree

17 files changed

+230
-142
lines changed

17 files changed

+230
-142
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ You can use the Custom CSS to customize the appearance.
970970
## Frontend Folder Overrides
971971
By default in astroid framework, majority of the HTML rendered can be edited via the /frontend/ folder in your template. However, updating astroid to newer version would overwrite your modifications with that or core astroid files.
972972
973-
Starting Astroid 1.2.0, You can override the frontend folder as well.
973+
Starting Astroid 1.2.1, You can override the frontend folder as well.
974974
975975
If you'd like to override the the header layout file **header.php**
976976
```html
@@ -988,7 +988,7 @@ and that should do it, the overrides are applicable to all files under the front
988988
989989
Here is record of all notable changes made to a Astroid Framework.
990990
991-
## v1.2.0
991+
## v1.2.1
992992
993993
* Social Profile list ordering
994994
* Missing Social icons added in Social Profile list

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.2.0</version>
8+
<version>1.2.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: 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 = '1.2.0';
13+
public static $astroid_version = '1.2.1';
1414
public static $fontawesome_version = '5.2.0';
1515
public static $animatecss_version = '3.6';
1616
public static $animations = [

astroid/astroid-framework/framework/menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class AstroidMenu {
1414

15-
public static function getMenu($menutype = '', $nav_class = [], $logo = null, $logoOdd = 'left', $headerType = 'horizontal') {
15+
public static function getMenu($menutype = '', $nav_class = [], $logo = null, $logoOdd = 'left', $headerType = 'horizontal', $nav_wrapper_class = []) {
1616
if (empty($menutype)) {
1717
return '';
1818
}
@@ -27,7 +27,7 @@ public static function getMenu($menutype = '', $nav_class = [], $logo = null, $l
2727
$showAll = 1;
2828

2929
$return = [];
30-
echo '<div class="align-self-center px-2 d-none d-lg-block' . ($headerType == 'stacked' ? ' w-100' : '') . '' . ($headerType == 'sticky' ? ' mr-auto' : '') . '"><ul class="' . implode(' ', $nav_class) . '">';
30+
echo '<div class="' . (!empty($nav_wrapper_class) ? ' ' . implode(' ', $nav_wrapper_class) : '') . '"><ul class="' . implode(' ', $nav_class) . '">';
3131
$megamenu = false;
3232

3333
$count_menu = 0;

astroid/astroid-framework/plugins/astroid/astroid.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ public function onBeforeRender() {
4141
}
4242
}
4343

44+
public function onExtensionAfterSave($context, $table, $isNew) {
45+
if ($this->app->isAdmin() && $context == "com_templates.style" && $isNew && $this->isAstroidTemplate($table->template)) {
46+
$db = JFactory::getDbo();
47+
$params = \json_decode($table->params, TRUE);
48+
$ast_id = $params['astroid_template_id'];
49+
$query = "SELECT * FROM `#__astroid_templates` WHERE `id`='" . $ast_id . "'";
50+
$db->setQuery($query);
51+
$astroid_template = $db->loadObject();
52+
53+
$object = new stdClass();
54+
$object->id = null;
55+
$object->template_id = $table->id;
56+
$object->title = $table->title;
57+
$object->params = $astroid_template->params;
58+
$object->created = time();
59+
$object->updated = time();
60+
$db->insertObject('#__astroid_templates', $object);
61+
$ast_id = $db->insertid();
62+
63+
$object = new stdClass();
64+
$object->id = $table->id;
65+
$object->params = \json_encode(["astroid_template_id" => $ast_id]);
66+
$db->updateObject('#__template_styles', $object, 'id');
67+
}
68+
}
69+
4470
public function onAfterRoute() {
4571
$option = $this->app->input->get('option', '');
4672
$astroid = $this->app->input->get('astroid', '');

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.2.0</version>
6+
<version>1.2.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-framework/script.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public function checkAndUpgrade($template) {
9797
$result = $db->loadObject();
9898
if (empty($result)) {
9999
$this->moveParamsJSON($template);
100+
} else {
101+
$object = new stdClass();
102+
$object->id = $template->id;
103+
$object->params = \json_encode(["astroid_template_id" => $result->id]);
104+
$db->updateObject('#__template_styles', $object, 'id');
100105
}
101106
}
102107

@@ -110,10 +115,10 @@ public function moveParamsJSON($template) {
110115
$object->created = time();
111116
$object->updated = time();
112117
$db->insertObject('#__astroid_templates', $object);
113-
118+
114119
$object = new stdClass();
115120
$object->id = $template->id;
116-
$object->params = "";
121+
$object->params = \json_encode(["astroid_template_id" => $db->insertid()]);
117122
$db->updateObject('#__template_styles', $object, 'id');
118123
}
119124

astroid/astroid-template-zero/frontend/header/horizontal.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
$class = ['astroid-header', 'astroid-horizontal-header', 'astroid-horizontal-' . $mode . '-header'];
2929

3030
$navClass = ['nav', 'astroid-nav', 'd-none', 'd-lg-flex'];
31+
$navWrapperClass = ['align-self-center', 'px-2','d-none', 'd-lg-block'];
3132
?>
3233
<!-- header starts -->
3334
<header id="astroid-header" class="<?php echo implode(' ', $class); ?>">
@@ -42,7 +43,7 @@
4243
<?php
4344
if ($mode == 'left') {
4445
// header nav starts
45-
AstroidMenu::getMenu($header_menu, $navClass);
46+
AstroidMenu::getMenu($header_menu, $navClass, null, 'left', 'horizontal', $navWrapperClass);
4647
// header nav ends
4748
}
4849
?>
@@ -51,7 +52,7 @@
5152
if ($mode == 'center') {
5253
echo '<div class="header-center-section d-flex justify-content-center">';
5354
// header nav starts
54-
AstroidMenu::getMenu($header_menu, $navClass);
55+
AstroidMenu::getMenu($header_menu, $navClass, null, 'left', 'horizontal', $navWrapperClass);
5556
// header nav ends
5657
echo '</div>';
5758
}
@@ -61,7 +62,7 @@
6162
<?php
6263
if ($mode == 'right') {
6364
// header nav starts
64-
AstroidMenu::getMenu($header_menu, $navClass);
65+
AstroidMenu::getMenu($header_menu, $navClass, null, 'left', 'horizontal', $navWrapperClass);
6566
// header nav ends
6667
}
6768
?>

astroid/astroid-template-zero/frontend/header/stacked.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
$navClass = ['nav', 'astroid-nav', 'justify-content-center', 'd-flex', 'align-items-center'];
3434
$navClassLeft = ['nav', 'astroid-nav', 'justify-content-left', 'd-flex', 'align-items-left'];
3535
$navClassDivided = ['nav', 'astroid-nav'];
36+
$navWrapperClass = ['align-self-center', 'px-2','d-none', 'd-lg-block', 'w-100'];
3637
?>
3738
<header id="astroid-header" class="<?php echo implode(' ', $class); ?>">
3839
<div class="d-flex">
@@ -66,7 +67,7 @@
6667
echo '</div>';
6768
// header nav starts -->
6869
echo '<div class="w-100 d-none d-lg-flex justify-content-center py-3">';
69-
AstroidMenu::getMenu($header_menu, array_merge($navClass), null, 'left', 'stacked');
70+
AstroidMenu::getMenu($header_menu, array_merge($navClass), null, 'left', 'stacked', $navWrapperClass);
7071
echo '</div>';
7172
// header nav ends
7273
// header block starts
@@ -108,7 +109,7 @@
108109
echo '<div class="d-lg-none">';
109110
$template->loadLayout('logo');
110111
echo '</div>';
111-
AstroidMenu::getMenu($header_menu, $navClass, true, $odd_menu_items, 'stacked');
112+
AstroidMenu::getMenu($header_menu, $navClass, true, $odd_menu_items, 'stacked', $navWrapperClass);
112113
echo '</div>';
113114
if ($enable_offcanvas) {
114115
?>
@@ -185,7 +186,7 @@
185186
// header nav starts -->
186187
echo '<div class="w-100 d-none d-lg-flex">';
187188
echo '<div class="d-flex justify-content-start py-3 flex-grow-1">';
188-
AstroidMenu::getMenu($header_menu, $navClassLeft, null, 'left', 'stacked');
189+
AstroidMenu::getMenu($header_menu, $navClassLeft, null, 'left', 'stacked', $navWrapperClass);
189190
echo '</div>';
190191
// header nav ends
191192
// header block starts

astroid/astroid-template-zero/frontend/header/sticky.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
$class[] = 'header-' . $stickyheadertablet . '-tablet';
3535

3636
$navClass = ['nav', 'astroid-nav', 'd-none', 'd-lg-flex'];
37+
$navWrapperClass = ['align-self-center', 'px-2','d-none', 'd-lg-block', 'mr-auto'];
3738
?>
3839
<!-- header starts -->
3940
<div id="astroid-sticky-header" class="<?php echo implode(' ', $class); ?> d-none border-bottom shadow-sm">
@@ -47,7 +48,7 @@
4748
<?php
4849
$template->loadLayout('logo');
4950
// header nav starts
50-
AstroidMenu::getMenu($header_menu, $navClass, null, 'left', 'sticky');
51+
AstroidMenu::getMenu($header_menu, $navClass, null, 'left', 'sticky', $navWrapperClass);
5152
// header nav ends
5253
?>
5354
</div>

0 commit comments

Comments
 (0)