Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:joomla/joomla-cms into copymail
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Sep 3, 2017
2 parents a3cd679 + bacc81f commit cb3b5ba
Show file tree
Hide file tree
Showing 47 changed files with 1,862 additions and 1,828 deletions.
Expand Up @@ -170,19 +170,20 @@
<ul class="dropdown-menu">
<?php foreach ($this->modules[$item->menutype] as &$module) : ?>
<li>
<?php if ($canEdit) : ?>
<?php if ($user->authorise('core.edit', 'com_modules.module.' . (int) $module->id)) : ?>
<?php $link = JRoute::_('index.php?option=com_modules&task=module.edit&id=' . $module->id . '&return=' . $return . '&tmpl=component&layout=modal'); ?>
<a href="#moduleEdit<?php echo $module->id; ?>Modal" role="button" class="button" data-toggle="modal" title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'); ?>">
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?></a>
<?php else : ?>
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
<a href="#" class="disabled" disabled="disabled">
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?></a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php foreach ($this->modules[$item->menutype] as &$module) : ?>
<?php if ($canEdit) : ?>
<?php if ($user->authorise('core.edit', 'com_modules.module.' . (int) $module->id)) : ?>
<?php $link = JRoute::_('index.php?option=com_modules&task=module.edit&id=' . $module->id . '&return=' . $return . '&tmpl=component&layout=modal'); ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
Expand Down
11 changes: 8 additions & 3 deletions administrator/components/com_modules/controllers/module.php
Expand Up @@ -118,14 +118,19 @@ protected function allowEdit($data = array(), $key = 'id')
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();

// Check general edit permission first.
// Zero record (id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}

// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', 'com_modules.module.' . $recordId))
{
return true;
}

// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
return false;
}

/**
Expand Down
1 change: 0 additions & 1 deletion administrator/language/en-GB/en-GB.ini
Expand Up @@ -855,7 +855,6 @@ JOPTION_ACCESS_SHOW_ALL_ACCESS="Show All Access"
JOPTION_ACCESS_SHOW_ALL_GROUPS="Show All Groups"
JOPTION_ACCESS_SHOW_ALL_LEVELS="Show All Access Levels"
JOPTION_ALL_CATEGORIES="- All Categories -"
JOPTION_ALL_TAGS="- All Tags -"
JOPTION_ANY_CATEGORY="Any Category"
JOPTION_ANY="Any"
JOPTION_DO_NOT_USE="- None Selected -"
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/en-GB.mod_menu.ini
Expand Up @@ -67,6 +67,7 @@ MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM="Official Support Forum"
; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module contains a URL
MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum"
; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'.
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE=""
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM="Official Language Forums"
MOD_MENU_HELP_TRANSLATIONS="Joomla! Translations"
MOD_MENU_HELP_XCHANGE="Stack Exchange"
Expand Down
10 changes: 10 additions & 0 deletions components/com_content/views/categories/tmpl/default.xml
Expand Up @@ -460,6 +460,16 @@
</fieldset>

<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">

<field
name="article_layout" type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>

<field
name="show_title"
type="list"
Expand Down
10 changes: 10 additions & 0 deletions components/com_content/views/category/tmpl/blog.xml
Expand Up @@ -335,6 +335,16 @@
</fieldset>

<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">

<field
name="article_layout" type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>

<field
name="show_title"
type="list"
Expand Down
10 changes: 10 additions & 0 deletions components/com_content/views/category/tmpl/default.xml
Expand Up @@ -375,6 +375,16 @@
</fieldset>

<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">

<field
name="article_layout" type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>

<field
name="show_title"
type="list"
Expand Down
1 change: 1 addition & 0 deletions components/com_fields/layouts/field/render.php
Expand Up @@ -22,6 +22,7 @@
{
return;
}

?>
<?php if ($showLabel == 1) : ?>
<span class="field-label"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
Expand Down
23 changes: 12 additions & 11 deletions components/com_fields/layouts/fields/render.php
Expand Up @@ -48,16 +48,17 @@
{
return;
}

?>
<dl class="fields-container">
<?php foreach ($fields as $field) : ?>
<?php // If the value is empty do nothing
if (!isset($field->value) or $field->value == '') :
continue;
endif; ?>
<?php $class = $field->params->get('render_class'); ?>
<dd class="field-entry <?php echo $class; ?>">
<?php echo FieldsHelper::render($context, 'field.render', array('field' => $field)); ?>
</dd>
<?php endforeach; ?>
</dl>
<?php foreach ($fields as $field) : ?>
<?php // If the value is empty do nothing ?>
<?php if (!isset($field->value) || $field->value == '') : ?>
<?php continue; ?>
<?php endif; ?>
<?php $class = $field->params->get('render_class'); ?>
<dd class="field-entry <?php echo $class; ?>">
<?php echo FieldsHelper::render($context, 'field.render', array('field' => $field)); ?>
</dd>
<?php endforeach; ?>
</dl>
43 changes: 20 additions & 23 deletions components/com_finder/views/search/tmpl/default.php
Expand Up @@ -13,30 +13,27 @@
JHtml::_('formbehavior.chosen');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('stylesheet', 'com_finder/finder.css', array('version' => 'auto', 'relative' => true));
?>

?>
<div class="finder<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php if ($this->escape($this->params->get('page_heading'))) : ?>
<?php echo $this->escape($this->params->get('page_heading')); ?>
<?php else : ?>
<?php echo $this->escape($this->params->get('page_title')); ?>
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php if ($this->escape($this->params->get('page_heading'))) : ?>
<?php echo $this->escape($this->params->get('page_heading')); ?>
<?php else : ?>
<?php echo $this->escape($this->params->get('page_title')); ?>
<?php endif; ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_search_form', 1)) : ?>
<div id="search-form">
<?php echo $this->loadTemplate('form'); ?>
</div>
<?php endif; ?>
<?php // Load the search results layout if we are performing a search. ?>
<?php if ($this->query->search === true) : ?>
<div id="search-results">
<?php echo $this->loadTemplate('results'); ?>
</div>
<?php endif; ?>
</h1>
<?php endif; ?>

<?php if ($this->params->get('show_search_form', 1)) : ?>
<div id="search-form">
<?php echo $this->loadTemplate('form'); ?>
</div>
<?php endif;

// Load the search results layout if we are performing a search.
if ($this->query->search === true) :
?>
<div id="search-results">
<?php echo $this->loadTemplate('results'); ?>
</div>
<?php endif; ?>
</div>
27 changes: 15 additions & 12 deletions components/com_finder/views/search/tmpl/default_form.php
Expand Up @@ -59,34 +59,37 @@

JFactory::getDocument()->addScriptDeclaration($script);
}
?>

?>
<form id="finder-search" action="<?php echo JRoute::_($this->query->toUri()); ?>" method="get" class="form-inline">
<?php echo $this->getFields(); ?>

<?php
/*
* DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN.
*/
if (false && $this->state->get('list.ordering') !== 'relevance_dsc') : ?>
<?php // DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN. ?>
<?php if (false && $this->state->get('list.ordering') !== 'relevance_dsc') : ?>
<input type="hidden" name="o" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>" />
<?php endif; ?>

