Skip to content

Commit

Permalink
Better j5 compatibility and add switcher mode
Browse files Browse the repository at this point in the history
  • Loading branch information
micker committed Jun 7, 2024
1 parent 0c04f5d commit 6252161
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
13 changes: 7 additions & 6 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@
use Joomla\Database\ParameterType;
use Joomla\Module\Quickicon\Administrator\Event\QuickIconsEvent;
use Joomla\Registry\Registry;
use Joomla\CMS\Router\Route;

abstract class modDashboardHelper
{

public static function getItems($data)
{
// recuperation utilisateur connecté
$user = JFactory::getUser();
$user = Factory::getUser();
$userid = $user->id;
$catids = $data->catidlist ?? [];
$limit = $data->count;
$nom_statut = $data->TypofBlock;
// recupere la connexion à la BD
$db = JFactory::getDbo();
$db = Factory::getDbo();
$query = $db->getQuery(true);

$query
Expand Down Expand Up @@ -128,24 +129,24 @@ public static function getItems($data)

foreach ($items as $item)
{
$item->link = JRoute::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
$item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
}

return $items;
}

public static function getUseritem(&$params)
{
$user = JFactory::getUser();
$user = Factory::getUser();
$userid = $user->id;
//recupére la connexion à la BD
$db = JFactory::getDbo();
$db = Factory::getDbo();
$queryUseritem = 'SELECT id, title, catid, created, created_by, modified, modified_by, state FROM #__content WHERE created_by = ' . $user->id . ' ORDER BY modified DESC LIMIT 50';
$db->setQuery($queryUseritem);
$itemsUseritem = $db->loadObjectList();
foreach ($itemsUseritem as &$itemUseritem)
{
$itemUseritem->link = JRoute::_('index.php?option=com_content&task=article.edit&id=' . $itemUseritem->id);
$itemUseritem->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $itemUseritem->id);
switch ($itemUseritem->state)
{
case 0:
Expand Down
16 changes: 7 additions & 9 deletions media/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ padding: 10px;
justify-content: center;
align-items: center;
}
.sep{
height: 2rem;
/*background: #edf2f7;*/
background:var(--template-bg-dark-5);
}
.card-body{
overflow-y: auto !important;
}
Expand All @@ -159,11 +154,14 @@ background:var(--template-bg-dark-5);
width: 100% !important;
}
}
@media (prefers-color-scheme: dark) {
.headerblock .breadcrumb {
[data-bs-theme="dark"] .headerblock .breadcrumb {
background: none;
}
.sep, .contentbloc {
[data-bs-theme="dark"] .sep, [data-bs-theme="dark"] .contentbloc {
background-color: var(--template-bg-dark-90);
}
}
[data-bs-theme="dark"] .sep{
height: 2rem;
/*background: #edf2f7;*/
background:var(--template-bg-dark-5);
}
3 changes: 2 additions & 1 deletion mod_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
defined('_JEXEC') or die('Accès interdit');
jimport('joomla.application.component.controller');
JLoader::register('ModLatestActionsHelper', __DIR__ . '/helper.php');
use Joomla\CMS\Helper\ModuleHelper;

// Inclut les méthodes du script de soutien
require_once dirname(__FILE__) . '/helper.php';
Expand All @@ -37,4 +38,4 @@
$actionlist = modDashboardHelper::getActionlogList($params);

// Get Joomla Layout
require JModuleHelper::getLayoutPath('mod_dashboard', $params->get('layout', 'default'));
require ModuleHelper::getLayoutPath('mod_dashboard', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion mod_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<creationDate>2023</creationDate>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.com3elles.com</authorUrl>
<version>3.3</version>
<version>3.4</version>
<copyright>Copyright (C) 2008 - 2022 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<description>MOD_DASHBOARD_INTRO</description>
Expand Down
2 changes: 1 addition & 1 deletion tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class="align-items-center">
<td>
<span class="small">
<i class="fa fa-calendar"></i>
<?php echo JHtml::date($item->modified, 'd M Y'); ?>
<?php echo HTMLHelper::date($item->modified, 'd M Y'); ?>
</span>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<element>mod_dashboard</element>
<type>module</type>
<client>administrator</client>
<version>3.3</version>
<version>3.4</version>

<infourl title="FAQ">
https://github.com/micker/mod_dashboard/wiki
</infourl>

<downloads>
<downloadurl type="full" format="zip">https://github.com/micker/mod_dashboard/archive/v3.3.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/micker/mod_dashboard/archive/v3.4.zip</downloadurl>
</downloads>

<tags>
Expand Down

0 comments on commit 6252161

Please sign in to comment.