summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/views/admin_block_recent_comments.html.php2
-rw-r--r--modules/comment/views/admin_comments.html.php2
-rw-r--r--modules/comment/views/comment.html.php2
-rw-r--r--modules/comment/views/comments.html.php2
-rw-r--r--modules/gallery/controllers/albums.php5
-rw-r--r--modules/gallery/controllers/movies.php5
-rw-r--r--modules/gallery/controllers/photos.php5
-rw-r--r--modules/gallery/helpers/album.php14
-rw-r--r--modules/gallery/helpers/gallery_quick.php16
-rw-r--r--modules/gallery/helpers/photo.php14
-rw-r--r--modules/gallery/tests/xss_data.txt92
-rw-r--r--modules/gallery/views/admin_maintenance_task.html.php23
-rw-r--r--modules/gallery/views/item_edit.html.php9
-rw-r--r--modules/server_add/views/server_add_tree_dialog.html.php2
-rw-r--r--modules/tag/controllers/tags.php17
-rw-r--r--modules/tag/helpers/tag.php2
-rw-r--r--modules/tag/helpers/tag_event.php10
-rw-r--r--modules/tag/helpers/tag_theme.php2
-rw-r--r--modules/tag/js/tag.js15
-rw-r--r--modules/tag/models/tag.php10
-rw-r--r--modules/tag/views/tag_block.html.php10
-rw-r--r--modules/user/controllers/admin_users.php4
-rw-r--r--modules/user/controllers/users.php1
-rw-r--r--modules/user/helpers/user.php6
-rw-r--r--modules/user/views/admin_users.html.php2
25 files changed, 190 insertions, 82 deletions
diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php
index 4ff24f86..516a8181 100644
--- a/modules/comment/views/admin_block_recent_comments.html.php
+++ b/modules/comment/views/admin_block_recent_comments.html.php
@@ -2,7 +2,7 @@
<ul>
<? foreach ($comments as $i => $comment): ?>
<li class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
- <img src="<?= $comment->author()->avatar_url(32, $theme->theme_url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="32"
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php
index ad0ae8f3..9fe7164b 100644
--- a/modules/comment/views/admin_comments.html.php
+++ b/modules/comment/views/admin_comments.html.php
@@ -106,7 +106,7 @@
<tr id="gComment-<?= $comment->id ?>" class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
<td>
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php
index ab72a0c8..3d17411c 100644
--- a/modules/comment/views/comment.html.php
+++ b/modules/comment/views/comment.html.php
@@ -2,7 +2,7 @@
<li id="gComment-<?= $comment->id; ?>">
<p class="gAuthor">
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index fa25a4e0..f7251389 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -10,7 +10,7 @@
<li id="gComment-<?= $comment->id ?>">
<p class="gAuthor">
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 56b74cb1..4fefd3a1 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -166,7 +166,8 @@ class Albums_Controller extends Items_Controller {
access::required("view", $album);
access::required("edit", $album);
- $form = album::get_edit_form($album);
+ $view = album::get_edit_form($album);
+ $form = $view->form;
if ($valid = $form->validate()) {
// Make sure that there's not a conflict
if ($album->id != 1 &&
@@ -202,7 +203,7 @@ class Albums_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index c8227d74..1391c4b4 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -70,7 +70,8 @@ class Movies_Controller extends Items_Controller {
access::required("view", $photo);
access::required("edit", $photo);
- $form = photo::get_edit_form($photo);
+ $view = photo::get_edit_form($photo);
+ $form = $view->form;
if ($valid = $form->validate()) {
// Make sure that there's not a conflict
if (Database::instance()
@@ -101,7 +102,7 @@ class Movies_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 8ee24da8..9d9b25a1 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -61,7 +61,8 @@ class Photos_Controller extends Items_Controller {
access::required("view", $photo);
access::required("edit", $photo);
- $form = photo::get_edit_form($photo);
+ $view = photo::get_edit_form($photo);
+ $form = $view->form;
if ($valid = $form->validate()) {
if ($form->edit_item->filename->value != $photo->name) {
// Make sure that there's not a conflict
@@ -94,7 +95,7 @@ class Photos_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index 5f10bd02..0263e0e1 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -94,9 +94,11 @@ class album_Core {
}
static function get_edit_form($parent) {
- $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
- $form->hidden("_method")->value("put");
- $group = $form->group("edit_item")->label(t("Edit Album"));
+ $view = new View("item_edit.html");
+ $view->script = array();
+ $view->form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
+ $view->form->hidden("_method")->value("put");
+ $group = $view->form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title);
$group->textarea("description")->label(t("Description"))->value($parent->description);
@@ -127,11 +129,11 @@ class album_Core {
"DESC" => t("Descending")))
->selected($parent->sort_order);
- module::event("item_edit_form", $parent, $form);
+ module::event("item_edit_form", $parent, $view);
$group->hidden("type")->value("album");
$group->submit("")->value(t("Modify"));
- $form->add_rules_from(ORM::factory("item"));
- return $form;
+ $view->form->add_rules_from(ORM::factory("item"));
+ return $view;
}
}
diff --git a/modules/gallery/helpers/gallery_quick.php b/modules/gallery/helpers/gallery_quick.php
index d0ffc584..8a92890b 100644
--- a/modules/gallery/helpers/gallery_quick.php
+++ b/modules/gallery/helpers/gallery_quick.php
@@ -108,12 +108,20 @@ class gallery_quick_Core {
"href" => url::site("move/browse/$item->id"));
}
- if (access::can("edit", $item->parent())) {
- $disabledState =
- $item->type == "album" && empty($item->album_cover_item_id) ? " ui-state-disabled" : "";
+ $parent = $item->parent();
+ if (access::can("edit", $parent)) {
+ // We can't make this item the highlight if it's an album with no album cover, or if it's
+ // already the album cover.
+ if (($item->type == "album" && empty($item->album_cover_item_id)) ||
+ ($item->type == "album" && $parent->album_cover_item_id == $item->album_cover_item_id) ||
+ $parent->album_cover_item_id == $item->id) {
+ $disabledState = " ui-state-disabled";
+ } else {
+ $disabledState = " ";
+ }
$elements["right"][] = (object)array(
"title" => $cover_title,
- "class" => "gButtonLink{$disabledState}",
+ "class" => "gButtonLink$disabledState",
"icon" => "ui-icon-star",
"href" => url::site("quick/make_album_cover/$item->id?csrf=$csrf&page_type=$page_type"));
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index 5cf37de1..299195e9 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -135,9 +135,11 @@ class photo_Core {
}
static function get_edit_form($photo) {
- $form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
- $form->hidden("_method")->value("put");
- $group = $form->group("edit_item")->label(t("Edit Photo"));
+ $view = new View("item_edit.html");
+ $view->script = array();
+ $view->form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
+ $view->form->hidden("_method")->value("put");
+ $group = $view->form->group("edit_item")->label(t("Edit Photo"));
$group->input("title")->label(t("Title"))->value($photo->title);
$group->textarea("description")->label(t("Description"))->value($photo->description);
$group->input("filename")->label(t("Filename"))->value($photo->name)
@@ -147,11 +149,11 @@ class photo_Core {
->callback("item::validate_no_trailing_period")
->error_messages("no_trailing_period", t("The photo name can't end in \".\""));
- module::event("item_edit_form", $photo, $form);
+ module::event("item_edit_form", $photo, $view);
$group->submit("")->value(t("Modify"));
- $form->add_rules_from(ORM::factory("item"));
- return $form;
+ $view->form->add_rules_from(ORM::factory("item"));
+ return $view;
}
/**
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index ce2fa2a5..2940a8df 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -2,7 +2,7 @@ modules/akismet/views/admin_akismet.html.php 14 DIRTY $form
modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY $api_key
modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY $blog_url
modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY $i
-modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY $comment->author()->avatar_url(32, $theme->theme_url("images/avatar.jpg", true))
+modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true))
modules/comment/views/admin_block_recent_comments.html.php 7 $comment->author_name()
modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY $comment->created
modules/comment/views/admin_block_recent_comments.html.php 12 $comment->author_name()
@@ -15,7 +15,7 @@ modules/comment/views/admin_comments.html.php 72 DIRTY $counts->
modules/comment/views/admin_comments.html.php 75 DIRTY $csrf
modules/comment/views/admin_comments.html.php 106 DIRTY $comment->id
modules/comment/views/admin_comments.html.php 106 DIRTY $i
-modules/comment/views/admin_comments.html.php 109 DIRTY $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true))
+modules/comment/views/admin_comments.html.php 109 DIRTY $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true))
modules/comment/views/admin_comments.html.php 111 $comment->author_name()
modules/comment/views/admin_comments.html.php 115 $comment->author_email()
modules/comment/views/admin_comments.html.php 116 $comment->author_email()
@@ -35,7 +35,7 @@ modules/comment/views/admin_comments.html.php 175 DIRTY $comment-
modules/comment/views/admin_comments.html.php 183 DIRTY $comment->id
modules/comment/views/admin_comments.html.php 196 DIRTY $pager
modules/comment/views/comment.html.php 2 DIRTY $comment->id
-modules/comment/views/comment.html.php 5 DIRTY $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true))
+modules/comment/views/comment.html.php 5 DIRTY $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true))
modules/comment/views/comment.html.php 7 $comment->author_name()
modules/comment/views/comment.html.php 12 DIRTY $comment->created
modules/comment/views/comment.html.php 13 $comment->author_name()
@@ -58,7 +58,7 @@ modules/comment/views/comment.mrss.php 34 DIRTY $child->t
modules/comment/views/comment.mrss.php 35 DIRTY $child->thumb_height
modules/comment/views/comment.mrss.php 35 DIRTY $child->thumb_width
modules/comment/views/comments.html.php 10 DIRTY $comment->id
-modules/comment/views/comments.html.php 13 DIRTY $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true))
+modules/comment/views/comments.html.php 13 DIRTY $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true))
modules/comment/views/comments.html.php 15 $comment->author_name()
modules/comment/views/comments.html.php 20 DIRTY $comment->created
modules/comment/views/comments.html.php 21 $comment->author_name()
@@ -108,7 +108,7 @@ modules/gallery/views/admin_block_photo_stream.html.php 6 DIRTY $photo->w
modules/gallery/views/admin_block_photo_stream.html.php 6 DIRTY $photo->height
modules/gallery/views/admin_block_photo_stream.html.php 7 DIRTY $photo->thumb_url()
modules/gallery/views/admin_block_photo_stream.html.php 7 $photo->title
-modules/gallery/views/admin_block_platform.html.php 16 DIRTY $load_average
+modules/gallery/views/admin_block_platform.html.php 19 DIRTY $load_average
modules/gallery/views/admin_block_stats.html.php 7 DIRTY $album_count
modules/gallery/views/admin_block_stats.html.php 10 DIRTY $photo_count
modules/gallery/views/admin_dashboard.html.php 5 DIRTY $csrf
@@ -207,6 +207,8 @@ modules/gallery/views/admin_themes_preview.html.php 4 DIRTY $info->na
modules/gallery/views/admin_themes_preview.html.php 7 DIRTY $url
modules/gallery/views/after_install.html.php 11 $user->name
modules/gallery/views/after_install.html.php 15 DIRTY $user->id
+modules/gallery/views/item_edit.html.php 4 DIRTY $script
+modules/gallery/views/item_edit.html.php 8 DIRTY $form
modules/gallery/views/kohana_error_page.php 102 DIRTY $message
modules/gallery/views/kohana_error_page.php 104 DIRTY $file
modules/gallery/views/kohana_error_page.php 104 DIRTY $line
@@ -303,8 +305,8 @@ modules/info/views/info_block.html.php 10 $item->de
modules/info/views/info_block.html.php 16 $item->name
modules/info/views/info_block.html.php 22 DIRTY $item->captured
modules/info/views/info_block.html.php 29 DIRTY $item->owner->url
-modules/info/views/info_block.html.php 29 $item->owner->full_name
-modules/info/views/info_block.html.php 31 $item->owner->name
+modules/info/views/info_block.html.php 29 $item->owner->display_name()
+modules/info/views/info_block.html.php 31 $item->owner->display_name()
modules/notification/views/comment_published.html.php 4 $subject
modules/notification/views/comment_published.html.php 7 $subject
modules/notification/views/comment_published.html.php 11 $comment->text
@@ -442,8 +444,8 @@ modules/tag/views/admin_tags.html.php 50 DIRTY $tag->id
modules/tag/views/admin_tags.html.php 50 $tag->name
modules/tag/views/admin_tags.html.php 51 DIRTY $tag->count
modules/tag/views/admin_tags.html.php 52 DIRTY $tag->id
-modules/tag/views/tag_block.html.php 3 DIRTY $cloud
-modules/tag/views/tag_block.html.php 5 DIRTY $form
+modules/tag/views/tag_block.html.php 13 DIRTY $cloud
+modules/tag/views/tag_block.html.php 15 DIRTY $form
modules/tag/views/tag_cloud.html.php 4 DIRTY $tag->count
modules/tag/views/tag_cloud.html.php 4 DIRTY $max_count
modules/tag/views/tag_cloud.html.php 5 DIRTY $tag->count
@@ -454,7 +456,7 @@ modules/user/views/admin_users.html.php 36 DIRTY $csrf
modules/user/views/admin_users.html.php 67 DIRTY $user->id
modules/user/views/admin_users.html.php 67 DIRTY $user->admin
modules/user/views/admin_users.html.php 68 DIRTY $user->id
-modules/user/views/admin_users.html.php 69 DIRTY $user->avatar_url(20, $theme->theme_url("images/avatar.jpg", true))
+modules/user/views/admin_users.html.php 69 DIRTY $user->avatar_url(20, $theme->url("images/avatar.jpg", true))
modules/user/views/admin_users.html.php 71 $user->name
modules/user/views/admin_users.html.php 74 $user->name
modules/user/views/admin_users.html.php 77 $user->full_name
@@ -475,9 +477,7 @@ modules/user/views/admin_users_group.html.php 22 DIRTY $group->i
modules/user/views/admin_users_group.html.php 25 $user->name
modules/user/views/admin_users_group.html.php 25 $group->name
modules/user/views/login.html.php 12 DIRTY $user->id
-modules/user/views/login.html.php 15 $user->full_name
-modules/user/views/login.html.php 15 $user->name
-modules/user/views/login.html.php 15 $user->full_name
+modules/user/views/login.html.php 15 $user->display_name()
modules/user/views/login.html.php 18 DIRTY $csrf
modules/user/views/login_ajax.html.php 37 DIRTY $form
modules/user/views/reset_password.html.php 9 $user->full_name
@@ -488,20 +488,20 @@ modules/watermark/views/admin_watermarks.html.php 19 DIRTY $width
modules/watermark/views/admin_watermarks.html.php 19 DIRTY $height
modules/watermark/views/admin_watermarks.html.php 19 DIRTY $url
modules/watermark/views/admin_watermarks.html.php 21 DIRTY $position
-themes/admin_default/views/admin.html.php 10 DIRTY $theme->css("lib/yui/reset-fonts-grids.css")
-themes/admin_default/views/admin.html.php 11 DIRTY $theme->css("lib/themeroller/ui.base.css")
-themes/admin_default/views/admin.html.php 12 DIRTY $theme->css("lib/superfish/css/superfish.css")
-themes/admin_default/views/admin.html.php 13 DIRTY $theme->css("themes/default/css/screen.css")
-themes/admin_default/views/admin.html.php 14 DIRTY $theme->theme_css("css/screen.css")
-themes/admin_default/views/admin.html.php 16 DIRTY $theme->theme_url("css/fix-ie.css")
-themes/admin_default/views/admin.html.php 20 DIRTY $theme->script("lib/jquery.js")
-themes/admin_default/views/admin.html.php 21 DIRTY $theme->script("lib/jquery.form.js")
-themes/admin_default/views/admin.html.php 22 DIRTY $theme->script("lib/jquery-ui.js")
-themes/admin_default/views/admin.html.php 23 DIRTY $theme->script("lib/gallery.common.js")
-themes/admin_default/views/admin.html.php 28 DIRTY $theme->script("lib/gallery.dialog.js")
-themes/admin_default/views/admin.html.php 29 DIRTY $theme->script("lib/superfish/js/superfish.js")
-themes/admin_default/views/admin.html.php 30 DIRTY $theme->theme_script("js/jquery.dropshadow.js")
-themes/admin_default/views/admin.html.php 31 DIRTY $theme->theme_script("js/ui.init.js")
+themes/admin_default/views/admin.html.php 10 DIRTY $theme->css("yui/reset-fonts-grids.css")
+themes/admin_default/views/admin.html.php 11 DIRTY $theme->css("themeroller/ui.base.css")
+themes/admin_default/views/admin.html.php 12 DIRTY $theme->css("superfish/css/superfish.css")
+themes/admin_default/views/admin.html.php 13 DIRTY $theme->css("screen.css")
+themes/admin_default/views/admin.html.php 14 DIRTY $theme->css("admin_screen.css")
+themes/admin_default/views/admin.html.php 16 DIRTY $theme->url("fix-ie.css")
+themes/admin_default/views/admin.html.php 20 DIRTY $theme->script("jquery.js")
+themes/admin_default/views/admin.html.php 21 DIRTY $theme->script("jquery.form.js")
+themes/admin_default/views/admin.html.php 22 DIRTY $theme->script("jquery-ui.js")
+themes/admin_default/views/admin.html.php 23 DIRTY $theme->script("gallery.common.js")
+themes/admin_default/views/admin.html.php 28 DIRTY $theme->script("gallery.dialog.js")
+themes/admin_default/views/admin.html.php 29 DIRTY $theme->script("superfish/js/superfish.js")
+themes/admin_default/views/admin.html.php 30 DIRTY $theme->script("jquery.dropshadow.js")
+themes/admin_default/views/admin.html.php 31 DIRTY $theme->script("ui.init.js")
themes/admin_default/views/admin.html.php 33 DIRTY $theme->admin_head()
themes/admin_default/views/admin.html.php 36 DIRTY $theme->body_attributes()
themes/admin_default/views/admin.html.php 37 DIRTY $theme->admin_page_top()
@@ -569,7 +569,7 @@ themes/default/views/footer.html.php 4 DIRTY $footer_t
themes/default/views/footer.html.php 9 DIRTY $theme->credits()
themes/default/views/header.html.php 2 DIRTY $theme->header_top()
themes/default/views/header.html.php 4 DIRTY $header_text
-themes/default/views/header.html.php 7 DIRTY $theme->theme_url("images/logo.png")
+themes/default/views/header.html.php 7 DIRTY $theme->url("images/logo.png")
themes/default/views/header.html.php 12 DIRTY $theme->site_menu()
themes/default/views/header.html.php 15 DIRTY $theme->header_bottom()
themes/default/views/header.html.php 21 DIRTY $parent->id
@@ -590,27 +590,27 @@ themes/default/views/page.html.php 13 $theme->i
themes/default/views/page.html.php 15 $theme->item()->title
themes/default/views/page.html.php 17 $theme->item()->title
themes/default/views/page.html.php 20 $theme->tag()->name
-themes/default/views/page.html.php 26 DIRTY $theme->theme_url("images/favicon.ico")
-themes/default/views/page.html.php 27 DIRTY $theme->css("lib/yui/reset-fonts-grids.css")
-themes/default/views/page.html.php 28 DIRTY $theme->css("lib/superfish/css/superfish.css")
-themes/default/views/page.html.php 29 DIRTY $theme->css("lib/themeroller/ui.base.css")
-themes/default/views/page.html.php 30 DIRTY $theme->theme_css("css/screen.css")
-themes/default/views/page.html.php 32 DIRTY $theme->theme_url("css/fix-ie.css")
+themes/default/views/page.html.php 26 DIRTY $theme->url("images/favicon.ico")
+themes/default/views/page.html.php 27 DIRTY $theme->css("yui/reset-fonts-grids.css")
+themes/default/views/page.html.php 28 DIRTY $theme->css("superfish/css/superfish.css")
+themes/default/views/page.html.php 29 DIRTY $theme->css("themeroller/ui.base.css")
+themes/default/views/page.html.php 30 DIRTY $theme->css("screen.css")
+themes/default/views/page.html.php 32 DIRTY $theme->url("css/fix-ie.css")
themes/default/views/page.html.php 41 DIRTY $new_width
themes/default/views/page.html.php 42 DIRTY $new_height
themes/default/views/page.html.php 43 DIRTY $thumb_proportion
-themes/default/views/page.html.php 48 DIRTY $theme->script("lib/jquery.js")
-themes/default/views/page.html.php 49 DIRTY $theme->script("lib/jquery.form.js")
-themes/default/views/page.html.php 50 DIRTY $theme->script("lib/jquery-ui.js")
-themes/default/views/page.html.php 51 DIRTY $theme->script("lib/gallery.common.js")
-themes/default/views/page.html.php 56 DIRTY $theme->script("lib/gallery.dialog.js")
-themes/default/views/page.html.php 57 DIRTY $theme->script("lib/gallery.form.js")
-themes/default/views/page.html.php 58 DIRTY $theme->script("lib/superfish/js/superfish.js")
-themes/default/views/page.html.php 59 DIRTY $theme->script("lib/jquery.localscroll.js")
-themes/default/views/page.html.php 60 DIRTY $theme->theme_script("js/ui.init.js")
-themes/default/views/page.html.php 64 DIRTY $theme->script("lib/jquery.scrollTo.js")
-themes/default/views/page.html.php 65 DIRTY $theme->script("lib/gallery.show_full_size.js")
-themes/default/views/page.html.php 67 DIRTY $theme->script("lib/flowplayer.js")
+themes/default/views/page.html.php 48 DIRTY $theme->script("jquery.js")
+themes/default/views/page.html.php 49 DIRTY $theme->script("jquery.form.js")
+themes/default/views/page.html.php 50 DIRTY $theme->script("jquery-ui.js")
+themes/default/views/page.html.php 51 DIRTY $theme->script("gallery.common.js")
+themes/default/views/page.html.php 56 DIRTY $theme->script("gallery.dialog.js")
+themes/default/views/page.html.php 57 DIRTY $theme->script("gallery.form.js")
+themes/default/views/page.html.php 58 DIRTY $theme->script("superfish/js/superfish.js")
+themes/default/views/page.html.php 59 DIRTY $theme->script("jquery.localscroll.js")
+themes/default/views/page.html.php 60 DIRTY $theme->script("ui.init.js")
+themes/default/views/page.html.php 64 DIRTY $theme->script("jquery.scrollTo.js")
+themes/default/views/page.html.php 65 DIRTY $theme->script("gallery.show_full_size.js")
+themes/default/views/page.html.php 67 DIRTY $theme->script("flowplayer.js")
themes/default/views/page.html.php 70 DIRTY $theme->head()
themes/default/views/page.html.php 73 DIRTY $theme->body_attributes()
themes/default/views/page.html.php 74 DIRTY $theme->page_top()
diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php
index 5c2c03a1..c81fe571 100644
--- a/modules/gallery/views/admin_maintenance_task.html.php
+++ b/modules/gallery/views/admin_maintenance_task.html.php
@@ -1,11 +1,32 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
+ var target_value;
+ var animation = null;
+ var delta = 1;
+ animate_progress_bar = function() {
+ var current_value = Number($(".gProgressBar div").css("width").replace("%", ""));
+ if (current_value != target_value) {
+ var new_value = Math.min(current_value + delta, target_value);
+ if (target_value - current_value > delta) {
+ delta += .075;
+ }
+ $(".gProgressBar").progressbar("value", new_value);
+ animation = setTimeout(function() { animate_progress_bar(target_value); }, 100);
+ } else {
+ animation = null;
+ delta = 1;
+ }
+ }
+
update = function() {
$.ajax({
url: "<?= url::site("admin/maintenance/run/$task->id?csrf=$csrf") ?>",
dataType: "json",
success: function(data) {
- $(".gProgressBar").progressbar("value", data.task.percent_complete);
+ target_value = data.task.percent_complete;
+ if (!animation) {
+ animate_progress_bar();
+ }
$("#gStatus").html("" + data.task.status);
if (data.task.done) {
$("#gPauseButton").hide();
diff --git a/modules/gallery/views/item_edit.html.php b/modules/gallery/views/item_edit.html.php
new file mode 100644
index 00000000..9aa2fb64
--- /dev/null
+++ b/modules/gallery/views/item_edit.html.php
@@ -0,0 +1,9 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<? if (!empty($script)): ?>
+<script>
+ <?= implode("\n", $script) ?>
+</script>
+<? endif ?>
+<div id="gEditFormContainer">
+ <?= $form ?>
+</div> \ No newline at end of file
diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php
index a4eda3b9..21952849 100644
--- a/modules/server_add/views/server_add_tree_dialog.html.php
+++ b/modules/server_add/views/server_add_tree_dialog.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
var GET_CHILDREN_URL = "<?= url::site("server_add/children?path=__PATH__") ?>";
- var START_URL = "<?= url::site("server_add/start?item_id={$item->id}&amp;csrf=$csrf") ?>";
+ var START_URL = "<?= url::site("server_add/start?item_id={$item->id}&csrf=$csrf") ?>";
</script>
<div id="gServerAdd">
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 5dd07935..a600ea1a 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -78,4 +78,21 @@ class Tags_Controller extends REST_Controller {
return tag::get_add_form($item);
}
+
+ public function autocomplete() {
+ $tags = array();
+ $tag_parts = preg_split("#[,\s;]+# ", $this->input->get("q"));
+ $limit = $this->input->get("limit");
+ $tag_part = end($tag_parts);
+ $tag_list = ORM::factory("tag")
+ ->like("name", "{$tag_part}%", false)
+ ->orderby("name", "ASC")
+ ->limit($limit)
+ ->find_all();
+ foreach ($tag_list as $tag) {
+ $tags[] = $tag->name;
+ }
+
+ print implode("\n", $tags);
+ }
}
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 5efa6a19..be5461a4 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -104,7 +104,7 @@ class tag_Core {
($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie"));
$group = $form->group("add_tag")->label("Add Tag");
- $group->input("name")->label($label)->rules("required|length[1,64]");
+ $group->input("name")->label($label)->rules("required");
$group->hidden("item_id")->value($item->id);
$group->submit("")->value(t("Add Tag"));
return $form;
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index e1ab1b73..58034900 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -64,9 +64,15 @@ class tag_event_Core {
tag::compact();
}
- static function item_edit_form($item, $form) {
+ static function item_edit_form($item, $view) {
+ $url = url::site("tags/autocomplete");
+ $view->script[] = "$('#gEditFormContainer form').ready(function() {
+ $('#gEditFormContainer form input[id=tags]').autocomplete(
+ '$url', {max: 30, formatResult: formatTagAutoCompleteResult}
+ );
+ });";
$tag_value = implode("; ", tag::item_tags($item));
- $form->edit_item->input("tags")->label(t("Tags (separate by , or ;)"))
+ $view->form->edit_item->input("tags")->label(t("Tags (separate by , or ;)"))
->value($tag_value);
}
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index d46a91e9..1bce9bd8 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -19,6 +19,8 @@
*/
class tag_theme_Core {
static function head($theme) {
+ $theme->css("jquery.autocomplete.css");
+ $theme->script("jquery.autocomplete.js");
$theme->script("tag.js");
}
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
index a5aaa3f8..bbf44166 100644
--- a/modules/tag/js/tag.js
+++ b/modules/tag/js/tag.js
@@ -66,3 +66,18 @@ function editInPlace(element) {
};
ajaxify_editInPlaceForm();
}
+
+function formatTagAutoCompleteResult(row) {
+ var text = $(".ac_loading").val();
+ if (/[\s,;]/.test(text)) {
+ for (var i= text.length - 1; i >= 0; i--) {
+ var chr = text.charAt(i);
+ if (chr == " " || chr == "," || chr == ";") {
+ break;
+ }
+ }
+ return text.substr(0, i + 1) + row[0];
+ } else {
+ return row[0];
+ }
+}
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php
index 7a85dbab..e910a8ee 100644
--- a/modules/tag/models/tag.php
+++ b/modules/tag/models/tag.php
@@ -44,10 +44,14 @@ class Tag_Model extends ORM {
* @return integer
*/
public function items_count($type=null) {
- return ORM::factory("item")
+ $model = ORM::factory("item")
->viewable()
->join("items_tags", "items.id", "items_tags.item_id")
- ->where("items_tags.tag_id", $this->id)
- ->count_all();
+ ->where("items_tags.tag_id", $this->id);
+
+ if ($type) {
+ $model->where("items.type", $type);
+ }
+ return $model->count_all();
}
} \ No newline at end of file
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php
index 12c90857..233eb361 100644
--- a/modules/tag/views/tag_block.html.php
+++ b/modules/tag/views/tag_block.html.php
@@ -1,4 +1,14 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script>
+ $("#gAddTagForm").ready(function() {
+ var url = $("#gTagCloud").attr("title") + "/autocomplete";
+ $("#gAddTagForm input:text").autocomplete(
+ url, {
+ max: 30,
+ formatResult: formatTagAutoCompleteResult}
+ );
+ });
+</script>
<div id="gTagCloud" title="<?= url::site("tags") ?>">
<?= $cloud ?>
</div>
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index b5dc6cb5..0a0086ff 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -48,8 +48,10 @@ class Admin_Users_Controller extends Controller {
$desired_locale = $form->add_user->locale->value;
$user->locale = $desired_locale == "none" ? null : $desired_locale;
}
-
$user->save();
+
+ module::event("user_add_form_admin_completed", $user, $form);
+
message::success(t("Created user %user_name", array("user_name" => p::clean($user->name))));
print json_encode(array("result" => "success"));
} else {
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index 46f799c5..0bf2e81d 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -39,6 +39,7 @@ class Users_Controller extends REST_Controller {
$user->locale = $desired_locale == "none" ? null : $desired_locale;
}
$user->save();
+ module::event("user_edit_form_completed", $user, $form);
message::success(t("User information updated."));
print json_encode(
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 53e9052c..a153ab69 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -36,6 +36,8 @@ class user_Core {
$group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
$group->submit("")->value(t("Save"));
$form->add_rules_from($user);
+
+ module::event("user_edit_form", $user);
return $form;
}
@@ -56,6 +58,8 @@ class user_Core {
$group->submit("")->value(t("Modify User"));
$form->add_rules_from($user);
$form->edit_user->password->rules("-required");
+
+ module::event("user_edit_form_admin", $user);
return $form;
}
@@ -75,6 +79,8 @@ class user_Core {
$group->submit("")->value(t("Add User"));
$user = ORM::factory("user");
$form->add_rules_from($user);
+
+ module::event("user_add_form_admin", $user);
return $form;
}
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index b469f82d..542b8b8b 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -66,7 +66,7 @@
<? foreach ($users as $i => $user): ?>
<tr id="gUser-<?= $user->id ?>" class="<?= text::alternate("gOddRow", "gEvenRow") ?> user <?= $user->admin ? "admin" : "" ?>">
<td id="user-<?= $user->id ?>" class="core-info gDraggable">
- <img src="<?= $user->avatar_url(20, $theme->theme_url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $user->avatar_url(20, $theme->url("images/avatar.jpg", true)) ?>"
title="<?= t("Drag user onto group below to add as a new member") ?>"
alt="<?= p::clean($user->name) ?>"
width="20"