Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
#7 - Remove messages component
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens authored and ercanozkaya committed Jun 17, 2015
1 parent ed09437 commit 3c4c611
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 353 deletions.
30 changes: 0 additions & 30 deletions administrator/modules/mod_status/mod_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
$db = JFactory::getDbo();
$lang = JFactory::getLanguage();
$input = JFactory::getApplication()->input;

// 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();

// Get the number of back-end logged in users.
$query->clear()
->select('COUNT(session_id)')
Expand All @@ -33,26 +23,6 @@
$db->setQuery($query);
$count = (int) $db->loadResult();

// Set the inbox link.
if ($input->getBool('hidemainmenu'))
{
$inboxLink = '';
}
else
{
$inboxLink = JRoute::_('index.php?option=com_messages');
}

// Set the inbox class.
if ($unread)
{
$inboxClass = 'unread-messages';
}
else
{
$inboxClass = 'no-unread-messages';
}

// Get the number of frontend logged in users.
$query->clear()
->select('COUNT(session_id)')
Expand Down
10 changes: 0 additions & 10 deletions administrator/modules/mod_status/mod_status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_messages"
type="radio"
class="btn-group btn-group-yesno"
default="1"
label="MOD_STATUS_FIELD_SHOW_MESSAGES_LABEL"
description="MOD_STATUS_FIELD_SHOW_MESSAGES_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="advanced">
<field
Expand Down
13 changes: 0 additions & 13 deletions administrator/modules/mod_status/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@
. '</div>';
}

// Print the inbox message.
if ($params->get('show_messages', 1))
{
$active = $unread ? ' badge-warning' : '';
$output[] = '<div class="btn-group hasTooltip ' . $inboxClass . '"'
. ' title="' . JText::plural('MOD_STATUS_MESSAGES', $unread) . '">'
. ($hideLinks ? '' : '<a href="' . $inboxLink . '">')
. '<i class="icon-envelope"></i> '
. '<span class="badge' . $active . '">' . $unread . '</span>'
. ($hideLinks ? '' : '</a>')
. '<div class="btn-group divider"></div>'
. '</div>';
}

// Print the logout link.
if ($task == 'edit' || $task == 'editA' || $input->getInt('hidemainmenu'))
Expand Down
16 changes: 0 additions & 16 deletions administrator/templates/hathor/css/colour_highcontrast.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ a:hover,a:focus {
background: url(../images/menu/icon-16-viewsite.png) 3px 3px no-repeat;
}

#module-status .unread-messages,#module-status .no-unread-messages {
background: url(../images/menu/icon-16-messages.png) 3px 3px no-repeat;
}

#module-status .loggedin-users {
background: url(../images/menu/icon-16-user.png) 3px 3px no-repeat;
}
Expand Down Expand Up @@ -971,18 +967,6 @@ a img.calendar {
background-image: url(../images/menu/icon-16-menumgr.png);
}

.icon-16-messages {
background-image: url(../images/menu/icon-16-messaging.png);
}

.icon-16-messages-add {
background-image: url(../images/menu/icon-16-new-privatemessage.png);
}

.icon-16-messages-read {
background-image: url(../images/menu/icon-16-messages.png);
}

.icon-16-module {
background-image: url(../images/menu/icon-16-module.png);
}
Expand Down
12 changes: 0 additions & 12 deletions administrator/templates/hathor/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,6 @@ p.warning {
#module-status div.divider {
display: none;
}
#module-status .unread-messages a {
font-weight: bold;
}
.title-ua {
position: relative;
width: 60%;
Expand Down Expand Up @@ -3086,15 +3083,6 @@ ul.helpmenu li {
.menu-menumgr {
background-image: url(../images/menu/icon-16-menumgr.png);
}
.menu-messages {
background-image: url(../images/menu/icon-16-messaging.png);
}
.menu-messages-add {
background-image: url(../images/menu/icon-16-new-privatemessage.png);
}
.menu-messages-read {
background-image: url(../images/menu/icon-16-messages.png);
}
.menu-module {
background-image: url(../images/menu/icon-16-module.png);
}
Expand Down
4 changes: 0 additions & 4 deletions administrator/templates/hathor/less/template.less
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ p.nowarning, p.warning {
display: none;
}

#module-status .unread-messages a {
font-weight: bold;
}

.title-ua {
position: relative;
width: 60%;
Expand Down
50 changes: 0 additions & 50 deletions libraries/cms/application/administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,61 +338,11 @@ public function login($credentials, $options = array())
$lang = $this->input->getCmd('lang', 'en-GB');
$lang = preg_replace('/[^A-Z-]/i', '', $lang);
$this->setUserState('application.lang', $lang);

static::purgeMessages();
}

return $result;
}

