Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/staging' into SqlOptimise_cate…
Browse files Browse the repository at this point in the history
…goryEdit_optionsBranch2
  • Loading branch information
nadeeshaan committed Aug 11, 2014
2 parents 4d4b192 + 4aa4872 commit cc83491
Show file tree
Hide file tree
Showing 575 changed files with 7,319 additions and 4,257 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6

before_script:
- composer self-update
- pyrus channel-discover pear.phpunit.de
- pyrus channel-discover pear.symfony.com
- pyrus install --force phpunit/DbUnit
- phpenv rehash
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/suites/database/stubs/mysql.sql
- psql -c 'create database joomla_ut;' -U postgres
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ All contributions are welcome to be submitted for review for inclusion in the Jo
3) After submitting the item to the Joomlacode tracker, add a link to the Joomlacode tracker item and the GitHub issue or pull request.

Please be patient as not all items will be tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code.

#### Branches
Pull Requests should usually be made for the `staging` branch as this contains the most recent version of the code.
There are other branches available which serve specific purposes.

| Branch | Purpose |
| ------ | ------- |
| staging | Current codebase. |
| master | Each commit made to staging gets tested if it passes unit tests and codestyle rules and then merged into master. This is done automatically. |
| 2.5.x | Branch for the Joomla 2.5.x series. Currently in maintenance mode with EOL end of 2014. No new features are accepted here. |
| 3.2.x | Branch for the Joomla 3.2.x series. Currently in security mode with EOL Oct 2014. Only security issues are fixed. |
| 3.4-dev | Branch for the next minor Joomla version. New backward compatible features go into this branch. Commits to staging will be applied to this branch as well. |
4 changes: 1 addition & 3 deletions administrator/components/com_admin/models/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getForm($data = array(), $loadData = true)
}

// Check for username compliance and parameter set
$usernameCompliant = true;
$isUsernameCompliant = true;

