Skip to content

Commit

Permalink
Issue #16141 fix: fetched latest changesMerge remote-tracking branch …
Browse files Browse the repository at this point in the history
…'upstream/staging' into local-staging
  • Loading branch information
Nilesh More committed Oct 6, 2017
2 parents c7fce01 + ec26ad7 commit f9ff4bf
Show file tree
Hide file tree
Showing 107 changed files with 1,099 additions and 488 deletions.
5 changes: 5 additions & 0 deletions administrator/components/com_fields/models/field.php
Expand Up @@ -957,6 +957,11 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
{
$form->setFieldAttribute('default_value', 'description', $key);
}
//Remove placeholder field on list fields
if ($dataObject->type == "list")
{
$form->removeField('hint', 'params');
}
}

// Setting the context for the category field
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_menus/presets/joomla.xml
Expand Up @@ -164,6 +164,7 @@
element="com_users"
link="index.php?option=com_users&view=mail"
class="class:massmail"
scope="massmail"
/>
</menuitem>
<menuitem
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_menus/presets/modern.xml
Expand Up @@ -164,6 +164,7 @@
element="com_users"
link="index.php?option=com_users&amp;view=mail"
class="class:massmail"
scope="massmail"
/>
</menuitem>
<menuitem
Expand Down
Expand Up @@ -15,6 +15,26 @@
$published = $this->state->get('filter.published');
$clientId = $this->state->get('filter.client_id');
$menuType = JFactory::getApplication()->getUserState('com_menus.items.menutype');
if ($clientId == 1) :
JFactory::getDocument()->addScriptDeclaration(
'
jQuery(document).ready(function($){
if ($("#batch-menu-id").length){var batchSelector = $("#batch-menu-id");}
if ($("#batch-copy-move").length) {
$("#batch-copy-move").hide();
batchSelector.on("change", function(){
if (batchSelector.val() != 0 || batchSelector.val() != "") {
$("#batch-copy-move").show();
} else {
$("#batch-copy-move").hide();
}
});
}
});
'
);
endif;

?>
<div class="container-fluid">
<?php if (strlen($menuType) && $menuType != '*') : ?>
Expand Down
Expand Up @@ -7,13 +7,14 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;

