Skip to content

Commit

Permalink
Merge branch '3.7.x' of https://github.com/joomla/joomla-cms into sef…
Browse files Browse the repository at this point in the history
…_no_IDs
  • Loading branch information
Hackwar committed Sep 17, 2016
2 parents 8bb28e5 + 5fdc8d8 commit 8905670
Show file tree
Hide file tree
Showing 22 changed files with 245 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
@@ -1,5 +1,5 @@
build:
image: yveshoppe/joomla-systemtests:latest
image: joomlaprojects/docker-systemtests:latest
commands:
- apt-get install nodejs npm
- ln -s /usr/bin/nodejs /usr/bin/node
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_menus/views/items/view.html.php
Expand Up @@ -328,6 +328,12 @@ protected function addToolbar()
JToolbarHelper::trash('items.trash');
}

if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
JToolbarHelper::divider();
JToolbarHelper::preferences('com_menus');
}

JToolbarHelper::help('JHELP_MENUS_MENU_ITEM_MANAGER');
}

Expand Down
5 changes: 4 additions & 1 deletion administrator/components/com_users/models/forms/note.xml
Expand Up @@ -28,7 +28,10 @@
extension="com_users"
required="true"
label="COM_USERS_FIELD_CATEGORY_ID_LABEL"
description="JFIELD_CATEGORY_DESC"
description="JFIELD_CATEGORY_DESC"
required="true"
select="true"
new="true"
edit="true"
clear="true"
>
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.ini
Expand Up @@ -424,7 +424,7 @@ JGLOBAL_MENU_SELECTION="Menu Selection:"
JGLOBAL_MODIFIED="Modified"
JGLOBAL_MODIFIED_DATE="Modified Date"
JGLOBAL_MOST_HITS="Most Hits"
JGLOBAL_MOST_RECENT_FIRST="Most recent first"
JGLOBAL_MOST_RECENT_FIRST="Most Recent First"
JGLOBAL_MULTI_COLUMN_ORDER_DESC="Order articles down or across columns."
JGLOBAL_MULTI_COLUMN_ORDER_LABEL="Multi Column Order"
JGLOBAL_MULTI_LEVEL="Multi Level"
Expand All @@ -447,7 +447,7 @@ JGLOBAL_NUMBER_CATEGORY_ITEMS_LABEL="Show Article Count"
JGLOBAL_NUMBER_ITEMS_LIST_DESC="Default number of articles to list on a page."
JGLOBAL_NUMBER_ITEMS_LIST_LABEL="# Articles to List"
JGLOBAL_NO_MATCHING_RESULTS="No Matching Results"
JGLOBAL_OLDEST_FIRST="Oldest first"
JGLOBAL_OLDEST_FIRST="Oldest First"
JGLOBAL_ORDER_ASCENDING="Ascending"
JGLOBAL_ORDER_DESCENDING="Descending"
JGLOBAL_ORDER_DIRECTION_LABEL="Direction"
Expand Down
106 changes: 106 additions & 0 deletions administrator/templates/isis/html/layouts/joomla/pagination/link.php
@@ -0,0 +1,106 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('JPATH_BASE') or die;

/** @var JPaginationObject $item */
$item = $displayData['data'];

if (!empty($displayData['pagOptions']))
{
$options = new Joomla\Registry\Registry($displayData['pagOptions']);
$liClass = $options->get('liClass', '');
$addText = $options->get('addText', '');
}
else
{
$liClass = $addText = '';
}

$display = $item->text;

switch ((string) $item->text)
{
// Check for "Start" item
case JText::_('JLIB_HTML_START') :
$icon = "icon-backward icon-first";
break;

// Check for "Prev" item
case JText::_('JPREV') :
$item->text = JText::_('JPREVIOUS');
$icon = "icon-step-backward icon-previous";
break;

// Check for "Next" item
case JText::_('JNEXT') :
$icon = "icon-step-forward icon-next";
break;

// Check for "End" item
case JText::_('JLIB_HTML_END') :
$icon = "icon-forward icon-last";
break;

default:
$icon = null;
break;
}

$item->text .= $addText ? $addText : '';

if ($icon !== null)
{
$display = '<span class="' . $icon . '"></span>';
}

