32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-25 17:51:07 +00:00

First step to 4.0 compatible

This commit is contained in:
chmst 2021-08-14 15:11:12 +02:00
parent 425daabf42
commit 757119be52
4 changed files with 26 additions and 52 deletions

View File

@ -5,29 +5,17 @@
MOD_WEBLINKS="Web Links"
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_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_GROUPBYORDERING_DESC="Ordering for the subcategories (valid only if grouping)."
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_COLUMNS_DESC="When grouping by subcategories, split into # 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_DESCRIPTION_DESC="Display Web Link 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_HITS_DESC="Show 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_ORDERING_DESC="Ordering for the Web Links."
MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering"
MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window"

View File

@ -14,7 +14,7 @@ use Joomla\Module\Weblinks\Site\Helper\WeblinksHelper;
$list = WeblinksHelper::getList($params, $app);
if (!count($list))
if (empty($list))
{
return;
}

View File

@ -25,7 +25,6 @@
name="catid"
type="category"
label="JCATEGORY"
description="MOD_WEBLINKS_FIELD_CATEGORY_DESC"
extension="com_weblinks"
required="true"
/>
@ -34,32 +33,29 @@
name="groupby"
type="radio"
label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL"
description="MOD_WEBLINKS_FIELD_GROUPBY_DESC"
class="btn-group btn-group-yesno"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="groupby_showtitle"
type="radio"
label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL"
description="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC"
class="btn-group btn-group-yesno"
layout="joomla.form.field.radio.switcher"
default="1"
showon="groupby:1"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="groupby_ordering"
type="list"
label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL"
description="MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC"
default="c.lft"
showon="groupby:1"
>
@ -71,7 +67,6 @@
name="groupby_direction"
type="list"
label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL"
description="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC"
default="asc"
showon="groupby:1"
>
@ -83,7 +78,6 @@
name="groupby_columns"
type="list"
label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL"
description="MOD_WEBLINKS_FIELD_COLUMNS_DESC"
default="3"
>
<option value="1">J1</option>
@ -97,7 +91,6 @@
name="count"
type="text"
label="MOD_WEBLINKS_FIELD_COUNT_LABEL"
description="MOD_WEBLINKS_FIELD_COUNT_DESC"
default="5"
/>
@ -105,7 +98,6 @@
name="ordering"
type="list"
label="MOD_WEBLINKS_FIELD_ORDERING_LABEL"
description="MOD_WEBLINKS_FIELD_ORDERING_DESC"
default="title"
>
<option value="title">JGLOBAL_TITLE</option>
@ -117,7 +109,6 @@
name="direction"
type="list"
label="MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL"
description="MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC"
default="asc"
>
<option value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
@ -128,7 +119,6 @@
name="follow"
type="list"
label="MOD_WEBLINKS_FIELD_FOLLOW_LABEL"
description="MOD_WEBLINKS_FIELD_FOLLOW_DESC"
default="0"
>
<option value="follow">MOD_WEBLINKS_FIELD_VALUE_FOLLOW</option>
@ -139,37 +129,33 @@
name="description"
type="radio"
label="MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL"
description="MOD_WEBLINKS_FIELD_DESCRIPTION_DESC"
class="btn-group btn-group-yesno"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="hits"
type="radio"
label="MOD_WEBLINKS_FIELD_HITS_LABEL"
description="MOD_WEBLINKS_FIELD_HITS_DESC"
class="btn-group btn-group-yesno"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="count_clicks"
type="list"
type="radio"
label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
description="MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC"
class="chzn-color"
default="0"
layout="joomla.form.field.radio.switcher"
default="1"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
@ -178,22 +164,23 @@
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
class="form-select"
validate="moduleLayout"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
rows="3"
validate="CssIdentifier"
/>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
description="COM_MODULES_FIELD_CACHING_DESC"
default="1"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
@ -204,7 +191,6 @@
name="cache_time"
type="text"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
/>

View File

@ -14,7 +14,7 @@ use Joomla\CMS\Language\Text;
?>
<?php if ($params->get('groupby', 0)) : ?>
<?php $cats = array(); ?>
<?php $cats = []; ?>
<?php $cols = $params->get('groupby_columns', 3); ?>
<?php foreach ($list as $l) : ?>
<?php $cats[] = array('catid' => $l->catid, 'title' => $l->category_title); ?>
@ -36,7 +36,7 @@ use Joomla\CMS\Language\Text;
<?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; ?>">
<ul class="mod-list weblinks <?php echo $moduleclass_sfx; ?>">
<?php foreach ($items as $item) : ?>
<li>
<?php $link = $item->link; ?>
@ -80,7 +80,7 @@ use Joomla\CMS\Language\Text;
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<ul class="weblinks<?php echo $moduleclass_sfx; ?>">
<ul class="weblinks mod-list <?php echo $moduleclass_sfx; ?>">
<?php foreach ($list as $item) : ?>
<li>
<?php $link = $item->link; ?>