Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 0 additions & 115 deletions src/administrator/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,6 @@
<config>
<fieldset label="COM_SUBUSERS" name="subusers">

<!-- Added to set category for easysocial group -->
<field
name="escategory" type="sql"
component="com_subusers"
label="JCONFIG_ESGROUP_CATEGORY_LABEL"
query="select id,title from #__social_clusters_categories where type='group'"
key_field="id" value_field="title"
section="component" />

<field
name="guest_usergroup"
type="usergrouplist"
default="1"
label="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL"
description="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC">
</field>

<field
name="announementcategory" type="sql"
component="com_subusers"
label="COM_SUBUSERS_CATEGORY_LABEL"
query="select id,title from #__categories"
key_field="id" value_field="title"
section="component" />


<field type="spacer" name="myspacer" hr="true" />

<field
name="max_logo_size" type="text"
label="COM_SUBUSERS_MAX_LOGO_SIZE_LBL"
description="COM_SUBUSERS_MAX_LOGO_SIZE_DESC"
default="1" class="validate-numeric" filter="int" >
</field>

<field
name="allowed_logo_types" type="FileMultiple"
label="COM_SUBUSERS_MAX_LOGO_TYPE_LBL"
description="COM_SUBUSERS_MAX_LOGO_TYPE_DESC"
default=".png" >
</field>
</fieldset>

<fieldset
Expand All @@ -57,77 +16,3 @@
section="component" />
</fieldset>
</config>
<!--
########################################################################################
The following are a list of all the different types of fields you can add to this file
They are here for copy pasting - neat eh?
########################################################################################

http://docs.joomla.org/Calendar_parameter_type
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />

http://docs.joomla.org/Category_parameter_type
<field name="mycategory" type="category" label="Select a category" description="" section="3" />

http://docs.joomla.org/Editors_parameter_type
<field name="myeditor" type="editors" default="none" label="Select an editor" />

http://docs.joomla.org/Filelist_parameter_type
<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />

http://docs.joomla.org/Folderlist_parameter_type
<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />

http://docs.joomla.org/Helpsites_parameter_type
<field name="myhelpsite" type="helpsites" default="" label="Select a help site" description="" />

http://docs.joomla.org/Hidden_parameter_type
<field name="mysecretvariable" type="hidden" default="" />

http://docs.joomla.org/Imagelist_parameter_type
<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />

http://docs.joomla.org/Languages_parameter_type
<field name="mylanguage" type="languages" client="site" default="en-GB" label="Select a language" description="" />

http://docs.joomla.org/List_parameter_type
<field name="mylistvalue" type="list" default="" label="Select an option" description="">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
</field>

http://docs.joomla.org/Menu_parameter_type
<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />

http://docs.joomla.org/Menuitem_parameter_type
<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />

http://docs.joomla.org/Password_parameter_type
<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />

http://docs.joomla.org/Radio_parameter_type
<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
<option value="0">1</option>
<option value="1">2</option>
</field>

http://docs.joomla.org/Spacer_parameter_type
<field type="spacer" default="&lt;b&gt;Advanced parameters&lt;/b&gt;" />

http://docs.joomla.org/Sql_parameter_type
<field name="myfield" type="sql" default="10" label="Select an article" query="SELECT id, title FROM #__content" key_field=”id” value_field=”title” />

http://docs.joomla.org/Text_parameter_type
<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />

http://docs.joomla.org/Textarea_parameter_type
<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />

http://docs.joomla.org/Timezones_parameter_type
<field name="mytimezone" type="timezones" default="-10" label="Select a timezone" description="" />

http://docs.joomla.org/Usergroup_parameter_type
<field name="myusergroups" type="usergroup" default="" label="Select a user group" description="" />


-->
26 changes: 15 additions & 11 deletions src/administrator/controller.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?php

