Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/staging' into extensionscript
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Sep 12, 2015
2 parents a9dc9c1 + 073eef3 commit 21a81bc
Show file tree
Hide file tree
Showing 1,065 changed files with 14,719 additions and 9,787 deletions.
25 changes: 9 additions & 16 deletions .travis.yml
@@ -1,3 +1,6 @@
# Forces new Travis-CI Infrastructure
sudo: false

language: php

php:
Expand All @@ -16,11 +19,8 @@ services:
- redis-server

before_script:
# - composer update
# Install PHPCS to validate code standards
- composer require squizlabs/php_codesniffer 1.5.6
# Install Cache_Lite for testing
- composer require pear/cache_lite 1.7.16
# Make sure all dev dependencies are installed
- composer install
# Set up databases for testing
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/schema/mysql.sql
Expand All @@ -30,22 +30,15 @@ before_script:
# - ./build/travis/php-apache.sh
# Enable additional PHP extensions
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-add build/travis/phpenv/memcached.ini; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-add build/travis/phpenv/apc-$TRAVIS_PHP_VERSION.ini; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' == '5.3' ] || [ '$TRAVIS_PHP_VERSION' == '5.4' ]; then phpenv config-add build/travis/phpenv/apc-$TRAVIS_PHP_VERSION.ini; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-add build/travis/phpenv/redis.ini; fi"
# PHP 5.5+ needs APCu
- if [ '$TRAVIS_PHP_VERSION' == "5.5" ] || [ '$TRAVIS_PHP_VERSION' == "5.6" ]; then printf "\n" | echo -e "extension = apcu.so\napc.enabled=1\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi

script:
- phpunit --configuration travisci-phpunit.xml
- libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then libraries/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi"

branches:
except:
- 2.5.x

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/18687d008d633d02aa84
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

