Skip to content

Commit 381a98c

Browse files
committed
V1.3 Quickstart Code Added
1 parent b2db9f1 commit 381a98c

7,621 files changed

Lines changed: 612481 additions & 92759 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

quickstart/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Documentation for Web designers: https://docs.joomla.org/Special:MyLanguage/Web_designers
6767

6868
Copyright:
69-
* Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
69+
* Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
7070
* Special Thanks: https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks
7171
* Distributed under the GNU General Public License version 2 or later
7272
* See Licenses details at https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses

quickstart/administrator/components/com_actionlogs/actionlogs.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
defined('_JEXEC') or die;
1111

12-
if (!JFactory::getUser()->authorise('core.admin'))
12+
use Joomla\CMS\Access\Exception\NotAllowed;
13+
use Joomla\CMS\Factory;
14+
use Joomla\CMS\Language\Text;
15+
use Joomla\CMS\MVC\Controller\BaseController;
16+
17+
if (!Factory::getUser()->authorise('core.admin'))
1318
{
14-
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
19+
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
1520
}
1621

17-
$controller = JControllerLegacy::getInstance('Actionlogs');
18-
$controller->execute(JFactory::getApplication()->input->get('task'));
22+
$controller = BaseController::getInstance('Actionlogs');
23+
$controller->execute(Factory::getApplication()->input->get('task'));
1924
$controller->redirect();

quickstart/administrator/components/com_actionlogs/actionlogs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>com_actionlogs</name>
44
<author>Joomla! Project</author>
55
<creationDate>May 2018</creationDate>
6-
<copyright>Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.</copyright>
6+
<copyright>Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.</copyright>
77
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
88
<authorEmail>admin@joomla.org</authorEmail>
99
<authorUrl>www.joomla.org</authorUrl>

quickstart/administrator/components/com_actionlogs/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL"
3030
description="COM_ACTIONLOGS_LOG_EXTENSIONS_DESC"
3131
multiple="true"
32-
default="com_banners,com_cache,com_categories,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_tags,com_templates,com_users"
32+
default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_tags,com_templates,com_users"
3333
/>
3434
</fieldset>
3535
</config>

quickstart/administrator/components/com_actionlogs/controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

quickstart/administrator/components/com_actionlogs/controllers/actionlogs.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
defined('_JEXEC') or die;
1111

1212
use Joomla\CMS\Component\ComponentHelper;
13+
use Joomla\CMS\Date\Date;
14+
use Joomla\CMS\Factory;
15+
use Joomla\CMS\Language\Text;
16+
use Joomla\CMS\Router\Route;
1317
use Joomla\Utilities\ArrayHelper;
1418

1519
JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php');
@@ -89,21 +93,21 @@ public function exportLogs()
8993
}
9094
catch (InvalidArgumentException $exception)
9195
{
92-
$this->setMessage(JText::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error');
93-
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false));
96+
$this->setMessage(Text::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error');
97+
$this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false));
9498

9599
return;
96100
}
97101

98102
// Destroy the iterator now
99103
unset($data);
100104

101-
$date = new JDate('now', new DateTimeZone('UTC'));
105+
$date = new Date('now', new DateTimeZone('UTC'));
102106
$filename = 'logs_' . $date->format('Y-m-d_His_T');
103107

104108
$csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ',');
105109

106-
$app = JFactory::getApplication();
110+
$app = Factory::getApplication();
107111
$app->setHeader('Content-Type', 'application/csv', true)
108112
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '.csv"', true)
109113
->setHeader('Cache-Control', 'must-revalidate', true)
@@ -122,8 +126,8 @@ public function exportLogs()
122126
}
123127
else
124128
{
125-
$this->setMessage(JText::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT'));
126-
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false));
129+
$this->setMessage(Text::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT'));
130+
$this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false));
127131
}
128132
}
129133

@@ -143,13 +147,13 @@ public function purge()
143147

144148
if ($model->purge())
145149
{
146-
$message = JText::_('COM_ACTIONLOGS_PURGE_SUCCESS');
150+
$message = Text::_('COM_ACTIONLOGS_PURGE_SUCCESS');
147151
}
148152
else
149153
{
150-
$message = JText::_('COM_ACTIONLOGS_PURGE_FAIL');
154+
$message = Text::_('COM_ACTIONLOGS_PURGE_FAIL');
151155
}
152156

153-
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false), $message);
157+
$this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false), $message);
154158
}
155159
}

quickstart/administrator/components/com_actionlogs/helpers/actionlogs.php

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
defined('_JEXEC') or die;
1111

12+
use Joomla\CMS\Date\Date;
13+
use Joomla\CMS\Factory;
1214
use Joomla\CMS\Filesystem\Path;
15+
use Joomla\CMS\Language\Text;
16+
use Joomla\CMS\Router\Route;
1317
use Joomla\String\StringHelper;
1418

