diff --git a/plugins/api/tjactivity/tjactivity.xml b/plugins/api/tjactivity/tjactivity.xml index 5fbfd3e..294c667 100755 --- a/plugins/api/tjactivity/tjactivity.xml +++ b/plugins/api/tjactivity/tjactivity.xml @@ -1,12 +1,12 @@ com_api_tjactivity - 1.0.3 - 22nd Jul 2021 + 2.0.0 + 25th Jan 2022 Techjoomla extensions@techjoomla.com https://techjoomla.com - Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. + Copyright (C) 2016 - 2022 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL PLG_API_TJACTIVITY_DESCRIPTION diff --git a/src/activitystream.xml b/src/activitystream.xml index 52aeef1..2ee3a04 100755 --- a/src/activitystream.xml +++ b/src/activitystream.xml @@ -1,13 +1,13 @@ com_activitystream - 22nd Jul 2021 + 25th Jan 2022 Techjoomla extensions@techjoomla.com https://techjoomla.com - Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. + Copyright (C) 2016 - 2022 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 1.0.3 + 2.0.0 COM_ACTIVITYSTREAM_DESCRIPTION script.activitystream.php diff --git a/src/admin/activitystream.php b/src/admin/activitystream.php index e9fdda1..d3477e7 100755 --- a/src/admin/activitystream.php +++ b/src/admin/activitystream.php @@ -9,12 +9,14 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Factory; // Get an instance of the controller prefixed by HelloWorld -$controller = JControllerLegacy::getInstance('activitystream'); +$controller = BaseController::getInstance('activitystream'); // Perform the Request task -$input = JFactory::getApplication()->input; +$input = Factory::getApplication()->input; $controller->execute($input->getCmd('task')); // Redirect if set by the controller diff --git a/src/admin/controller.php b/src/admin/controller.php index ff48d36..76cf6f2 100755 --- a/src/admin/controller.php +++ b/src/admin/controller.php @@ -9,6 +9,7 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\BaseController; /** * General Controller of ActivityStream component @@ -17,7 +18,7 @@ * @subpackage com_activitystream * @since 0.0.7 */ -class ActivityStreamController extends JControllerLegacy +class ActivityStreamController extends BaseController { /** * The default view for the display method. diff --git a/src/admin/controllers/activities.php b/src/admin/controllers/activities.php index 8a5224e..eab9510 100755 --- a/src/admin/controllers/activities.php +++ b/src/admin/controllers/activities.php @@ -7,6 +7,12 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\AdminController; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Log\Log; +use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; /** @@ -14,7 +20,7 @@ * * @since 0.0.1 */ -class ActivityStreamControllerActivities extends JControllerAdmin +class ActivityStreamControllerActivities extends AdminController { /** * Proxy for getModel. @@ -44,7 +50,7 @@ public function getModel($name = 'Activity', $prefix = 'ActivityStreamModel', $c public function getActivities() { // Load component tables - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables'); + Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables'); // Variable to store activity data fetched $result = array(); @@ -54,14 +60,14 @@ public function getActivities() $ActivityStreamModelActivities = $this->getModel('Activities'); - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $type = $jinput->get("type", '', 'STRING'); // Return result related to specified activity type if (empty($type)) { $result_arr['success'] = false; - $result_arr['message'] = JText::_("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE"); + $result_arr['message'] = Text::_("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE"); echo json_encode($result_arr); @@ -90,7 +96,7 @@ public function getActivities() if (empty($result['results'])) { $result_arr['success'] = false; - $result_arr['message'] = JText::_("COM_ACTIVITYSTREAM_NO_ACTIVITY"); + $result_arr['message'] = Text::_("COM_ACTIVITYSTREAM_NO_ACTIVITY"); } else { @@ -113,13 +119,13 @@ public function getActivities() */ public function delete() { - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $client = $input->get('client', '', 'STRING'); - $id = JFactory::getApplication()->input->get('cid', array(), 'array'); + $id = Factory::getApplication()->input->get('cid', array(), 'array'); if (!is_array($id) || count($id) < 1) { - JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror'); + Log::add(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), Log::WARNING, 'jerror'); } else { @@ -133,7 +139,7 @@ public function delete() // Remove the activity. if ($model->delete($id)) { - $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($id))); + $this->setMessage(Text::plural($this->text_prefix . '_N_ITEMS_DELETED', count($id))); } else { @@ -142,11 +148,11 @@ public function delete() if (isset($client)) { - $this->setRedirect(JRoute::_('index.php?option=com_activitystream&view=activities&client=' . $client, false)); + $this->setRedirect(Route::_('index.php?option=com_activitystream&view=activities&client=' . $client, false)); } else { - $this->setRedirect(JRoute::_('index.php?option=com_activitystream&view=activities', false)); + $this->setRedirect(Route::_('index.php?option=com_activitystream&view=activities', false)); } } } diff --git a/src/admin/controllers/activity.php b/src/admin/controllers/activity.php index 7a1717a..eb17311 100755 --- a/src/admin/controllers/activity.php +++ b/src/admin/controllers/activity.php @@ -8,6 +8,7 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\FormController; /** * HelloWorld Controller @@ -16,6 +17,6 @@ * @subpackage com_activitystream * @since 0.0.9 */ -class ActivityStreamControllerActivity extends JControllerForm +class ActivityStreamControllerActivity extends FormController { } diff --git a/src/admin/helpers/activities.php b/src/admin/helpers/activities.php index 92f728d..2f54bb9 100755 --- a/src/admin/helpers/activities.php +++ b/src/admin/helpers/activities.php @@ -9,6 +9,7 @@ // No direct access defined('_JEXEC') or die(); +use Joomla\CMS\Factory; /** * Products helper for quick2cart backend. @@ -87,7 +88,7 @@ public function json_to_array($array, $recursive = true) */ public function buildActivityFilterQuery($filterString) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Check if $filterString is comma separated string. if ((strpos($filterString, ',') !== false)) diff --git a/src/admin/models/activities.php b/src/admin/models/activities.php index cad4fcf..3b7092b 100755 --- a/src/admin/models/activities.php +++ b/src/admin/models/activities.php @@ -7,13 +7,16 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Model\ListModel; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; /** * ActivityStreamList Model * * @since 0.0.1 */ -class ActivityStreamModelActivities extends JModelList +class ActivityStreamModelActivities extends ListModel { /** * Constructor. @@ -60,7 +63,7 @@ public function __construct($config = array()) protected function populateState($ordering = 'id', $direction = 'desc') { // Initialise variables. - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // Client filter $extension = $jinput->get("client", '', 'STRING'); @@ -94,7 +97,7 @@ protected function populateState($ordering = 'id', $direction = 'desc') protected function getListQuery() { // Initialize variables. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); // Create the base select statement. @@ -184,8 +187,8 @@ public function getItems() foreach ($items as $k => $item) { // Get date in local time zone - $item->created_date = JHtml::date($item->created_date, 'Y-m-d h:i:s'); - $item->updated_date = JHtml::date($item->updated_date, 'Y-m-d h:i:s'); + $item->created_date = HTMLHelper::date($item->created_date, 'Y-m-d h:i:s'); + $item->updated_date = HTMLHelper::date($item->updated_date, 'Y-m-d h:i:s'); // Get extra date info $items[$k]->created_day = date_format(date_create($item->created_date), "D"); diff --git a/src/admin/models/activity.php b/src/admin/models/activity.php index b971659..5b5d48b 100755 --- a/src/admin/models/activity.php +++ b/src/admin/models/activity.php @@ -8,13 +8,16 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; /** * ActivityStream Model * * @since 0.0.1 */ -class ActivityStreamModelActivity extends JModelAdmin +class ActivityStreamModelActivity extends AdminModel { /** * Method to get a table object, load it if necessary. @@ -29,7 +32,7 @@ class ActivityStreamModelActivity extends JModelAdmin */ public function getTable($type = 'activity', $prefix = 'ActivityStreamTable', $config = array()) { - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); } /** @@ -72,7 +75,7 @@ public function getForm($data = array(), $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState( + $data = Factory::getApplication()->getUserState( 'com_activitystream.edit.activity.data', array() ); @@ -96,7 +99,7 @@ protected function loadFormData() */ public function save($data) { - $cdate = JFactory::getDate('now'); + $cdate = Factory::getDate('now'); if (empty($data['id'])) { diff --git a/src/admin/models/fields/activitytype.php b/src/admin/models/fields/activitytype.php index 03286c7..e2e94bf 100644 --- a/src/admin/models/fields/activitytype.php +++ b/src/admin/models/fields/activitytype.php @@ -9,6 +9,10 @@ // No direct access. defined('_JEXEC') or die(); +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper; JFormHelper::loadFieldClass('list'); @@ -44,8 +48,8 @@ class JFormFieldActivityType extends JFormFieldList */ protected function getOptions() { - $db = JFactory::getDbo(); - $client = JFactory::getApplication()->input->get('client', '', 'STRING'); + $db = Factory::getDbo(); + $client = Factory::getApplication()->input->get('client', '', 'STRING'); $query = $db->getQuery(true); $query->select('distinct l.type') @@ -57,14 +61,14 @@ protected function getOptions() // Send filter values $activityType = $db->loadObjectList(); $options = array(); - $options[] = JHtml::_('select.option', 'all', JText::_('COM_ACTIVITYSTREAM_SEARCH_FILTER')); + $options[] = HTMLHelper::_('select.option', 'all', Text::_('COM_ACTIVITYSTREAM_SEARCH_FILTER')); foreach ($activityType as $type) { $temp = implode("_", explode('.', $type->type)); $filterValue = $client . '_activity_type_' . $temp; $filterText = strtoupper($filterValue); - $options[] = JHtml::_('select.option', $type->type, JText::_($filterText)); + $options[] = HTMLHelper::_('select.option', $type->type, Text::_($filterText)); } return $options; diff --git a/src/admin/tables/activity.php b/src/admin/tables/activity.php index 136730f..b1470d0 100755 --- a/src/admin/tables/activity.php +++ b/src/admin/tables/activity.php @@ -8,13 +8,16 @@ */ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; /** * Hello Table class * * @since 0.0.1 */ -class ActivityStreamTableActivity extends JTable +class ActivityStreamTableActivity extends Table { /** * Constructor @@ -34,26 +37,26 @@ public function __construct(&$db) */ public function check() { - $jinput = JFactory::getApplication()->input; - $db = JFactory::getDbo(); + $jinput = Factory::getApplication()->input; + $db = Factory::getDbo(); $errors = array(); // Activity type should not be empty if (empty($this->type)) { - $errors['type'] = JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_TYPE_REQUIRED'); + $errors['type'] = Text::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_TYPE_REQUIRED'); } // Actor and actor_id should not be empty if (empty($this->actor_id) || empty($this->actor)) { - $errors['actor'] = JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_ACTOR_REQUIRED'); + $errors['actor'] = Text::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_ACTOR_REQUIRED'); } // Object and object_id should not be empty if (empty($this->object_id) || empty($this->object)) { - $errors['object'] = JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_OBJECT_REQUIRED'); + $errors['object'] = Text::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_OBJECT_REQUIRED'); } // If there is data in target then target_id should not be empty @@ -61,7 +64,7 @@ public function check() { if (empty($this->target_id)) { - $errors['target_id'] = JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_TARGET_REQUIRED'); + $errors['target_id'] = Text::_('COM_ACTIVITYSTREAM_ACTIVITY_ERROR_TARGET_REQUIRED'); } } diff --git a/src/admin/views/activities/tmpl/default.php b/src/admin/views/activities/tmpl/default.php index af0ae04..f5120c7 100755 --- a/src/admin/views/activities/tmpl/default.php +++ b/src/admin/views/activities/tmpl/default.php @@ -8,17 +8,21 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Language\Text; -JHtml::_('formbehavior.chosen', 'select'); +HTMLHelper::_('formbehavior.chosen', 'select'); $sortFields = $this->getSortFields(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> -
+
$this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
@@ -28,22 +32,22 @@ + title="" onclick="Joomla.checkAll(this)"/> - + - + - + - + - + @@ -59,14 +63,14 @@ items) && empty($this->items['error'])) : ?> items as $i => $row) : - $link = JRoute::_('index.php?option=com_activitystream&task=activity.edit&id=' . $row->id); + $link = Route::_('index.php?option=com_activitystream&task=activity.edit&id=' . $row->id); ?> - id); ?> + id); ?> - state, $i, 'activities.', true, 'cb'); ?> + state, $i, 'activities.', true, 'cb'); ?> type; ?> @@ -78,7 +82,7 @@ updated_date; ?> - + id; ?> @@ -101,6 +105,6 @@ - +
diff --git a/src/admin/views/activities/view.html.php b/src/admin/views/activities/view.html.php index d637741..f5a9ad7 100755 --- a/src/admin/views/activities/view.html.php +++ b/src/admin/views/activities/view.html.php @@ -8,13 +8,16 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; /** * ActivityStream View * * @since 0.0.1 */ -class ActivityStreamViewActivities extends JViewLegacy +class ActivityStreamViewActivities extends HtmlView { protected $input; @@ -31,7 +34,7 @@ public function display($tpl = null) // To show all types of activity in list view $activitiesModel = $this->getModel(); $activitiesModel->setState("type", 'all'); - $this->input = JFactory::getApplication()->input; + $this->input = Factory::getApplication()->input; $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); @@ -62,9 +65,9 @@ public function display($tpl = null) */ protected function addToolBar() { - $title = JText::_('Activity Stream'); - $languageFile = JFactory::getLanguage(); - $extension = JFactory::getApplication()->input->get('client', '', 'STRING'); + $title = Text::_('Activity Stream'); + $languageFile = Factory::getLanguage(); + $extension = Factory::getApplication()->input->get('client', '', 'STRING'); $base_dir = JPATH_BASE; // Load the language file for particular extension @@ -95,11 +98,11 @@ protected function addToolBar() protected function getSortFields() { return array( - 'id' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ID'), - 'state' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_STATE'), - 'type' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_TYPE'), - 'created_date' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_CREATED_DATE'), - 'updated_date' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_UPDATED_DATE') + 'id' => Text::_('COM_ACTIVITYSTREAM_ACTIVITY_ID'), + 'state' => Text::_('COM_ACTIVITYSTREAM_ACTIVITY_STATE'), + 'type' => Text::_('COM_ACTIVITYSTREAM_ACTIVITY_TYPE'), + 'created_date' => Text::_('COM_ACTIVITYSTREAM_ACTIVITY_CREATED_DATE'), + 'updated_date' => Text::_('COM_ACTIVITYSTREAM_ACTIVITY_UPDATED_DATE') ); } } diff --git a/src/admin/views/activity/tmpl/edit.php b/src/admin/views/activity/tmpl/edit.php index f96c2c6..e7d89e1 100755 --- a/src/admin/views/activity/tmpl/edit.php +++ b/src/admin/views/activity/tmpl/edit.php @@ -9,14 +9,17 @@ // No direct access defined('_JEXEC') or die; -JHtml::_('behavior.formvalidator'); +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Language\Text; +HTMLHelper::_('behavior.formvalidator'); ?> -
- +
form->getFieldset() as $field): ?> @@ -30,5 +33,5 @@
- + diff --git a/src/admin/views/activity/view.html.php b/src/admin/views/activity/view.html.php index 01cabaa..578dcc1 100755 --- a/src/admin/views/activity/view.html.php +++ b/src/admin/views/activity/view.html.php @@ -9,13 +9,16 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; /** * Activity Stream View * * @since 0.0.1 */ -class ActivityStreamViewActivity extends JViewLegacy +class ActivityStreamViewActivity extends HtmlView { /** * View form @@ -65,7 +68,7 @@ public function display($tpl = null) */ protected function addToolBar() { - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; // Hide com_activitystream Main menu $input->set('hidemainmenu', true); @@ -74,11 +77,11 @@ protected function addToolBar() if ($isNew) { - $title = JText::_('New'); + $title = Text::_('New'); } else { - $title = JText::_('Edit'); + $title = Text::_('Edit'); } JToolBarHelper::title($title, 'Activity'); diff --git a/src/plugins/privacy/activitystream/activitystream.php b/src/plugins/privacy/activitystream/activitystream.php index cd70749..cc4ece6 100644 --- a/src/plugins/privacy/activitystream/activitystream.php +++ b/src/plugins/privacy/activitystream/activitystream.php @@ -10,9 +10,11 @@ // No direct access. defined('_JEXEC') or die(); -jimport('joomla.application.component.model'); +use Joomla\CMS\User\User; +use Joomla\CMS\Table\User as UserTable; use Joomla\CMS\Factory; + JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/plugin.php'); JLoader::register('PrivacyRemovalStatus', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/removal/status.php'); @@ -54,7 +56,7 @@ class PlgPrivacyActivitystream extends PrivacyPlugin * * @since 1.0.0 */ - public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user = null) + public function onPrivacyExportRequest(PrivacyTableRequest $request, User $user = null) { if (!$user) { @@ -62,7 +64,7 @@ public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user } /** @var JTableUser $userTable */ - $userTable = JUser::getTable(); + $userTable = UserTable::getTable(); $userTable->load($user->id); $domains = array(); @@ -82,7 +84,7 @@ public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user * * @since 1.0.0 */ - private function createActivityStreamDomain(JTableUser $user) + private function createActivityStreamDomain(UserTable $user) { $domain = $this->createDomain('ActivityStream', 'ActivityStream data'); $db = Factory::getDbo(); @@ -117,7 +119,7 @@ private function createActivityStreamDomain(JTableUser $user) * * @since 1.0.0 */ - public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user = null) + public function onPrivacyCanRemoveData(PrivacyTableRequest $request, User $user = null) { $status = new PrivacyRemovalStatus; @@ -141,7 +143,7 @@ public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user * * @since 1.0.0 */ - public function onPrivacyRemoveData(PrivacyTableRequest $request, JUser $user = null) + public function onPrivacyRemoveData(PrivacyTableRequest $request, User $user = null) { // This plugin only processes data for registered user accounts if (!$user) diff --git a/src/plugins/privacy/activitystream/activitystream.xml b/src/plugins/privacy/activitystream/activitystream.xml index a17e895..89c9bc4 100644 --- a/src/plugins/privacy/activitystream/activitystream.xml +++ b/src/plugins/privacy/activitystream/activitystream.xml @@ -1,12 +1,12 @@ plg_privacy_activitystream - 1.0.3 - 22nd Jul 2021 + 2.0.0 + 25th Jan 2022 Techjoomla extensions@techjoomla.com https://techjoomla.com - Copyright (C) 2016 - 2021 Techjoomla. All rights reserved. + Copyright (C) 2016 - 2022 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL PLG_PRIVACY_ACTIVITYSTREAM_XML_DESCRIPTION diff --git a/src/script.activitystream.php b/src/script.activitystream.php index c5c2e58..4c48871 100644 --- a/src/script.activitystream.php +++ b/src/script.activitystream.php @@ -9,6 +9,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Installer\Installer; +use Joomla\Data\DataObject; +use Joomla\CMS\Language\Text; /** * Script file of activitystream component @@ -51,8 +56,8 @@ public function install($parent) public function uninstall($parent) { jimport('joomla.installer.installer'); - $db = JFactory::getDbo(); - $status = new JObject; + $db = Factory::getDbo(); + $status = new CMSObject; $status->plugins = array(); // Plugins uninstallation @@ -75,7 +80,7 @@ public function uninstall($parent) if ($id) { - $installer = new JInstaller; + $installer = new Installer; $result = $installer->uninstall('plugin', $id); $status->plugins[] = array( 'name' => 'plg_' . $plugin, @@ -126,8 +131,8 @@ public function preflight($type, $parent) public function postflight($type, $parent) { $src = $parent->getParent()->getPath('source'); - $db = JFactory::getDbo(); - $status = new JObject; + $db = Factory::getDbo(); + $status = new CMSObject; $status->plugins = array(); // Plugins installation @@ -170,7 +175,7 @@ public function postflight($type, $parent) $db->setQuery($query); $count = $db->loadResult(); - $installer = new JInstaller; + $installer = new Installer; $result = $installer->install($path); $status->plugins[] = array('name' => 'plg_' . $plugin, 'group' => $folder, 'result' => $result); @@ -205,7 +210,7 @@ public function postflight($type, $parent) */ public function installSqlFiles($parent) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); // Obviously you may have to change the path and name if your installation SQL file ;) if (method_exists($parent, 'extension_root')) @@ -222,8 +227,7 @@ public function installSqlFiles($parent) if ($buffer !== false) { - jimport('joomla.installer.helper'); - $queries = JInstallerHelper::splitSql($buffer); + $queries = \JDatabaseDriver::splitSql($buffer); if (count($queries) != 0) { @@ -235,9 +239,9 @@ public function installSqlFiles($parent) { $db->setQuery($query); - if (!$db->query()) + if (!$db->execute()) { - JError::raiseWarning(1, JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true))); + JError::raiseWarning(1, Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true))); return false; } diff --git a/src/site/activitystream.php b/src/site/activitystream.php index d759a4d..62ff569 100644 --- a/src/site/activitystream.php +++ b/src/site/activitystream.php @@ -8,6 +8,8 @@ */ defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; // Include dependancies jimport('joomla.application.component.controller'); @@ -15,10 +17,10 @@ JLoader::registerPrefix('Activitystream', JPATH_COMPONENT); JLoader::register('ActivitystreamController', JPATH_COMPONENT . '/controller.php'); -$lang = JFactory::getLanguage(); +$lang = Factory::getLanguage(); $lang->load('com_activitystream', JPATH_SITE); // Execute the task. -$controller = JControllerLegacy::getInstance('Activitystream'); -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller = BaseController::getInstance('Activitystream'); +$controller->execute(Factory::getApplication()->input->get('task')); $controller->redirect(); diff --git a/src/site/controller.php b/src/site/controller.php index cd832d1..29dee84 100644 --- a/src/site/controller.php +++ b/src/site/controller.php @@ -9,6 +9,8 @@ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Factory; jimport('joomla.application.component.controller'); @@ -17,7 +19,7 @@ * * @since 1.6 */ -class ActivitystreamController extends JControllerLegacy +class ActivitystreamController extends BaseController { /** * Method to display a view. @@ -31,7 +33,7 @@ class ActivitystreamController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $view = $app->input->getCmd('view', 'items'); $app->input->set('view', $view); diff --git a/src/site/controllers/activities.php b/src/site/controllers/activities.php index e20da02..d11bc2f 100755 --- a/src/site/controllers/activities.php +++ b/src/site/controllers/activities.php @@ -8,13 +8,17 @@ */ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Controller\AdminController; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; /** * HelloWorlds Controller * * @since 0.0.1 */ -class ActivityStreamControllerActivities extends JControllerAdmin +class ActivityStreamControllerActivities extends AdminController { /** * Proxy for getModel. @@ -44,7 +48,7 @@ public function getModel($name = 'Activity', $prefix = 'ActivityStreamModel', $c public function getActivities() { // Load component tables - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables'); + Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables'); // Variable to store activity data fetched $result = array(); @@ -54,14 +58,14 @@ public function getActivities() $ActivityStreamModelActivities = $this->getModel('Activities'); - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $type = $jinput->get("type", '', 'STRING'); // Return result related to specified activity type if (empty($type)) { $result_arr['success'] = false; - $result_arr['message'] = JText::_("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE"); + $result_arr['message'] = Text::_("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE"); echo json_encode($result_arr); @@ -94,7 +98,7 @@ public function getActivities() if (empty($result['results'])) { $result_arr['success'] = false; - $result_arr['message'] = JText::_("COM_ACTIVITYSTREAM_NO_ACTIVITY"); + $result_arr['message'] = Text::_("COM_ACTIVITYSTREAM_NO_ACTIVITY"); } else { diff --git a/src/site/helper.php b/src/site/helper.php index 8a9d027..d13ba0c 100644 --- a/src/site/helper.php +++ b/src/site/helper.php @@ -9,6 +9,7 @@ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; /** * Class ActivitystreamHelper @@ -26,7 +27,7 @@ class ComActivityStreamHelper */ public function getLanguageConstantForJs() { - JText::script('COM_ACTIVITYSTREAM_POST_TEXT_ACTIVITY_REMAINING_TEXT_LIMIT'); - JText::script('COM_ACTIVITYSTREAM_LOAD_MORE_ACTIVITIES'); + Text::script('COM_ACTIVITYSTREAM_POST_TEXT_ACTIVITY_REMAINING_TEXT_LIMIT'); + Text::script('COM_ACTIVITYSTREAM_LOAD_MORE_ACTIVITIES'); } } diff --git a/src/site/models/activities.php b/src/site/models/activities.php index 80790cc..26a5156 100755 --- a/src/site/models/activities.php +++ b/src/site/models/activities.php @@ -9,11 +9,11 @@ // No direct access to this file defined('_JEXEC') or die; -use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Language\Text; /** * ActivityStreamList Model @@ -192,7 +192,7 @@ public function getItems() // Get date in local time zone $item->created_date = HTMLHelper::date($item->created_date, 'Y-m-d h:i:s'); $item->updated_date = HTMLHelper::date($item->updated_date, 'Y-m-d h:i:s'); - $item->root = Uri::root(); + $item->root = Uri::root(); // Get extra date info $items[$k]->created_day = Factory::getDate($item->created_date)->Format(Text::_('COM_ACTIVITYSTREAM_CREATED_DAY'), false, true); diff --git a/src/site/models/activity.php b/src/site/models/activity.php index a11dd55..1c899ad 100755 --- a/src/site/models/activity.php +++ b/src/site/models/activity.php @@ -9,13 +9,16 @@ // No direct access to this file defined('_JEXEC') or die; +use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Factory; /** * ActivityStream Model * * @since 0.0.1 */ -class ActivityStreamModelActivity extends JModelAdmin +class ActivityStreamModelActivity extends AdminModel { /** * Method to get a table object, load it if necessary. @@ -30,7 +33,7 @@ class ActivityStreamModelActivity extends JModelAdmin */ public function getTable($type = 'activity', $prefix = 'ActivityStreamTable', $config = array()) { - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); } /** @@ -73,7 +76,7 @@ public function getForm($data = array(), $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState( + $data = Factory::getApplication()->getUserState( 'com_activitystream.edit.activity.data', array() ); @@ -97,7 +100,7 @@ protected function loadFormData() */ public function save($data) { - $cdate = JFactory::getDate('now'); + $cdate = Factory::getDate('now'); if (empty($data['id']) && empty($data['created_date'])) { diff --git a/src/site/router.php b/src/site/router.php index 675146f..7ae0c31 100644 --- a/src/site/router.php +++ b/src/site/router.php @@ -9,6 +9,7 @@ // No direct access defined('_JEXEC') or die; +use Joomla\CMS\Component\Router\RouterBase; JLoader::registerPrefix('Activitystream', JPATH_SITE . '/components/com_activitystream/'); @@ -17,7 +18,7 @@ * * @since 3.3 */ -class ActivitystreamRouter extends JComponentRouterBase +class ActivitystreamRouter extends RouterBase { /** * Build method for URLs