if ($this->loadFormData()->username)
{
Expand Down Expand Up @@ -128,8 +128,6 @@ public function save($data)
unset($data['sendEmail']);
unset($data['block']);

// Unset the username if it should not be overwritten
$username = $data['username'];
$isUsernameCompliant = $this->getState('user.username.compliant');

if (!JComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
function admin_postinstall_eaccelerator_condition()
{
$app = JFactory::getApplication();
$cacheHandler = $app->getCfg('cacheHandler', '');
$cacheHandler = $app->get('cacheHandler', '');

return (ucfirst($cacheHandler) == 'Eaccelerator');
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ protected function clearRadCache()
/**
* Method to create assets for newly installed components
*
* @return void
* @return boolean
*
* @since 3.2
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `#__user_profiles` CHANGE `profile_value` `profile_value` TEXT NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "#__user_profiles" ALTER COLUMN "profile_value" TYPE TEXT;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET IDENTITY_INSERT [#__extensions] ON;

INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 451, 'plg_search_tags', 'plugin', 'tags', 'search', 0, 0, 1, 0, '', '{"search_limit":"50","show_tagged_items":"1"}', '', '', 0, '0000-00-00 00:00:00', 0, 0;
SELECT 451, 'plg_search_tags', 'plugin', 'tags', 'search', 0, 0, 1, 0, '', '{"search_limit":"50","show_tagged_items":"1"}', '', '', 0, '1900-01-01 00:00:00', 0, 0;

SET IDENTITY_INSERT #__extensions OFF;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE [#__user_profiles] ALTER COLUMN [profile_value] [nvarchar](max) NOT NULL;
10 changes: 0 additions & 10 deletions administrator/components/com_admin/views/help/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
<form action="<?php echo JRoute::_('index.php?option=com_admin&amp;view=help'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row-fluid">
<div id="sidebar" class="span3">
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search input-append">
<label for="helpsearch" class="element-invisible"><?php echo JText::_('COM_ADMIN_SEARCH'); ?></label>
<input type="text" name="helpsearch" id="helpsearch" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->help_search); ?>" class="input-small hasTooltip" title="<?php echo JHtml::tooltipText('COM_ADMIN_SEARCH'); ?>" />
<button type="submit" class="btn hasTooltip" title="<?php JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>">
<i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()">
<i class="icon-remove"></i></button>
</div>
</div>
<div class="clearfix"></div>
<div class="sidebar-nav">
<ul class="nav nav-list">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function _setSubMenu()
*/
protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info systeminfo');
JToolbarHelper::title(JText::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info-2 systeminfo');
JToolbarHelper::help('JHELP_SITE_SYSTEM_INFORMATION');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public function display($cachable = false, $urlparams = false)
$model->setState('list.limit', 0);
$model->setState('list.start', 0);

$form = JRequest::getVar('jform');
$input = JFactory::getApplication()->input;
$form = $input->get('jform', array(), 'array');

$model->setState('basename', $form['basename']);
$model->setState('compressed', $form['compressed']);

Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_banners/helpers/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public static function getClientOptions()
$query = $db->getQuery(true)
->select('id As value, name As text')
->from('#__banner_clients AS a')
->where('a.state = 1')
->order('a.name');

// Get the options.
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/models/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function getListQuery()
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(a.name LIKE ' . $search . ' OR a.alias LIKE ' . $search . ')');
}
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/models/clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected function getListQuery()
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('a.name LIKE ' . $search);
}
}
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_banners/models/tracks.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function getBaseName()
{
$app = JFactory::getApplication();
$basename = $this->getState('basename');
$basename = str_replace('__SITE__', $app->getCfg('sitename'), $basename);
$basename = str_replace('__SITE__', $app->get('sitename'), $basename);
$categoryId = $this->getState('filter.category_id');

if (is_numeric($categoryId))
Expand Down Expand Up @@ -502,12 +502,12 @@ public function getContent()
$files['track']['name'] = $this->getBasename() . '.csv';
$files['track']['data'] = $this->content;
$files['track']['time'] = time();
$ziproot = $app->getCfg('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip';
$ziproot = $app->get('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip';

// Run the packager
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$delete = JFolder::files($app->getCfg('tmp_path') . '/', uniqid('banners_tracks_'), false, true);
$delete = JFolder::files($app->get('tmp_path') . '/', uniqid('banners_tracks_'), false, true);

if (!empty($delete))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class="form-validate">
<?php echo $field->input; ?>
<?php endforeach; ?>
<div class="clr"></div>
<button type="button" class="btn" onclick="this.form.submit();window.top.setTimeout('window.parent.SqueezeBox.close()', 700);"><?php echo JText::_('COM_BANNERS_TRACKS_EXPORT'); ?></button>
<button type="button" class="btn" onclick="window.parent.SqueezeBox.close();"><?php echo JText::_('COM_BANNERS_CANCEL'); ?></button>
<button type="button" class="btn" onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.closeModalDialog()', 700);"><?php echo JText::_('COM_BANNERS_TRACKS_EXPORT'); ?></button>
<button type="button" class="btn" onclick="window.parent.Joomla.closeModalDialog();"><?php echo JText::_('COM_BANNERS_CANCEL'); ?></button>

</fieldset>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
JHtml::_('behavior.modal', 'a.modal');
JHtml::_('formbehavior.chosen', 'select');

$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$sortFields = $this->getSortFields();
?>
<script type="text/javascript">
Expand All @@ -36,6 +36,11 @@
}
Joomla.tableOrdering(order, dirn, '');
}

Joomla.closeModalDialog = function()
{
window.jQuery('#modal-download').modal('hide');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_banners&view=tracks'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-sidebar-container" class="span2">
Expand Down
11 changes: 7 additions & 4 deletions administrator/components/com_banners/views/tracks/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class BannersViewTracks extends JViewLegacy
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand All @@ -48,8 +48,11 @@ public function display($tpl = null)
BannersHelper::addSubmenu('tracks');

$this->addToolbar();

require_once JPATH_COMPONENT . '/models/fields/bannerclient.php';

$this->sidebar = JHtmlSidebar::render();

parent::display($tpl);
}

Expand All @@ -69,7 +72,7 @@ protected function addToolbar()
JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks');

$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'export', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&amp;view=download&amp;tmpl=component', 600, 300);
$bar->appendButton('Popup', 'download', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&amp;view=download&amp;tmpl=component', 600, 300);

if ($canDo->get('core.delete'))
{
Expand Down
6 changes: 5 additions & 1 deletion administrator/components/com_categories/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

$input = JFactory::getApplication()->input;

if (!JFactory::getUser()->authorise('core.manage', $input->get('extension')))
//If you have a url like this: com_categories&view=categories&extension=com_example.example_cat
$parts = explode('.', $input->get('extension'));
$component = $parts[0];

if (!JFactory::getUser()->authorise('core.manage', $component))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected function getListQuery()
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ' OR a.note LIKE ' . $search . ')');
}
}
Expand Down
8 changes: 2 additions & 6 deletions administrator/components/com_categories/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function getItem($pk = null)
$result->metadata = $registry->toArray();

// Convert the created and modified dates to local user time for display in the form.
$tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset'));
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));

