Skip to content

Commit

Permalink
Fix issue Deprecated in PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed May 6, 2024
1 parent 95e7127 commit c64367e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 49 deletions.
15 changes: 8 additions & 7 deletions html/com_users/login/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
* @copyright Copyright (C) 2023 AstroidFrame.work.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/

defined('_JEXEC') or die;
$cookieLogin = $this->user->get('cookieLogin');
if (!empty($cookieLogin) || $this->user->get('guest')) {
echo $this->loadTemplate('login'); // The user is not logged in or needs to provide a password.
} else {
echo $this->loadTemplate('logout'); // The user is already logged in.
}

/**
* TO OVERRIDE THIS LAYOUT
* 1. Remove line "require Astroid\Helper\Overrides::getHTMLTemplate()";
* 2. Copy source code from libraries/astroid/framework/html/{find a file that you will override here}
* 3. Paste source code to below and start to edit.
*/
require Astroid\Helper\Overrides::getHTMLTemplate();
49 changes: 7 additions & 42 deletions html/com_users/login/default_logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,10 @@
*/
defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

?>
<div class="logout<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="item-title">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '') || $this->params->get('logout_image') != '') : ?>
<div class="logout-description">
<?php endif; ?>
<?php if ($this->params->get('logoutdescription_show') == 1) : ?>
<?php echo $this->params->get('logout_description'); ?>
<?php endif; ?>
<?php if ($this->params->get('logout_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('logout_image')); ?>" class="thumbnail pull-right logout-image" alt="<?php echo Text::_('COM_USER_LOGOUT_IMAGE_ALT'); ?>" />
<?php endif; ?>
<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '') || $this->params->get('logout_image') != '') : ?>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_users&task=user.logout'); ?>" method="post" class="form-horizontal well">
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">
<span class="icon-arrow-left icon-white"></span>
<?php echo Text::_('JLOGOUT'); ?>
</button>
</div>
</div>
<?php if ($this->params->get('logout_redirect_url')) : ?>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_url', $this->form->getValue('return'))); ?>" />
<?php else : ?>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_menuitem', $this->form->getValue('return'))); ?>" />
<?php endif; ?>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
</div>
/**
* TO OVERRIDE THIS LAYOUT
* 1. Remove line "require Astroid\Helper\Overrides::getHTMLTemplate()";
* 2. Copy source code from libraries/astroid/framework/html/{find a file that you will override here}
* 3. Paste source code to below and start to edit.
*/
require Astroid\Helper\Overrides::getHTMLTemplate();

0 comments on commit c64367e

Please sign in to comment.