/**
* Purge the jos_messages table of old messages
*
* @return void
*
* @since 3.2
*/
public static function purgeMessages()
{
$user = JFactory::getUser();
$userid = $user->get('id');

$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__messages_cfg'))
->where($db->quoteName('user_id') . ' = ' . (int) $userid, 'AND')
->where($db->quoteName('cfg_name') . ' = ' . $db->quote('auto_purge'), 'AND');
$db->setQuery($query);
$config = $db->loadObject();

// Check if auto_purge value set
if (is_object($config) and $config->cfg_name == 'auto_purge')
{
$purge = $config->cfg_value;
}
else
{
// If no value set, default is 7 days
$purge = 7;
}

// If purge value is not 0, then allow purging of old messages
if ($purge > 0)
{
// Purge old messages at day set in message configuration
$past = JFactory::getDate(time() - $purge * 86400);
$pastStamp = $past->toSql();

$query->clear()
->delete($db->quoteName('#__messages'))
->where($db->quoteName('date_time') . ' < ' . $db->Quote($pastStamp), 'AND')
->where($db->quoteName('user_id_to') . ' = ' . (int) $userid, 'AND');
$db->setQuery($query);
$db->execute();
}
}

/**
* Rendering is the process of pushing the document buffers into the template
* placeholders, retrieving data from the document and pushing it into
Expand Down
10 changes: 0 additions & 10 deletions libraries/joomla/linkedin/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ public function changeSettings($group_id, $show_logo = null, $digest_frequency =
$xml .= '<email-announcements-from-managers>' . $this->booleanToString($announcements) . '</email-announcements-from-managers>';
}

if (!is_null($allow_messages))
{
$xml .= '<allow-messages-from-members>' . $this->booleanToString($allow_messages) . '</allow-messages-from-members>';
}

if (!is_null($new_post))
{
$xml .= '<email-for-every-new-post>' . $this->booleanToString($new_post) . '</email-for-every-new-post>';
Expand Down Expand Up @@ -328,11 +323,6 @@ public function joinGroup($group_id, $show_logo = null, $digest_frequency = null
$xml .= '<email-announcements-from-managers>' . $this->booleanToString($announcements) . '</email-announcements-from-managers>';
}

if (!is_null($allow_messages))
{
$xml .= '<allow-messages-from-members>' . $this->booleanToString($allow_messages) . '</allow-messages-from-members>';
}

if (!is_null($new_post))
{
$xml .= '<email-for-every-new-post>' . $this->booleanToString($new_post) . '</email-for-every-new-post>';
Expand Down
12 changes: 0 additions & 12 deletions libraries/joomla/table/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,6 @@ public function delete($userId = null)
* Clean Up Related Data.
*/

$query->clear()
->delete($this->_db->quoteName('#__messages_cfg'))
->where($this->_db->quoteName('user_id') . ' = ' . (int) $this->$k);
$this->_db->setQuery($query);
$this->_db->execute();

$query->clear()
->delete($this->_db->quoteName('#__messages'))
->where($this->_db->quoteName('user_id_to') . ' = ' . (int) $this->$k);
$this->_db->setQuery($query);
$this->_db->execute();