if ((int) $result->created_time)
{
Expand Down Expand Up @@ -394,10 +394,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
if ($assoc)
{
$languages = JLanguageHelper::getLanguages('lang_code');

// Force to array (perhaps move to $this->loadFormData())
$data = (array) $data;

$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name', 'associations');
Expand All @@ -407,7 +403,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
$add = false;
foreach ($languages as $tag => $language)
{
if (empty($data['language']) || $tag != $data['language'])
if (empty($data->language) || $tag != $data->language)
{
$add = true;
$field = $fieldset->addChild('field');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function getOptions()
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage);
JError::raiseWarning(500, $e->getMessage());
}

// Pad the option text with spaces using depth level as a multiplier.
Expand Down Expand Up @@ -161,7 +161,7 @@ protected function getOptions()
// To take save or create in a category you need to have create rights for that category
// unless the item is already in that category.
// Unset the option if the user isn't authorised for it. In this field assets are always categories.
if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true)
if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true && $option->level != 0)
{
unset($options[$i]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</thead>
<tfoot>
<tr>
<td colspan="15">
<td colspan="<?php echo ($this->assoc) ? '8' : '7'; ?>">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
Expand Down
14 changes: 10 additions & 4 deletions administrator/components/com_checkin/models/checkin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function checkin($ids = array())
foreach ($ids as $tn)
{
// make sure we get the right tables based on prefix
if (stripos($tn, $app->getCfg('dbprefix')) !== 0)
if (stripos($tn, $app->get('dbprefix')) !== 0)
{
continue;
}
Expand Down Expand Up @@ -122,8 +122,8 @@ public function getItems()
{
if (!isset($this->items))
{
$app = JFactory::getApplication();
$db = $this->_db;
$app = JFactory::getApplication();
$db = $this->_db;
$tables = $db->getTableList();

// this array will hold table name as key and checked in item count as value
Expand All @@ -132,7 +132,7 @@ public function getItems()
foreach ($tables as $i => $tn)
{
// make sure we get the right tables based on prefix
if (stripos($tn, $app->getCfg('dbprefix')) !== 0)
if (stripos($tn, $app->get('dbprefix')) !== 0)
{
unset($tables[$i]);
continue;
Expand All @@ -152,6 +152,7 @@ public function getItems()
continue;
}
}

foreach ($tables as $tn)
{
$query = $db->getQuery(true)
Expand All @@ -160,6 +161,7 @@ public function getItems()
->where('checked_out > 0');

$db->setQuery($query);

if ($db->execute())
{
$results[$tn] = $db->loadResult();
Expand All @@ -169,7 +171,9 @@ public function getItems()
continue;
}
}

$this->total = count($results);

if ($this->getState('list.ordering') == 'table')
{
if ($this->getState('list.direction') == 'asc')
Expand All @@ -192,9 +196,11 @@ public function getItems()
arsort($results);
}
}

$results = array_slice($results, $this->getState('list.start'), $this->getState('list.limit') ? $this->getState('list.limit') : null);
$this->items = $results;
}

return $this->items;
}
}

0 comments on commit cc83491

Please sign in to comment.