static function install() { module::set_version("gwtorganise", 1); upload_configuration::setResize(false); upload_configuration::setMaxWidth(500); upload_configuration::setMaxHeight(400); }
static function extractForm($form) { $resize = $form->configure->resize->value; $max_width = $form->configure->max_width->value; $max_height = $form->configure->max_height->value; upload_configuration::setResize($resize); upload_configuration::setMaxWidth($max_width); upload_configuration::setMaxHeight($max_height); }
/** * the index page of the user homes admin */ public function index() { $form = upload_configuration::get_configure_form(); if (request::method() == "post") { access::verify_csrf(); if ($form->validate()) { upload_configuration::extractForm($form); message::success(t("GWTOrganise Module Configured!")); } } else { upload_configuration::populateForm($form); } print $form; }
/** * the index page of the user homes admin */ public function index() { $form = upload_configuration::get_configure_form(); if (request::method() == "post") { access::verify_csrf(); if ($form->validate()) { upload_configuration::extractForm($form); message::success(t("GWTOrganise Module Configured!")); json::reply(array("result" => "success")); return; } else { json::reply(array("result" => "error", "html" => (string) $form)); return; } } else { upload_configuration::populateForm($form); } print $form; }
public function resize_config() { if (upload_configuration::isResize()) { print json_encode(array("resize" => true, "max_width" => upload_configuration::getMaxWidth(), "max_height" => upload_configuration::getMaxHeight())); } else { print json_encode(array("resize" => false)); } }