[3663] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | |
---|
| 5 | // Enregistrement de l'ordre |
---|
| 6 | if (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(' |
---|
| 13 | UPDATE ' . FLASHGAL_TABLE . ' |
---|
| 14 | SET pos=' . $pos++ . ' |
---|
| 15 | WHERE 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 |
---|
| 22 | FROM ' . FLASHGAL_TABLE . ' |
---|
| 23 | ORDER BY pos ASC;'; |
---|
| 24 | $result = pwg_query($q); |
---|
| 25 | $num = 0; |
---|
| 26 | $pos = 1; |
---|
| 27 | $cat_mod = array('name' => l10n('Categories'), 'type' => '-', 'description' => ''); |
---|
| 28 | |
---|
| 29 | while ($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&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadd_module.php&type=' . $module['type'] . '&edit=' . $module['id'], |
---|
| 56 | 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '', |
---|
| 57 | 'U_HOME' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&home=' . $module['on_home'] . '&global=' .$module['on_home_global'], |
---|
| 58 | 'U_CATS' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&cats=' . $module['on_cats'], |
---|
| 59 | 'U_RECURS' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&recurs=' . $module['recurs_cats'], |
---|
| 60 | )); |
---|
| 61 | } |
---|
| 62 | $template->assign('SCRIPT', '<script src="'.FLASHGAL_PATH .'js/screenshot.js" type="text/javascript"></script>'); |
---|
| 63 | |
---|
| 64 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl'); |
---|
| 65 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 66 | |
---|
[3531] | 67 | ?> |
---|