Skip to content

Commit

Permalink
0000809: Use more php classes implementation
Browse files Browse the repository at this point in the history
Use class for tabsheet like grum class
Change way for tabsheet

git-svn-id: http://piwigo.org/svn/trunk@2226 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Feb 28, 2008
1 parent 7818a77 commit 4621be1
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 198 deletions.
50 changes: 11 additions & 39 deletions admin/cat_options.php
Expand Up @@ -30,7 +30,7 @@
}

include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_tabsheet.inc.php');
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');

// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
Expand Down Expand Up @@ -159,50 +159,22 @@
)
);

// TabSheet
$tabsheet = new tabsheet();
// TabSheet initialization
$opt_link = $link_start.'cat_options&section=';
$tabsheet = array
(
'status' => array
(
'caption' => l10n('cat_security'),
'url' => $opt_link.'status'
),
'visible' => array
(
'caption' => l10n('lock'),
'url' => $opt_link.'visible'
),
'upload' => array
(
'caption' => l10n('upload'),
'url' => $opt_link.'upload'
),
'comments' => array
(
'caption' => l10n('comments'),
'url' => $opt_link.'comments'
),
);

$tabsheet->add('status', l10n('cat_security'), $opt_link.'status');
$tabsheet->add('visible', l10n('lock'), $opt_link.'visible');
$tabsheet->add('upload', l10n('upload'), $opt_link.'upload');
$tabsheet->add('comments', l10n('comments'), $opt_link.'comments');
if ($conf['allow_random_representative'])
{
$tabsheet['representative'] =
array
(
'caption' => l10n('Representative'),
'url' => $opt_link.'representative'
);
$tabsheet->add('representative', l10n('Representative'), $opt_link.'representative');
}
$tabsheet[$page['section']]['selected'] = true;

// TabSheet selection
$tabsheet->select($page['section']);
// Assign tabsheet to template
$template->assign(
array(
'tabsheet' => $tabsheet,
'TABSHEET_TITLE' => $tabsheet[$page['section']]['caption']
)
);
$tabsheet->assign();

// +-----------------------------------------------------------------------+
// | form display |
Expand Down
40 changes: 11 additions & 29 deletions admin/configuration.php
Expand Up @@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
Expand Down Expand Up @@ -31,7 +31,7 @@
}

include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_tabsheet.inc.php');
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');

// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
Expand Down Expand Up @@ -157,35 +157,17 @@
//----------------------------------------------------- template initialization
$template->set_filename('config', 'admin/configuration.tpl');

// TabSheet
$tabsheet = new tabsheet();
// TabSheet initialization
$page['tabsheet'] = array
(
'main' => array
(
'caption' => l10n('conf_main_title'),
'url' => $conf_link.'main'
),
'history' => array
(
'caption' => l10n('conf_history_title'),
'url' => $conf_link.'history'
),
'comments' => array
(
'caption' => l10n('conf_comments_title'),
'url' => $conf_link.'comments'
),
'default' => array
(
'caption' => l10n('conf_display'),
'url' => $conf_link.'default'
)
);

$page['tabsheet'][$page['section']]['selected'] = true;

$tabsheet->add('main', l10n('conf_main_title'), $conf_link.'main');
$tabsheet->add('history', l10n('conf_history_title'), $conf_link.'history');
$tabsheet->add('comments', l10n('conf_comments_title'), $conf_link.'comments');
$tabsheet->add('default', l10n('conf_display'), $conf_link.'default');
// TabSheet selection
$tabsheet->select($page['section']);
// Assign tabsheet to template
template_assign_tabsheet();
$tabsheet->assign();

$action = PHPWG_ROOT_PATH.'admin.php?page=configuration';
$action.= '&section='.$page['section'];
Expand Down
28 changes: 9 additions & 19 deletions admin/include/functions_history.inc.php
Expand Up @@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
Expand All @@ -24,31 +24,21 @@
// | USA. |
// +-----------------------------------------------------------------------+

include_once(PHPWG_ROOT_PATH.'admin/include/functions_tabsheet.inc.php');
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');

function history_tabsheet()
{
global $page, $link_start;

// TabSheet
$tabsheet = new tabsheet();
// TabSheet initialization
$page['tabsheet'] = array
(
'stats' => array
(
'caption' => l10n('Statistics'),
'url' => $link_start.'stats'
),
'history' => array
(
'caption' => l10n('Search'),
'url' => $link_start.'history'
)
);

$page['tabsheet'][$page['page']]['selected'] = true;

$tabsheet->add('stats', l10n('Statistics'), $link_start.'stats');
$tabsheet->add('history', l10n('Search'), $link_start.'history');
// TabSheet selection
$tabsheet->select($page['page']);
// Assign tabsheet to template
template_assign_tabsheet();
$tabsheet->assign();
}

function history_compare($a, $b)
Expand Down
64 changes: 0 additions & 64 deletions admin/include/functions_tabsheet.inc.php

This file was deleted.

28 changes: 9 additions & 19 deletions admin/include/functions_waiting.inc.php
Expand Up @@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
Expand All @@ -24,31 +24,21 @@
// | USA. |
// +-----------------------------------------------------------------------+

include_once(PHPWG_ROOT_PATH.'admin/include/functions_tabsheet.inc.php');
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');

function waiting_tabsheet()
{
global $page, $link_start;

// TabSheet
$tabsheet = new tabsheet();
// TabSheet initialization
$page['tabsheet'] = array
(
'comments' => array
(
'caption' => l10n('comments'),
'url' => $link_start.'comments'
),
'upload' => array
(
'caption' => l10n('upload_pictures'),
'url' => $link_start.'upload'
)
);

$page['tabsheet'][$page['page']]['selected'] = true;

$tabsheet->add('comments', l10n('comments'), $link_start.'comments');
$tabsheet->add('upload', l10n('upload_pictures'), $link_start.'upload');
// TabSheet selection
$tabsheet->select($page['page']);
// Assign tabsheet to template
template_assign_tabsheet();
$tabsheet->assign();
}

?>

0 comments on commit 4621be1

Please sign in to comment.