content = new View("admin_theme_3nids.html"); // Generate a form for Google Maps Settings. $view->content->theme_form = $this->_get_3nids_form(); // Display the page. print $view; } private function _get_3nids_form() { // Make a new form for inputing information associated with google maps. $form = new Forge("admin/theme_3nids/save3nidsprefs", "", "post", array("id" => "gTagsMapAdminForm")); // Input box for the Maps API Key $form->input("title") ->label(t("item title : parent or item.")) ->value(module::get_var("theme_3nids", "title")); $form->input("description") ->label(t("item description : tags or item or parent or nothing. If item description chosen and not available, then parent description is used.")) ->value(module::get_var("theme_3nids", "description")); $form->input("photo_size") ->label(t("Photo size: resize or full.")) ->value(module::get_var("theme_3nids", "photo_size")); // Add a save button to the form. $form->submit("SaveSettings")->value(t("Save")); // Return the newly generated form. return $form; } public function save3nidsprefs() { // Save information associated with Google Maps to the database. // Prevent Cross Site Request Forgery access::verify_csrf(); // Figure out the values of the text boxes $description = Input::instance()->post("description"); $title = Input::instance()->post("title"); $photo_size = Input::instance()->post("photo_size"); // Save Settings. module::set_var("theme_3nids", "description", $description); module::set_var("theme_3nids", "title", $title); module::set_var("theme_3nids", "photo_size", $photo_size); // Display a success message and redirect back to the TagsMap admin page. message::success(t("Your Settings Have Been Saved.")); url::redirect("admin/theme_3nids"); } }