prefix . "awm"; include_once WP_PLUGIN_DIR.'/allwebmenus-wordpress-menu-plugin/include.php'; include_once WP_PLUGIN_DIR.'/allwebmenus-wordpress-menu-plugin/widgetClass.php'; $awm_total_tabs = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $awm_table_name;")); /* * Do the Form Error-Checking */ for ($awm_t=0; $awm_t<$awm_total_tabs; $awm_t++) { // AWM_categories_subitems_no if (isset($_POST['AWM_categories_subitems_no_'.$awm_t])) { if ($_POST['AWM_categories_subitems_no_'.$awm_t]<1) $_POST['AWM_categories_subitems_no_'.$awm_t]=1; if ($_POST['AWM_categories_subitems_no_'.$awm_t]>50) $_POST['AWM_categories_subitems_no_'.$awm_t]=50; } // AWM_menu_name if (isset($_POST["AWM_menu_name_".$awm_t])) $_POST["AWM_menu_name_".$awm_t] = awm_fix_menu_name($_POST["AWM_menu_name_".$awm_t]); } // AWM_menu_path if (isset($_POST["AWM_menu_path"])) { $awm_path = (string) $_POST["AWM_menu_path"]; if ((strpos($awm_path, "/") != 0) || (strpos($awm_path, "/") === FALSE)) $awm_path = "/" . $awm_path; if (substr($awm_path, strlen($awm_path)-1,1) != "/") $awm_path = $awm_path . "/"; $_POST["AWM_menu_path"] = $awm_path; } if (!isset($_POST['theaction'])){ ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } if ($_POST['theaction'] == "createnew") { $message = awm_create_new_menu(); $_SESSION['message'] = $message; ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else if ($_POST['theaction']=="delete") { // update all values $message = awm_delete_menu(); $_SESSION['message'] = '

'.$message.'

'; ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } elseif ($_POST['theaction']=="generate_structure") { // first update all values, then generate the current tab's structure global $awm_total_tabs; if ($awm_total_tabs) { awm_update_option_values(); ob_end_clean(); wp_redirect($_POST['ref']."&generated=true" ); } else{ $_SESSION['message'] = '

There are no menus. You can create one using the appropriate button.

'; ob_end_clean(); wp_redirect($_POST['ref'] ); } exit; /* } elseif ($_POST['theaction']=='Activate') { echo '

'; if (!in_array('yet-another-related-posts-plugin/yarpp.php', get_option('active_plugins'))) { include_once('yet-another-related-posts-plugin/yarpp.php'); update_option('AWM_YARPP', TRUE); echo "YARPP Activated!"; } else { update_option('AWM_YARPP', TRUE); echo "YARPP Activated!"; } echo '

'; } elseif ($_POST['theaction']=='Deactivate') { update_option('AWM_YARPP', FALSE); echo '

YARPP Dectivated!

'; */ } else if ($_POST['theaction']=="set_defaults") { // first update all values, then reset this tab to defaults awm_update_option_values(); awm_set_default_option_values(get_option('AWM_selected_tab')); $_SESSION['message'] = '

Default Settings Loaded!

'; ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else if ($_POST['theaction']=="info_update") { // update all values $message = awm_update_option_values(); $_SESSION['message'] = '

'.$message.'

'; ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else if ($_POST['theaction']=='hide_msg') { update_option('AWM_Check_show', 0); ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else if ($_POST['theaction']=='hide_addcode') { update_option("AWM_code_check", 0); ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else if ($_POST['theaction']=="zip_update") { if (strpos($_SERVER['HTTP_REFERER'],"wp-admin/options-general.php?page=allwebmenus-wordpress-menu-plugin/allwebmenus-wordpress-menu.php")<1) { echo "Access error! Please contact: support@likno.com";exit;} $message = awm_update_zip(); $_SESSION['message'] = '

'.$message.'

'; ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } else { ob_end_clean(); wp_redirect($_POST['ref'] ); exit; } ?>