$published = $this->state->get('filter.published');
$clientId = $this->state->get('filter.client_id');
$menuType = JFactory::getApplication()->getUserState('com_menus.items.menutype');
?>
<a class="btn" type="button" onclick="document.getElementById('batch-menu-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</a>
<?php if (strlen($menuType) && $menuType != '*') : ?>
<?php if ((strlen($menuType) && $menuType != '*' && $clientId == 0) || ($published > 0 && $clientId == 1)): ?>
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('item.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.com_menus.ini
Expand Up @@ -221,9 +221,9 @@ COM_MENUS_TYPE_CONTAINER_DESC="This will create a container menu which will show
COM_MENUS_TYPE_EXTERNAL_URL="URL"
COM_MENUS_TYPE_EXTERNAL_URL_DESC="An external or internal URL."
COM_MENUS_TYPE_HEADING="Menu Heading"
COM_MENUS_TYPE_HEADING_DESC="A heading for use within menus, useful when separating menus with a separator."
COM_MENUS_TYPE_HEADING_DESC="A heading for the parent of submenu items."
COM_MENUS_TYPE_SEPARATOR="Text Separator"
COM_MENUS_TYPE_SEPARATOR_DESC="A text separator."
COM_MENUS_TYPE_SEPARATOR_DESC="A text separator, useful to separate items within a menu."
COM_MENUS_TYPE_SYSTEM="System Links"
COM_MENUS_TYPE_UNEXISTING="Component '%s' does not exist."
COM_MENUS_TYPE_UNKNOWN="Unknown"
Expand Down
9 changes: 5 additions & 4 deletions administrator/language/en-GB/en-GB.ini
Expand Up @@ -511,10 +511,10 @@ JGLOBAL_SAVE_HISTORY_OPTIONS_DESC="Automatically save old versions of an item. I
JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL="Enable Versions"
JGLOBAL_SECRETKEY="Secret Key"
JGLOBAL_SECRETKEY_HELP="If you have enabled two factor authentication in your user account please enter your secret key. If you do not know what this means, you can leave this field blank."
JGLOBAL_SEF_ADVANCED_DESC="Experimental Routing enables advanced features but may change your URLs. Stable routing ensures full compatibility for existing sites. This is configured per component."
JGLOBAL_SEF_ADVANCED_DESC="Modern routing enables advanced features but may change your URLs. Legacy routing ensures full compatibility for existing sites. This is configured per component."
JGLOBAL_SEF_ADVANCED_LABEL="URL Routing"
JGLOBAL_SEF_ADVANCED_LEGACY="Stable"
JGLOBAL_SEF_ADVANCED_MODERN="Experimental"
JGLOBAL_SEF_ADVANCED_LEGACY="Legacy"
JGLOBAL_SEF_ADVANCED_MODERN="Modern"
JGLOBAL_SEF_NOIDS_DESC="Remove the IDs from the URLs of this component."
JGLOBAL_SEF_NOIDS_LABEL="Remove IDs from URLs"
JGLOBAL_SELECT_ALLOW_DENY_GROUP="Change %s permission for %s group."
Expand Down Expand Up @@ -949,7 +949,8 @@ JWARNING_ARCHIVE_MUST_SELECT="You must select at least one item to archive."
JWARNING_UNPUBLISH_MUST_SELECT="You must select at least one item to unpublish."
JWARNING_TRASH_MUST_SELECT="You must select at least one item to remove."
JWARNING_DELETE_MUST_SELECT="You must select at least one item to permanently delete."
JWARNING_REMOVE_ROOT_USER="You are logged-in using the emergency Root User setting in configuration.php.<br />You should remove $root_user from configuration.php as soon as you have restored control to your site to avoid future security breaches.<br /><a href='%s'>Select here to try to do it automatically.</a>"
JWARNING_REMOVE_ROOT_USER="You are logged-in using the emergency Root User setting in configuration.php.<br />You should remove $root_user from the configuration.php as soon as you have restored control to your site to avoid future security breaches.<br /><a href='%s'>Select here to try to do it automatically.</a>"
JWARNING_REMOVE_ROOT_USER_ADMIN="The emergency Root User setting is currently enabled for the user(id): %s.<br />You should remove $root_user from the configuration.php as soon as you have restored control to your site to avoid future security breaches.<br /><a href='%s'>Select here to try to do it automatically.</a>"

; Date format

Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_custom/mod_custom.xml
Expand Up @@ -65,7 +65,7 @@

<field
name="cache_time"
type="text"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
Expand Down
6 changes: 3 additions & 3 deletions administrator/modules/mod_feed/mod_feed.xml
Expand Up @@ -83,7 +83,7 @@

<field
name="rssitems"
type="text"
type="number"
label="MOD_FEED_FIELD_ITEMS_LABEL"
description="MOD_FEED_FIELD_ITEMS_DESC"
default="3"
Expand All @@ -103,7 +103,7 @@

<field
name="word_count"
type="text"
type="number"
label="MOD_FEED_FIELD_WORDCOUNT_LABEL"
description="MOD_FEED_FIELD_WORDCOUNT_DESC"
size="6"
Expand Down Expand Up @@ -139,7 +139,7 @@

<field
name="cache_time"
type="text"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_latest/mod_latest.xml
Expand Up @@ -24,7 +24,7 @@
<fieldset name="basic">
<field
name="count"
type="text"
type="number"
label="MOD_LATEST_FIELD_COUNT_LABEL"
description="MOD_LATEST_FIELD_COUNT_DESC"
default="5"
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_logged/mod_logged.xml
Expand Up @@ -23,7 +23,7 @@
<fieldset name="basic">
<field
name="count"
type="text"
type="number"
label="MOD_LOGGED_FIELD_COUNT_LABEL"
description="MOD_LOGGED_FIELD_COUNT_DESC"
default="5"
Expand Down
6 changes: 6 additions & 0 deletions administrator/modules/mod_menu/menu.php
Expand Up @@ -281,6 +281,12 @@ protected function preprocess($items)
continue;
}