if ($displayData['active'])
{
if ($item->base > 0)
{
$limit = 'limitstart.value=' . $item->base;
}
else
{
$limit = 'limitstart.value=0';
}

$cssClasses = array();

$title = '';

if (!is_numeric($item->text))
{
JHtml::_('bootstrap.tooltip');
$cssClasses[] = 'hasTooltip';
$title = ' title="' . $item->text . '" ';
}

$onClick = 'document.adminForm.' . $item->prefix . 'limitstart.value=' . ($item->base > 0 ? $item->base : '0') . '; Joomla.submitform();return false;';
}
else
{
$class = (property_exists($item, 'active') && $item->active) ? 'active' : 'disabled';
if ($class != 'active')
{
$class .= $liClass ? ($class ? ' ' : '') . $liClass : '';
}
}
?>
<?php if ($displayData['active']) : ?>
<li<?php echo $liClass ? ' class="' . $liClass . '"' : ''; ?>>
<a class="<?php echo implode(' ', $cssClasses); ?>" <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>">
<?php echo $display; ?>
</a>
</li>
<?php else : ?>
<li class="<?php echo $class; ?>">
<span><?php echo $display; ?></span>
</li>
<?php endif;
@@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('JPATH_BASE') or die;

use Joomla\Registry\Registry;

$list = $displayData['list'];
$pages = $list['pages'];
$pagesTotal = $list['pagesTotal'];

$options = new Registry($displayData['options']);

$showLimitBox = $options->get('showLimitBox', 0);
$showPagesLinks = $options->get('showPagesLinks', true);
$showLimitStart = $options->get('showLimitStart', true);
?>

<div class="pagination pagination-toolbar clearfix">

<?php if ($showLimitBox) : ?>
<div class="limit pull-right">
<?php echo $list['limitfield']; ?>
</div>
<?php endif; ?>

<?php if ($showPagesLinks && (!empty($pages))) : ?>
<ul class="pagination-list">
<?php
$pages['start']['pagOptions'] = array('addText' => ' (' . JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', 1, $pagesTotal) . ')');
echo JLayoutHelper::render('joomla.pagination.link', $pages['start']);
echo JLayoutHelper::render('joomla.pagination.link', $pages['previous']); ?>
<?php foreach ($pages['pages'] as $page) :
$page['pagOptions'] = array('liClass' => 'hidden-phone');
?>
<?php echo JLayoutHelper::render('joomla.pagination.link', $page); ?>
<?php endforeach; ?>
<?php
echo JLayoutHelper::render('joomla.pagination.link', $pages['next']);
$pages['end']['pagOptions'] = array('addText' => ' (' . JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', $pagesTotal, $pagesTotal) . ')');
echo JLayoutHelper::render('joomla.pagination.link', $pages['end']); ?>
</ul>
<?php endif; ?>

<?php if ($showLimitStart) : ?>
<input type="hidden" name="<?php echo $list['prefix']; ?>limitstart" value="<?php echo $list['limitstart']; ?>" />
<?php endif; ?>

</div>
18 changes: 0 additions & 18 deletions administrator/templates/isis/html/pagination.php
Expand Up @@ -59,24 +59,6 @@
* NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
*/

/**
* Renders the pagination footer
*
* @param array $list Array containing pagination footer
*
* @return string HTML markup for the full pagination footer
*
* @since 3.0
*/
function pagination_list_footer($list)
{
$html = "<div class=\"pagination pagination-toolbar\">\n";
$html .= $list['pageslinks'];
$html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"" . $list['limitstart'] . "\" />";
$html .= "\n</div>";

return $html;
}

