1
0

Bugfixes for older browsers.

This commit is contained in:
rWatcher 2010-11-01 13:28:59 +08:00 committed by Bharat Mediratta
parent a7db07e0f9
commit e8b325878d
8 changed files with 18 additions and 82 deletions

View File

@ -84,7 +84,7 @@ class albumpassword_Controller extends Controller {
// Display a success message and close the dialog.
message::success(t("Password saved."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
}
public function logout() {
@ -112,10 +112,10 @@ class albumpassword_Controller extends Controller {
// If not, close the dialog and display a rejected message.
cookie::set("g3_albumpassword", $album_password);
message::success(t("Password Accepted."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
} else {
message::error(t("Password Rejected."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
}
}
@ -129,7 +129,7 @@ class albumpassword_Controller extends Controller {
$assignpassword_group->input("assignpassword_password")
->id('assignpassword_password')
->label(t("Password:"));
$form->submit("save_password")->value(t("Save"));
$assignpassword_group->submit("save_password")->value(t("Save"));
// Return the newly generated form.
return $form;
@ -139,12 +139,14 @@ class albumpassword_Controller extends Controller {
// Generate a form for allowing visitors to enter in their passwords.
$form = new Forge("albumpassword/checkpassword", "", "post",
array("id" => "g-login-password-form"));
$assignpassword_group = $form->group("Enter Password")
->label(t("Enter Password:"));
$assignpassword_group->input("albumpassword_password")
$assignpassword_group->password("albumpassword_password")
->id('albumpassword_password')
->label(t("Password:"));
$form->submit("login_password")->value(t("Login"));
$assignpassword_group->submit("")->value(t("Login"));
// Return the newly generated form.
return $form;

View File

@ -36,8 +36,8 @@ class item extends item_Core {
}
// set access::DENY if necessary.
$view_restrictions = array();
if ($deny_access == true) {
$view_restrictions = array();
if (!identity::active_user()->admin) {
foreach (identity::group_ids_for_active_user() as $id) {
$view_restrictions[] = array("items.view_$id", "=", access::DENY);

View File

@ -1,20 +1,3 @@
<script type="text/javascript">
function ajaxify_login_reset_form() {
$("#g-login form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
$("#g-login form").replaceWith(data.form);
ajaxify_login_reset_form();
}
if (data.result == "success") {
$("#g-dialog").dialog("close");
window.location.reload();
}
}
});
};
</script>
<div id="g-assign-password">
<ul>
<li id="g-assign-password-form">

View File

@ -1,20 +1,3 @@
<script type="text/javascript">
function ajaxify_login_reset_form() {
$("#g-login form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
$("#g-login form").replaceWith(data.form);
ajaxify_login_reset_form();
}
if (data.result == "success") {
$("#g-dialog").dialog("close");
window.location.reload();
}
}
});
};
</script>
<div id="g-login-password">
<ul>
<li id="g-login-password-form">

View File

@ -84,7 +84,7 @@ class albumpassword_Controller extends Controller {
// Display a success message and close the dialog.
message::success(t("Password saved."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
}
public function logout() {
@ -112,10 +112,10 @@ class albumpassword_Controller extends Controller {
// If not, close the dialog and display a rejected message.
cookie::set("g3_albumpassword", $album_password);
message::success(t("Password Accepted."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
} else {
message::error(t("Password Rejected."));
json::reply(array("result" => "success"));
print "<html>\n<body>\n<script type=\"text/javascript\">\n$(\"#g-dialog\").dialog(\"close\");\nwindow.location.reload();\n</script>\n</body>\n</html>\n";
}
}
@ -129,7 +129,7 @@ class albumpassword_Controller extends Controller {
$assignpassword_group->input("assignpassword_password")
->id('assignpassword_password')
->label(t("Password:"));
$form->submit("save_password")->value(t("Save"));
$assignpassword_group->submit("save_password")->value(t("Save"));
// Return the newly generated form.
return $form;
@ -139,12 +139,14 @@ class albumpassword_Controller extends Controller {
// Generate a form for allowing visitors to enter in their passwords.
$form = new Forge("albumpassword/checkpassword", "", "post",
array("id" => "g-login-password-form"));
$assignpassword_group = $form->group("Enter Password")
->label(t("Enter Password:"));
$assignpassword_group->input("albumpassword_password")
$assignpassword_group->password("albumpassword_password")
->id('albumpassword_password')
->label(t("Password:"));
$form->submit("login_password")->value(t("Login"));
$assignpassword_group->submit("")->value(t("Login"));
// Return the newly generated form.
return $form;

View File

@ -36,8 +36,8 @@ class item extends item_Core {
}
// set access::DENY if necessary.
$view_restrictions = array();
if ($deny_access == true) {
$view_restrictions = array();
if (!identity::active_user()->admin) {
foreach (identity::group_ids_for_active_user() as $id) {
$view_restrictions[] = array("items.view_$id", "=", access::DENY);

View File

@ -1,20 +1,3 @@
<script type="text/javascript">
function ajaxify_login_reset_form() {
$("#g-login form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
$("#g-login form").replaceWith(data.form);
ajaxify_login_reset_form();
}
if (data.result == "success") {
$("#g-dialog").dialog("close");
window.location.reload();
}
}
});
};
</script>
<div id="g-assign-password">
<ul>
<li id="g-assign-password-form">

View File

@ -1,20 +1,3 @@
<script type="text/javascript">
function ajaxify_login_reset_form() {
$("#g-login form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
$("#g-login form").replaceWith(data.form);
ajaxify_login_reset_form();
}
if (data.result == "success") {
$("#g-dialog").dialog("close");
window.location.reload();
}
}
});
};
</script>
<div id="g-login-password">
<ul>
<li id="g-login-password-form">