// Exclude Mass Mail if disabled in global configuration
if ($item->scope == 'massmail' && (JFactory::getApplication()->get('massmailoff', 0) == 1))
{
continue;
}

// Exclude item if the component is not authorised
$assetName = $item->element;

Expand Down
Expand Up @@ -38,9 +38,10 @@

<field
name="moduleclass_sfx"
type="textarea" rows="3"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
rows="3"
/>

</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_popular/mod_popular.xml
Expand Up @@ -24,7 +24,7 @@
<fieldset name="basic">
<field
name="count"
type="text"
type="number"
label="MOD_POPULAR_FIELD_COUNT_LABEL"
description="MOD_POPULAR_FIELD_COUNT_DESC"
default="5"
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_quickicon/mod_quickicon.xml
Expand Up @@ -59,7 +59,7 @@

<field
name="cache_time"
type="text"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
Expand Down
4 changes: 2 additions & 2 deletions administrator/modules/mod_stats_admin/mod_stats_admin.xml
Expand Up @@ -61,7 +61,7 @@

<field
name="increase"
type="text"
type="number"
label="MOD_STATS_FIELD_INCREASECOUNTER_LABEL"
description="MOD_STATS_FIELD_INCREASECOUNTER_DESC"
default="0"
Expand Down Expand Up @@ -96,7 +96,7 @@

<field
name="cache_time"
type="text"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
Expand Down
Expand Up @@ -95,7 +95,7 @@
?>
<?php if ($displayData['active']) : ?>
<li<?php echo $liClass ? ' class="' . $liClass . '"' : ''; ?>>
<a class="<?php echo implode(' ', $cssClasses); ?>" <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>">
<a <?php echo $cssClasses ? 'class="' . implode(' ', $cssClasses) . '"' : ''; ?> <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>">
<?php echo $display; ?>
</a>
</li>
Expand Down
1 change: 1 addition & 0 deletions components/com_content/views/category/tmpl/blog.xml
Expand Up @@ -30,6 +30,7 @@
type="tag"
label="JTAG"
description="JTAG_FIELD_SELECT_DESC"
multiple="true"
>
<option value="">JNONE</option>
</field>
Expand Down
3 changes: 3 additions & 0 deletions components/com_search/views/search/view.html.php
Expand Up @@ -265,6 +265,9 @@ public function display($tpl = null)
$created = JHtml::_('date', $result->created, JText::_('DATE_FORMAT_LC3'));
}

// Make sure there are no slashes in the needle
$needle = str_replace('/', '\/', $needle);

$result->title = preg_replace("/\b($needle)\b/ui", $hl1 . "$1" . $hl2, htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8'));
$result->text = JHtml::_('content.prepare', $result->text, '', 'com_search.search');
$result->created = $created;
Expand Down
2 changes: 1 addition & 1 deletion layouts/joomla/pagination/link.php
Expand Up @@ -78,7 +78,7 @@
?>
<?php if ($displayData['active']) : ?>
<li>
<a class="<?php echo implode(' ', $cssClasses); ?>" <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>">
<a <?php echo $cssClasses ? 'class="' . implode(' ', $cssClasses) . '"' : ''; ?> <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>">
<?php echo $display; ?>
</a>
</li>
Expand Down
35 changes: 35 additions & 0 deletions libraries/joomla/form/fields/number.php
Expand Up @@ -143,6 +143,41 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
*/
protected function getInput()
{
if ($this->element['useglobal'])
{
$component = JFactory::getApplication()->input->getCmd('option');

// Get correct component for menu items
if ($component == 'com_menus')
{
$link = $this->form->getData()->get('link');
$uri = new JUri($link);
$component = $uri->getVar('option', 'com_menus');
}

$params = JComponentHelper::getParams($component);
$value = $params->get($this->fieldname);

// Try with global configuration
if (is_null($value))
{
$value = JFactory::getConfig()->get($this->fieldname);
}

// Try with menu configuration
if (is_null($value) && JFactory::getApplication()->input->getCmd('option') == 'com_menus')
{
$value = JComponentHelper::getParams('com_menus')->get($this->fieldname);
}

if (!is_null($value))
{
$value = (string) $value;

$this->hint = JText::sprintf('JGLOBAL_USE_GLOBAL_VALUE', $value);
}
}

// Trim the trailing line in the layout file
return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL);
}
Expand Down
32 changes: 23 additions & 9 deletions libraries/src/Application/AdministratorApplication.php
Expand Up @@ -421,16 +421,30 @@ protected function render()
// Safety check for when configuration.php root_user is in use.
$rootUser = $this->get('root_user');