$query->clear()
->delete($this->_db->quoteName('#__user_keys'))
->where($this->_db->quoteName('user_id') . ' = ' . $this->_db->quote($this->username));
Expand Down
1 change: 0 additions & 1 deletion tests/system/resetdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ INSERT INTO `jos_components` (`id`, `name`, `link`, `menuid`, `parent`, `admin_m
(23, 'Language Manager', '', 0, 0, '', 'Languages', 'com_languages', 0, '', 1, 'administrator=en-GB\nsite=en-GB', 1),
(24, 'Mass mail', '', 0, 0, '', 'Mass Mail', 'com_massmail', 0, '', 1, 'mailSubjectPrefix=\nmailBodySuffix=\n\n', 1),
(25, 'Menu Editor', '', 0, 0, '', 'Menu Editor', 'com_menus', 0, '', 1, '', 1),
(27, 'Messaging', '', 0, 0, '', 'Messages', 'com_messages', 0, '', 1, '', 1),
(28, 'Modules Manager', '', 0, 0, '', 'Modules', 'com_modules', 0, '', 1, '', 1),
(29, 'Plugin Manager', '', 0, 0, '', 'Plugins', 'com_plugins', 0, '', 1, '', 1),
(30, 'Template Manager', '', 0, 0, '', 'Templates', 'com_templates', 0, '', 1, '', 1),
Expand Down
3 changes: 0 additions & 3 deletions tests/system/suite/acl/acl0001Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ function testAclGroupCreation()

$this->assertTrue($this->isElementPresent("//ul[@id='menu-com-menus-menus']"), 'Menus should be visible');

$this->assertTrue($this->isElementPresent("//ul[@id='menu-com-messages']"), 'Messaging should be visible');

$this->assertTrue($this->isElementPresent("//a[@href='index.php?option=com_search']"), 'Search should be visible');

$this->assertTrue($this->isElementPresent("//a[@href='index.php?option=com_installer']"), 'Extensions should be visible');
Expand Down Expand Up @@ -66,7 +64,6 @@ function testAclGroupCreation()
$this->assertFalse($this->isElementPresent("//ul[@id='menu-com-users-users']"), 'Users menu should not be visible');
$this->assertFalse($this->isElementPresent("//ul[@id='menu-com-users-groups']"), 'Groups should not be visible');

$this->assertFalse($this->isElementPresent("//ul[@id='menu-com-messages']"), 'Messaging should not be visible');
$this->assertFalse($this->isElementPresent("//a[@href='index.php?option=com_search']"), 'Search should not be visible');

$this->assertFalse($this->isElementPresent("//a[contains(@href, 'option=com_installer')]"), 'Extensions should not be visible');
Expand Down
63 changes: 0 additions & 63 deletions tests/system/webdriver/Pages/Components/MessagingEditPage.php

This file was deleted.

3 changes: 0 additions & 3 deletions tests/system/webdriver/Pages/System/AdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ abstract class AdminPage
'Media Manager' => 'administrator/index.php?option=com_media',
'Components' => 'administrator/index.php#',
'Joomla! Update' => 'administrator/index.php?option=com_joomlaupdate',
'Messaging' => 'administrator/index.php?option=com_messages',
'New Private Message' => 'administrator/index.php?option=com_messages&task=message.add',
'Read Private Messages' => 'administrator/index.php?option=com_messages',
'Post-installation Messages' => 'administrator/index.php?option=com_postinstall',
'Search' => 'administrator/index.php?option=com_search',
'Smart Search' => 'administrator/index.php?option=com_finder',
Expand Down
1 change: 0 additions & 1 deletion tests/unit/stubs/database/jos_assets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'14','1','308','309','1','com_massmail','com_massmail','{}'
'15','1','310','311','1','com_media','com_media','{"core.admin":{"7":1},"core.manage":{"6":1},"core.create":{"3":1},"core.delete":{"5":1},"core.edit":[],"core.edit.state":[]}'
'16','1','312','313','1','com_menus','com_menus','{"core.admin":{"7":1},"core.manage":[],"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[]}'
'17','1','37','38','1','com_messages','com_messages','{"core.admin":{"7":1},"core.manage":{"7":1}}'
'18','1','316','317','1','com_modules','com_modules','{"core.admin":{"7":1},"core.manage":[],"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[]}'
'20','1','326','327','1','com_plugins','com_plugins','{"core.admin":{"7":1},"core.manage":[],"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[]}'
'22','1','330','331','1','com_search','com_search','{"core.admin":{"7":1},"core.manage":{"6":1}}'
Expand Down
1 change: 0 additions & 1 deletion tests/unit/stubs/database/jos_extensions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'12','com_login','component','com_login',,'1','1','1','1','{"name":"com_login","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_LOGIN_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0'
'13','com_media','component','com_media',,'1','1','0','1','{"name":"com_media","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_MEDIA_XML_DESCRIPTION","group":""}','{"upload_extensions":"bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,swf,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,SWF,TXT,XCF,XLS","upload_maxsize":"10","file_path":"images","image_path":"images","restrict_uploads":"1","allowed_media_usergroup":"3","check_mime":"1","image_extensions":"bmp,gif,jpg,png","ignore_extensions":"","upload_mime":"image\\/jpeg,image\\/gif,image\\/png,image\\/bmp,application\\/x-shockwave-flash,application\\/msword,application\\/excel,application\\/pdf,application\\/powerpoint,text\\/plain,application\\/x-zip","upload_mime_illegal":"text\\/html"}',,,'0','0000-00-00 00:00:00','0','0'
'14','com_menus','component','com_menus',,'1','1','1','1','{"name":"com_menus","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_MENUS_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0'
'15','com_messages','component','com_messages',,'1','1','1','1','{"name":"com_messages","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_MESSAGES_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0'
'16','com_modules','component','com_modules',,'1','1','1','1','{"name":"com_modules","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_MODULES_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0'
'18','com_plugins','component','com_plugins',,'1','1','1','1','{"name":"com_plugins","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_PLUGINS_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0'
'19','com_search','component','com_search',,'1','1','1','0','{"name":"com_search","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2014 Open Source Matters. All rights reserved.\\n\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_SEARCH_XML_DESCRIPTION","group":""}','{"enabled":"0","show_date":"1"}',,,'0','0000-00-00 00:00:00','0','0'
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/stubs/database/jos_menu.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'id','menutype','title','alias','note','path','link','type','published','parent_id','level','component_id','checked_out','checked_out_time','browserNav','access','img','template_style_id','params','lft','rgt','home','language','client_id'
'1',,'Menu_Item_Root','root',,,,,'1','0','0','0','0','0000-00-00 00:00:00','0','0',,'0',,'0','279','0','*','0'
'10','menu','com_messages','Messaging',,'Messaging','index.php?option=com_messages','component','0','1','1','15','0','0000-00-00 00:00:00','0','0','class:messages','0',,'29','34','0','*','1'
'11','menu','com_messages_add','New Private Message',,'Messaging/New Private Message','index.php?option=com_messages&task=message.add','component','0','10','2','15','0','0000-00-00 00:00:00','0','0','class:messages-add','0',,'30','31','0','*','1'
'12','menu','com_messages_read','Read Private Message',,'Messaging/Read Private Message','index.php?option=com_messages','component','0','10','2','15','0','0000-00-00 00:00:00','0','0','class:messages-read','0',,'32','33','0','*','1'
17','menu','com_search','Basic Search',,'Basic Search','index.php?option=com_search','component','0','1','1','19','0','0000-00-00 00:00:00','0','0','class:search','0',,'43','44','0','*','1'
'21','menu','com_finder','Smart Search',,'Smart Search','index.php?option=com_finder','component','0','1','1','27','0','0000-00-00 00:00:00','0','0','class:finder','0',,'41','42','0','*','1'
'22','menu','com_joomlaupdate','Joomla! Update',,'Joomla! Update','index.php?option=com_joomlaupdate','component','0','1','1','28','0','0000-00-00 00:00:00','0','0','class:joomlaupdate','0',,'41','42','0','*','1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<filename>en-GB.com_finder.ini</filename>
<filename>en-GB.com_mailto.ini</filename>
<filename>en-GB.com_media.ini</filename>
<filename>en-GB.com_messages.ini</filename>
<filename>en-GB.com_search.ini</filename>
<filename>en-GB.com_users.ini</filename>
<filename>en-GB.com_weblinks.ini</filename>
Expand Down
Loading

0 comments on commit 3c4c611

Please sign in to comment.