77 */
88// No direct access to this file
99defined ('_JEXEC ' ) or die;
10+ use Joomla \CMS \MVC \Controller \AdminController ;
11+ use Joomla \CMS \Table \Table ;
12+ use Joomla \CMS \Factory ;
13+ use Joomla \CMS \Language \Text ;
14+ use Joomla \CMS \Log \Log ;
15+ use Joomla \CMS \Router \Route ;
1016use Joomla \Utilities \ArrayHelper ;
1117
1218/**
1319 * Activity Stream Controller
1420 *
1521 * @since 0.0.1
1622 */
17- class ActivityStreamControllerActivities extends JControllerAdmin
23+ class ActivityStreamControllerActivities extends AdminController
1824{
1925 /**
2026 * Proxy for getModel.
@@ -44,7 +50,7 @@ public function getModel($name = 'Activity', $prefix = 'ActivityStreamModel', $c
4450 public function getActivities ()
4551 {
4652 // Load component tables
47- JTable ::addIncludePath (JPATH_ADMINISTRATOR . '/components/com_activitystream/tables ' );
53+ Table ::addIncludePath (JPATH_ADMINISTRATOR . '/components/com_activitystream/tables ' );
4854
4955 // Variable to store activity data fetched
5056 $ result = array ();
@@ -54,14 +60,14 @@ public function getActivities()
5460
5561 $ ActivityStreamModelActivities = $ this ->getModel ('Activities ' );
5662
57- $ jinput = JFactory ::getApplication ()->input ;
63+ $ jinput = Factory ::getApplication ()->input ;
5864 $ type = $ jinput ->get ("type " , '' , 'STRING ' );
5965
6066 // Return result related to specified activity type
6167 if (empty ($ type ))
6268 {
6369 $ result_arr ['success ' ] = false ;
64- $ result_arr ['message ' ] = JText ::_ ("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE " );
70+ $ result_arr ['message ' ] = Text ::_ ("COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE " );
6571
6672 echo json_encode ($ result_arr );
6773
@@ -90,7 +96,7 @@ public function getActivities()
9096 if (empty ($ result ['results ' ]))
9197 {
9298 $ result_arr ['success ' ] = false ;
93- $ result_arr ['message ' ] = JText ::_ ("COM_ACTIVITYSTREAM_NO_ACTIVITY " );
99+ $ result_arr ['message ' ] = Text ::_ ("COM_ACTIVITYSTREAM_NO_ACTIVITY " );
94100 }
95101 else
96102 {
@@ -113,13 +119,13 @@ public function getActivities()
113119 */
114120 public function delete ()
115121 {
116- $ input = JFactory ::getApplication ()->input ;
122+ $ input = Factory ::getApplication ()->input ;
117123 $ client = $ input ->get ('client ' , '' , 'STRING ' );
118- $ id = JFactory ::getApplication ()->input ->get ('cid ' , array (), 'array ' );
124+ $ id = Factory ::getApplication ()->input ->get ('cid ' , array (), 'array ' );
119125
120126 if (!is_array ($ id ) || count ($ id ) < 1 )
121127 {
122- JLog ::add (JText ::_ ($ this ->text_prefix . '_NO_ITEM_SELECTED ' ), JLog ::WARNING , 'jerror ' );
128+ Log ::add (Text ::_ ($ this ->text_prefix . '_NO_ITEM_SELECTED ' ), Log ::WARNING , 'jerror ' );
123129 }
124130 else
125131 {
@@ -133,7 +139,7 @@ public function delete()
133139 // Remove the activity.
134140 if ($ model ->delete ($ id ))
135141 {
136- $ this ->setMessage (JText ::plural ($ this ->text_prefix . '_N_ITEMS_DELETED ' , count ($ id )));
142+ $ this ->setMessage (Text ::plural ($ this ->text_prefix . '_N_ITEMS_DELETED ' , count ($ id )));
137143 }
138144 else
139145 {
@@ -142,11 +148,11 @@ public function delete()
142148
143149 if (isset ($ client ))
144150 {
145- $ this ->setRedirect (JRoute ::_ ('index.php?option=com_activitystream&view=activities&client= ' . $ client , false ));
151+ $ this ->setRedirect (Route ::_ ('index.php?option=com_activitystream&view=activities&client= ' . $ client , false ));
146152 }
147153 else
148154 {
149- $ this ->setRedirect (JRoute ::_ ('index.php?option=com_activitystream&view=activities ' , false ));
155+ $ this ->setRedirect (Route ::_ ('index.php?option=com_activitystream&view=activities ' , false ));
150156 }
151157 }
152158 }
0 commit comments