3 changes: 2 additions & 1 deletion administrator/components/com_admin/models/help.php
Expand Up @@ -205,7 +205,8 @@ public function &getLatestVersionCheck()
{
if (!$this->latest_version_check)
{
$override = 'https://help.joomla.org/proxy/index.php?option=com_help&amp;keyref=Help{major}{minor}:Joomla_Version_{major}_{minor}_{maintenance}/{langcode}&amp;lang={langcode}';
$override = 'https://help.joomla.org/proxy/index.php?option=com_help&amp;keyref=Help{major}{minor}:'
. 'Joomla_Version_{major}_{minor}_{maintenance}/{langcode}&amp;lang={langcode}';
$this->latest_version_check = JHelp::createUrl('JVERSION', false, $override);
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/models/sysinfo.php
Expand Up @@ -136,7 +136,7 @@ public function &getInfo()
$this->info = array();
$version = new JVersion;
$platform = new JPlatform;
$db = JFactory::getDbo();
$db = $this->getDbo();

$this->info['php'] = php_uname();
$this->info['dbversion'] = $db->getVersion();
Expand Down
11 changes: 8 additions & 3 deletions administrator/components/com_admin/script.php
Expand Up @@ -19,7 +19,7 @@ class JoomlaInstallerScript
/**
* Method to update Joomla!
*
* @param JInstallerFile $installer The class calling this method
* @param JInstallerFile $installer The class calling this method
*
* @return void
*/
Expand Down Expand Up @@ -49,7 +49,7 @@ protected function updateDatabase()

if (strpos($db->name, 'mysql') !== false)
{
$this->updateDatabaseMySQL();
$this->updateDatabaseMysql();
}

$this->uninstallEosPlugin();
Expand All @@ -60,7 +60,7 @@ protected function updateDatabase()
*
* @return void
*/
protected function updateDatabaseMySQL()
protected function updateDatabaseMysql()
{
$db = JFactory::getDbo();

Expand Down Expand Up @@ -1082,6 +1082,8 @@ public function deleteUnexistingFiles()
'/libraries/joomla/registry/format/json.php',
'/libraries/joomla/registry/format/php.php',
'/libraries/joomla/registry/format/xml.php',
// Joomla 3.3.1
'/administrator/templates/isis/html/message.php',
// Joomla! 3.4
'/administrator/components/com_tags/helpers/html/index.html',
'/administrator/components/com_tags/models/fields/index.html',
Expand Down Expand Up @@ -1292,6 +1294,9 @@ public function deleteUnexistingFiles()
'/administrator/components/com_config/models/forms/index.html',
// Joomla 3.4.2
'/libraries/composer_autoload.php',
// Joomla 3.4.3
'/libraries/classloader.php',
'/libraries/ClassLoader.php',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down
@@ -0,0 +1 @@
ALTER TABLE "#__contentitem_tag_map" DROP CONSTRAINT "#__uc_ItemnameTagid", ADD CONSTRAINT "#__uc_ItemnameTagid" UNIQUE ("type_id", "content_item_id", "tag_id");
@@ -0,0 +1,8 @@
ALTER TABLE [#__contentitem_tag_map] DROP CONSTRAINT [#__contentitem_tag_map$uc_ItemnameTagid];

ALTER TABLE [#__contentitem_tag_map] ADD CONSTRAINT [#__contentitem_tag_map$uc_ItemnameTagid] UNIQUE NONCLUSTERED
(
[type_id] ASC,
[content_item_id] ASC,
[tag_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
10 changes: 5 additions & 5 deletions administrator/components/com_admin/views/help/view.html.php
Expand Up @@ -55,11 +55,11 @@ class AdminViewHelp extends JViewLegacy
*/
public function display($tpl = null)
{
$this->help_search = $this->get('HelpSearch');
$this->page = $this->get('Page');
$this->toc = $this->get('Toc');
$this->lang_tag = $this->get('LangTag');
$this->latest_version_check = $this->get('LatestVersionCheck');
$this->help_search = $this->get('HelpSearch');
$this->page = $this->get('Page');
$this->toc = $this->get('Toc');
$this->lang_tag = $this->get('LangTag');
$this->latest_version_check = $this->get('LatestVersionCheck');

$this->addToolbar();
parent::display($tpl);
Expand Down
Expand Up @@ -23,6 +23,7 @@
}
};
');

// Load chosen.css
JHtml::_('formbehavior.chosen', 'select');

Expand Down
Expand Up @@ -31,9 +31,9 @@ class AdminViewProfile extends JViewLegacy
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_admin/views/sysinfo/view.html.php
Expand Up @@ -56,11 +56,11 @@ public function display($tpl = null)
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

$this->php_settings = $this->get('PhpSettings');
$this->config = $this->get('config');
$this->info = $this->get('info');
$this->php_info = $this->get('PhpInfo');
$this->directory = $this->get('directory');
$this->php_settings = $this->get('PhpSettings');
$this->config = $this->get('config');
$this->info = $this->get('info');
$this->php_info = $this->get('PhpInfo');
$this->directory = $this->get('directory');

$this->addToolbar();
$this->_setSubMenu();
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_banners/controllers/banner.php
Expand Up @@ -67,8 +67,8 @@ protected function allowAdd($data = array())
*/
protected function allowEdit($data = array(), $key = 'id')
{
$user = JFactory::getUser();
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$categoryId = 0;

if ($recordId)
Expand All @@ -95,14 +95,14 @@ protected function allowEdit($data = array(), $key = 'id')
*
* @return boolean True on success.
*
* @since 2.5
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

// Set the model
$model = $this->getModel('Banner', '', array());
$model = $this->getModel('Banner', '', array());

// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_banners&view=banners' . $this->getRedirectToListAppend(), false));
Expand Down
Expand Up @@ -18,7 +18,7 @@ class BannersControllerClient extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
*
*
* @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_CLIENT';
Expand Down
Expand Up @@ -55,9 +55,9 @@ public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = a
public function display($cachable = false, $urlparams = false)
{
// Get the document object.
$document = JFactory::getDocument();
$vName = 'tracks';
$vFormat = 'raw';
$document = JFactory::getDocument();
$vName = 'tracks';
$vFormat = 'raw';

// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
Expand Down
9 changes: 5 additions & 4 deletions administrator/components/com_banners/models/banner.php
Expand Up @@ -193,7 +193,7 @@ protected function batchCopy($value, $pks, $contexts)
$table->state = 0;

// TODO: Deal with ordering?
// $table->ordering = 1;
// $table->ordering = 1;

// Check the row.
if (!$table->check())
Expand Down Expand Up @@ -459,11 +459,12 @@ protected function prepareTable($table)
{
// Set the values
$table->created = $date->toSql();
$table->created_by = $user->id;

// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$db = $this->getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from('#__banners');
Expand All @@ -477,8 +478,8 @@ protected function prepareTable($table)
else
{
// Set the values
$table->modified = $date->toSql();
$table->modified_by = $user->get('id');
$table->modified = $date->toSql();
$table->modified_by = $user->get('id');
}
// Increment the content version number.
$table->version++;
Expand Down
23 changes: 16 additions & 7 deletions administrator/components/com_banners/models/banners.php
Expand Up @@ -95,14 +95,23 @@ protected function getListQuery()
$query->select(
$this->getState(
'list.select',
'a.id AS id, a.name AS name, a.alias AS alias,' .
'a.id AS id,' .
'a.name AS name,' .
'a.alias AS alias,' .
'a.checked_out AS checked_out,' .
'a.checked_out_time AS checked_out_time, a.catid AS catid,' .
'a.clicks AS clicks, a.metakey AS metakey, a.sticky AS sticky,' .
'a.impmade AS impmade, a.imptotal AS imptotal,' .
'a.state AS state, a.ordering AS ordering,' .
'a.purchase_type as purchase_type,' .
'a.language, a.publish_up, a.publish_down'
'a.checked_out_time AS checked_out_time,' .
'a.catid AS catid,' .
'a.clicks AS clicks,' .
'a.metakey AS metakey,' .
'a.sticky AS sticky,' .
'a.impmade AS impmade,' .
'a.imptotal AS imptotal,' .
'a.state AS state,' .
'a.ordering AS ordering,' .
'a.purchase_type AS purchase_type,' .
'a.language,' .
'a.publish_up,' .
'a.publish_down'
)
);
$query->from($db->quoteName('#__banners') . ' AS a');
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_banners/models/download.php
Expand Up @@ -71,8 +71,8 @@ public function getForm($data = array(), $loadData = true)
protected function loadFormData()
{
$data = array(
'basename' => $this->getState('basename'),
'compressed' => $this->getState('compressed')
'basename' => $this->getState('basename'),
'compressed' => $this->getState('compressed'),
);

$this->preprocessData('com_banners.download', $data);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_banners/models/fields/clicks.php
Expand Up @@ -37,7 +37,7 @@ protected function getInput()

return
'<input class="input-small" type="text" name="' . $this->name . '" id="' . $this->id . '" value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly" /> <a class="btn" ' . $onclick . '><span class="icon-refresh"></span> '
. JText::_('COM_BANNERS_RESET_CLICKS') . '</a>';
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly" /> <a class="btn" ' . $onclick . '>'
. '<span class="icon-refresh"></span> ' . JText::_('COM_BANNERS_RESET_CLICKS') . '</a>';
}
}
Expand Up @@ -37,7 +37,7 @@ protected function getInput()

return
'<input class="input-small" type="text" name="' . $this->name . '" id="' . $this->id . '" value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly" /> <a class="btn" ' . $onclick . '><span class="icon-refresh"></span> '
. JText::_('COM_BANNERS_RESET_IMPMADE') . '</a>';
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly" /> <a class="btn" ' . $onclick . '>'
. '<span class="icon-refresh"></span> ' . JText::_('COM_BANNERS_RESET_IMPMADE') . '</a>';
}
}
12 changes: 7 additions & 5 deletions administrator/components/com_banners/models/fields/imptotal.php
Expand Up @@ -33,11 +33,13 @@ class JFormFieldImpTotal extends JFormField
*/
protected function getInput()
{
$class = ' class="validate-numeric text_area"';
$onchange = ' onchange="document.getElementById(\'' . $this->id . '_unlimited\').checked=document.getElementById(\'' . $this->id . '\').value==\'\';"';
$onclick = ' onclick="if (document.getElementById(\'' . $this->id . '_unlimited\').checked) document.getElementById(\'' . $this->id . '\').value=\'\';"';
$value = empty($this->value) ? '' : $this->value;
$checked = empty($this->value) ? ' checked="checked"' : '';
$class = ' class="validate-numeric text_area"';
$onchange = ' onchange="document.getElementById(\'' . $this->id . '_unlimited\').checked=document.getElementById(\'' . $this->id
. '\').value==\'\';"';
$onclick = ' onclick="if (document.getElementById(\'' . $this->id . '_unlimited\').checked) document.getElementById(\'' . $this->id
. '\').value=\'\';"';
$value = empty($this->value) ? '' : $this->value;
$checked = empty($this->value) ? ' checked="checked"' : '';

return
'<input type="text" name="' . $this->name . '" id="' . $this->id . '" size="9" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8')
Expand Down
Expand Up @@ -45,6 +45,7 @@
type="text"
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
maxlength="255"
class="span12" size="45"
labelclass="control-label"
/>
Expand Down
Expand Up @@ -36,6 +36,7 @@
type="text"
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
maxlength="255"
size="45"
labelclass="control-label"
/>
Expand Down
25 changes: 18 additions & 7 deletions administrator/components/com_banners/views/banner/tmpl/edit.php
Expand Up @@ -22,13 +22,24 @@
}
};
jQuery(document).ready(function ($){
$("#jform_type").change(function(){
if($(this).val() == 1) {
$("#image").css("display", "none");
$("#custom").css("display", "block");
} else {
$("#image").css("display", "block");
$("#custom").css("display", "none");
$("#jform_type").on("change", function (a, params) {
var v = typeof(params) !== "object" ? $("#jform_type").val() : params.selected;
var img_url = $("#image, #url");
var custom = $("#custom");
switch (v) {
case "0":
// Image
img_url.show();
custom.hide();
break;
case "1":
// Custom
img_url.hide();
custom.show();
break;
}
}).trigger("change");
});
Expand Down

0 comments on commit 21a81bc

Please sign in to comment.