mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-09-28 04:59:04 +00:00
Add parameter target to weblinks module
This commit is contained in:
parent
1bff687429
commit
a448df85ec
@ -157,6 +157,19 @@
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="target"
|
||||
type="list"
|
||||
label="MOD_WEBLINKS_FIELD_TARGET_LABEL"
|
||||
default="0"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JBROWSERTARGET_PARENT</option>
|
||||
<option value="1">JBROWSERTARGET_NEW</option>
|
||||
<option value="2">JBROWSERTARGET_POPUP</option>
|
||||
<option value="3">JBROWSERTARGET_MODAL</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="advanced">
|
||||
|
@ -46,12 +46,12 @@ use Joomla\CMS\HTML\HTMLHelper;
|
||||
{
|
||||
case 1:
|
||||
// Open in a new window
|
||||
echo '<a href="' . $link . '" target="_blank" class="' . $menuclass . '" rel="nofollow">' .
|
||||
echo '<a href="' . $link . '" target="_blank" class="weblinks_module_<?php echo $" rel="nofollow">' .
|
||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||
break;
|
||||
case 2:
|
||||
// Open in a popup window
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . htmlspecialchars($width, ENT_COMPAT, 'UTF-8') . ',height=' . htmlspecialchars($width, ENT_COMPAT, 'UTF-8') . '';
|
||||
echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\">" .
|
||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||
break;
|
||||
@ -104,12 +104,14 @@ use Joomla\CMS\HTML\HTMLHelper;
|
||||
{
|
||||
case 1:
|
||||
// Open in a new window
|
||||
echo '<a href="' . $link . '" target="_blank" class="' . $menuclass . '" rel="nofollow">' .
|
||||
echo '<a href="' . $link . '" target="_blank" class="mod-weblink-item' . $item->id . '" rel="nofollow">' .
|
||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||
break;
|
||||
case 2:
|
||||
// Open in a popup window
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
||||
$width = $item->params->get('width', 600);
|
||||
$height = $item->params->get('height', 500);
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . htmlspecialchars($width, ENT_COMPAT, 'UTF-8') . ',height=' . htmlspecialchars($height, ENT_COMPAT, 'UTF-8') . '';
|
||||
echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\">" .
|
||||
htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8') . '</a>';
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user