Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ciar4n committed Jul 10, 2017
2 parents b866032 + 3a31839 commit abdd678
Show file tree
Hide file tree
Showing 26 changed files with 152 additions and 292 deletions.
10 changes: 8 additions & 2 deletions administrator/components/com_fields/Model/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,14 @@ protected function preprocessForm(\JForm $form, $data, $group = 'content')
$form->setFieldAttribute('group_id', 'context', $this->state->get('field.context'));
$form->setFieldAttribute('rules', 'component', $component);

// Looking first in the component models/forms folder
$path = \JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fields/' . $section . '.xml');
// Looking in the component forms folder for a specific section forms file
$path = \JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/forms/fields/' . $section . '.xml');

if (!file_exists($path))
{
// Looking in the component models/forms folder for a specific section forms file
$path = \JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fields/' . $section . '.xml');
}

if (file_exists($path))
{
Expand Down
9 changes: 5 additions & 4 deletions administrator/language/en-GB/en-GB.mod_status.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ MOD_STATUS="User Status"
MOD_STATUS_BACKEND_USERS_0="Administrators"
MOD_STATUS_BACKEND_USERS_1="Administrator"
MOD_STATUS_BACKEND_USERS_MORE="Administrators"
MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_DESC="Show the number of users logged-in to the Backend."
MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_LABEL="Logged-in Backend Users"
MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_DESC="Show the number of users logged-in to the Frontend."
MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_LABEL="Logged-in Users"
MOD_STATUS_EDIT_ACCOUNT="Edit Account"
MOD_STATUS_POST_INSTALLATION_MESSAGES="Post-installation messages"
MOD_STATUS_PREVIEW="Preview %s"
MOD_STATUS_PRIVATE_MESSAGES="Private Messages"
MOD_STATUS_TOTAL_USERS_0="Users"
MOD_STATUS_TOTAL_USERS_1="User"
MOD_STATUS_TOTAL_USERS_MORE="Users"
MOD_STATUS_USER_MENU="User Menu"
MOD_STATUS_USERS_0="Visitors"
MOD_STATUS_USERS_1="Visitor"
MOD_STATUS_USERS_MORE="Visitors"
Expand Down
7 changes: 4 additions & 3 deletions administrator/modules/mod_multilangstatus/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
JHtml::_('script', 'mod_multilangstatus/admin-multilangstatus.min.js', array('version' => 'auto', 'relative' => true));
?>

<li class="px-2 multilanguage">
<a data-toggle="modal" href="#multiLangModal" title="<?php echo JText::_('MOD_MULTILANGSTATUS'); ?>" role="button">
<span class="mr-1 fa fa-comment" aria-hidden="true"></span><?php echo JText::_('MOD_MULTILANGSTATUS'); ?>
<li class="nav-item multilanguage">
<a class="nav-link" href="#multiLangModal" title="<?php echo JText::_('MOD_MULTILANGSTATUS'); ?>" data-toggle="modal" role="button">
<span class="fa fa-comment" aria-hidden="true"></span>
<span class="sr-only"><?php echo JText::_('MOD_MULTILANGSTATUS'); ?></span>
</a>
</li>

Expand Down
76 changes: 14 additions & 62 deletions administrator/modules/mod_status/mod_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,26 @@

defined('_JEXEC') or die;

$config = JFactory::getConfig();
$user = JFactory::getUser();
$db = JFactory::getDbo();
$lang = JFactory::getLanguage();
$input = JFactory::getApplication()->input;
$user = JFactory::getUser();
$lang = JFactory::getLanguage();
$app = JFactory::getApplication();
$sitename = htmlspecialchars($app->get('sitename', ''), ENT_QUOTES, 'UTF-8');

// Get the number of unread messages in your inbox.
$query = $db->getQuery(true)
->select('COUNT(*)')
->from('#__messages')
->where('state = 0 AND user_id_to = ' . (int) $user->get('id'));

$db->setQuery($query);
$unread = (int) $db->loadResult();

// Set the unread message count as a session variable so we can access it in the template
JFactory::getSession()->set('messages.unread', $unread);

$count = 0;

// Get the number of backend logged in users if shared sessions is not enabled.
if (!$config->get('shared_session', '0'))
{
$query->clear()
->select('COUNT(session_id)')
->from('#__session')
->where('guest = 0 AND client_id = 1');

$db->setQuery($query);
$count = (int) $db->loadResult();
}

// Set the inbox link.
if ($input->getBool('hidemainmenu'))
// Try to get the items from the post-installation model
try
{
$inboxLink = '';
$messagesModel = new \Joomla\Component\Postinstall\Administrator\Model\Messages(['ignore_request' => true]);
$messages = $messagesModel->getItems();
}
else
catch (RuntimeException $e)
{
$inboxLink = JRoute::_('index.php?option=com_messages');
}

$online_num = 0;

// Get the number of frontend logged in users if shared sessions is not enabled.
if (!$config->get('shared_session', '0'))
{
$query->clear()
->select('COUNT(session_id)')
->from('#__session')
->where('guest = 0 AND client_id = 0');
$messages = [];

$db->setQuery($query);
$online_num = (int) $db->loadResult();
// Still render the error message from the Exception object
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}

$total_users = 0;

// Get the number of logged in users if shared sessions is enabled.
if ($config->get('shared_session', '0'))
{
$query->clear()
->select('COUNT(session_id)')
->from('#__session')
->where('guest = 0');

$db->setQuery($query);
$total_users = (int) $db->loadResult();
}
// Load the com_postinstall language file
$lang->load('com_postinstall', JPATH_ADMINISTRATOR, 'en-GB', true);

require JModuleHelper::getLayoutPath('mod_status', $params->get('layout', 'default'));
26 changes: 0 additions & 26 deletions administrator/modules/mod_status/mod_status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,6 @@
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_STATUS" />
<config>
<fields name="params">
<fieldset name="basic">
<field
name="show_loggedin_users"
type="radio"
label="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_LABEL"
description="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_DESC"
class="switcher"
default="1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field
name="show_loggedin_users_admin"
type="radio"
label="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_LABEL"
description="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_DESC"
class="switcher"
default="1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>

<fieldset name="advanced">
<field
name="layout"
Expand Down
120 changes: 78 additions & 42 deletions administrator/modules/mod_status/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,81 @@

defined('_JEXEC') or die;

$hideLinks = $input->getBool('hidemainmenu');
$task = $input->getCmd('task');
$output = array();

// Print logged in user count based on the shared session state
if (JFactory::getConfig()->get('shared_session', '0'))
{
// Print the frontend logged in users.
if ($params->get('show_loggedin_users', 1))
{
$output[] = '<li class="px-2">'
. '<span class="mr-1 ml-1 badge badge-pill badge-default">' . $total_users . '</span>'
. JText::plural('MOD_STATUS_TOTAL_USERS', $total_users)
. '</li>';
}
}
else
{
// Print the frontend logged in users.
if ($params->get('show_loggedin_users', 1))
{
$output[] = '<li class="px-2">'
. '<span class="mr-1 ml-1 badge badge-pill badge-default">' . $online_num . '</span>'
. JText::plural('MOD_STATUS_USERS', $online_num)
. '</li>';
}

// Print the backend logged in users.
if ($params->get('show_loggedin_users_admin', 1))
{
$output[] = '<li class="px-2">'
. '<span class="mr-1 ml-1 badge badge-pill badge-default">' . $count . '</span>'
. JText::plural('MOD_STATUS_BACKEND_USERS', $count)
. '</li>';
}
}

// Output the items.
foreach ($output as $item)
{
echo $item;
}
$hideLinks = $app->input->getBool('hidemainmenu');

?>
<div class="ml-auto">
<ul class="nav text-center">

<?php
$module = JModuleHelper::getModule('multilangstatus');
echo JModuleHelper::renderModule($module);
?>

<li class="nav-item">
<a class="nav-link" href="<?php echo JUri::root(); ?>" title="<?php echo JText::sprintf('MOD_STATUS_PREVIEW', $sitename); ?>" target="_blank">
<span class="fa fa-external-link" aria-hidden="true"></span>
<span class="sr-only"><?php echo JHtml::_('string.truncate', $sitename, 28, false, false); ?></span>
</a>
</li>

<li class="nav-item">
<a class="nav-link dropdown-toggle" href="<?php echo JRoute::_('index.php?option=com_messages'); ?>" title="<?php echo JText::_('MOD_STATUS_PRIVATE_MESSAGES'); ?>">
<span class="fa fa-envelope-o" aria-hidden="true"></span>
<span class="sr-only"><?php echo JText::_('MOD_STATUS_PRIVATE_MESSAGES'); ?></span>
<?php $countUnread = JFactory::getSession()->get('messages.unread'); ?>
<?php if ($countUnread > 0) : ?>
<span class="badge badge-pill badge-success"><?php echo $countUnread; ?></span>
<?php endif; ?>
</a>
</li>

<?php if ($user->authorise('core.manage', 'com_postinstall')) : ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" title="<?php echo JText::_('MOD_STATUS_POST_INSTALLATION_MESSAGES'); ?>">
<span class="fa fa-bell-o" aria-hidden="true"></span>
<span class="sr-only"><?php echo JText::_('MOD_STATUS_POST_INSTALLATION_MESSAGES'); ?></span>
<?php if (count($messages) > 0) : ?>
<span class="badge badge-pill badge-success"><?php echo count($messages); ?></span>
<?php endif; ?>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-notifications">
<div class="list-group">
<?php if (empty($messages)) : ?>
<p class="list-group-item text-center">
<strong><?php echo JText::_('COM_POSTINSTALL_LBL_NOMESSAGES_TITLE'); ?></strong>
</p>
<?php endif; ?>
<?php foreach ($messages as $message) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_postinstall&amp;eid=700'); ?>" class="list-group-item list-group-item-action">
<h5 class="list-group-item-heading"><?php echo JHtml::_('string.truncate', JText::_($message->title_key), 28, false, false); ?></h5>
<p class="list-group-item-text small">
<?php echo JHtml::_('string.truncate', JText::_($message->description_key), 120, false, false); ?>
</p>
</a>
<?php endforeach; ?>
</div>
</div>
</li>
<?php endif; ?>

<li class="nav-item dropdown header-profile">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">
<span class="fa fa-user-o" aria-hidden="true"></span>
<span class="sr-only"><?php echo JText::_('MOD_STATUS_USER_MENU'); ?></span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-item header-profile-user">
<span class="fa fa-user" aria-hidden="true"></span>
<?php echo $user->name; ?>
</div>
<?php $route = 'index.php?option=com_admin&amp;task=profile.edit&amp;id=' . $user->id; ?>
<a class="dropdown-item" href="<?php echo JRoute::_($route); ?>">
<?php echo JText::_('MOD_STATUS_EDIT_ACCOUNT'); ?></a>
<a class="dropdown-item" href="<?php echo JRoute::_('index.php?option=com_login&task=logout&'
. JSession::getFormToken() . '=1') ?>"><?php echo JText::_('JLOGOUT'); ?></a>
</div>
</li>

