mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-12-25 17:51:07 +00:00
Merge pull request #8 from chmst/mod-weblinks-first
First step to mod_weblinks 4.0 compatible
This commit is contained in:
commit
065f724ae3
@ -5,29 +5,17 @@
|
|||||||
|
|
||||||
MOD_WEBLINKS="Web Links"
|
MOD_WEBLINKS="Web Links"
|
||||||
MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display."
|
MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display."
|
||||||
MOD_WEBLINKS_FIELD_GROUPBY_DESC="If set to yes, web links will be grouped by subcategories."
|
|
||||||
MOD_WEBLINKS_FIELD_GROUPBY_LABEL="Group By Subcategories"
|
MOD_WEBLINKS_FIELD_GROUPBY_LABEL="Group By Subcategories"
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC="If set to yes, will show groups titles (valid only if grouping)."
|
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL="Show Group Title"
|
MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL="Show Group Title"
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC="Ordering for the subcategories (valid only if grouping)."
|
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL="Group Ordering"
|
MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL="Group Ordering"
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC="Direction for the subcategories (valid only if grouping)."
|
|
||||||
MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL="Group Ordering Direction"
|
MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL="Group Ordering Direction"
|
||||||
MOD_WEBLINKS_FIELD_COLUMNS_DESC="When grouping by subcategories, split into # columns."
|
|
||||||
MOD_WEBLINKS_FIELD_COLUMNS_LABEL="Columns"
|
MOD_WEBLINKS_FIELD_COLUMNS_LABEL="Columns"
|
||||||
MOD_WEBLINKS_FIELD_COUNT_DESC="Number of Web Links to display."
|
MOD_WEBLINKS_FIELD_COUNT_LABEL="Count"MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
|
||||||
MOD_WEBLINKS_FIELD_COUNT_LABEL="Count"
|
|
||||||
MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
|
|
||||||
MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
|
MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
|
||||||
MOD_WEBLINKS_FIELD_DESCRIPTION_DESC="Display Web Link description."
|
|
||||||
MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL="Description"
|
MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL="Description"
|
||||||
MOD_WEBLINKS_FIELD_FOLLOW_DESC="Robots index - allow to follow or not."
|
|
||||||
MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow"
|
MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow"
|
||||||
MOD_WEBLINKS_FIELD_HITS_DESC="Show hits."
|
|
||||||
MOD_WEBLINKS_FIELD_HITS_LABEL="Hits"
|
MOD_WEBLINKS_FIELD_HITS_LABEL="Hits"
|
||||||
MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC="Set the ordering direction."
|
|
||||||
MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL="Direction"
|
MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL="Direction"
|
||||||
MOD_WEBLINKS_FIELD_ORDERING_DESC="Ordering for the Web Links."
|
|
||||||
MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering"
|
MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering"
|
||||||
MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
|
MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
|
||||||
MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window"
|
MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window"
|
||||||
|
@ -14,7 +14,7 @@ use Joomla\Module\Weblinks\Site\Helper\WeblinksHelper;
|
|||||||
|
|
||||||
$list = WeblinksHelper::getList($params, $app);
|
$list = WeblinksHelper::getList($params, $app);
|
||||||
|
|
||||||
if (!count($list))
|
if (empty($list))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
name="catid"
|
name="catid"
|
||||||
type="category"
|
type="category"
|
||||||
label="JCATEGORY"
|
label="JCATEGORY"
|
||||||
description="MOD_WEBLINKS_FIELD_CATEGORY_DESC"
|
|
||||||
extension="com_weblinks"
|
extension="com_weblinks"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
@ -34,32 +33,29 @@
|
|||||||
name="groupby"
|
name="groupby"
|
||||||
type="radio"
|
type="radio"
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBY_DESC"
|
layout="joomla.form.field.radio.switcher"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
default="0"
|
||||||
>
|
>
|
||||||
<option value="1">JYES</option>
|
|
||||||
<option value="0">JNO</option>
|
<option value="0">JNO</option>
|
||||||
|
<option value="1">JYES</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_showtitle"
|
name="groupby_showtitle"
|
||||||
type="radio"
|
type="radio"
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC"
|
layout="joomla.form.field.radio.switcher"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
default="1"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
<option value="1">JYES</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="0">JNO</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_ordering"
|
name="groupby_ordering"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC"
|
|
||||||
default="c.lft"
|
default="c.lft"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
@ -71,7 +67,6 @@
|
|||||||
name="groupby_direction"
|
name="groupby_direction"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC"
|
|
||||||
default="asc"
|
default="asc"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
@ -83,7 +78,6 @@
|
|||||||
name="groupby_columns"
|
name="groupby_columns"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL"
|
label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_COLUMNS_DESC"
|
|
||||||
default="3"
|
default="3"
|
||||||
>
|
>
|
||||||
<option value="1">J1</option>
|
<option value="1">J1</option>
|
||||||
@ -97,7 +91,6 @@
|
|||||||
name="count"
|
name="count"
|
||||||
type="text"
|
type="text"
|
||||||
label="MOD_WEBLINKS_FIELD_COUNT_LABEL"
|
label="MOD_WEBLINKS_FIELD_COUNT_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_COUNT_DESC"
|
|
||||||
default="5"
|
default="5"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -105,7 +98,6 @@
|
|||||||
name="ordering"
|
name="ordering"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_ORDERING_LABEL"
|
label="MOD_WEBLINKS_FIELD_ORDERING_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_ORDERING_DESC"
|
|
||||||
default="title"
|
default="title"
|
||||||
>
|
>
|
||||||
<option value="title">JGLOBAL_TITLE</option>
|
<option value="title">JGLOBAL_TITLE</option>
|
||||||
@ -117,7 +109,6 @@
|
|||||||
name="direction"
|
name="direction"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL"
|
label="MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC"
|
|
||||||
default="asc"
|
default="asc"
|
||||||
>
|
>
|
||||||
<option value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
<option value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
||||||
@ -128,8 +119,7 @@
|
|||||||
name="follow"
|
name="follow"
|
||||||
type="list"
|
type="list"
|
||||||
label="MOD_WEBLINKS_FIELD_FOLLOW_LABEL"
|
label="MOD_WEBLINKS_FIELD_FOLLOW_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_FOLLOW_DESC"
|
default="follow"
|
||||||
default="0"
|
|
||||||
>
|
>
|
||||||
<option value="follow">MOD_WEBLINKS_FIELD_VALUE_FOLLOW</option>
|
<option value="follow">MOD_WEBLINKS_FIELD_VALUE_FOLLOW</option>
|
||||||
<option value="nofollow">MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW</option>
|
<option value="nofollow">MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW</option>
|
||||||
@ -139,37 +129,33 @@
|
|||||||
name="description"
|
name="description"
|
||||||
type="radio"
|
type="radio"
|
||||||
label="MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL"
|
label="MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
layout="joomla.form.field.radio.switcher"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
default="0"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="hits"
|
name="hits"
|
||||||
type="radio"
|
type="radio"
|
||||||
label="MOD_WEBLINKS_FIELD_HITS_LABEL"
|
label="MOD_WEBLINKS_FIELD_HITS_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_HITS_DESC"
|
layout="joomla.form.field.radio.switcher"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
default="0"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="count_clicks"
|
name="count_clicks"
|
||||||
type="list"
|
type="radio"
|
||||||
label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
layout="joomla.form.field.radio.switcher"
|
||||||
class="chzn-color"
|
default="1"
|
||||||
default="0"
|
|
||||||
>
|
>
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="0">JNO</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="1">JYES</option>
|
|
||||||
</field>
|
</field>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
@ -178,22 +164,23 @@
|
|||||||
name="layout"
|
name="layout"
|
||||||
type="modulelayout"
|
type="modulelayout"
|
||||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
|
class="form-select"
|
||||||
|
validate="moduleLayout"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="moduleclass_sfx"
|
name="moduleclass_sfx"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
|
|
||||||
rows="3"
|
rows="3"
|
||||||
|
validate="CssIdentifier"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="cache"
|
name="cache"
|
||||||
type="list"
|
type="list"
|
||||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||||
description="COM_MODULES_FIELD_CACHING_DESC"
|
|
||||||
default="1"
|
default="1"
|
||||||
>
|
>
|
||||||
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||||
@ -204,7 +191,6 @@
|
|||||||
name="cache_time"
|
name="cache_time"
|
||||||
type="text"
|
type="text"
|
||||||
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||||
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
|
|
||||||
default="900"
|
default="900"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -11,110 +11,126 @@ defined('_JEXEC') or die;
|
|||||||
|
|
||||||
use Joomla\CMS\Language\Text;
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
?>
|
if ($params->get('groupby', 0)) :
|
||||||
|
$cats = [];
|
||||||
|
$cols = $params->get('groupby_columns', 3);
|
||||||
|
|
||||||
<?php if ($params->get('groupby', 0)) : ?>
|
foreach ($list as $l) :
|
||||||
<?php $cats = array(); ?>
|
$cats[] = array('catid' => $l->catid, 'title' => $l->category_title);
|
||||||
<?php $cols = $params->get('groupby_columns', 3); ?>
|
endforeach;
|
||||||
<?php foreach ($list as $l) : ?>
|
|
||||||
<?php $cats[] = array('catid' => $l->catid, 'title' => $l->category_title); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php $cats = array_values(array_map('unserialize', array_unique(array_map('serialize', $cats)))); ?>
|
|
||||||
<?php foreach ($cats as $k => $cat) : ?>
|
|
||||||
<?php $items = array(); ?>
|
|
||||||
<?php foreach ($list as $item) : ?>
|
|
||||||
<?php if ($item->catid == $cat['catid']) : ?>
|
|
||||||
<?php $items[] = $item; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($cols > 1) : ?>
|
|
||||||
<?php if ($k % $cols == 0) : ?>
|
|
||||||
<div class="row row-fluid">
|
|
||||||
<?php endif; ?>
|
|
||||||
<div class="span<?php echo (12 / $cols); ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($params->get('groupby_showtitle', 1)) : ?>
|
|
||||||
<h4><?php echo htmlspecialchars($cat['title'], ENT_COMPAT, 'UTF-8'); ?></h4>
|
|
||||||
<?php endif; ?>
|
|
||||||
<ul class="weblinks<?php echo $moduleclass_sfx; ?>">
|
|
||||||
<?php foreach ($items as $item) : ?>
|
|
||||||
<li>
|
|
||||||
<?php $link = $item->link; ?>
|
|
||||||
<?php
|
|
||||||
switch ($item->params->get('target', 3))
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
// Open in a new window
|
|
||||||
echo '<a href="' . $link . '" target="_blank" rel="' . $params->get('follow', 'nofollow') . '">' .
|
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
$cats = array_values(array_map('unserialize', array_unique(array_map('serialize', $cats))));
|
||||||
// Open in a popup window
|
|
||||||
echo "<a href=\"#\" onclick=\"window.open('" . $link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">" .
|
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
foreach ($cats as $k => $cat) :
|
||||||
// Open in parent window
|
$items = [];
|
||||||
echo '<a href="' . $link . '" rel="' . $params->get('follow', 'nofollow') . '">' .
|
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php if ($params->get('description', 0)) : ?>
|
|
||||||
<?php echo nl2br($item->description); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($params->get('hits', 0)) : ?>
|
foreach ($list as $item) :
|
||||||
<?php echo '(' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . ')'; ?>
|
if ($item->catid == $cat['catid']) :
|
||||||
<?php endif; ?>
|
$items[] = $item;
|
||||||
</li>
|
endif;
|
||||||
<?php endforeach; ?>
|
endforeach;
|
||||||
</ul>
|
|
||||||
<?php if ($cols > 1) : ?>
|
|
||||||
</div>
|
|
||||||
<?php if(($k + 1) % $cols == 0 || $k == count($cats) - 1) : ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php else : ?>
|
|
||||||
<ul class="weblinks<?php echo $moduleclass_sfx; ?>">
|
|
||||||
<?php foreach ($list as $item) : ?>
|
|
||||||
<li>
|
|
||||||
<?php $link = $item->link; ?>
|
|
||||||
<?php
|
|
||||||
switch ($item->params->get('target', 3))
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
// Open in a new window
|
|
||||||
echo '<a href="' . $link . '" target="_blank" rel="' . $params->get('follow', 'nofollow') . '">' .
|
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
if ($cols > 1) :
|
||||||
// Open in a popup window
|
if ($k % $cols == 0) :
|
||||||
echo "<a href=\"#\" onclick=\"window.open('" . $link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">" .
|
echo '<div class="row row-fluid">';
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
endif;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
echo '<div class="col-' . 12 / $cols . '">';
|
||||||
// Open in parent window
|
endif;
|
||||||
echo '<a href="' . $link . '" rel="' . $params->get('follow', 'nofollow') . '">' .
|
|
||||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php if ($params->get('description', 0)) : ?>
|
if ($params->get('groupby_showtitle', 1)) :
|
||||||
<?php echo nl2br($item->description); ?>
|
echo '<strong>' . htmlspecialchars($cat['title'], ENT_COMPAT, 'UTF-8') . '</strong>';
|
||||||
<?php endif; ?>
|
endif;
|
||||||
|
|
||||||
<?php if ($params->get('hits', 0)) : ?>
|
echo '<ul class="mod-list weblinks ' . $moduleclass_sfx . '">';
|
||||||
<?php echo '(' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . ')'; ?>
|
|
||||||
<?php endif; ?>
|
foreach ($items as $item) :
|
||||||
</li>
|
echo '<li><div class="d-flex flex-wrap">';
|
||||||
<?php endforeach; ?>
|
echo '<div class="col flex-sm-grow-1">';
|
||||||
</ul>
|
|
||||||
<?php endif; ?>
|
$link = $item->link;
|
||||||
|
switch ($item->params->get('target', 3)) :
|
||||||
|
case 1:
|
||||||
|
// Open in a new window
|
||||||
|
echo '<a href="' . $link . '" target="_blank" rel="' . $params->get('follow', 'nofollow') . '">' .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
// Open in a popup window
|
||||||
|
echo "<a href=\"#\" onclick=\"window.open('" . $link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">" .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Open in parent window
|
||||||
|
echo '<a href="' . $link . '" rel="' . $params->get('follow', 'nofollow') . '">' .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
endswitch;
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
echo $params->get('description', 0) ? '<div class="colvflex-sm-grow-1">' . nl2br($item->description) . '</div>' : '';
|
||||||
|
|
||||||
|
if ($params->get('hits', 0)) :
|
||||||
|
echo '<div class="col flex-sm-grow-1">';
|
||||||
|
echo '<span class="badge bg-info float-md-end">' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . '</span>';
|
||||||
|
echo '</div>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
echo '</ul>';
|
||||||
|
|
||||||
|
if ($cols > 1) :
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
if (($k + 1) % $cols == 0 || $k == count($cats) - 1) :
|
||||||
|
echo '</div>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
else :
|
||||||
|
echo '<ul class="mod-list weblinks ' . $moduleclass_sfx . '">';
|
||||||
|
|
||||||
|
foreach ($list as $item) :
|
||||||
|
echo '<li><div class="d-flex flex-wrap">';
|
||||||
|
echo '<div class="col flex-sm-grow-1">';
|
||||||
|
|
||||||
|
$link = $item->link;
|
||||||
|
switch ($item->params->get('target', 3)) :
|
||||||
|
case 1:
|
||||||
|
// Open in a new window
|
||||||
|
echo '<a href="' . $link . '" target="_blank" rel="' . $params->get('follow', 'nofollow') . '">' .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
// Open in a popup window
|
||||||
|
echo "<a href=\"#\" onclick=\"window.open('" . $link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">" .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Open in parent window
|
||||||
|
echo '<a href="' . $link . '" rel="' . $params->get('follow', 'nofollow') . '">' .
|
||||||
|
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||||
|
break;
|
||||||
|
endswitch;
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
echo $params->get('description', 0) ? '<div class="col flex-sm-grow-1">' . nl2br($item->description) . '</div>' : '';
|
||||||
|
|
||||||
|
if ($params->get('hits', 0)) :
|
||||||
|
echo '<div class="col flex-sm-grow-1">';
|
||||||
|
echo '<span class="badge bg-info float-md-end">' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . '</span>';
|
||||||
|
echo '</div>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
echo '</ul>';
|
||||||
|
endif; ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user