Skip to content

Commit

Permalink
Merge pull request #476 from templaza/v3
Browse files Browse the repository at this point in the history
v3.0.6
  • Loading branch information
sonvnn authored Nov 28, 2023
2 parents 7d56eb4 + 56e5bd3 commit 9dc6924
Show file tree
Hide file tree
Showing 11 changed files with 346 additions and 20 deletions.
3 changes: 3 additions & 0 deletions assets/vendor/astroid/scss/joomla/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ ul.tags {
--bs-btn-padding-y: 0.3rem;
--bs-btn-padding-x: 1rem;
}
}
.pagenavigation .pagination a {
padding: 5px 15px;
}
2 changes: 1 addition & 1 deletion astroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<libraryname>astroid</libraryname>
<author>Astroid Framework Team</author>
<creationDate>November 2023</creationDate>
<version>3.0.5</version>
<version>3.0.6</version>
<url>https://astroidframe.work/</url>
<copyright>Copyright (C) 2023 TemPlaza, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
Expand Down
4 changes: 2 additions & 2 deletions astroid_framework.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<updates>
<update>
<name>Astroid Framework</name>
<version>3.0.5</version>
<version>3.0.6</version>
<infourl title="Astroid Framework">https://astroidframe.work/</infourl>
<element>astroid</element>
<type>library</type>
<client>0</client>
<downloads>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.0.5/astroid-framework-3.0.5.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.0.6/astroid-framework-3.0.6.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
14 changes: 7 additions & 7 deletions framework/frontend/blog/modules/related.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
use Joomla\CMS\Language\Text;
// No direct access.
defined('_JEXEC') or die;
jimport('astroid.framework.article');

extract($displayData);
if (empty($items)) {
return;
}
$document = Astroid\Framework::getDocument();
?>
<div class="relatedposts-wrap">
<h4><?php echo Text::_('ASTROID_ARTICLE_RELATED_LBL'); ?></h4>
<div class="relateditems row">
<div class="relateditems row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4">
<?php foreach ($items as $item) : $images = json_decode($item->images);
$astroidArticle = new AstroidFrameworkArticle($item, true);
$astroidArticle = new Astroid\Article($item, true);
?>
<div class="col-md-6 p-2">
<div class="card h-100 mb-4">
<div>
<div class="card">
<?php
if (!empty($images->image_intro)) {
?>
Expand All @@ -37,10 +37,10 @@
<div class="card-body">
<?php
if ($display_posttypeicon) {
Astroid\Framework::getDocument()->include('blog.modules.posttype', ['article' => $astroidArticle]);
$document->include('blog.modules.posttype', ['article' => $astroidArticle]);
}
if ($display_badge) {
Astroid\Framework::getDocument()->include('blog.modules.badge', ['article' => $astroidArticle]);
$document->include('blog.modules.badge', ['article' => $astroidArticle]);
}
?>
<small class="text-muted"> <?php echo $item->category_title; ?></small>
Expand Down
2 changes: 1 addition & 1 deletion framework/html/layouts/chromes/astroidxhtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

$moduleTag = $params->get('module_tag', 'div');
$moduleAttribs = [];
$moduleAttribs['class'] = $module->position . ' moduletable ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');
$moduleAttribs['class'] = $module->position . '-position moduletable ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');
$headerTag = htmlspecialchars($params->get('header_tag', 'h3'), ENT_QUOTES, 'UTF-8');
$headerClass = htmlspecialchars($params->get('header_class', ''), ENT_QUOTES, 'UTF-8');
$headerAttribs = [];
Expand Down
139 changes: 139 additions & 0 deletions framework/html/mod_login/card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?php