</ul>
</div>
6 changes: 5 additions & 1 deletion administrator/modules/mod_title/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
defined('_JEXEC') or die;
?>
<?php if (!empty($title)) : ?>
<?php echo $title; ?>
<div class="d-flex col">
<div class="container-title">
<?php echo $title; ?>
</div>
</div>
<?php endif; ?>
4 changes: 3 additions & 1 deletion administrator/modules/mod_version/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
defined('_JEXEC') or die;
?>
<?php if (!empty($version)) : ?>
<p class="text-center"><?php echo $version; ?></p>
<div class="d-flex align-items-center">
<p class="joomla-version"><?php echo $version; ?></p>
</div>
<?php endif; ?>
2 changes: 1 addition & 1 deletion administrator/templates/atum/css/bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion administrator/templates/atum/css/template-rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion administrator/templates/atum/css/template-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion administrator/templates/atum/css/template.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion administrator/templates/atum/css/template.min.css

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions administrator/templates/atum/html/mod_version/default.php

This file was deleted.

2 changes: 1 addition & 1 deletion administrator/templates/atum/html/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function modChrome_well($module, &$params, &$attribs)

if ($module->showtitle)
{
echo '<h5 class="card-title nav-header' . $headerClass . '">' . $module->title . '</h5>';
echo '<h2 class="card-title nav-header' . $headerClass . '">' . $module->title . '</h2>';
}

echo $module->content;
Expand Down

0 comments on commit abdd678

Please sign in to comment.