<fieldset class="word">
<label for="q">
<?php echo JText::_('COM_FINDER_SEARCH_TERMS'); ?>
</label>
<input type="text" name="q" id="q" size="30" value="<?php echo $this->escape($this->query->input); ?>" class="inputbox" />
<?php if ($this->escape($this->query->input) != '' || $this->params->get('allow_empty_query')) : ?>
<button name="Search" type="submit" class="btn btn-primary"><span class="icon-search icon-white"></span> <?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button name="Search" type="submit" class="btn btn-primary">
<span class="icon-search icon-white"></span>
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<?php else : ?>
<button name="Search" type="submit" class="btn btn-primary disabled"><span class="icon-search icon-white"></span> <?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button name="Search" type="submit" class="btn btn-primary disabled">
<span class="icon-search icon-white"></span>
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<?php endif; ?>
<?php if ($this->params->get('show_advanced', 1)) : ?>
<a href="#advancedSearch" data-toggle="collapse" class="btn"><span class="icon-list" aria-hidden="true"></span> <?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE'); ?></a>
<a href="#advancedSearch" data-toggle="collapse" class="btn">
<span class="icon-list" aria-hidden="true"></span>
<?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE'); ?>
</a>
<?php endif; ?>
</fieldset>

<?php if ($this->params->get('show_advanced', 1)) : ?>
<div id="advancedSearch" class="collapse<?php if ($this->params->get('expand_advanced', 0)) echo ' in'; ?>">
<hr />
Expand Down
7 changes: 4 additions & 3 deletions components/com_finder/views/search/tmpl/default_result.php
Expand Up @@ -21,7 +21,7 @@
// Calculate number of characters to display around the result
$term_length = StringHelper::strlen($this->query->input);
$desc_length = $this->params->get('description_length', 255);
$pad_length = $term_length < $desc_length ? (int) floor(($desc_length - $term_length) / 2) : 0;
$pad_length = $term_length < $desc_length ? (int) floor(($desc_length - $term_length) / 2) : 0;

