[1900] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
| 4 | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | |
---|
| 5 | // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | |
---|
| 6 | // +-----------------------------------------------------------------------+ |
---|
[1912] | 7 | // | file : $Id: functions_tabsheet.inc.php 2223 2008-02-28 02:41:48Z rvelices $ |
---|
| 8 | // | last update : $Date: 2008-02-28 02:41:48 +0000 (Thu, 28 Feb 2008) $ |
---|
| 9 | // | last modifier : $Author: rvelices $ |
---|
| 10 | // | revision : $Revision: 2223 $ |
---|
[1900] | 11 | // +-----------------------------------------------------------------------+ |
---|
| 12 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 13 | // | it under the terms of the GNU General Public License as published by | |
---|
| 14 | // | the Free Software Foundation | |
---|
| 15 | // | | |
---|
| 16 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 19 | // | General Public License for more details. | |
---|
| 20 | // | | |
---|
| 21 | // | You should have received a copy of the GNU General Public License | |
---|
| 22 | // | along with this program; if not, write to the Free Software | |
---|
| 23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 24 | // | USA. | |
---|
| 25 | // +-----------------------------------------------------------------------+ |
---|
| 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 | */ |
---|
| 40 | |
---|
| 41 | function template_assign_tabsheet() |
---|
| 42 | { |
---|
| 43 | global $page, $template; |
---|
[2223] | 44 | //THIS SHOULD BE DEPRECATED ? |
---|
| 45 | |
---|
| 46 | $template->set_filename('tabsheet', 'admin/tabsheet.tpl'); |
---|
| 47 | $template->assign('tabsheet', $page['tabsheet']); |
---|
[1900] | 48 | |
---|
[2223] | 49 | foreach ($page['tabsheet'] as $tab_name => $tab) |
---|
[1900] | 50 | { |
---|
[2223] | 51 | $is_selected = isset($tab['selected']) and $tab['selected'] === true; |
---|
| 52 | if ($is_selected) |
---|
[1900] | 53 | { |
---|
[2223] | 54 | $template->assign_vars( |
---|
| 55 | array('TABSHEET_TITLE' => '['.$tab['caption'].']')); |
---|
| 56 | break; |
---|
[1900] | 57 | } |
---|
[2223] | 58 | } |
---|
[1900] | 59 | |
---|
[2223] | 60 | $template->assign_var_from_handle('TABSHEET', 'tabsheet'); |
---|
| 61 | $template->clear_assign('tabsheet'); |
---|
[1900] | 62 | } |
---|
| 63 | |
---|
| 64 | ?> |
---|