aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-02-27 02:31:51 +0000
committerrvelices <rv-github@modusoptimus.com>2008-02-27 02:31:51 +0000
commit75bb450a6ece6b2e30ad4c148083b7192d7d7224 (patch)
tree6b3e6c0da5baa7ba7e736e79a4b49a83918f25c9 /admin
parent01687607ec04f32ca03370456c112b64f66ca599 (diff)
- first smarty use ... (in admin.php and admin plugins page)
git-svn-id: http://piwigo.org/svn/trunk@2216 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin.php30
-rw-r--r--admin/plugins.php50
2 files changed, 31 insertions, 49 deletions
diff --git a/admin.php b/admin.php
index 7a93863d2..8306e2db6 100644
--- a/admin.php
+++ b/admin.php
@@ -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$
@@ -77,7 +77,7 @@ $page['body_id'] = 'theAdminPage';
$template->set_filenames(array('admin' => 'admin.tpl'));
-$template->assign_vars(
+$template->assign(
array(
'U_SITE_MANAGER'=> $link_start.'site_manager',
'U_HISTORY_STAT'=> $link_start.'stats',
@@ -102,16 +102,13 @@ $template->assign_vars(
'U_PERMALINKS'=> $link_start.'permalinks',
'U_RETURN'=> make_index_url(),
'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
+ 'TAG_INPUT_ENABLED' =>
+ ((is_adviser()) ? 'disabled="disabled" onclick="return false;"' : ''),
)
);
if ($conf['ws_access_control']) // Do we need to display ws_checker
{
- $template->assign_block_vars(
- 'web_services',
- array(
- 'U_WS_CHECKER'=> $link_start.'ws_checker',
- )
- );
+ $template->assign('U_WS_CHECKER', $link_start.'ws_checker' );
}
//---------------------------------------------------------------- plugin menus
@@ -130,10 +127,7 @@ array_unshift($plugin_menu_links,
)
);
-foreach ($plugin_menu_links as $menu_item)
-{
- $template->assign_block_vars('plugin_menu.menu_item', $menu_item);
-}
+$template->assign('plugin_menu_items', $plugin_menu_links);
include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
@@ -145,22 +139,16 @@ include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
if (count($page['errors']) != 0)
{
- foreach ($page['errors'] as $error)
- {
- $template->assign_block_vars('errors.error',array('ERROR'=>$error));
- }
+ $template->assign('errors', $page['errors']);
}
if (count($page['infos']) != 0)
{
- foreach ($page['infos'] as $info)
- {
- $template->assign_block_vars('infos.info',array('INFO'=>$info));
- }
+ $template->assign('infos', $page['infos']);
}
include(PHPWG_ROOT_PATH.'include/page_header.php');
-$template->parse('admin');
+$template->pparse('admin');
// +-----------------------------------------------------------------------+
// | order permission refreshment |
diff --git a/admin/plugins.php b/admin/plugins.php
index 6c88a3b68..1c467a4c2 100644
--- a/admin/plugins.php
+++ b/admin/plugins.php
@@ -197,14 +197,14 @@ foreach( $fs_plugins as $plugin_id => $fs_plugin )
}
$desc.= '</em>)';
}
- $template->assign_block_vars( 'plugins.plugin',
+
+ $tpl_plugin =
array(
'NAME' => $display_name,
'VERSION' => $fs_plugin['version'],
'DESCRIPTION' => $desc,
- 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
- )
- );
+ 'actions' => array(),
+ );
$action_url = $my_base_url.'&amp;plugin='.$plugin_id;
@@ -214,40 +214,37 @@ foreach( $fs_plugins as $plugin_id => $fs_plugin )
switch ($db_plugins_by_id[$plugin_id]['state'])
{
case 'active':
- $template->assign_block_vars( 'plugins.plugin.action',
+ $tpl_plugin['actions'][] =
array(
'U_ACTION' => $action_url . '&amp;action=deactivate',
'L_ACTION' => l10n('Deactivate'),
- )
- );
+ );
break;
case 'inactive':
- $template->assign_block_vars( 'plugins.plugin.action',
+ $tpl_plugin['actions'][] =
array(
'U_ACTION' => $action_url . '&amp;action=activate',
'L_ACTION' => l10n('Activate'),
- )
- );
- $template->assign_block_vars( 'plugins.plugin.action',
+ );
+ $tpl_plugin['actions'][] =
array(
'U_ACTION' => $action_url . '&amp;action=uninstall',
'L_ACTION' => l10n('Uninstall'),
- )
- );
- $template->assign_block_vars( 'plugins.plugin.action.confirm', array());
+ 'CONFIRM' => true,
+ );
break;
}
}
else
{
- $template->assign_block_vars( 'plugins.plugin.action',
+ $tpl_plugin['actions'][] =
array(
'U_ACTION' => $action_url . '&amp;action=install',
'L_ACTION' => l10n('Install'),
- )
- );
- $template->assign_block_vars( 'plugins.plugin.action.confirm', array());
+ 'CONFIRM' => true,
+ );
}
+ $template->append('plugins', $tpl_plugin);
}
$missing_plugin_ids = array_diff(
@@ -255,22 +252,19 @@ $missing_plugin_ids = array_diff(
);
foreach( $missing_plugin_ids as $plugin_id )
{
- $template->assign_block_vars( 'plugins.plugin',
+ $action_url = $my_base_url.'&amp;plugin='.$plugin_id;
+
+ $template->append( 'plugins',
array(
'NAME' => $plugin_id,
'VERSION' => $db_plugins_by_id[$plugin_id]['version'],
'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !",
- 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
- )
- );
- $action_url = $my_base_url.'&amp;plugin='.$plugin_id;
- $template->assign_block_vars( 'plugins.plugin.action',
- array(
+ 'actions' => array ( array (
'U_ACTION' => $action_url . '&amp;action=uninstall',
'L_ACTION' => l10n('Uninstall'),
- )
- );
-
+ ) )
+ )
+ );
}
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins');