assign('EVNTCATS_VERSION', EVNTCATS_INFO_VERSION); $me = get_plugin_data($plugin_id); $template->clear_assign('ec_infos'); $template->append('head_elements', '' ); $ec_debug = array(); if ( isset($_POST['ec_in_up_auto_code_length']) and $_POST['ec_in_up_auto_code_length'] != read_ec_conf('auto_code_dg_nb') ) change_ec_conf('auto_code_dg_nb', $_POST['ec_in_up_auto_code_length']); $ec_howto = (read_ec_conf('howto') == '0'); if ($ec_howto) change_ec_conf('howto', '1'); build_ec_lists(); // in evntcats_main_funcs.php // +-----------------------------------------------------------------------+ // | Tabsheet // +-----------------------------------------------------------------------+ $page['tab'] = (!($ec_exist_entries = (mysql_num_rows(pwg_query(" SELECT * FROM `".EVNTCATS_TABLE."` WHERE `code` IS NOT NULL ")) != 0))) ? 'autolog_new' : 'autolog_entries'; // Rajouter un test pour que si $ec_exist_entries est faux, mais qu'il y a // quand même des entrées dans la table (donc pour gérer la duplication de // compte), l'onglet sélectionné par défaut soit celui de la gestion de la // duplication de compte. if (isset($_POST['ec_act1'])) { if ( $_POST['ec_act1'] == 'disable' and count($ec_lists['add_pages']) == 0 ) { $_POST['ec_act1'] = 'modify_entry_submit'; $_POST['ec_input_action'] = 'refused'; } if ( $_POST['ec_act1'] == 'duplicate_entry_ask' or $_POST['ec_act1'] == 'create_ask' ) $page['tab'] = 'autolog_new'; elseif ( $_POST['ec_act1'] == 'disable' or $_POST['ec_act1'] == 'modify_entry_ask' ) $page['tab'] = 'autolog_modif'; elseif ($_POST['ec_act1'] == 'create') $page['tab'] = (ec_create_modify_entry_OK()) ? 'autolog_entries' : 'autolog_new'; elseif ( isset($_POST['ec_entry_sel']) and is_numeric($_POST['ec_entry_sel']) ) { if ($_POST['ec_act1'] == 'duplicate_entry_submit') $page['tab'] = (ec_create_modify_entry_OK()) ? 'autolog_entries' : 'autolog_new'; elseif ($_POST['ec_act1'] == 'modify_entry_submit') $page['tab'] = (ec_create_modify_entry_OK()) ? 'autolog_entries' : 'autolog_modif'; else { $page['tab'] = 'autolog_entries'; if ($_POST['ec_act1'] == 'delete') { if (isset($_POST['ec_entry_sel'])) { ec_delete_entry_OK($_POST['ec_entry_sel']); build_ec_table(); } else ec_end1('ec_entry_sel', 'ec_bad_argument1'); } else if ($_POST['ec_act1'] == 'toggle_forced') ec_create_modify_entry_OK(); } } } else { if (isset($_GET['tab'])) switch ($_GET['tab']) { case 'autolog_modif': case 'autolog_new': case 'duplication': case 'config': $page['tab'] = $_GET['tab']; break; } } $ec_exist_entries = (mysql_num_rows(pwg_query(" SELECT * FROM `".EVNTCATS_TABLE."` WHERE `code` IS NOT NULL ")) != 0); $tabsheet = new tabsheet(); if ($ec_exist_entries) { $tabsheet->add('autolog_entries', l10n('ec_tab_autoid_entries'), $my_base_url.'&tab=autolog_entries'); $tabsheet->add('autolog_modif', l10n('ec_tab_autoid_modif'), $my_base_url.'&tab=autolog_modif'); } $tabsheet->add('autolog_new', l10n('ec_tab_autoid_new'), $my_base_url.'&tab=autolog_new'); $tabsheet->add('duplication', l10n('ec_tab_duplication'), $my_base_url.'&tab=duplication'); $tabsheet->add('config', l10n('ec_tab_config'), $my_base_url.'&tab=config'); $template->assign( array('U_HELP' => get_root_url().'popuphelp.php?page=event_cats')); $template->assign('EVNTCATS_URLS', array( 'ROOT' => EVNTCATS_PATH, )); /****************************************************************************/ $ec_file = ($page['tab'] == 'autolog_modif') ? 'autolog_new' : $page['tab']; include(EVNTCATS_PATH.'admin/'.$ec_file.'.inc.php'); $tabsheet->select($page['tab']); $tabsheet->assign(); /* print '
';
//print_r('ROOT_URL : '.ROOT_URL.'
EVNTCATS_PATH : '.EVNTCATS_PATH); print('ROOT_URL : '.ROOT_URL.'
EVNTCATS_PATH : '.EVNTCATS_PATH); print '
'; */ $template->assign('ec_howto', ($ec_howto and (count($page['errors']) ==0 and count($page['infos']) == 0))); $template->assign('EVNTCATS_PATH',EVNTCATS_PATH); $template->assign('RACINE_URL',ROOT_URL); if (isset($conf['ec_debug1'])) $template->assign('ec_debug1', array( 'POST' => str_from_var($_POST), 'ec_debug' => (isset($ec_debug)) ? str_from_var($ec_debug) : '(unset)', 'GET' => str_from_var($_GET), 'page' => str_from_var($page), 'ec_conf' => str_from_var($ec_conf), 'ec_lists' => (isset($ec_lists)) ? str_from_var($ec_lists) : '(unset)', 'code_list' => (isset($code_list)) ? str_from_var($code_list) : '(unset)', )); $template->set_filenames(array( 'evntcats_admin_content' => dirname(__FILE__).'/template/'.$ec_file.'.tpl' )); $template->assign_var_from_handle('ADMIN_CONTENT','evntcats_admin_content'); ?>