Merge pull request #5 from zero-24/weblinks_assoc

fix some smal things
This commit is contained in:
infograf768 2017-05-22 12:01:44 +02:00 committed by GitHub
commit da554cbac7
8 changed files with 26 additions and 27 deletions

View File

@ -16,7 +16,7 @@ JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_webli
/**
* Weblink HTML helper class.
*
* @since 1.6
* @since __DELPOY_VERSION__
*/
abstract class JHtmlWeblink
{
@ -28,14 +28,17 @@ abstract class JHtmlWeblink
* @return string The language HTML
*
* @throws Exception
*
* @since __DELPOY_VERSION__
*/
public static function association($weblinkid)
{
// Defaults
$html = '';
$associations = JLanguageAssociations::getAssociations('com_weblinks', '#__weblinks', 'com_weblinks.item', $weblinkid);
// Get the associations
if ($associations = JLanguageAssociations::getAssociations('com_weblinks', '#__weblinks', 'com_weblinks.item', $weblinkid))
if ($associations)
{
foreach ($associations as $tag => $associated)
{

View File

@ -90,18 +90,8 @@
<option value="access_level DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
<option value="a.hits DESC">JGLOBAL_HITS_DESC</option>
<option
value="association ASC"
requires="associations"
>
JASSOCIATIONS_ASC
</option>
<option
value="association DESC"
requires="associations"
>
JASSOCIATIONS_DESC
</option>
<option value="association ASC" requires="associations">JASSOCIATIONS_ASC</option>
<option value="association DESC" requires="associations">JASSOCIATIONS_DESC</option>
<option value="language_title ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="language_title DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>

View File

@ -32,7 +32,7 @@ class WeblinksModelWeblink extends JModelAdmin
* The context used for the associations table
*
* @var string
* @since 3.4.4
* @since __DEPLOY_VERSION__
*/
protected $associationsContext = 'com_weblinks.item';
@ -211,7 +211,6 @@ class WeblinksModelWeblink extends JModelAdmin
$item->images = $registry->toArray();
// Load associated web links items
$app = JFactory::getApplication();
$assoc = JLanguageAssociations::isEnabled();
if ($assoc)

View File

@ -54,6 +54,7 @@ class WeblinksModelWeblinks extends JModelList
);
$assoc = JLanguageAssociations::isEnabled();
if ($assoc)
{
$config['filter_fields'][] = 'association';

View File

@ -84,7 +84,7 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ( ! $isModal && $assoc) : ?>
<?php if (!$isModal && $assoc) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<?php echo $this->loadTemplate('associations'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>

View File

@ -7,7 +7,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
if ($app->isClient('site'))
{
JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
@ -26,23 +28,27 @@ JHtml::_('formbehavior.chosen', 'select');
// Special case for the search field tooltip.
$searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter');
JHtml::_('bootstrap.tooltip', '#filter_search', array('title' => JText::_($searchFilterDesc), 'placement' => 'bottom'));
$function = $app->input->getCmd('function', 'jSelectWeblink');
$editor = $app->input->getCmd('editor', '');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$onclick = $this->escape($function);
if (!empty($editor))
{
// This view is used also in com_menus. Load the xtd script only if the editor is set!
JFactory::getDocument()->addScriptOptions('xtd-weblinks', array('editor' => $editor));
$onclick = "jSelectWeblink";
}
$iconStates = array(
-2 => 'icon-trash',
0 => 'icon-unpublish',
1 => 'icon-publish',
2 => 'icon-archive',
);
?>
<div class="container-popup">