Skip to content

Commit

Permalink
Merge branch 'staging' into cf/field-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Mar 15, 2017
2 parents afe0f85 + 16b6fd0 commit d310fe3
Show file tree
Hide file tree
Showing 114 changed files with 344 additions and 198 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.settings
.DS_Store
.idea
.vscode

# Local System Files (i.e. cache, logs, etc.) #
/administrator/cache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Where can you get support and help?
* Find the [information you need](https://docs.joomla.org/Start_here);
* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html);
* Post questions at [our forums](https://forum.joomla.org);
* [Joomla Resources Directory](http://resources.joomla.org/) (JRD).
* [Joomla Resources Directory](https://resources.joomla.org/) (JRD).

Do you already have a Joomla! site that isn't built with Joomla! 3.x?
---------------------
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* Find the information you need: https://docs.joomla.org/Start_here
* Find help and other users: https://www.joomla.org/about-joomla/create-and-share.html
* Post questions at our forums: https://forum.joomla.org
* Joomla! Resources Directory (JRD): http://resources.joomla.org/
* Joomla! Resources Directory (JRD): https://resources.joomla.org/

11- Do you already have a Joomla! site that's not built with Joomla! 3.x ?
* What's new in Joomla! 3.x: https://www.joomla.org/3
Expand Down
51 changes: 32 additions & 19 deletions administrator/components/com_associations/helpers/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ private static function getExtensionRealName($extensionName)
/**
* Get the associated language edit links Html.
*
* @param string $extensionName Extension Name
* @param string $typeName ItemType
* @param integer $itemId Item id.
* @param string $itemLanguage Item language code.
* @param boolean $addLink True for adding edit links. False for just text.
* @param boolean $allLanguages True for showing all content languages. False only languages with associations.
* @param string $extensionName Extension Name
* @param string $typeName ItemType
* @param integer $itemId Item id.
* @param string $itemLanguage Item language code.
* @param boolean $addLink True for adding edit links. False for just text.
* @param boolean $assocLanguages True for showing non associated content languages. False only languages with associations.
*
* @return string The language HTML
*
* @since 3.7.0
*/
public static function getAssociationHtmlList($extensionName, $typeName, $itemId, $itemLanguage, $addLink = true, $allLanguages = true)
public static function getAssociationHtmlList($extensionName, $typeName, $itemId, $itemLanguage, $addLink = true, $assocLanguages = true)
{
// Get the associations list for this item.
$items = self::getAssociationList($extensionName, $typeName, $itemId);
Expand All @@ -191,16 +191,23 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
continue;
}

// Don't show languages with associations, if we don't want to show them.
if ($assocLanguages && isset($items[$langCode]))
{
unset($items[$langCode]);
continue;
}

// Don't show languages without associations, if we don't want to show them.
if (!$allLanguages && !isset($items[$langCode]))
if (!$assocLanguages && !isset($items[$langCode]))
{
continue;
}

// Get html parameters.
if (isset($items[$langCode]))
{
$title = '<br/><br/>' . $items[$langCode][$titleFieldName];
$title = $items[$langCode][$titleFieldName];
$additional = '';

if (isset($items[$langCode]['category_title']))
Expand All @@ -212,21 +219,21 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
$additional = '<br/>' . JText::_('COM_ASSOCIATIONS_HEADING_MENUTYPE') . ': ' . $items[$langCode]['menu_title'];
}

$labelClass = 'label';
$labelClass = '';
$target = $langCode . ':' . $items[$langCode]['id'] . ':edit';
$allow = $canEditReference
&& self::allowEdit($extensionName, $typeName, $items[$langCode]['id'])
&& self::canCheckinItem($extensionName, $typeName, $items[$langCode]['id']);

$additional .= $addLink && $allow ? '<br/><br/>' . JText::_('COM_ASSOCIATIONS_EDIT_ASSOCIATION') : '';
$additional .= $addLink && $allow ? JText::_('COM_ASSOCIATIONS_EDIT_ASSOCIATION') : '';
}
else
{
$items[$langCode] = array();

$title = '<br/><br/>' . JText::_('COM_ASSOCIATIONS_NO_ASSOCIATION');
$additional = $addLink ? '<br/><br/>' . JText::_('COM_ASSOCIATIONS_ADD_NEW_ASSOCIATION') : '';
$labelClass = 'label label-warning';
$title = JText::_('COM_ASSOCIATIONS_NO_ASSOCIATION');
$additional = $addLink ? JText::_('COM_ASSOCIATIONS_ADD_NEW_ASSOCIATION') : '';
$labelClass = 'label-warning';
$target = $langCode . ':0:add';
$allow = $canCreate;
}
Expand All @@ -242,14 +249,19 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
'target' => $target,
);

$url = JRoute::_('index.php?' . http_build_query($options));
$text = strtoupper($language->sef);
$langImage = JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title, array('title' => $language->title), true);
$tooltip = implode(' ', array($langImage, $language->title, $title, $additional));
$url = JRoute::_('index.php?' . http_build_query($options));
$url = $allow && $addLink ? $url : '';
$text = strtoupper($language->sef);

