Skip to content

Commit

Permalink
Issue 0000624: Enhanced Links Menu
Browse files Browse the repository at this point in the history
Add name and features options when new_window is true.
(To display a popup for example)


git-svn-id: http://piwigo.org/svn/trunk@1743 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Jan 22, 2007
1 parent ee5dbae commit 767064c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions include/config_default.inc.php
Expand Up @@ -179,13 +179,22 @@
// 'http://phpwebgallery.net' => array('label' => 'PWG website', 'new_window' => false, 'eval_visible' => 'return true;'),
// 'http://forum.phpwebgallery.net' => array('label' => 'For ADMIN', 'new_window' => true, 'eval_visible' => 'return is_admin();'),
// 'http://phpwebgallery.net/doc' => array('label' => 'For Guest', 'new_window' => true, 'eval_visible' => 'return $user[\'is_the_guest\'];'),
// 'http://download.gna.org/phpwebgallery/' =>
// array('label' => 'PopUp', 'new_window' => true,
// 'nw_name' => 'PopUp', 'nw_features' => 'width=800,height=450,location=no,status=no,toolbar=no,scrollbars=no,menubar=no'),
// );
// Parameters:
// 'label':
// Label to display for the link, must be defined
// 'new_window':
// If true open link on tab/window
// [Default value is true if it's not defined]
// 'nw_name':
// Name use when new_window is true
// [Default value is '' if it's not defined]
// 'nw_features':
// features use when new_window is true
// [Default value is '' if it's not defined]
// 'eval_visible':
// It's php code witch must return if the link is visible or not
// [Default value is true if it's not defined]
Expand Down
8 changes: 7 additions & 1 deletion include/menubar.inc.php
Expand Up @@ -76,7 +76,13 @@
);
if (!isset($url_data['new_window']) or $url_data['new_window'])
{
$template->assign_block_vars('links.link.new_window', array('1'=>'1'));
$template->assign_block_vars(
'links.link.new_window',
array(
'name' => (isset($url_data['nw_name']) ? $url_data['nw_name'] : ''),
'features' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
)
);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion template/yoga/menubar.tpl
Expand Up @@ -9,7 +9,10 @@
<li>
<a href="{links.link.URL}"
<!-- BEGIN new_window -->
onclick="window.open(this.href, ''); return false;"
onclick="window.open(this.href,
'{links.link.new_window.name}',
'{links.link.new_window.features}'
); return false;"
<!-- END new_window -->
>{links.link.LABEL}
</a>
Expand Down

0 comments on commit 767064c

Please sign in to comment.