/**
* @version CVS: 1.0.0
* @package Com_Subusers
* @author Techjoomla <contact@techjoomla.com>
* @copyright Copyright (C) 2015. All rights reserved.
* @package Subusers
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2018 Techjoomla. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;

\JLoader::import("/components/com_subusers/includes/rbacl", JPATH_ADMINISTRATOR);

/**
* Class SubusersController
*
* @since 1.6
* @since 1.0.0
*/
class SubusersController extends JControllerLegacy
class SubusersController extends BaseController
{
/**
* Method to display a view.
Expand All @@ -25,14 +29,14 @@ class SubusersController extends JControllerLegacy
*
* @return JController This object to support chaining.
*
* @since 1.5
* @since 1.0.0
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/subusers.php';

$view = JFactory::getApplication()->input->getCmd('view', 'organizations');
JFactory::getApplication()->input->set('view', $view);
$view = Factory::getApplication()->input->getCmd('view', 'roles');
Factory::getApplication()->input->set('view', $view);

parent::display($cachable, $urlparams);

Expand Down
24 changes: 7 additions & 17 deletions src/administrator/controllers/action.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<?php
/**
* @version CVS: 1.0.0
* @package Com_Subusers
* @author Techjoomla <contact@techjoomla.com>
* @copyright Copyright (C) 2015. All rights reserved.
* @package Subusers
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2018 Techjoomla. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controllerform');
use Joomla\CMS\MVC\Controller\FormController;

/**
* Action controller class.
*
* @since 1.6
* @since 1.0.0
*/
class SubusersControllerAction extends JControllerForm
class SubusersControllerAction extends FormController
{
/**
* Constructor
*
* @throws Exception
*/
public function __construct()
{
$this->view_list = 'actions';
parent::__construct();
}
}
94 changes: 11 additions & 83 deletions src/administrator/controllers/actions.php
Original file line number Diff line number Diff line change
@@ -1,107 +1,35 @@
<?php
/**
* @version CVS: 1.0.0
* @package Com_Subusers
* @author Techjoomla <contact@techjoomla.com>
* @copyright Copyright (C) 2015. All rights reserved.
* @package Subusers
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2018 Techjoomla. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die();

// No direct access.
defined('_JEXEC') or die;

jimport('joomla.application.component.controlleradmin');

use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\MVC\Controller\AdminController;

/**
* Actions list controller class.
*
* @since 1.6
* @since 1.0.0
*/
class SubusersControllerActions extends JControllerAdmin
class SubusersControllerActions extends AdminController
{
/**
* Method to clone existing Actions
*
* @return void
*/
public function duplicate()
{
// Check for request forgeries
Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

// Get id(s)
$pks = $this->input->post->get('cid', array(), 'array');

try
{
if (empty($pks))
{
throw new Exception(JText::_('COM_SUBUSERS_NO_ELEMENT_SELECTED'));
}

ArrayHelper::toInteger($pks);
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(Jtext::_('COM_SUBUSERS_ITEMS_SUCCESS_DUPLICATED'));
}
catch (Exception $e)
{
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
}

$this->setRedirect('index.php?option=com_subusers&view=actions');
}

/**
* Proxy for getModel.
*
* @param string $name Optional. Model name
* @param string $prefix Optional. Class prefix
* @param array $config Optional. Configuration array for model
*
* @return object The Model
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel|boolean Model object on success; otherwise false on failure.
*
* @since 1.6
* @since 1.0.0
*/
public function getModel($name = 'action', $prefix = 'SubusersModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));

return $model;
}

/**
* Method to save the submitted ordering values for records via AJAX.
*
* @return void
*
* @since 3.0
*/
public function saveOrderAjax()
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
$order = $input->post->get('order', array(), 'array');

// Sanitize the input
ArrayHelper::toInteger($pks);
ArrayHelper::toInteger($order);

// Get the model
$model = $this->getModel();

// Save the ordering
$return = $model->saveorder($pks, $order);

if ($return)
{
echo "1";
}

// Close the application
JFactory::getApplication()->close();
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
}
1 change: 0 additions & 1 deletion src/administrator/controllers/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/**
* @package Subusers
* @subpackage com_subusers
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Expand Down
2 changes: 1 addition & 1 deletion src/administrator/controllers/mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @version CVS: 1.0.0
* @package Com_Subusers
* @author Techjoomla <contact@techjoomla.com>
* @copyright Copyright (C) 2015. All rights reserved.
* @copyright Copyright (c) 2009-2017 TechJoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down
2 changes: 1 addition & 1 deletion src/administrator/controllers/mappings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @version CVS: 1.0.0
* @package Com_Subusers
* @author Techjoomla <contact@techjoomla.com>
* @copyright Copyright (C) 2015. All rights reserved.
* @copyright Copyright (c) 2009-2017 TechJoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down
32 changes: 0 additions & 32 deletions src/administrator/controllers/organization.php

This file was deleted.

Loading