added parameter for a popup in links

This commit is contained in:
Ralf Becker 2005-07-30 12:49:11 +00:00
parent e03b9a8a67
commit 566d5ecbd5
2 changed files with 16 additions and 4 deletions

View File

@ -103,9 +103,15 @@
{ {
foreach ($value as $link) foreach ($value as $link)
{ {
$options = '';
if (($popup = $this->link->is_popup($link['app'],'view')))
{
list($w,$h) = explode('x',$popup);
$options = ' onclick="window.open(this,this.target,\'width='.(int)$w.',height='.(int)$h.',location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false;"';
}
$str .= ($str !== '' ? ', ' : '') . $tmpl->html->a_href( $str .= ($str !== '' ? ', ' : '') . $tmpl->html->a_href(
$tmpl->html->htmlspecialchars($this->link->title($link['app'],$link['id'])), $tmpl->html->htmlspecialchars($this->link->title($link['app'],$link['id'])),
$this->link->view($link['app'],$link['id'],$link)); '/index.php',$this->link->view($link['app'],$link['id'],$link),$options);
} }
} }
$cell['type'] = 'html'; $cell['type'] = 'html';
@ -201,6 +207,7 @@
if (!is_array($link['id'])) if (!is_array($link['id']))
{ {
$value[$row]['view'] = $this->link->view($link['app'],$link['id'],$link); $value[$row]['view'] = $this->link->view($link['app'],$link['id'],$link);
$value[$row]['popup'] = $this->link->is_popup($link['app'],'view');
} }
} }
break; break;

View File

@ -817,10 +817,10 @@
} }
switch ($type) switch ($type)
{ {
case 'label': // size: [[b]old][[i]talic][,link][,activate_links][,label_for] case 'label': // size: [[b]old][[i]talic][,link][,activate_links][,label_for][,link_popup_size]
if (is_array($value)) if (is_array($value))
break; break;
list($style,$extra_link,$activate_links,$label_for) = explode(',',$cell_options); list($style,$extra_link,$activate_links,$label_for,$extra_link_popup) = explode(',',$cell_options);
$value = strlen($value) > 1 && !$cell['no_lang'] ? lang($value) : $value; $value = strlen($value) > 1 && !$cell['no_lang'] ? lang($value) : $value;
$value = nl2br($this->html->htmlspecialchars($value)); $value = nl2br($this->html->htmlspecialchars($value));
if ($activate_links) $value = $this->html->activate_links($value); if ($activate_links) $value = $this->html->activate_links($value);
@ -1434,7 +1434,12 @@
' onmouseout="self.status=\'\'; return true;"' : ''; ' onmouseout="self.status=\'\'; return true;"' : '';
if ($extra_link_target) $options .= ' target="'.$extra_link_target.'"'; if ($extra_link_target) $options .= ' target="'.$extra_link_target.'"';
if ($extra_link_popup)
{
list($w,$h) = explode('x',$extra_link_popup);
$options .= ' onclick="window.open(this,this.target,\'width='.(int)$w.',height='.(int)$h.',location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false;"';
}
return $this->html->a_href($html,$extra_link,'',$options); return $this->html->a_href($html,$extra_link,'',$options);
} }
} }