Changeset 2226
- Timestamp:
- Feb 29, 2008, 12:41:47 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_options.php
r2223 r2226 31 31 32 32 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 33 include_once(PHPWG_ROOT_PATH.'admin/include/ functions_tabsheet.inc.php');33 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 34 34 35 35 // +-----------------------------------------------------------------------+ … … 160 160 ); 161 161 162 // TabSheet 163 $tabsheet = new tabsheet(); 162 164 // TabSheet initialization 163 165 $opt_link = $link_start.'cat_options&section='; 164 $tabsheet = array 165 ( 166 'status' => array 167 ( 168 'caption' => l10n('cat_security'), 169 'url' => $opt_link.'status' 170 ), 171 'visible' => array 172 ( 173 'caption' => l10n('lock'), 174 'url' => $opt_link.'visible' 175 ), 176 'upload' => array 177 ( 178 'caption' => l10n('upload'), 179 'url' => $opt_link.'upload' 180 ), 181 'comments' => array 182 ( 183 'caption' => l10n('comments'), 184 'url' => $opt_link.'comments' 185 ), 186 ); 187 166 $tabsheet->add('status', l10n('cat_security'), $opt_link.'status'); 167 $tabsheet->add('visible', l10n('lock'), $opt_link.'visible'); 168 $tabsheet->add('upload', l10n('upload'), $opt_link.'upload'); 169 $tabsheet->add('comments', l10n('comments'), $opt_link.'comments'); 188 170 if ($conf['allow_random_representative']) 189 171 { 190 $tabsheet['representative'] = 191 array 192 ( 193 'caption' => l10n('Representative'), 194 'url' => $opt_link.'representative' 195 ); 196 } 197 $tabsheet[$page['section']]['selected'] = true; 198 172 $tabsheet->add('representative', l10n('Representative'), $opt_link.'representative'); 173 } 174 // TabSheet selection 175 $tabsheet->select($page['section']); 199 176 // Assign tabsheet to template 200 $template->assign( 201 array( 202 'tabsheet' => $tabsheet, 203 'TABSHEET_TITLE' => $tabsheet[$page['section']]['caption'] 204 ) 205 ); 177 $tabsheet->assign(); 206 178 207 179 // +-----------------------------------------------------------------------+ -
trunk/admin/configuration.php
r2201 r2226 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 32 32 33 33 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 34 include_once(PHPWG_ROOT_PATH.'admin/include/ functions_tabsheet.inc.php');34 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 35 35 36 36 // +-----------------------------------------------------------------------+ … … 158 158 $template->set_filename('config', 'admin/configuration.tpl'); 159 159 160 // TabSheet 161 $tabsheet = new tabsheet(); 160 162 // TabSheet initialization 161 $page['tabsheet'] = array 162 ( 163 'main' => array 164 ( 165 'caption' => l10n('conf_main_title'), 166 'url' => $conf_link.'main' 167 ), 168 'history' => array 169 ( 170 'caption' => l10n('conf_history_title'), 171 'url' => $conf_link.'history' 172 ), 173 'comments' => array 174 ( 175 'caption' => l10n('conf_comments_title'), 176 'url' => $conf_link.'comments' 177 ), 178 'default' => array 179 ( 180 'caption' => l10n('conf_display'), 181 'url' => $conf_link.'default' 182 ) 183 ); 184 185 $page['tabsheet'][$page['section']]['selected'] = true; 186 163 $tabsheet->add('main', l10n('conf_main_title'), $conf_link.'main'); 164 $tabsheet->add('history', l10n('conf_history_title'), $conf_link.'history'); 165 $tabsheet->add('comments', l10n('conf_comments_title'), $conf_link.'comments'); 166 $tabsheet->add('default', l10n('conf_display'), $conf_link.'default'); 167 // TabSheet selection 168 $tabsheet->select($page['section']); 187 169 // Assign tabsheet to template 188 template_assign_tabsheet();170 $tabsheet->assign(); 189 171 190 172 $action = PHPWG_ROOT_PATH.'admin.php?page=configuration'; -
trunk/admin/include/functions_history.inc.php
r2157 r2226 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 25 25 // +-----------------------------------------------------------------------+ 26 26 27 include_once(PHPWG_ROOT_PATH.'admin/include/ functions_tabsheet.inc.php');27 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 28 28 29 29 function history_tabsheet() … … 31 31 global $page, $link_start; 32 32 33 // TabSheet 34 $tabsheet = new tabsheet(); 33 35 // TabSheet initialization 34 $page['tabsheet'] = array 35 ( 36 'stats' => array 37 ( 38 'caption' => l10n('Statistics'), 39 'url' => $link_start.'stats' 40 ), 41 'history' => array 42 ( 43 'caption' => l10n('Search'), 44 'url' => $link_start.'history' 45 ) 46 ); 47 48 $page['tabsheet'][$page['page']]['selected'] = true; 49 36 $tabsheet->add('stats', l10n('Statistics'), $link_start.'stats'); 37 $tabsheet->add('history', l10n('Search'), $link_start.'history'); 38 // TabSheet selection 39 $tabsheet->select($page['page']); 50 40 // Assign tabsheet to template 51 template_assign_tabsheet();41 $tabsheet->assign(); 52 42 } 53 43 -
trunk/admin/include/functions_waiting.inc.php
r1915 r2226 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 25 25 // +-----------------------------------------------------------------------+ 26 26 27 include_once(PHPWG_ROOT_PATH.'admin/include/ functions_tabsheet.inc.php');27 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 28 28 29 29 function waiting_tabsheet() … … 31 31 global $page, $link_start; 32 32 33 // TabSheet 34 $tabsheet = new tabsheet(); 33 35 // TabSheet initialization 34 $page['tabsheet'] = array 35 ( 36 'comments' => array 37 ( 38 'caption' => l10n('comments'), 39 'url' => $link_start.'comments' 40 ), 41 'upload' => array 42 ( 43 'caption' => l10n('upload_pictures'), 44 'url' => $link_start.'upload' 45 ) 46 ); 47 48 $page['tabsheet'][$page['page']]['selected'] = true; 49 36 $tabsheet->add('comments', l10n('comments'), $link_start.'comments'); 37 $tabsheet->add('upload', l10n('upload_pictures'), $link_start.'upload'); 38 // TabSheet selection 39 $tabsheet->select($page['page']); 50 40 // Assign tabsheet to template 51 template_assign_tabsheet();41 $tabsheet->assign(); 52 42 } 53 43 -
trunk/admin/include/tabsheet.class.php
r2225 r2226 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 25 25 // +-----------------------------------------------------------------------+ 26 26 27 /* 28 * Build TabSheet and assign this content to current page 29 * 30 * Uses $page['tabsheet'], it's an array of array 31 * 32 * $page['tabsheet'] description: 33 * $page['tabsheet']'[url'] : Tab link 34 * $page['tabsheet']['Caption'] : Tab caption 35 * $page['tabsheet']['selected'] : Is the selected tab (default value false) 36 * 37 * Fill {TABSHEET} with HTML code for tabshette 38 * Fill {U_TABSHEET_TITLE} with formated caption of the selected tab 39 */ 27 class tabsheet 28 { 29 var $sheets; 30 var $name; 31 var $titlename; 32 var $selected; 40 33 41 function template_assign_tabsheet() 42 { 43 global $page, $template; 44 //THIS SHOULD BE DEPRECATED ? 45 46 $template->set_filename('tabsheet', 'admin/tabsheet.tpl'); 47 $template->assign('tabsheet', $page['tabsheet']); 34 /* 35 $name is the tabsheet's name inside the template .tpl file 36 $titlename in the template is affected by $titlename value 37 */ 38 function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE') 39 { 40 $this->sheets = array(); 41 $this->name = $name; 42 $this->titlename = $titlename; 43 $this->selected = ""; 44 } 48 45 49 foreach ($page['tabsheet'] as $tab_name => $tab) 46 /* 47 add a tab 48 */ 49 function add($name, $caption, $url, $selected = false) 50 50 { 51 $is_selected = isset($tab['selected']) and $tab['selected'] === true; 52 if ($is_selected) 51 if (!isset($this->sheets[$name])) 53 52 { 54 $template->assign_vars( 55 array('TABSHEET_TITLE' => '['.$tab['caption'].']')); 56 break; 53 $this->sheets[$name] = array('caption' => $caption, 54 'url' => $url); 55 if($selected) 56 { 57 $this->selected=$name; 58 } 59 return true; 60 } 61 return false; 62 } 63 64 /* 65 remove a tab 66 */ 67 function delete($name) 68 { 69 if (isset($this->sheets[$name])) 70 { 71 array_splice($this->sheets, $name, 1); 72 73 if ($this->selected == $name) 74 { 75 $this->selected = ""; 76 } 77 return true; 78 } 79 return false; 80 } 81 82 /* 83 select a tab to be active 84 */ 85 function select($name) 86 { 87 $this->selected = $name; 88 } 89 90 /* 91 set $titlename value 92 */ 93 function set_titlename($titlename) 94 { 95 $this->titlename = $titlename; 96 return $this->titlename; 97 } 98 99 /* 100 returns $titlename value 101 */ 102 function get_titlename() 103 { 104 return $this->titlename; 105 } 106 107 /* 108 returns properties of selected tab 109 */ 110 function get_selected() 111 { 112 if (!empty($this->selected)) 113 { 114 return $this->sheets[$this->selected]; 115 } 116 else 117 { 118 return null; 57 119 } 58 120 } 59 121 60 $template->assign_var_from_handle('TABSHEET', 'tabsheet'); 61 $template->clear_assign('tabsheet'); 122 /* 123 * Build TabSheet and assign this content to current page 124 * 125 * Fill $this->$name {default value = TABSHEET} with HTML code for tabsheet 126 * Fill $this->titlename {default value = TABSHEET_TITLE} with formated caption of the selected tab 127 */ 128 function assign() 129 { 130 global $template; 131 132 $template->set_filename('tabsheet', 'admin/tabsheet.tpl'); 133 $template->assign('tabsheet', $this->sheets); 134 $template->assign('tabsheet_selected', $this->selected); 135 136 $selected_tab = $this->get_selected(); 137 138 if (isset($selected_tab)) 139 { 140 $template->assign_vars( 141 array($this->titlename => '['.$selected_tab['caption'].']')); 142 } 143 144 $template->assign_var_from_handle($this->name, 'tabsheet'); 145 $template->clear_assign('tabsheet'); 146 } 62 147 } 63 148 -
trunk/admin/notification_by_mail.php
r2140 r2226 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 36 36 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 37 37 include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); 38 include_once(PHPWG_ROOT_PATH.'admin/include/ functions_tabsheet.inc.php');38 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 39 39 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 40 40 include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); … … 611 611 if (is_autorize_status(ACCESS_WEBMASTER)) 612 612 { 613 // TabSheet 614 $tabsheet = new tabsheet(); 613 615 // TabSheet initialization 614 $page['tabsheet'] = array 615 ( 616 'param' => array 617 ( 618 'caption' => l10n('nbm_param_mode'), 619 'url' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), 620 array('mode' => 'param')) 621 ), 622 'subscribe' => array 623 ( 624 'caption' => l10n('nbm_subscribe_mode'), 625 'url' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'subscribe')), 626 ), 627 'send' => array 628 ( 629 'caption' => l10n('nbm_send_mode'), 630 'url' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'send')) 631 ) 632 ); 633 634 $page['tabsheet'][$page['mode']]['selected'] = true; 635 616 $tabsheet->add('param', l10n('nbm_param_mode'), 617 add_url_params($base_url.get_query_string_diff(array('mode', 'select')), 618 array('mode' => 'param'))); 619 $tabsheet->add('subscribe', l10n('nbm_subscribe_mode'), 620 add_url_params($base_url.get_query_string_diff(array('mode', 'select')), 621 array('mode' => 'subscribe'))); 622 $tabsheet->add('send', l10n('nbm_send_mode'), 623 add_url_params($base_url.get_query_string_diff(array('mode', 'select')), 624 array('mode' => 'send'))); 625 // TabSheet selection 626 $tabsheet->select($page['mode']); 636 627 // Assign tabsheet to template 637 template_assign_tabsheet();628 $tabsheet->assign(); 638 629 } 639 630 -
trunk/template/yoga/admin/cat_options.tpl
r2223 r2226 5 5 </ul> 6 6 <h2>{'cat_options_title'|@translate} {$TABSHEET_TITLE}</h2> 7 { include file='admin/tabsheet.tpl'}7 {$TABSHEET} 8 8 </div> 9 9 -
trunk/template/yoga/admin/tabsheet.tpl
r2223 r2226 2 2 {if isset($tabsheet) and count($tabsheet)} 3 3 <ul class="tabsheet"> 4 {foreach from=$tabsheet item=tab}5 <li class="{if isset($tab.selected) and $tab.selected}selected_tab{else}normal_tab{/if}"><a href="{$tab.url}">{$tab.caption}</a></li>4 {foreach from=$tabsheet key=name item=sheet} 5 <li class="{if ($name == $tabsheet_selected)}selected_tab{else}normal_tab{/if}"><a href="{$sheet.url}">{$sheet.caption}</a></li> 6 6 {/foreach} 7 7 </ul>
Note: See TracChangeset
for help on using the changeset viewer.