Changeset 1728
- Timestamp:
- Jan 17, 2007, 11:27:10 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config_default.inc.php
r1722 r1728 165 165 // than a long explanation : 166 166 // 167 // $conf['links'] = array( 168 // 'http://phpwebgallery.net' => 'PWG website', 169 // 'http://forum.phpwebgallery.net' => 'PWG forum', 170 // 'http://phpwebgallery.net/doc' => 'PWG wiki' 171 // ); 167 // Simple use: 168 // for each link is associated a label 169 // $conf['links'] = array( 170 // 'http://phpwebgallery.net' => 'PWG website', 171 // 'http://forum.phpwebgallery.net' => 'PWG forum', 172 // 'http://phpwebgallery.net/doc' => 'PWG wiki' 173 // ); 174 // 175 // Advenced use: 176 // You can also used special options. Instead to pass a string like parameter value 177 // you can pass a array with different optional parameter values 178 // $conf['links'] = array( 179 // 'http://phpwebgallery.net' => array('label' => 'PWG website', 'new_window' => true, 'eval_visible' => 'return true;'), 180 // 'http://forum.phpwebgallery.net' => array('label' => 'For ADMIN', 'new_window' => true, 'eval_visible' => 'return is_admin();'), 181 // 'http://phpwebgallery.net/doc' => array('label' => 'For Guest', 'new_window' => true, 'eval_visible' => 'return $user[\'is_the_guest\'];'), 182 // ); 183 // 184 // Equivalence: 185 // $conf['links'] = array( 186 // 'http://phpwebgallery.net' => 'PWG website', 187 // ); 188 // $conf['links'] = array( 189 // 'http://phpwebgallery.net' => array('label' => 'PWG website', 'new_window' => false, 'visible' => 'return true;'), 190 // ); 172 191 // 173 192 // If the array is empty, the "Links" box won't be displayed on the main -
trunk/include/menubar.inc.php
r1723 r1728 54 54 55 55 //-------------------------------------------------------------- external links 56 foreach ($conf['links'] as $url => $label) 57 { 58 $template->assign_block_vars( 59 'links.link', 60 array( 61 'URL' => $url, 62 'LABEL' => $label 63 ) 64 ); 56 foreach ($conf['links'] as $url => $url_data) 57 { 58 if (!is_array($url_data)) 59 { 60 $url_data = array('label' => $url_data); 61 } 62 63 if 64 ( 65 (!isset($url_data['eval_visible'])) 66 or 67 (eval($url_data['eval_visible'])) 68 ) 69 { 70 $template->assign_block_vars( 71 'links.link', 72 array( 73 'URL' => $url, 74 'LABEL' => $url_data['label'] 75 ) 76 ); 77 if (isset($url_data['new_window']) and $url_data['new_window']) 78 { 79 $template->assign_block_vars('links.link.new_window', array('1'=>'1')); 80 } 81 } 65 82 } 66 83 -
trunk/template/yoga/menubar.tpl
r1703 r1728 7 7 <ul> 8 8 <!-- BEGIN link --> 9 <li><a href="{links.link.URL}">{links.link.LABEL}</a></li> 9 <li> 10 <a href="{links.link.URL}" 11 <!-- BEGIN new_window --> 12 onclick="window.open(this.href, ''); return false;" 13 <!-- END new_window --> 14 >{links.link.LABEL} 15 </a> 16 </li> 10 17 <!-- END link --> 11 18 </ul>
Note: See TracChangeset
for help on using the changeset viewer.