From 6381378a8fe8fc260344e93fd24a833aaaa656d0 Mon Sep 17 00:00:00 2001 From: rub Date: Thu, 18 Jan 2007 22:01:28 +0000 Subject: Issue 0000624: Enhanced Links Menu Change default value. By default, a link will be opened on new tab/window. git-svn-id: http://piwigo.org/svn/trunk@1736 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/config_default.inc.php | 13 +++++++++++-- include/menubar.inc.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 52190833f..ce87e18fc 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -176,11 +176,20 @@ $conf['show_version'] = true; // You can also used special options. Instead to pass a string like parameter value // you can pass a array with different optional parameter values // $conf['links'] = array( -// 'http://phpwebgallery.net' => array('label' => 'PWG website', 'new_window' => true, 'eval_visible' => 'return true;'), +// '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\'];'), // ); -// +// 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] +// '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] +// // Equivalence: // $conf['links'] = array( // 'http://phpwebgallery.net' => 'PWG website', diff --git a/include/menubar.inc.php b/include/menubar.inc.php index 0fcaf1cbc..26e24df16 100644 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -74,7 +74,7 @@ foreach ($conf['links'] as $url => $url_data) 'LABEL' => $url_data['label'] ) ); - if (isset($url_data['new_window']) and $url_data['new_window']) + if (!isset($url_data['new_window']) or $url_data['new_window']) { $template->assign_block_vars('links.link.new_window', array('1'=>'1')); } -- cgit v1.2.3