first commit
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_post_installation_messages
|
||||
*
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\ExtensionHelper;
|
||||
use Joomla\CMS\Helper\ModuleHelper;
|
||||
|
||||
// Try to get the items from the post-installation model
|
||||
try {
|
||||
/** @var \Joomla\Component\Postinstall\Administrator\Model\MessagesModel $messagesModel */
|
||||
$messagesModel = $app->bootComponent('com_postinstall')->getMVCFactory()
|
||||
->createModel('Messages', 'Administrator', ['ignore_request' => true]);
|
||||
$messagesCount = $messagesModel->getItemsCount();
|
||||
} catch (RuntimeException $e) {
|
||||
$messagesCount = 0;
|
||||
|
||||
// Still render the error message from the Exception object
|
||||
$app->enqueueMessage($e->getMessage(), 'error');
|
||||
}
|
||||
|
||||
$joomlaFilesExtensionId = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id;
|
||||
|
||||
// Load the com_postinstall language file
|
||||
$app->getLanguage()->load('com_postinstall', JPATH_ADMINISTRATOR);
|
||||
|
||||
require ModuleHelper::getLayoutPath('mod_post_installation_messages', $params->get('layout', 'default'));
|
||||
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="module" client="administrator" method="upgrade">
|
||||
<name>mod_post_installation_messages</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2019-07</creationDate>
|
||||
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>4.0.0</version>
|
||||
<description>MOD_POST_INSTALLATION_MESSAGES_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_post_installation_messages">mod_post_installation_messages.php</filename>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/mod_post_installation_messages.ini</language>
|
||||
<language tag="en-GB">language/en-GB/mod_post_installation_messages.sys.ini</language>
|
||||
</languages>
|
||||
<help key="Admin_Modules:_Post_Installation_Messages" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="advanced">
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
class="form-select"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="textarea"
|
||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||
rows="3"
|
||||
validate="CssIdentifier"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_post_installation_messages
|
||||
*
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$hideLinks = $app->getInput()->getBool('hidemainmenu');
|
||||
|
||||
if ($hideLinks || $messagesCount < 1) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<?php if ($app->getIdentity()->authorise('core.manage', 'com_postinstall')) : ?>
|
||||
<a class="header-item-content"
|
||||
href="<?php echo Route::_('index.php?option=com_postinstall&eid=' . $joomlaFilesExtensionId); ?>"
|
||||
title="<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>">
|
||||
<div class="header-item-icon">
|
||||
<div class="w-auto">
|
||||
<span class="icon-bell icon-fw" aria-hidden="true"></span>
|
||||
<small class="header-item-count"><?php echo $messagesCount; ?></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-item-text">
|
||||
<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user