summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-12 07:50:04 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-12 07:50:04 +0000
commitae73ef3d5743b2afba65db7d89e78b135d8c9090 (patch)
tree52faf725a5756933a0547b2ea908a6d05051b1e4
parentb19729435cd918e03e1bd6fbb91f7281bf3e5873 (diff)
Updated for new Form_Submit API.
OLD: $form->submit("Foo") --> <input type="submit" value="Foo"> New: $form->submit("foo_button")->("Foo") --> <input type="submit" name="foo_button" value="Foo"> Mostly we don't care what the button is so we leave the name blank.
-rw-r--r--core/helpers/album.php4
-rw-r--r--core/helpers/photo.php4
-rw-r--r--core/helpers/theme.php12
-rw-r--r--modules/akismet/helpers/akismet.php2
-rw-r--r--modules/comment/helpers/comment.php4
-rw-r--r--modules/tag/helpers/tag.php6
-rw-r--r--modules/user/controllers/login.php2
-rw-r--r--modules/user/helpers/group.php6
-rw-r--r--modules/user/helpers/user.php8
-rw-r--r--modules/watermark/helpers/watermark.php6
10 files changed, 27 insertions, 27 deletions
diff --git a/core/helpers/album.php b/core/helpers/album.php
index 8998c8d0..fb79015e 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -70,7 +70,7 @@ class album_Core {
$group->input("title")->label(t("Title"));
$group->textarea("description")->label(t("Description"));
$group->hidden("type")->value("album");
- $group->submit(t("Create"));
+ $group->submit("")->value(t("Create"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
@@ -85,7 +85,7 @@ class album_Core {
$group->input("title")->label(t("Title"))->value($parent->title);
$group->textarea("description")->label(t("Description"))->value($parent->description);
$group->hidden("type")->value("album");
- $group->submit(t("Modify"));
+ $group->submit("")->value(t("Modify"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index 749efb87..63845612 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -102,7 +102,7 @@ class photo_Core {
$group->textarea("description")->label(t("Description"));
$group->upload("file")->label(t("File"))->rules("required|allow[jpg,png,gif]");
$group->hidden("type")->value("photo");
- $group->submit(t("Upload"));
+ $group->submit("")->value(t("Upload"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
@@ -114,7 +114,7 @@ class photo_Core {
$group->input("name")->label(t("Name"))->value($photo->name);
$group->input("title")->label(t("Title"))->value($photo->title);
$group->textarea("description")->label(t("Description"))->value($photo->description);
- $group->submit(t("Modify"));
+ $group->submit("")->value(t("Modify"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
diff --git a/core/helpers/theme.php b/core/helpers/theme.php
index fac2de33..8f977e0c 100644
--- a/core/helpers/theme.php
+++ b/core/helpers/theme.php
@@ -37,7 +37,7 @@ class theme_Core {
}
Kohana::config_set('core.modules', $modules);
}
-
+
public static function get_edit_form_admin($theme) {
$form = new Forge("admin/themes/edit/{$theme->id}",
'', null, array("id" =>"gThemeDetailsForm"));
@@ -51,15 +51,15 @@ class theme_Core {
$group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("gResizeSize")->
rules('required|valid_digit')->
value(self::get_var($theme->id, "resize_size", 600));
- $group->submit(t("Modify Theme"));
+ $group->submit("")->value(t("Modify Theme"));
return $form;
}
-
+
public static function get_edit_form_content($theme_name) {
- $file = THEMEPATH . $theme_name . "/theme.info";
- $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
+ $file = THEMEPATH . $theme_name . "/theme.info";
+ $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
}
-
+
public static function get_var($theme_id, $name, $default_value = null) {
return module::get_var($theme_id, $name, module::get_var("core", $name, $default_value));
}
diff --git a/modules/akismet/helpers/akismet.php b/modules/akismet/helpers/akismet.php
index dd657d17..47353caf 100644
--- a/modules/akismet/helpers/akismet.php
+++ b/modules/akismet/helpers/akismet.php
@@ -25,7 +25,7 @@ class akismet_Core {
$group = $form->group("configure_akismet")->label(t("Configure Akismet"));
$group->input("api_key")->label(t("API Key"))->value(module::get_var("akismet", "api_key"));
$group->api_key->error_messages("invalid", t("The API key you provided is invalid."));
- $group->submit(t("Save"));
+ $group->submit("")->value(t("Save"));
return $form;
}
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index f6cbbe87..329d5ba3 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -73,7 +73,7 @@ class comment_Core {
$group->input("url") ->label(t("Website (hidden)"))->id("gUrl");
$group->textarea("text")->label(t("Comment")) ->id("gText");
$group->hidden("item_id")->value($item->id);
- $group->submit(t("Add"));
+ $group->submit("")->value(t("Add"));
// Forge will try to reload any pre-seeded values upon validation if it's a post request, so
// force validation before seeding values.
@@ -99,7 +99,7 @@ class comment_Core {
$group->input("email") ->label(t("Email (hidden)")) ->id("gEmail");
$group->input("url") ->label(t("Website (hidden)"))->id("gUrl");
$group->textarea("text")->label(t("Comment")) ->id("gText");
- $group->submit(t("Edit"));
+ $group->submit("")->value(t("Edit"));
$group->text = $comment->text;
$author = $comment->author();
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index f552c669..b1160db2 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -80,7 +80,7 @@ class tag_Core {
$group = $form->group("add_tag")->label(t("Add Tag"));
$group->input("name")->label(t("Add tag"));
$group->hidden("item_id")->value($item->id);
- $group->submit(t("Add Tag"));
+ $group->submit("")->value(t("Add Tag"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
@@ -90,7 +90,7 @@ class tag_Core {
$group = $form->group("rename_tag")->label(t("Rename Tag"));
$group->input("name")->label(t("Tag name"))->value($tag->name);
$group->inputs["name"]->error_messages("in_use", t("There is already a tag with that name"));
- $group->submit(t("Save"));
+ $group->submit("")->value(t("Save"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
@@ -98,7 +98,7 @@ class tag_Core {
public static function get_delete_form($tag) {
$form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm"));
$group = $form->group("delete_tag")->label(t("Really delete tag {{tag_name}}?", array("tag_name" => $tag->name)));
- $group->submit(t("Delete Tag"));
+ $group->submit("")->value(t("Delete Tag"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php
index b3ab5b10..66ea55e6 100644
--- a/modules/user/controllers/login.php
+++ b/modules/user/controllers/login.php
@@ -58,7 +58,7 @@ class Login_Controller extends Controller {
$group->input("name")->label(t("Name"))->id("gName")->class(null);
$group->password("password")->label(t("Password"))->id("gPassword")->class(null);
$group->inputs["name"]->error_messages("invalid_login", t("Invalid name or password"));
- $group->submit(t("Login"));
+ $group->submit("")->value(t("Login"));
return $form;
}
} \ No newline at end of file
diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php
index 41f19a7d..4ec841dc 100644
--- a/modules/user/helpers/group.php
+++ b/modules/user/helpers/group.php
@@ -67,7 +67,7 @@ class group_Core {
$form_group->input("name")->label(t("Name"))->id("gName")->value($group->name);
$form_group->inputs["name"]->error_messages(
"in_use", t("There is already a group with that name"));
- $form_group->submit(t("Save"));
+ $form_group->submit("")->value(t("Save"));
$form->add_rules_from($group);
return $form;
}
@@ -78,7 +78,7 @@ class group_Core {
$form_group->input("name")->label(t("Name"))->id("gName");
$form_group->inputs["name"]->error_messages(
"in_use", t("There is already a group with that name"));
- $form_group->submit(t("Add Group"));
+ $form_group->submit("")->value(t("Add Group"));
$group = ORM::factory("group");
$form->add_rules_from($group);
return $form;
@@ -88,7 +88,7 @@ class group_Core {
$form = new Forge("admin/groups/delete/$group->id", "", "post");
$form_group = $form->group("delete_group")->label(
t("Are you sure you want to delete group {{group_name}}?", array("group_name" => $group->name)));
- $form_group->submit(t("Delete"));
+ $form_group->submit("")->value(t("Delete"));
return $form;
}
}
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 377a1036..36bcf2e5 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -32,7 +32,7 @@ class user_Core {
$group->password("password")->label(t("Password"))->id("gPassword");
$group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
$group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
- $group->submit(t("Save"));
+ $group->submit("")->value(t("Save"));
$form->add_rules_from($user);
return $form;
}
@@ -47,7 +47,7 @@ class user_Core {
$group->password("password")->label(t("Password"))->id("gPassword");
$group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
$group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
- $group->submit(t("Modify User"));
+ $group->submit("")->value(t("Modify User"));
$form->add_rules_from($user);
return $form;
}
@@ -62,7 +62,7 @@ class user_Core {
$group->password("password")->label(t("Password"))->id("gPassword");
$group->input("email")->label(t("Email"))->id("gEmail");
$group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
- $group->submit(t("Add User"));
+ $group->submit("")->value(t("Add User"));
$user = ORM::factory("user");
$form->add_rules_from($user);
return $form;
@@ -72,7 +72,7 @@ class user_Core {
$form = new Forge("admin/users/delete/$user->id", "", "post");
$group = $form->group("delete_user")->label(
t("Are you sure you want to delete user {{name}}?", array("name" => $user->name)));
- $group->submit(t("Delete user {{name}}", array("name" => $user->name)));
+ $group->submit("")->value(t("Delete user {{name}}", array("name" => $user->name)));
return $form;
}
diff --git a/modules/watermark/helpers/watermark.php b/modules/watermark/helpers/watermark.php
index 649c041c..1e9b8990 100644
--- a/modules/watermark/helpers/watermark.php
+++ b/modules/watermark/helpers/watermark.php
@@ -32,7 +32,7 @@ class watermark_Core {
$group->dropdown("transparency")->label(t("Transparency Percent"))
->options($range)
->selected(100);
- $group->submit(t("Upload"));
+ $group->submit("")->value(t("Upload"));
return $form;
}
@@ -49,14 +49,14 @@ class watermark_Core {
$group->dropdown("transparency")->label(t("Transparency Percent"))
->options($range)
->selected(module::get_var("watermark", "transparency"));
- $group->submit(t("Save"));
+ $group->submit("")->value(t("Save"));
return $form;
}
public static function get_delete_form() {
$form = new Forge("admin/watermarks/delete", "", "post");
$group = $form->group("delete_watermark")->label(t("Really delete Watermark?"));
- $group->submit(t("Delete"));
+ $group->submit("")->value(t("Delete"));
return $form;
}