// Find the position of the search term
$pos = $term_length ? StringHelper::strpos(StringHelper::strtolower($this->result->description), StringHelper::strtolower($this->query->input)) : false;
Expand All @@ -48,10 +48,11 @@
}

?>

<li>
<h4 class="result-title <?php echo $mime; ?>">
<a href="<?php echo JRoute::_($route); ?>"><?php echo $this->result->title; ?></a>
<a href="<?php echo JRoute::_($route); ?>">
<?php echo $this->result->title; ?>
</a>
</h4>
<?php if ($show_description && $description !== '') : ?>
<p class="result-text<?php echo $this->pageclass_sfx; ?>">
Expand Down
26 changes: 7 additions & 19 deletions components/com_finder/views/search/tmpl/default_results.php
Expand Up @@ -18,64 +18,52 @@
<?php // Replace the base query string with the suggested query string. ?>
<?php $uri = JUri::getInstance($this->query->toUri()); ?>
<?php $uri->setVar('q', $this->suggested); ?>

<?php // Compile the suggested query link. ?>
<?php $linkUrl = JRoute::_($uri->toString(array('path', 'query'))); ?>
<?php $link = '<a href="' . $linkUrl . '">' . $this->escape($this->suggested) . '</a>'; ?>

<?php echo JText::sprintf('COM_FINDER_SEARCH_SIMILAR', $link); ?>

<?php // Display the explained search query. ?>
<?php elseif ($this->explained && $this->params->get('show_explained_query', 1)) : ?>
<?php // Display the explained search query. ?>
<?php echo $this->explained; ?>
<?php endif; ?>
</div>
<?php endif; ?>

<?php // Display the 'no results' message and exit the template. ?>
<?php if (($this->total === 0) || ($this->total === null)) : ?>
<div id="search-result-empty">
<h2><?php echo JText::_('COM_FINDER_SEARCH_NO_RESULTS_HEADING'); ?></h2>
<?php $multilang = JFactory::getApplication()->getLanguageFilter() ? '_MULTILANG' : ''; ?>
<p><?php echo JText::sprintf('COM_FINDER_SEARCH_NO_RESULTS_BODY' . $multilang, $this->escape($this->query->input)); ?></p>
</div>

<?php // Exit this template. ?>
<?php return; ?>
<?php endif; ?>

<?php // Activate the highlighter if enabled. ?>
<?php if (!empty($this->query->highlight) && $this->params->get('highlight_terms', 1)) : ?>
<?php JHtml::_('behavior.highlighter', $this->query->highlight); ?>
<?php endif; ?>

<?php // Display a list of results ?>
<br id="highlighter-start" />
<ul class="search-results<?php echo $this->pageclass_sfx; ?> list-striped">
<?php $this->baseUrl = JUri::getInstance()->toString(array('scheme', 'host', 'port')); ?>

<?php foreach ($this->results as $result) : ?>
<?php $this->result = &$result; ?>
<?php $layout = $this->getLayoutFile($this->result->layout); ?>
<?php echo $this->loadTemplate($layout); ?>
<?php endforeach; ?>
</ul>
<br id="highlighter-end" />

<?php // Display the pagination ?>
<div class="search-pagination">
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<div class="search-pages-counter">
<?php
// Prepare the pagination string. Results X - Y of Z
$start = (int) $this->pagination->get('limitstart') + 1;
$total = (int) $this->pagination->get('total');
$limit = (int) $this->pagination->get('limit') * $this->pagination->get('pages.current');
$limit = (int) ($limit > $total ? $total : $limit);

echo JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF', $start, $limit, $total);
?>
<?php // Prepare the pagination string. Results X - Y of Z ?>
<?php $start = (int) $this->pagination->get('limitstart') + 1; ?>
<?php $total = (int) $this->pagination->get('total'); ?>
<?php $limit = (int) $this->pagination->get('limit') * $this->pagination->get('pages.current'); ?>
<?php $limit = (int) ($limit > $total ? $total : $limit); ?>
<?php echo JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF', $start, $limit, $total); ?>
</div>
</div>
7 changes: 3 additions & 4 deletions components/com_newsfeeds/views/categories/tmpl/default.php
Expand Up @@ -22,10 +22,9 @@
});
});
});");

?>
<div class="categories-list<?php echo $this->pageclass_sfx; ?>">
<?php
echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
<?php echo JLayoutHelper::render('joomla.content.categories_default', $this); ?>
<?php echo $this->loadTemplate('items'); ?>
</div>

0 comments on commit cb3b5ba

Please sign in to comment.