$old_pos) { $id_line = !empty($_POST['id_line'][$id]) ? '"'.$_POST['id_line'][$id].'"' : 'NULL'; $width = (!empty($_POST['width'][$id]) and is_numeric($_POST['width'][$id])) ? '"'.$_POST['width'][$id].'"' : 'NULL'; pwg_query(' UPDATE ' . STUFFS_TABLE . ' SET pos=' . $pos++ . ' , id_line='.$id_line.', width='.$width.' WHERE id=' . $id . ' LIMIT 1'); } pwg_query(' UPDATE ' . STUFFS_TABLE . ' SET datas = "'.addslashes(serialize(array('hide' => isset($_POST['hidemb'])))).'" WHERE id=0;'); array_push($page['infos'], l10n('stuffs_order_saved')); } // Display $q = 'SELECT id, name, descr, path, parent, id_line, width, datas FROM ' . STUFFS_TABLE . ' ORDER BY pos ASC;'; $result = pwg_query($q); $num = 0; $pos = 1; $id_line_options = array( '' => '-', 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F', 'G' => 'G', 'H' => 'H', 'I' => 'I', 'J' => 'J'); while ($module = mysql_fetch_assoc($result)) { $module['name'] = !empty($module['path']) ? $module['name'] : l10n('stuffs_main_block'); $template->append('modules', array( 'ID' => $module['id'], 'NAME' => trigger_event('render_stuffs_name', $module['name']), 'DESC' => $module['descr'], 'PATH' => $module['path'], 'TYPE_NAME' => (isset($modules[$module['path']]['name']) ? $modules[$module['path']]['name'] : ''), 'POS' => 10 * $pos++, 'ID_LINE_OPTIONS' => $id_line_options, 'ID_LINE_SELECTED' => $module['id_line'], 'WIDTH' => $module['width'], 'ID' => $module['id'], 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&tab=edit_module&edit='.$module['id'], 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '', 'MISSING' => (isset($module['parent']) and !isset($pwg_loaded_plugins[$module['parent']])), ) ); if (empty($module['path']) and !empty($module['datas'])) { $datas = unserialize($module['datas']); $template->assign('HIDEMB', $datas['hide']); } } $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl'); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); ?>