source: extensions/Flash_Gallery/admin/manage.php @ 3531

Last change on this file since 3531 was 3531, checked in by tiico, 15 years ago

First revision (for testing)
Only in French (translation to be done)

File size: 3.1 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5// Enregistrement de l'ordre
6if (isset($_POST['submitOrder']) and !is_adviser())
7{
8  asort($_POST['position'], SORT_NUMERIC);
9  $pos = 1;
10  foreach($_POST['position'] as $id => $old_pos)
11  {
12    pwg_query('
13UPDATE ' . FLASHGAL_TABLE . '
14SET pos=' . $pos++ . '
15WHERE id=' . $id . ' LIMIT 1');
16  }
17  array_push($page['infos'], l10n('flashgal_order_saved'));
18}
19
20// Affichage des modules et de leur position
21$q = 'SELECT id, name, descr, type, on_home, on_home_global, on_cats, recurs_cats
22FROM ' . FLASHGAL_TABLE . '
23ORDER BY pos ASC;';
24$result = pwg_query($q);
25$num = 0;
26$pos = 1;
27$cat_mod = array('name' => l10n('Categories'), 'type' => '-', 'description' => '');
28
29while ($module = mysql_fetch_assoc($result))
30{
31        $module['name'] = $module['type'] != 'MainBlock' ? $module['name'] : l10n('flashgal_main_block');
32
33  $template->append('modules', array(
34    'ID' => $module['id'],
35    'NAME' => trigger_event('render_flashgal_name', $module['name']),
36    'DESC' => $module['descr'],
37    'TYPE' => $module['type'],
38    'TYPE_NAME' => (isset($modules[$module['type']]['name']) ? $modules[$module['type']]['name'] : ''),
39    'POS' => 10 * $pos++,
40// Ajouter les infos sur 'actif sur home (mode global/selectif)', 'actif sur categories', 'recursivite'... pour afficher des icones
41        'ON_HOME_LIB'           => ($module['on_home'] == 'true' ? ($module['on_home_global'] == 'global' ? l10n('flashgal_on_home_global_ON_label') 
42                                                                                                                                                                                                : l10n('flashgal_on_home_ON_label') ) 
43                                                                                                                 : l10n('flashgal_on_home_OFF_label')),
44
45        'ON_HOME'                       => ($module['on_home'] == 'true' ? ($module['on_home_global'] == 'global' ? FLASHGAL_PATH . 'img/on_home_Global_ON.png' 
46                                                                                                                                                                                                 : FLASHGAL_PATH . 'img/on_home_ON.png')
47                                                                                                                 : FLASHGAL_PATH . 'img/on_home_OFF.png'),
48
49        'ON_CATS_LIB'           => ($module['on_cats'] == 'true' ? l10n('flashgal_oncats_ON_label') : l10n('flashgal_oncats_OFF_label')),
50        'ON_CATS'                       => ($module['on_cats'] == 'true' ? FLASHGAL_PATH . 'img/on_cats_ON.png' : FLASHGAL_PATH . 'img/on_cats_OFF.png'),
51        'RECURS_CATS_LIB'       => ($module['recurs_cats'] == 'true' ? l10n('flashgal_recurs_ON_label') : l10n('flashgal_recurs_OFF_label')),
52        'RECURS_CATS'           => ($module['recurs_cats'] == 'true' ? FLASHGAL_PATH . 'img/recurs_cats_ON.png' : FLASHGAL_PATH . 'img/recurs_cats_OFF.png'),
53        'ICON_INFO'                     => FLASHGAL_PATH . 'img/infos.png',
54        'SCREEN'                        => FLASHGAL_PATH . '/modules/'. $module['type'].'/screenshot.jpg',
55    'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . FLASHGAL_DIR . '%2Fadmin%2Fadd_module.php&amp;type=' . $module['type'] . '&amp;edit=' . $module['id'],
56    'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&amp;del=' . $module['id'] : '',
57  ));
58}
59$template->assign('SCRIPT', '<script src="'.FLASHGAL_PATH .'js/screenshot.js" type="text/javascript"></script>');
60
61$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl');
62$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
63
64?>
Note: See TracBrowser for help on using the repository browser.