Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pe7er committed May 29, 2019
1 parent 313dcdc commit ac4d027
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 53 deletions.
10 changes: 5 additions & 5 deletions components/com_users/Model/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
use Joomla\Database\ParameterType;

/**
* This models retrieves some data of a user.
* This models retrieves some data of a User.
*
* @since 4.0
* @since __deploy_version__
*/
class UserModel extends ItemModel
{
/**
* Load the Author data.
* Load the User data.
*
* @param integer $id ID of Author
* @param integer $id ID of User
*
* @return object The product information.
* @throws Exception
* @since 1.0.0
* @since __deploy_version__
*/
public function getItem($id = null)
{
Expand Down
36 changes: 9 additions & 27 deletions components/com_users/Model/UsersModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,25 @@
/**
* This models supports retrieving a list of users.
*
* @since 4.0
* @since __deploy_version__
*/
class UsersModel extends ListModel
{
/**
* User items data
*
* @var array
* @since 4.0
* @var array
* @since __deploy_version__
*/
protected $item = null;

/**
* The category that applies.
*
* @var object
* @access protected
* @since 4.0
*/
protected $category = null;

/**
* The list of other contact categories.
*
* @var array
* @access protected
* @since 4.0
*/
protected $categories = null;

/**
* Constructor
*
* @param array $config An optional associative array of configuration settings.
*
* @throws Exception
* @since 4.0
* @throws Exception
* @since __deploy_version__
*/
public function __construct($config = array())
{
Expand All @@ -81,7 +63,7 @@ public function __construct($config = array())
* Method to get a list of items.
*
* @return mixed An array of objects on success, false on failure.
* @since 4.0
* @since __deploy_version__
*/
public function getItems()
{
Expand All @@ -95,8 +77,8 @@ public function getItems()
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
* @throws Exception
* @since 4.0
* @throws Exception
* @since __deploy_version__
*/
protected function getListQuery()
{
Expand Down Expand Up @@ -176,7 +158,7 @@ protected function getListQuery()
*
* @return void
* @throws Exception
* @since 1.6
* @since __deploy_version__
*/
protected function populateState($ordering = null, $direction = null)
{
Expand Down
14 changes: 6 additions & 8 deletions components/com_users/View/User/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
/**
* View class for Single User
*
* @since 4.0
* @since __deploy_version__
*/
class HtmlView extends BaseHtmlView
{
/**
* The Author data
* The User data
*
* @var object
* @since 1.0.0
* @since __deploy_version__
*/
protected $item;

/**
* The model state
*
* @var Joomla\Registry\Registry
* @since 1.0.0
* @since __deploy_version__
*/
protected $state;

Expand All @@ -44,11 +44,9 @@ class HtmlView extends BaseHtmlView
*
* @param string $tpl The template file to include
*
* @return mixed
*
* @return void
* @throws Exception
*
* @since 1.0.0
* @since __deploy_version__
*/
public function display($tpl = null)
{
Expand Down
14 changes: 7 additions & 7 deletions components/com_users/View/Users/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@
/**
* View class for Users
*
* @since 4.0
* @since __deploy_version__
*/
class HtmlView extends BaseHtmlView
{
/**
* An array of items
*
* @var array
* @since 4.0
* @since __deploy_version__
*/
protected $items;

/**
* The pagination object
*
* @var JPagination
* @since 4.0
* @since __deploy_version__
*/
protected $pagination;

/**
* The model state
*
* @var object
* @since 4.0
* @since __deploy_version__
*/
protected $state;

/**
* The page parameters
*
* @var Registry|null
* @since 4.0.0
* @since __deploy_version__
*/
protected $params = null;

Expand All @@ -61,7 +61,7 @@ class HtmlView extends BaseHtmlView
*
* @return void
* @throws Exception
* @since 1.0.0
* @since __deploy_version__
*/
public function display($tpl = null)
{
Expand All @@ -75,7 +75,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors));
throw new Exception(implode("\n", $errors), 500);
}

parent::display($tpl);
Expand Down
7 changes: 1 addition & 6 deletions components/com_users/tmpl/users/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="COM_USERS_TAB">
<field
name="layout_type"
type="hidden"
default="blog"
/>

<field
name="groups"
type="usergrouplist"
label="COM_USERS_PARAMS_SELECT_GROUPS"
required="true"
multiple="true"
class="2do"
/>

<field
Expand Down

0 comments on commit ac4d027

Please sign in to comment.