if (property_exists('\JConfig', 'root_user')
&& (\JFactory::getUser()->get('username') === $rootUser || \JFactory::getUser()->id === (string) $rootUser))
if (property_exists('\JConfig', 'root_user'))
{
$this->enqueueMessage(
\JText::sprintf(
'JWARNING_REMOVE_ROOT_USER',
'index.php?option=com_config&task=config.removeroot&' . \JSession::getFormToken() . '=1'
),
'notice'
);
if (\JFactory::getUser()->get('username') === $rootUser || \JFactory::getUser()->id === (string) $rootUser)
{
$this->enqueueMessage(
\JText::sprintf(
'JWARNING_REMOVE_ROOT_USER',
'index.php?option=com_config&task=config.removeroot&' . \JSession::getFormToken() . '=1'
),
'error'
);
}
// Show this message to superusers too
elseif (\JFactory::getUser()->authorise('core.admin'))
{
$this->enqueueMessage(
\JText::sprintf(
'JWARNING_REMOVE_ROOT_USER_ADMIN',
$rootUser,
'index.php?option=com_config&task=config.removeroot&' . \JSession::getFormToken() . '=1'
),
'error'
);
}
}

parent::render();
Expand Down
30 changes: 14 additions & 16 deletions media/editors/codemirror/addon/comment/continuecomment.js
Expand Up @@ -18,30 +18,28 @@
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), mode, inserts = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head, token = cm.getTokenAt(pos);
if (token.type != "comment") return CodeMirror.Pass;
var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode;
var pos = ranges[i].head
if (!/\bcomment\b/.test(cm.getTokenTypeAt(pos))) return CodeMirror.Pass;
var modeHere = cm.getModeAt(pos)
if (!mode) mode = modeHere;
else if (mode != modeHere) return CodeMirror.Pass;

var insert = null;
if (mode.blockCommentStart && mode.blockCommentContinue) {
var end = token.string.indexOf(mode.blockCommentEnd);
var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) {
var line = cm.getLine(pos.line).slice(0, pos.ch)
var end = line.indexOf(mode.blockCommentEnd), found
if (end != -1 && end == pos.ch - mode.blockCommentEnd.length) {
// Comment ended, don't continue it
} else if (token.string.indexOf(mode.blockCommentStart) == 0) {
insert = full.slice(0, token.start);
if (!/^\s*$/.test(insert)) {
insert = "";
for (var j = 0; j < token.start; ++j) insert += " ";
} else if ((found = line.indexOf(mode.blockCommentStart)) > -1) {
insert = line.slice(0, found)
if (/\S/.test(insert)) {
insert = ""
for (var j = 0; j < found; ++j) insert += " "
}
} else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
found + mode.blockCommentContinue.length > token.start &&
/^\s*$/.test(full.slice(0, found))) {
insert = full.slice(0, found);
} else if ((found = line.indexOf(mode.blockCommentContinue)) > -1 && !/\S/.test(line.slice(0, found))) {
insert = line.slice(0, found)
}
if (insert != null) insert += mode.blockCommentContinue;
if (insert != null) insert += mode.blockCommentContinue
}
if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) {
var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f9ff4bf

Please sign in to comment.