Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into pr/4643
Browse files Browse the repository at this point in the history
  • Loading branch information
javigomez committed Oct 16, 2014
2 parents f1d3767 + 0d13914 commit dd3fd00
Show file tree
Hide file tree
Showing 626 changed files with 4,773 additions and 27,330 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ php:

before_script:
- composer self-update
- pyrus install -f pear/PHP_CodeSniffer-1.5.4
- pyrus install -f pear/PHP_CodeSniffer-1.5.5
- phpenv rehash
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/suites/database/stubs/mysql.sql
- mysql joomla_ut < tests/unit/schema/mysql.sql
- psql -c 'create database joomla_ut;' -U postgres
- psql -d joomla_ut -a -f tests/unit/suites/database/stubs/postgresql.sql
- psql -d joomla_ut -a -f tests/unit/schema/postgresql.sql

script:
- phpunit --configuration travisci-phpunit.xml
Expand Down
8 changes: 7 additions & 1 deletion administrator/components/com_admin/views/help/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class AdminViewHelp extends JViewLegacy
protected $start_here = null;

/**
* Display the view
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
Expand All @@ -64,6 +68,8 @@ public function display($tpl = null)
/**
* Setup the Toolbar
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class AdminViewProfile extends JViewLegacy
protected $state;

/**
* Display the view
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
Expand All @@ -35,6 +39,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));

return false;
}

Expand All @@ -48,6 +53,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class AdminViewSysinfo extends JViewLegacy
protected $directory = null;

/**
* Display the view
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
Expand Down Expand Up @@ -87,6 +91,8 @@ protected function _setSubMenu()
/**
* Setup the Toolbar
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_cache/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class CacheController extends JControllerLegacy
{
/**
* Method to display a view.
* Display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
Expand Down Expand Up @@ -65,7 +65,7 @@ public function display($cachable = false, $urlparams = false)
}

/**
* Purge an array of cache groups.
* Method to delete a list of cache groups.
*
* @return void
*/
Expand Down
24 changes: 12 additions & 12 deletions administrator/components/com_cache/models/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class CacheModelCache extends JModelList
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
* @param string $ordering Field for ordering.
* @param string $direction Direction of ordering.
*
* @return void
*
Expand Down Expand Up @@ -79,14 +79,14 @@ public function getData()

if ($this->_total)
{
// Apply custom ordering
// Apply custom ordering.
$ordering = $this->getState('list.ordering');
$direction = ($this->getState('list.direction') == 'asc') ? 1 : -1;
$direction = ($this->getState('list.direction') == 'asc') ? 1 : (-1);

jimport('joomla.utilities.arrayhelper');
$this->_data = JArrayHelper::sortObjects($data, $ordering, $direction);

// Apply custom pagination
// Apply custom pagination.
if ($this->_total > $this->getState('list.limit') && $this->getState('list.limit'))
{
$this->_data = array_slice($this->_data, $this->getState('list.start'), $this->getState('list.limit'));
Expand All @@ -103,7 +103,7 @@ public function getData()
}

/**
* Method to get cache instance
* Method to get cache instance.
*
* @return object
*/
Expand All @@ -124,7 +124,7 @@ public function getCache()
}

/**
* Method to get client data
* Method to get client data.
*
* @return array
*/
Expand All @@ -134,7 +134,7 @@ public function getClient()
}

/**
* Get the number of current Cache Groups
* Get the number of current Cache Groups.
*
* @return int
*/
Expand All @@ -149,7 +149,7 @@ public function getTotal()
}

/**
* Method to get a pagination object for the cache
* Method to get a pagination object for the cache.
*
* @return integer
*/
Expand Down Expand Up @@ -178,7 +178,7 @@ public function clean($group = '')
}

/**
* Clean a list of cache groups.
* Purge an array of cache groups.
*
* @param array $array Array of cache group names.
*
Expand All @@ -193,9 +193,9 @@ public function cleanlist($array)
}

/**
* Purge the cache.
* Purge all cache items.
*
* @return boolean True on success, false otherwise.
* @return boolean True if successful; false otherwise.
*/
public function purge()
{
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_cache/views/cache/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class CacheViewCache extends JViewLegacy
protected $state;

/**
* Display the view
* Display a view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
Expand Down Expand Up @@ -75,7 +75,7 @@ protected function addToolbar()
JHtmlSidebar::setAction('index.php?option=com_cache');

JHtmlSidebar::addFilter(
// @todo We need an actual label here
// @todo We need an actual label here.
'',
'filter_client_id',
JHtml::_('select.options', CacheHelper::getClientOptions(), 'value', 'text', $this->state->get('clientId'))
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_cache/views/purge/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
class CacheViewPurge extends JViewLegacy
{
/**
* Display the view
* Display a view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (document.formvalidator.isValid(document.id('component-form')))
if (task == 'config.cancel.component' || document.formvalidator.isValid(document.id('component-form')))
{
Joomla.submitform(task, document.getElementById('component-form'));
}
Expand Down
12 changes: 7 additions & 5 deletions administrator/components/com_contact/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/**
* Component Controller
*
* @since 1.5
*/
class ContactController extends JControllerLegacy
{
Expand All @@ -24,23 +25,24 @@ class ContactController extends JControllerLegacy
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT.'/helpers/contact.php';
require_once JPATH_COMPONENT . '/helpers/contact.php';

$view = $this->input->get('view', 'contacts');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');

// Check for edit form.
if ($view == 'contact' && $layout == 'edit' && !$this->checkEditId('com_contact.edit.contact', $id)) {

if ($view == 'contact' && $layout == 'edit' && !$this->checkEditId('com_contact.edit.contact', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function batch($model = null)
* @param array $validData The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
Expand Down
16 changes: 9 additions & 7 deletions administrator/components/com_contact/controllers/contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
defined('_JEXEC') or die;

/**
* Articles list controller class.
* Contacts list controller class.
*
* @since 1.6
*/
Expand All @@ -19,9 +19,8 @@ class ContactControllerContacts extends JControllerAdmin
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param array $config An optional associative array of configuration settings.
*
* @return ContactControllerContacts
* @see JController
* @since 1.6
*/
Expand All @@ -36,6 +35,7 @@ public function __construct($config = array())
* Method to toggle the featured setting of a list of contacts.
*
* @return void
*
* @since 1.6
*/
public function featured()
Expand All @@ -56,7 +56,8 @@ public function featured()
foreach ($ids as $i => $id)
{
$item = $model->getItem($id);
if (!$user->authorise('core.edit.state', 'com_contact.category.'.(int) $item->catid))

if (!$user->authorise('core.edit.state', 'com_contact.category.' . (int) $item->catid))
{
// Prune items that you can't change.
unset($ids[$i]);
Expand All @@ -83,10 +84,12 @@ public function featured()
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the PHP class name.
* @param string $name The name of the model.
* @param string $prefix The prefix for the PHP class name.
* @param array $config Array of configuration parameters.
*
* @return JModel
*
* @since 1.6
*/
public function getModel($name = 'Contact', $prefix = 'ContactModel', $config = array('ignore_request' => true))
Expand All @@ -110,5 +113,4 @@ public function getModel($name = 'Contact', $prefix = 'ContactModel', $config =
protected function postDeleteHook(JModelLegacy $model, $ids = null)
{
}

}
1 change: 0 additions & 1 deletion administrator/components/com_contact/helpers/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public static function addSubmenu($vName)
$vName == 'categories'
);
}

}

0 comments on commit dd3fd00

Please sign in to comment.