summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-11-07 07:35:15 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-11-07 07:35:15 -0800
commit87f00a5ec5e072f98f5ed6fcd559ef249da57b36 (patch)
treed1c6ddf82600c4d02ab9098766597d1a3cbfac33 /modules
parentc40735c922b53eb32be1ae39a030362eea52e602 (diff)
parente300ede3d8311bf236594480355f710b39aaa451 (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/css/gallery.css2
-rw-r--r--modules/gallery/libraries/InPlaceEdit.php8
-rw-r--r--modules/gallery/models/item.php4
-rw-r--r--modules/gallery/tests/Item_Model_Test.php1
-rw-r--r--modules/gallery/views/in_place_edit.html.php4
-rw-r--r--modules/tag/controllers/admin_tags.php18
-rw-r--r--modules/tag/css/tag.css4
7 files changed, 21 insertions, 20 deletions
diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css
index 18d9a522..3262dee2 100644
--- a/modules/gallery/css/gallery.css
+++ b/modules/gallery/css/gallery.css
@@ -50,7 +50,7 @@
/* In-place edit ~~~~~~~~~~~~~~~~~~~~~~~~~ */
-#g-inplace-edit-form ul {
+#g-in-place-edit-form ul {
margin: 0;
}
diff --git a/modules/gallery/libraries/InPlaceEdit.php b/modules/gallery/libraries/InPlaceEdit.php
index 057874e3..67ab3805 100644
--- a/modules/gallery/libraries/InPlaceEdit.php
+++ b/modules/gallery/libraries/InPlaceEdit.php
@@ -35,22 +35,22 @@ class InPlaceEdit_Core {
return $instance;
}
- public function add_action($action) {
+ public function action($action) {
$this->action = $action;
return $this;
}
- public function add_rules($rules) {
+ public function rules($rules) {
$this->rules += $rules;
return $this;
}
- public function add_messages($messages) {
+ public function messages($messages) {
$this->messages += $messages;
return $this;
}
- public function add_callback($callback) {
+ public function callback($callback) {
$this->callback = $callback;
return $this;
}
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 9735ed62..d27e331b 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -444,11 +444,11 @@ class Item_Model extends ORM_MPTT {
$position = $db->from("items")
->where("parent_id", $this->id)
- ->where("$sort_column < ", $child->$sort_column)
+ ->where("$sort_column $comp ", $child->$sort_column)
->where($where)
->count_records();
- // We stopped short of our target value in the sort (notice that we're using a < comparator
+ // We stopped short of our target value in the sort (notice that we're using a < comparator
// above) because it's possible that we have duplicate values in the sort column. An
// equality check would just arbitrarily pick one of those multiple possible equivalent
// columns, which would mean that if you choose a sort order that has duplicates, it'd pick
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index fefc9383..e7dce893 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -232,6 +232,7 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_equal("resize", file_get_contents($photo->resize_path()));
$this->assert_equal("file", file_get_contents($photo->file_path()));
}
+
public function move_album_fails_invalid_target_test() {
// Create an album with a photo in it
$root = ORM::factory("item", 1);
diff --git a/modules/gallery/views/in_place_edit.html.php b/modules/gallery/views/in_place_edit.html.php
index 64671d57..03cbdc69 100644
--- a/modules/gallery/views/in_place_edit.html.php
+++ b/modules/gallery/views/in_place_edit.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<?= form::open($action, array("method" => "post", "id" => "g-inplace-edit-form", "class" => "g-short-form"), $hidden) ?>
+<?= form::open($action, array("method" => "post", "id" => "g-in-place-edit-form", "class" => "g-short-form"), $hidden) ?>
<ul>
<li <? if (!empty($errors["input"])): ?> class="g-error"<? endif ?>>
<?= form::input("input", $form["input"], " class='textbox'") ?>
@@ -11,6 +11,6 @@
</ul>
<?= form::close() ?>
<? if (!empty($errors["input"])): ?>
-<div id="g-inplace-edit-message" class="g-error"><?= $errors["input"] ?></div>
+<div id="g-in-place-edit-message" class="g-error"><?= $errors["input"] ?></div>
<? endif ?>
diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php
index d79f697c..67587c2e 100644
--- a/modules/tag/controllers/admin_tags.php
+++ b/modules/tag/controllers/admin_tags.php
@@ -70,7 +70,7 @@ class Admin_Tags_Controller extends Admin_Controller {
$tag = ORM::factory("tag", $id);
if ($tag->loaded) {
print InPlaceEdit::factory($tag->name)
- ->add_action("admin/tags/rename/$id")
+ ->action("admin/tags/rename/$id")
->render();
}
}
@@ -83,15 +83,15 @@ class Admin_Tags_Controller extends Admin_Controller {
kohana::show_404();
}
- $inplaceedit = InPlaceEdit::factory($tag->name)
- ->add_action("admin/tags/rename/$tag->id")
- ->add_rules(array("required", "length[1,64]"))
- ->add_messages(array("in_use" => t("There is already a tag with that name")))
- ->add_callback(array($this, "check_for_duplicate"));
+ $in_place_edit = InPlaceEdit::factory($tag->name)
+ ->action("admin/tags/rename/$tag->id")
+ ->rules(array("required", "length[1,64]"))
+ ->messages(array("in_use" => t("There is already a tag with that name")))
+ ->callback(array($this, "check_for_duplicate"));
- if ($inplaceedit->validate()) {
+ if ($in_place_edit->validate()) {
$old_name = $tag->name;
- $tag->name = $inplaceedit->value();
+ $tag->name = $in_place_edit->value();
$tag->save();
$message = t("Renamed tag %old_name to %new_name",
@@ -101,7 +101,7 @@ class Admin_Tags_Controller extends Admin_Controller {
print json_encode(array("result" => "success"));
} else {
- print json_encode(array("result" => "error", "form" => $inplaceedit->render()));
+ print json_encode(array("result" => "error", "form" => $in_place_edit->render()));
}
}
diff --git a/modules/tag/css/tag.css b/modules/tag/css/tag.css
index 03ed444b..6d6438e3 100644
--- a/modules/tag/css/tag.css
+++ b/modules/tag/css/tag.css
@@ -91,6 +91,6 @@
padding: .1em 0 .2em 0;
}
-#g-rename-tag-form ul {
+#g-tag-admin form ul {
margin-bottom: 0;
-} \ No newline at end of file
+}