1519
/**
@@ -57,7 +61,7 @@ public static function getCsvData($data)
5761

5862
foreach ($data as $log)
5963
{
60-
$date = new JDate($log->log_date, new DateTimeZone('UTC'));
64+
$date = new Date($log->log_date, new DateTimeZone('UTC'));
6165
$extension = strtok($log->extension, '.');
6266

6367
static::loadTranslationFiles($extension);
@@ -66,9 +70,9 @@ public static function getCsvData($data)
6670
'id' => $log->id,
6771
'message' => strip_tags(static::getHumanReadableLogMessage($log, false)),
6872
'date' => $date->format('Y-m-d H:i:s T'),
69-
'extension' => JText::_($extension),
73+
'extension' => Text::_($extension),
7074
'name' => $log->name,
71-
'ip_address' => JText::_($log->ip_address),
75+
'ip_address' => Text::_($log->ip_address),
7276
);
7377
}
7478

@@ -94,7 +98,8 @@ public static function loadTranslationFiles($extension)
9498
return;
9599
}
96100

97-
$lang = JFactory::getLanguage();
101+
$lang = Factory::getLanguage();
102+
$source = '';
98103

99104
switch (substr($extension, 0, 3))
100105
{
@@ -113,7 +118,15 @@ public static function loadTranslationFiles($extension)
113118

114119
case 'plg':
115120
$parts = explode('_', $extension, 3);
116-
$source = JPATH_PLUGINS . '/' . $parts[1] . '/' . $parts[2];
121+
122+
if (count($parts) > 2)
123+
{
124+
$source = JPATH_PLUGINS . '/' . $parts[1] . '/' . $parts[2];
125+
}
126+
break;
127+
128+
case 'pkg':
129+
$source = JPATH_SITE;
117130
break;
118131

119132
case 'tpl':
@@ -145,7 +158,7 @@ public static function loadTranslationFiles($extension)
145158
*/
146159
public static function getLogContentTypeParams($context)
147160
{
148-
$db = JFactory::getDbo();
161+
$db = Factory::getDbo();
149162
$query = $db->getQuery(true)
150163
->select('a.*')
151164
->from($db->quoteName('#__action_log_config', 'a'))
@@ -170,17 +183,17 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
170183
{
171184
static $links = array();
172185

173-
$message = JText::_($log->message_language_key);
186+
$message = Text::_($log->message_language_key);
174187
$messageData = json_decode($log->message, true);
175188

176189
// Special handling for translation extension name
177190
if (isset($messageData['extension_name']))
178191
{
179192
static::loadTranslationFiles($messageData['extension_name']);
180-
$messageData['extension_name'] = JText::_($messageData['extension_name']);
193+
$messageData['extension_name'] = Text::_($messageData['extension_name']);
181194
}
182195

183-
$linkMode = JFactory::getApplication()->get('force_ssl', 0) >= 1 ? 1 : -1;
196+
$linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? 1 : -1;
184197

185198
foreach ($messageData as $key => $value)
186199
{
@@ -189,13 +202,13 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
189202
{
190203
if (!isset($links[$value]))
191204
{
192-
$links[$value] = JRoute::link('administrator', $value, false, $linkMode);
205+
$links[$value] = Route::link('administrator', $value, false, $linkMode);
193206
}
194207

195208
$value = $links[$value];
196209
}
197210

198-
$message = str_replace('{' . $key . '}', JText::_($value), $message);
211+
$message = str_replace('{' . $key . '}', Text::_($value), $message);
199212
}
200213

201214
return $message;
@@ -252,8 +265,8 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar
252265
*/
253266
public static function loadActionLogPluginsLanguage()
254267
{
255-
$lang = JFactory::getLanguage();
256-
$db = JFactory::getDbo();
268+
$lang = Factory::getLanguage();
269+
$db = Factory::getDbo();
257270

258271
// Get all (both enabled and disabled) actionlog plugins
259272
$query = $db->getQuery(true)

quickstart/administrator/components/com_actionlogs/helpers/actionlogsphp55.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
defined('_JEXEC') or die;
1111

12+
use Joomla\CMS\Date\Date;
13+
use Joomla\CMS\Language\Text;
14+
1215
/**
1316
* Actionlogs component helper for newer PHP versions.
1417
*
@@ -55,10 +58,10 @@ public static function getCsvAsGenerator($data)
5558
yield array(
5659
'id' => $log->id,
5760
'message' => strip_tags(ActionlogsHelper::getHumanReadableLogMessage($log, false)),
58-
'date' => (new JDate($log->log_date, new DateTimeZone('UTC')))->format('Y-m-d H:i:s T'),
59-
'extension' => JText::_($extension),
61+
'date' => (new Date($log->log_date, new DateTimeZone('UTC')))->format('Y-m-d H:i:s T'),
62+
'extension' => Text::_($extension),
6063
'name' => $log->name,
61-
'ip_address' => JText::_($log->ip_address),
64+
'ip_address' => Text::_($log->ip_address),
6265
);
6366
}
6467
}

quickstart/administrator/components/com_actionlogs/layouts/logstable.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,46 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
defined('_JEXEC') or die;
1111

12-
JFactory::getLanguage()->load("com_actionlogs", JPATH_ADMINISTRATOR, null, false, true);
12+
use Joomla\CMS\Factory;
13+
use Joomla\CMS\HTML\HTMLHelper;
14+
use Joomla\CMS\Language\Text;
15+
16+
Factory::getLanguage()->load("com_actionlogs", JPATH_ADMINISTRATOR, null, false, true);
1317

1418
$messages = $displayData['messages'];
1519
$showIpColumn = $displayData['showIpColumn'];
1620
?>
1721
<h1>
18-
<?php echo JText::_('COM_ACTIONLOGS_EMAIL_SUBJECT'); ?>
22+
<?php echo Text::_('COM_ACTIONLOGS_EMAIL_SUBJECT'); ?>
1923
</h1>
2024
<h2>
21-
<?php echo JText::_('COM_ACTIONLOGS_EMAIL_DESC'); ?>
25+
<?php echo Text::_('COM_ACTIONLOGS_EMAIL_DESC'); ?>
2226
</h2>
2327
<table>
2428
<thead>
25-
<th><?php echo JText::_('COM_ACTIONLOGS_ACTION'); ?></th>
26-
<th><?php echo JText::_('COM_ACTIONLOGS_DATE'); ?></th>
27-
<th><?php echo JText::_('COM_ACTIONLOGS_EXTENSION'); ?></th>
28-
<th><?php echo JText::_('COM_ACTIONLOGS_NAME'); ?></th>
29+
<th><?php echo Text::_('COM_ACTIONLOGS_ACTION'); ?></th>
30+
<th><?php echo Text::_('COM_ACTIONLOGS_DATE'); ?></th>
31+
<th><?php echo Text::_('COM_ACTIONLOGS_EXTENSION'); ?></th>
32+
<th><?php echo Text::_('COM_ACTIONLOGS_NAME'); ?></th>
2933
<?php if ($showIpColumn) : ?>
30-
<th><?php echo JText::_('COM_ACTIONLOGS_IP_ADDRESS'); ?></th>
34+
<th><?php echo Text::_('COM_ACTIONLOGS_IP_ADDRESS'); ?></th>
3135
<?php endif; ?>
3236
</thead>
3337
<tbody>
3438
<?php foreach ($messages as $message) : ?>
3539
<tr>
3640
<td><?php echo $message->message; ?></td>
37-
<td><?php echo JHtml::_('date', $message->log_date, 'Y-m-d H:i:s T', 'UTC'); ?></td>
41+
<td><?php echo HTMLHelper::_('date', $message->log_date, 'Y-m-d H:i:s T', 'UTC'); ?></td>
3842
<td><?php echo $message->extension; ?></td>
3943
<td><?php echo $displayData['username']; ?></td>
4044
<?php if ($showIpColumn) : ?>
41-
<td><?php echo JText::_($message->ip_address); ?></td>
45+
<td><?php echo Text::_($message->ip_address); ?></td>
4246
<?php endif; ?>
4347
</tr>
4448
<?php endforeach; ?>

quickstart/administrator/components/com_actionlogs/libraries/actionlogplugin.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
* @package Joomla.Administrator
44
* @subpackage com_actionlogs
55
*
6-
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6+
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
77
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99
defined('_JEXEC') or die;
1010

11-
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_actionlogs/models', 'ActionlogsModel');
11+
use Joomla\CMS\Factory;
12+
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
13+
14+
BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_actionlogs/models', 'ActionlogsModel');
1215

1316
/**
1417
* Abstract Action Log Plugin
@@ -57,7 +60,7 @@ abstract class ActionLogPlugin extends JPlugin
5760
*/
5861
protected function addLog($messages, $messageLanguageKey, $context, $userId = null)
5962
{
60-
$user = JFactory::getUser();
63+
$user = Factory::getUser();
6164

6265
foreach ($messages as $index => $message)
6366
{
@@ -90,7 +93,7 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu
9093
}
9194

9295
/** @var ActionlogsModelActionlog $model **/
93-
$model = JModelLegacy::getInstance('Actionlog', 'ActionlogsModel');
96+
$model = BaseDatabaseModel::getInstance('Actionlog', 'ActionlogsModel');
9497
$model->addLog($messages, strtoupper($messageLanguageKey), $context, $userId);
9598
}
9699
}

0 commit comments

Comments
 (0)