$return_info = array("result" => "pass", "bah" => "stupid"); if ($component == "core") { $missing_files = sc_check_core_files(); $return_info["component_type"] = "core"; $return_info["component_name"] = "Form Tools Core"; } if (preg_match("/^module_/", $component)) { $module_id = preg_replace("/^module_/", "", $component); $module_info = ft_get_module($module_id); $missing_files = sc_check_module_files($module_info["module_folder"]); $return_info["component_type"] = "module"; $return_info["component_name"] = $module_info["module_name"]; } if (preg_match("/^theme_/", $component)) { $theme_id = preg_replace("/^theme_/", "", $component); $theme_info = ft_get_theme($theme_id); $missing_files = sc_check_theme_files($theme_info["theme_folder"]); $return_info["component_type"] = "theme"; $return_info["component_name"] = $theme_info["theme_name"]; } if (!empty($missing_files)) { $return_info["result"] = "fail"; $return_info["missing_files"] = $missing_files; } echo ft_convert_to_json($return_info); break; case "find_table_orphans": $remove_orphans = isset($request["remove_orphans"]) ? true : false; $results = sc_find_table_orphans($request["table_name"], $remove_orphans); echo ft_convert_to_json($results); break;
/** * This function updates the default theme for multiple accounts simultaneously. It's called when * an administrator disables a theme that's current used by some client accounts. They're presented with * the option of setting the theme ID for all the clients. * * There's very little error checking done here... * * @param string $account_id_str a comma delimited list of account IDs * @param integer $theme_id the theme ID */ function ft_update_client_themes($account_ids, $theme_id) { global $LANG, $g_table_prefix; if (empty($account_ids) || empty($theme_id)) { return; } $client_ids = explode(",", $account_ids); $theme_info = ft_get_theme($theme_id); $theme_name = $theme_info["theme_name"]; $theme_folder = $theme_info["theme_folder"]; foreach ($client_ids as $client_id) { mysql_query("UPDATE {$g_table_prefix}accounts SET theme='{$theme_folder}' WHERE account_id = {$client_id}"); } $placeholders = array("theme" => $theme_name); $message = ft_eval_smarty_string($LANG["notify_client_account_themes_updated"], $placeholders); $success = true; return array($success, $message); }