/**
* @package Astroid Framework
* @author Astroid Framework https://astroidframe.work
* @copyright Copyright (C) 2023 AstroidFrame.work.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;

$app->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('keepalive')
->useScript('field.passwordview');

Text::script('JSHOWPASSWORD');
Text::script('JHIDEPASSWORD');
?>
<div class="card card-body">
<form id="login-form-<?php echo $module->id; ?>" class="mod-login" action="<?php echo Route::_('index.php', true); ?>" method="post">

<?php if ($params->get('pretext')) : ?>
<div class="mod-login__pretext pretext">
<p><?php echo $params->get('pretext'); ?></p>
</div>
<?php endif; ?>

<div class="mod-login__userdata userdata">
<div class="mod-login__username form-group">
<?php if (!$params->get('usetext', 0)) : ?>
<div class="input-group">
<input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<label for="modlgn-username-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
<span class="input-group-text" title="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<span class="icon-user icon-fw" aria-hidden="true"></span>
</span>
</div>
<?php else : ?>
<label for="modlgn-username-<?php echo $module->id; ?>"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
<input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<?php endif; ?>
</div>

<div class="mod-login__password form-group">
<?php if (!$params->get('usetext', 0)) : ?>
<div class="input-group">
<input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
<label for="modlgn-passwd-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
<button type="button" class="btn btn-secondary input-password-toggle">
<span class="icon-eye icon-fw" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JSHOWPASSWORD'); ?></span>
</button>
</div>
<?php else : ?>
<label for="modlgn-passwd-<?php echo $module->id; ?>"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
<input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
<?php endif; ?>
</div>

<?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
<div class="mod-login__remember form-group">
<div id="form-login-remember-<?php echo $module->id; ?>" class="form-check">
<input type="checkbox" name="remember" class="form-check-input" value="yes" id="form-login-input-remember-<?php echo $module->id; ?>">
<label class="form-check-label" for="form-login-input-remember-<?php echo $module->id; ?>">
<?php echo Text::_('MOD_LOGIN_REMEMBER_ME'); ?>
</label>
</div>
</div>
<?php endif; ?>

<?php foreach ($extraButtons as $button) :
$dataAttributeKeys = array_filter(array_keys($button), function ($key) {
return substr($key, 0, 5) == 'data-';
});
?>
<div class="mod-login__submit form-group">
<button type="button"
class="btn btn-secondary w-100 <?php echo $button['class'] ?? '' ?>"
<?php foreach ($dataAttributeKeys as $key) : ?>
<?php echo $key ?>="<?php echo $button[$key] ?>"
<?php endforeach; ?>
<?php if ($button['onclick']) : ?>
onclick="<?php echo $button['onclick'] ?>"
<?php endif; ?>
title="<?php echo Text::_($button['label']) ?>"
id="<?php echo $button['id'] ?>"
>
<?php if (!empty($button['icon'])) : ?>
<span class="<?php echo $button['icon'] ?>"></span>
<?php elseif (!empty($button['image'])) : ?>
<?php echo $button['image']; ?>
<?php elseif (!empty($button['svg'])) : ?>
<?php echo $button['svg']; ?>
<?php endif; ?>
<?php echo Text::_($button['label']) ?>
</button>
</div>
<?php endforeach; ?>

<div class="mod-login__submit form-group">
<button type="submit" name="Submit" class="btn btn-primary w-100"><?php echo Text::_('JLOGIN'); ?></button>
</div>

<?php
$usersConfig = ComponentHelper::getParams('com_users'); ?>
<ul class="mod-login__options list-group">
<li class="list-group-item">
<a href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
<?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>
</li>
<li class="list-group-item">
<a href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
<?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li class="list-group-item">
<a href="<?php echo Route::_($registerLink); ?>">
<?php echo Text::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-register" aria-hidden="true"></span></a>
</li>
<?php endif; ?>
</ul>
<input type="hidden" name="option" value="com_users">
<input type="hidden" name="task" value="user.login">
<input type="hidden" name="return" value="<?php echo $return; ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
<?php if ($params->get('posttext')) : ?>
<div class="mod-login__posttext posttext">
<p><?php echo $params->get('posttext'); ?></p>
</div>
<?php endif; ?>
</form>
</div>
137 changes: 137 additions & 0 deletions framework/html/mod_login/default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?php

/**
* @package Astroid Framework
* @author Astroid Framework https://astroidframe.work
* @copyright Copyright (C) 2023 AstroidFrame.work.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;

$app->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('keepalive')
->useScript('field.passwordview');

Text::script('JSHOWPASSWORD');
Text::script('JHIDEPASSWORD');
?>
<form id="login-form-<?php echo $module->id; ?>" class="mod-login" action="<?php echo Route::_('index.php', true); ?>" method="post">

<?php if ($params->get('pretext')) : ?>
<div class="mod-login__pretext pretext">
<p><?php echo $params->get('pretext'); ?></p>
</div>
<?php endif; ?>

<div class="mod-login__userdata userdata">
<div class="mod-login__username form-group">
<?php if (!$params->get('usetext', 0)) : ?>
<div class="input-group">
<input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<label for="modlgn-username-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
<span class="input-group-text" title="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<span class="icon-user icon-fw" aria-hidden="true"></span>
</span>
</div>
<?php else : ?>
<label for="modlgn-username-<?php echo $module->id; ?>"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
<input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
<?php endif; ?>
</div>

<div class="mod-login__password form-group">
<?php if (!$params->get('usetext', 0)) : ?>
<div class="input-group">
<input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
<label for="modlgn-passwd-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
<button type="button" class="btn btn-secondary input-password-toggle">
<span class="icon-eye icon-fw" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('JSHOWPASSWORD'); ?></span>
</button>
</div>
<?php else : ?>
<label for="modlgn-passwd-<?php echo $module->id; ?>"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
<input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
<?php endif; ?>
</div>

<?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
<div class="mod-login__remember form-group">
<div id="form-login-remember-<?php echo $module->id; ?>" class="form-check">
<input type="checkbox" name="remember" class="form-check-input" value="yes" id="form-login-input-remember-<?php echo $module->id; ?>">
<label class="form-check-label" for="form-login-input-remember-<?php echo $module->id; ?>">
<?php echo Text::_('MOD_LOGIN_REMEMBER_ME'); ?>
</label>
</div>
</div>
<?php endif; ?>

<?php foreach ($extraButtons as $button) :
$dataAttributeKeys = array_filter(array_keys($button), function ($key) {
return substr($key, 0, 5) == 'data-';
});
?>
<div class="mod-login__submit form-group">
<button type="button"
class="btn btn-secondary w-100 <?php echo $button['class'] ?? '' ?>"
<?php foreach ($dataAttributeKeys as $key) : ?>
<?php echo $key ?>="<?php echo $button[$key] ?>"
<?php endforeach; ?>
<?php if ($button['onclick']) : ?>
onclick="<?php echo $button['onclick'] ?>"
<?php endif; ?>
title="<?php echo Text::_($button['label']) ?>"
id="<?php echo $button['id'] ?>"
>
<?php if (!empty($button['icon'])) : ?>
<span class="<?php echo $button['icon'] ?>"></span>
<?php elseif (!empty($button['image'])) : ?>
<?php echo $button['image']; ?>
<?php elseif (!empty($button['svg'])) : ?>
<?php echo $button['svg']; ?>
<?php endif; ?>
<?php echo Text::_($button['label']) ?>
</button>
</div>
<?php endforeach; ?>

<div class="mod-login__submit form-group">
<button type="submit" name="Submit" class="btn btn-primary w-100"><?php echo Text::_('JLOGIN'); ?></button>
</div>

<?php
$usersConfig = ComponentHelper::getParams('com_users'); ?>
<ul class="mod-login__options list-group">
<li class="list-group-item">
<a href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
<?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>
</li>
<li class="list-group-item">
<a href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
<?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li class="list-group-item">
<a href="<?php echo Route::_($registerLink); ?>">
<?php echo Text::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-register" aria-hidden="true"></span></a>
</li>
<?php endif; ?>
</ul>
<input type="hidden" name="option" value="com_users">
<input type="hidden" name="task" value="user.login">
<input type="hidden" name="return" value="<?php echo $return; ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
<?php if ($params->get('posttext')) : ?>
<div class="mod-login__posttext posttext">
<p><?php echo $params->get('posttext'); ?></p>
</div>
<?php endif; ?>
</form>
34 changes: 34 additions & 0 deletions framework/html/mod_tags_popular/default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* @package Astroid Framework
* @author Astroid Framework https://astroidframe.work
* @copyright Copyright (C) 2023 AstroidFrame.work.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/

defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Tags\Site\Helper\RouteHelper;
?>
<div class="mod-tagspopular tagspopular">
<?php if (!count($list)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('MOD_TAGS_POPULAR_NO_ITEMS_FOUND'); ?>
</div>
<?php else : ?>
<div class="row row-cols-auto g-2">
<?php foreach ($list as $item) : ?>
<div>
<a class="btn btn-sm btn-primary" href="<?php echo Route::_(RouteHelper::getComponentTagRoute($item->tag_id . ':' . $item->alias, $item->language)); ?>">
<?php echo htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8'); ?>
<?php if ($display_count) : ?>
<span class="tag-count badge text-bg-secondary"><?php echo $item->count; ?></span>
<?php endif; ?></a>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
Loading

0 comments on commit 9dc6924

Please sign in to comment.