$tooltip = htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '<br /><br />' . $additional;
$classes = 'hasPopover label ' . $labelClass . ' label-' . $language->sef;

$items[$langCode]['link'] = JHtml::_('tooltip', $tooltip, null, null, $text, $allow && $addLink ? $url : '', null, 'hasTooltip ' . $labelClass);
$items[$langCode]['link'] = '<a href="' . $url . '" title="' . $language->title . '" class="' . $classes
. '" data-content="' . $tooltip . '" data-placement="top">'
. $text . '</a>';
}

JHtml::_('bootstrap.popover');
return JLayoutHelper::render('joomla.content.associations', $items);
}

Expand Down Expand Up @@ -416,6 +428,7 @@ public static function getContentLanguages()
$query = $db->getQuery(true)
->select($db->quoteName(array('sef', 'lang_code', 'image', 'title', 'published')))
->from($db->quoteName('#__languages'))
->where($db->quoteName('published') . ' != -2')
->order($db->quoteName('ordering') . ' ASC');

$db->setQuery($query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<th width="5%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
</th>
<th width="15%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_NO_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
</th>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<th width="10%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_MENUTYPE', 'menutype_title', $listDirn, $listOrder); $colSpan++; ?>
Expand Down Expand Up @@ -143,10 +146,13 @@
<?php endif; ?>
</td>
<td class="small">
<?php echo $item->language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . '&nbsp;' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, !$isCheckout, false); ?>
</td>
<td>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, !$isCheckout); ?>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, !$isCheckout, true); ?>
</td>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<td class="small">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@
<?php endif; ?>
</td>
<td class="small">
<?php echo $item->language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . '&nbsp;' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td>
<?php if (true || $item->association) : ?>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, false); ?>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, false, false); ?>
<?php endif; ?>
</td>
<?php if (!empty($this->typeFields['menutype'])) : ?>
Expand Down
4 changes: 1 addition & 3 deletions administrator/components/com_fields/helpers/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ function categoryHasChanged(element) {
// Loading the XML fields string into the form
$form->load($xml->saveXML());

$model = JModelLegacy::getInstance('Field', 'FieldsModel', array(
'ignore_request' => true)
);
$model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true));

if ((!isset($data->id) || !$data->id) && JFactory::getApplication()->input->getCmd('controller') == 'config.display.modules'
&& JFactory::getApplication()->isClient('site'))
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fields/models/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
type="category"
label="JCATEGORY"
extension="com_content"
description="JFIELD_CATEGORY_DESC"
description="JFIELD_FIELDS_CATEGORY_DESC"
multiple="true"
>
<option value="">JALL</option>
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_fields/views/field/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,7 @@ protected function addToolbar()
{
JToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE');
}

JToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELDS_EDIT');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ protected function addToolbar()
{
JToolbarHelper::trash('fields.trash');
}

JToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELDS');
}

/**
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_fields/views/group/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,7 @@ protected function addToolbar()
{
JToolbarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
}

JToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELD_GROUPS_EDIT');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ protected function addToolbar()
{
JToolbarHelper::trash('groups.trash');
}

JToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELD_GROUPS');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/helpers/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public static function getMenuLinks($menuType = null, $parentId = 0, $mode = 0,
a.lft')
->from('#__menu AS a');

$query->select('e.name as componentname')
$query->select('e.name as componentname, e.element')
->join('left', '#__extensions e ON e.extension_id = a.component_id');

if (JLanguageMultilang::isEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

foreach ($menuLinks as $i => $link) : ?>
<?php
if ($extension = $link->componentname):
if ($extension = $link->element):
$lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true)
|| $lang->load("$extension.sys", JPATH_ADMINISTRATOR . '/components/' . $extension, null, false, true);
endif;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
<div id="j-main-container">
<?php endif;?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('selectorFieldName' => 'menutype'))); ?>
<?php if ($this->total > 0) : ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="itemList">
<thead>
<tr>
Expand Down

0 comments on commit d310fe3

Please sign in to comment.