/**
* Renders the pagination list
Expand Down
5 changes: 3 additions & 2 deletions components/com_banners/models/banners.php
Expand Up @@ -64,6 +64,7 @@ protected function getListQuery()
$keywords = $this->getState('filter.keywords');
$randomise = ($ordering == 'random');
$nullDate = $db->quote($db->getNullDate());
$nowDate = $db->quote(JFactory::getDate()->toSql());

$query->select(
'a.id as id,'
Expand All @@ -80,8 +81,8 @@ protected function getListQuery()
->from('#__banners as a')
->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid')
->where('a.state=1')
->where('(' . $query->currentTimestamp() . ' >= a.publish_up OR a.publish_up = ' . $nullDate . ')')
->where('(' . $query->currentTimestamp() . ' <= a.publish_down OR a.publish_down = ' . $nullDate . ')')
->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')')
->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')')
->where('(a.imptotal = 0 OR a.impmade <= a.imptotal)');

if ($cid)
Expand Down
4 changes: 3 additions & 1 deletion components/com_contact/views/category/tmpl/default.xml
Expand Up @@ -23,8 +23,10 @@
description="COM_CONTACT_FIELD_CATEGORY_DESC"
extension="com_contact"
required="true"
select="true"
new="true"
edit="true"
clear="false"
clear="true"
/>
</fieldset>
</fields>
Expand Down
6 changes: 4 additions & 2 deletions components/com_content/views/category/tmpl/blog.xml
Expand Up @@ -19,8 +19,10 @@
description="JGLOBAL_CHOOSE_CATEGORY_DESC"
extension="com_content"
required="true"
select="true"
new="true"
edit="true"
clear="false"
clear="true"
/>
</fieldset>
</fields>
Expand Down Expand Up @@ -625,4 +627,4 @@
</field>
</fieldset>
</fields>
</metadata>
</metadata>
4 changes: 3 additions & 1 deletion components/com_content/views/category/tmpl/default.xml
Expand Up @@ -21,8 +21,10 @@
description="JGLOBAL_CHOOSE_CATEGORY_DESC"
extension="com_content"
required="true"
select="true"
new="true"
edit="true"
clear="false"
clear="true"
/>
</fieldset>
</fields>
Expand Down
13 changes: 10 additions & 3 deletions components/com_modules/modules.php
Expand Up @@ -10,11 +10,18 @@
defined('_JEXEC') or die;

// Load the required admin language files
$lang = JFactory::getLanguage();
$lang = JFactory::getLanguage();
$app = JFactory::getApplication();
$config = array();
$lang->load('joomla', JPATH_ADMINISTRATOR);
$lang->load('com_modules', JPATH_ADMINISTRATOR);

if ($app->input->get('task') === 'module.orderPosition')
{
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
}

// Trigger the controller
$controller = JControllerLegacy::getInstance('Modules');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller = JControllerLegacy::getInstance('Modules', $config);
$controller->execute($app->input->get('task'));
$controller->redirect();
4 changes: 3 additions & 1 deletion components/com_newsfeeds/views/category/tmpl/default.xml
Expand Up @@ -23,8 +23,10 @@
description="COM_NEWSFEEDS_FIELD_SELECT_CATEGORY_DESC"
extension="com_newsfeeds"
required="true"
select="true"
new="true"
edit="true"
clear="false"
clear="true"
/>
</fieldset>
</fields>
Expand Down
8 changes: 7 additions & 1 deletion libraries/cms/component/router/rules/menu.php
Expand Up @@ -55,7 +55,13 @@ public function __construct(JComponentRouterView $router)
*/
public function preprocess(&$query)
{
if (isset($query['Itemid']) && $this->router->menu->getActive() && $query['Itemid'] != $this->router->menu->getActive()->id)
/**
* If the active item id is not the same as the supplied item id or we have a supplied item id and no active
* menu item then we just use the supplied menu item and continue
*/
if (isset($query['Itemid'])
&& (($this->router->menu->getActive() && $query['Itemid'] != $this->router->menu->getActive()->id)
|| ($this->router->menu->getActive() === null)))
{
return;
}
Expand Down
6 changes: 5 additions & 1 deletion libraries/cms/component/router/rules/standard.php
Expand Up @@ -62,7 +62,11 @@ public function parse(&$segments, &$vars)
// Get the views and the currently active query vars
$views = $this->router->getViews();
$active = $this->router->menu->getActive();
$vars = array_merge($active->query, $vars);

if ($active)
{
$vars = array_merge($active->query, $vars);
}

// We don't have a view or its not a view of this component! We stop here
if (!isset($vars['view']) || !isset($views[$vars['view']]))
Expand Down
1 change: 1 addition & 0 deletions libraries/cms/pagination/pagination.php
Expand Up @@ -461,6 +461,7 @@ public function getPaginationLinks($layoutId = 'joomla.pagination.links', $optio
'limitfield' => $this->getLimitBox(),
'pagescounter' => $this->getPagesCounter(),
'pages' => $this->getPaginationPages(),
'pagesTotal' => $this->pagesTotal,
);

return JLayoutHelper::render($layoutId, array('list' => $list, 'options' => $options));
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/document/renderer/html/head.php
Expand Up @@ -137,7 +137,7 @@ public function fetchHead($document)
// Generate stylesheet links
foreach ($document->_styleSheets as $strSrc => $strAttr)
{
$buffer .= $tab . '<link rel="stylesheet" href="' . $strSrc . '"';
$buffer .= $tab . '<link href="' . $strSrc . '" rel="stylesheet"';

if (!is_null($strAttr['mime']) && (!$document->isHtml5() || !in_array($strAttr['mime'], $defaultCssMimes)))
{
Expand Down
10 changes: 10 additions & 0 deletions libraries/joomla/form/fields/checkbox.php
Expand Up @@ -96,6 +96,16 @@ public function __set($name, $value)
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
// Handle the default attribute
$default = (string) $element['default'];

if ($default)
{
$test = $this->form->getValue((string) $element['name'], $group);

$value = ($test == $default) ? $default : null;
}

$return = parent::setup($element, $value, $group);

if ($return)
Expand Down

0 comments on commit 8905670

Please sign in to comment.