summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php4
-rw-r--r--installer/cli.php2
-rw-r--r--installer/database_config.php2
-rw-r--r--[-rwxr-xr-x]installer/install.sql29
-rw-r--r--installer/installer.php6
-rw-r--r--installer/web.php1
-rw-r--r--lib/gallery.common.css658
-rw-r--r--lib/gallery.common.js105
-rw-r--r--lib/gallery.dialog.js80
-rw-r--r--lib/gallery.form.js34
-rw-r--r--lib/gallery.in_place_edit.js78
-rw-r--r--lib/gallery.panel.js30
-rw-r--r--lib/gallery.show_full_size.js31
-rw-r--r--lib/images/ico-denied-inactive.png (renamed from themes/default/images/ico-denied-gray.png)bin604 -> 604 bytes
-rw-r--r--lib/images/ico-denied-passive.png (renamed from themes/default/images/ico-denied-pale.png)bin916 -> 916 bytes
-rw-r--r--lib/images/ico-denied.png (renamed from themes/default/images/ico-denied.png)bin715 -> 715 bytes
-rw-r--r--lib/images/ico-error.png (renamed from themes/admin_default/images/ico-error.png)bin701 -> 701 bytes
-rw-r--r--lib/images/ico-info.png (renamed from themes/admin_default/images/ico-info.png)bin778 -> 778 bytes
-rw-r--r--lib/images/ico-lock.png (renamed from themes/default/images/ico-lock.png)bin749 -> 749 bytes
-rw-r--r--lib/images/ico-separator.gif (renamed from themes/admin_default/images/ico-separator.gif)bin106 -> 106 bytes
-rw-r--r--lib/images/ico-success-inactive.png (renamed from themes/default/images/ico-success-gray.png)bin476 -> 476 bytes
-rw-r--r--lib/images/ico-success-passive.png (renamed from themes/default/images/ico-success-pale.png)bin617 -> 617 bytes
-rw-r--r--lib/images/ico-success.png (renamed from themes/admin_default/images/ico-success.png)bin537 -> 537 bytes
-rw-r--r--lib/images/ico-warning.png (renamed from themes/admin_default/images/ico-warning.png)bin666 -> 666 bytes
-rw-r--r--lib/jquery.autocomplete.js2
-rw-r--r--lib/swfobject.js4
-rw-r--r--lib/uploadify/cancel.pngbin0 -> 603 bytes
-rw-r--r--lib/uploadify/jquery.uploadify.min.js26
-rw-r--r--lib/uploadify/uploadify.allglyphs.swfbin0 -> 239838 bytes
-rw-r--r--lib/uploadify/uploadify.css53
-rw-r--r--lib/uploadify/uploadify.flabin0 -> 125952 bytes
-rw-r--r--lib/uploadify/uploadify.swfbin0 -> 23118 bytes
-rw-r--r--modules/akismet/helpers/akismet.php2
-rw-r--r--modules/akismet/tests/Akismet_Helper_Test.php2
-rw-r--r--modules/akismet/views/admin_akismet.html.php17
-rw-r--r--modules/akismet/views/admin_akismet_stats.html.php6
-rw-r--r--modules/comment/controllers/admin_comments.php8
-rw-r--r--modules/comment/controllers/comments.php8
-rw-r--r--modules/comment/css/comment.css45
-rw-r--r--modules/comment/helpers/comment.php24
-rw-r--r--modules/comment/helpers/comment_block.php8
-rw-r--r--modules/comment/helpers/comment_event.php24
-rw-r--r--modules/comment/helpers/comment_installer.php1
-rw-r--r--modules/comment/helpers/comment_rss.php2
-rw-r--r--modules/comment/helpers/comment_theme.php8
-rw-r--r--modules/comment/js/comment.js30
-rw-r--r--modules/comment/models/comment.php2
-rw-r--r--modules/comment/tests/Comment_Event_Test.php2
-rw-r--r--modules/comment/tests/Comment_Helper_Test.php6
-rw-r--r--modules/comment/tests/Comment_Model_Test.php8
-rw-r--r--modules/comment/views/admin_block_recent_comments.html.php6
-rw-r--r--modules/comment/views/admin_comments.html.php313
-rw-r--r--modules/comment/views/comment.html.php6
-rw-r--r--modules/comment/views/comments.html.php16
-rw-r--r--modules/digibug/controllers/digibug.php2
-rw-r--r--modules/digibug/helpers/digibug_event.php7
-rw-r--r--modules/digibug/js/digibug.js7
-rw-r--r--modules/digibug/tests/Digibug_Controller_Test.php4
-rw-r--r--modules/digibug/views/admin_digibug.html.php14
-rw-r--r--modules/exif/helpers/exif.php2
-rw-r--r--modules/exif/helpers/exif_event.php8
-rw-r--r--modules/exif/lib/exif.php219
-rw-r--r--modules/exif/lib/makers/canon.php234
-rw-r--r--modules/exif/lib/makers/fujifilm.php118
-rw-r--r--modules/exif/lib/makers/nikon.php76
-rw-r--r--modules/exif/lib/makers/olympus.php4
-rw-r--r--modules/exif/lib/makers/panasonic.php168
-rw-r--r--modules/exif/lib/makers/sanyo.php12
-rw-r--r--modules/exif/views/exif_dialog.html.php24
-rw-r--r--modules/exif/views/exif_sidebar.html.php5
-rw-r--r--modules/g2_import/controllers/admin_g2_import.php2
-rw-r--r--modules/g2_import/css/g2_import.css30
-rw-r--r--modules/g2_import/helpers/g2_import.php25
-rw-r--r--modules/g2_import/helpers/g2_import_theme.php28
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php144
-rw-r--r--modules/gallery/config/upload.php2
-rw-r--r--modules/gallery/controllers/admin.php2
-rw-r--r--modules/gallery/controllers/admin_dashboard.php6
-rw-r--r--modules/gallery/controllers/admin_identity.php76
-rw-r--r--modules/gallery/controllers/admin_languages.php39
-rw-r--r--modules/gallery/controllers/admin_sidebar.php68
-rw-r--r--modules/gallery/controllers/admin_theme_options.php8
-rw-r--r--modules/gallery/controllers/albums.php17
-rw-r--r--modules/gallery/controllers/file_proxy.php4
-rw-r--r--modules/gallery/controllers/l10n_client.php8
-rw-r--r--modules/gallery/controllers/login.php (renamed from modules/user/controllers/login.php)13
-rw-r--r--modules/gallery/controllers/logout.php (renamed from modules/user/controllers/logout.php)7
-rw-r--r--modules/gallery/controllers/movies.php100
-rw-r--r--modules/gallery/controllers/packager.php9
-rw-r--r--modules/gallery/controllers/permissions.php8
-rw-r--r--modules/gallery/controllers/photos.php28
-rw-r--r--modules/gallery/controllers/quick.php3
-rw-r--r--modules/gallery/controllers/simple_uploader.php2
-rw-r--r--modules/gallery/controllers/upgrader.php16
-rw-r--r--modules/gallery/controllers/welcome_message.php4
-rw-r--r--modules/gallery/css/debug.css8
-rw-r--r--modules/gallery/css/gallery.css89
-rw-r--r--modules/gallery/css/l10n_client.css28
-rw-r--r--modules/gallery/css/upgrader.css20
-rw-r--r--modules/gallery/helpers/access.php12
-rw-r--r--modules/gallery/helpers/album.php15
-rw-r--r--modules/gallery/helpers/auth.php56
-rw-r--r--modules/gallery/helpers/block_manager.php62
-rw-r--r--modules/gallery/helpers/gallery.php257
-rw-r--r--modules/gallery/helpers/gallery_block.php69
-rw-r--r--modules/gallery/helpers/gallery_error.php30
-rw-r--r--modules/gallery/helpers/gallery_event.php326
-rw-r--r--modules/gallery/helpers/gallery_graphics.php129
-rw-r--r--modules/gallery/helpers/gallery_installer.php86
-rw-r--r--modules/gallery/helpers/gallery_rss.php4
-rw-r--r--modules/gallery/helpers/gallery_task.php25
-rw-r--r--modules/gallery/helpers/gallery_theme.php10
-rw-r--r--modules/gallery/helpers/graphics.php144
-rw-r--r--modules/gallery/helpers/identity.php244
-rw-r--r--modules/gallery/helpers/item.php6
-rw-r--r--modules/gallery/helpers/locales.php34
-rw-r--r--modules/gallery/helpers/log.php10
-rw-r--r--modules/gallery/helpers/message.php10
-rw-r--r--modules/gallery/helpers/module.php76
-rw-r--r--modules/gallery/helpers/movie.php39
-rw-r--r--modules/gallery/helpers/photo.php17
-rw-r--r--modules/gallery/helpers/site_status.php12
-rw-r--r--modules/gallery/helpers/task.php2
-rw-r--r--modules/gallery/helpers/theme.php30
-rw-r--r--modules/gallery/hooks/init_gallery.php4
-rw-r--r--modules/gallery/js/albums_form_add.js20
-rw-r--r--modules/gallery/js/l10n_client.js44
-rw-r--r--modules/gallery/libraries/Admin_View.php16
-rw-r--r--modules/gallery/libraries/Gallery_View.php22
-rw-r--r--modules/gallery/libraries/IdentityProvider.php209
-rw-r--r--modules/gallery/libraries/InPlaceEdit.php88
-rw-r--r--modules/gallery/libraries/Menu.php90
-rw-r--r--modules/gallery/libraries/Theme_View.php103
-rw-r--r--modules/gallery/libraries/drivers/IdentityProvider.php133
-rw-r--r--modules/gallery/models/item.php115
-rw-r--r--modules/gallery/models/log.php18
-rw-r--r--modules/gallery/models/task.php2
-rw-r--r--modules/gallery/module.info2
-rw-r--r--modules/gallery/tests/Access_Helper_Test.php153
-rw-r--r--modules/gallery/tests/Albums_Controller_Test.php15
-rw-r--r--modules/gallery/tests/Controller_Auth_Test.php13
-rw-r--r--modules/gallery/tests/Database_Test.php22
-rw-r--r--modules/gallery/tests/DrawForm_Test.php12
-rw-r--r--modules/gallery/tests/File_Structure_Test.php36
-rw-r--r--modules/gallery/tests/Gallery_Filters.php48
-rw-r--r--modules/gallery/tests/Item_Helper_Test.php6
-rw-r--r--modules/gallery/tests/Item_Model_Test.php136
-rw-r--r--modules/gallery/tests/Photos_Controller_Test.php14
-rw-r--r--modules/gallery/tests/Xss_Security_Test.php4
-rw-r--r--modules/gallery/tests/controller_auth_data.txt10
-rw-r--r--modules/gallery/tests/selenium/Add_Comment.html8
-rw-r--r--modules/gallery/tests/selenium/Login.html8
-rw-r--r--modules/gallery/tests/xss_data.txt421
-rw-r--r--modules/gallery/views/admin_advanced_settings.html.php63
-rw-r--r--modules/gallery/views/admin_block_photo_stream.html.php2
-rw-r--r--modules/gallery/views/admin_block_platform.html.php2
-rw-r--r--modules/gallery/views/admin_dashboard.html.php22
-rw-r--r--modules/gallery/views/admin_graphics.html.php37
-rw-r--r--modules/gallery/views/admin_graphics_gd.html.php12
-rw-r--r--modules/gallery/views/admin_graphics_graphicsmagick.html.php8
-rw-r--r--modules/gallery/views/admin_graphics_imagemagick.html.php8
-rw-r--r--modules/gallery/views/admin_graphics_none.html.php4
-rw-r--r--modules/gallery/views/admin_identity.html.php59
-rw-r--r--modules/gallery/views/admin_identity_confirm.html.php10
-rw-r--r--modules/gallery/views/admin_languages.html.php157
-rw-r--r--modules/gallery/views/admin_maintenance.html.php364
-rw-r--r--modules/gallery/views/admin_maintenance_show_log.html.php12
-rw-r--r--modules/gallery/views/admin_maintenance_task.html.php26
-rw-r--r--modules/gallery/views/admin_modules.html.php50
-rw-r--r--modules/gallery/views/admin_sidebar.html.php64
-rw-r--r--modules/gallery/views/admin_sidebar_blocks.html.php5
-rw-r--r--modules/gallery/views/admin_theme_options.html.php4
-rw-r--r--modules/gallery/views/admin_themes.html.php137
-rw-r--r--modules/gallery/views/form.html.php4
-rw-r--r--modules/gallery/views/in_place_edit.html.php16
-rw-r--r--modules/gallery/views/kohana_error_page.php7
-rw-r--r--modules/gallery/views/l10n_client.html.php14
-rw-r--r--modules/gallery/views/login_ajax.html.php45
-rw-r--r--modules/gallery/views/login_current_user.html.php11
-rw-r--r--modules/gallery/views/maintenance.html.php6
-rw-r--r--modules/gallery/views/menu.html.php24
-rw-r--r--modules/gallery/views/menu_ajax_link.html.php10
-rw-r--r--modules/gallery/views/menu_dialog.html.php9
-rw-r--r--modules/gallery/views/menu_link.html.php9
-rw-r--r--modules/gallery/views/move_browse.html.php14
-rw-r--r--modules/gallery/views/movieplayer.html.php2
-rw-r--r--modules/gallery/views/permissions_browse.html.php28
-rw-r--r--modules/gallery/views/permissions_form.html.php43
-rw-r--r--modules/gallery/views/simple_uploader.html.php394
-rw-r--r--modules/gallery/views/upgrader.html.php61
-rw-r--r--modules/gallery/views/user_languages_block.html.php (renamed from modules/user/views/user_languages_block.html.php)4
-rw-r--r--modules/gallery/views/welcome_message.html.php14
-rw-r--r--modules/gallery/views/welcome_message_loader.html.php4
-rw-r--r--modules/gallery_unit_test/controllers/gallery_unit_test.php27
-rw-r--r--modules/image_block/helpers/image_block_block.php (renamed from modules/image_block/helpers/image_block_theme.php)51
-rw-r--r--modules/image_block/helpers/image_block_installer.php30
-rw-r--r--modules/image_block/views/image_block_block.html.php4
-rw-r--r--modules/info/helpers/info_block.php (renamed from modules/rss/helpers/rss_theme.php)35
-rw-r--r--modules/info/helpers/info_theme.php10
-rw-r--r--modules/info/views/info_block.html.php2
-rw-r--r--modules/notification/helpers/notification.php34
-rw-r--r--modules/notification/helpers/notification_event.php15
-rw-r--r--modules/notification/views/comment_published.html.php4
-rw-r--r--modules/notification/views/item_updated.html.php4
-rw-r--r--modules/organize/css/organize.css63
-rw-r--r--modules/organize/helpers/organize_event.php6
-rw-r--r--modules/organize/js/organize.js94
-rw-r--r--modules/organize/views/organize_dialog.html.php34
-rw-r--r--modules/organize/views/organize_thumb_grid.html.php12
-rw-r--r--modules/organize/views/organize_tree.html.php8
-rw-r--r--modules/recaptcha/css/recaptcha.css7
-rw-r--r--modules/recaptcha/helpers/recaptcha.php2
-rw-r--r--modules/recaptcha/helpers/recaptcha_event.php8
-rw-r--r--modules/recaptcha/helpers/recaptcha_theme.php28
-rw-r--r--modules/recaptcha/views/admin_recaptcha.html.php46
-rw-r--r--modules/recaptcha/views/form_recaptcha.html.php6
-rw-r--r--modules/rss/controllers/rss.php8
-rw-r--r--modules/rss/helpers/rss_block.php49
-rw-r--r--modules/rss/views/feed.mrss.php6
-rw-r--r--modules/rss/views/rss_block.html.php2
-rw-r--r--modules/search/controllers/search.php5
-rw-r--r--modules/search/helpers/search.php23
-rw-r--r--modules/search/views/search.html.php16
-rw-r--r--modules/search/views/search_link.html.php6
-rw-r--r--modules/server_add/controllers/admin_server_add.php4
-rw-r--r--modules/server_add/controllers/server_add.php4
-rw-r--r--modules/server_add/css/server_add.css38
-rw-r--r--modules/server_add/helpers/server_add_event.php4
-rw-r--r--modules/server_add/helpers/server_add_theme.php6
-rw-r--r--modules/server_add/js/admin.js2
-rw-r--r--modules/server_add/js/server_add.js62
-rw-r--r--modules/server_add/views/admin_server_add.html.php30
-rw-r--r--modules/server_add/views/server_add_tree.html.php6
-rw-r--r--modules/server_add/views/server_add_tree_dialog.html.php36
-rw-r--r--modules/slideshow/helpers/slideshow_event.php22
-rw-r--r--modules/slideshow/helpers/slideshow_theme.php2
-rw-r--r--modules/tag/controllers/admin_tags.php46
-rw-r--r--modules/tag/controllers/tags.php9
-rw-r--r--modules/tag/css/tag.css96
-rw-r--r--modules/tag/helpers/tag.php18
-rw-r--r--modules/tag/helpers/tag_block.php45
-rw-r--r--modules/tag/helpers/tag_theme.php28
-rw-r--r--modules/tag/js/tag.js81
-rw-r--r--modules/tag/models/tag.php14
-rw-r--r--modules/tag/views/admin_tags.html.php81
-rw-r--r--modules/tag/views/tag_block.html.php26
-rw-r--r--modules/tag/views/tag_cloud.html.php2
-rw-r--r--modules/user/config/identity.php37
-rw-r--r--modules/user/controllers/admin_users.php212
-rw-r--r--modules/user/controllers/password.php35
-rw-r--r--modules/user/controllers/users.php57
-rw-r--r--modules/user/css/user.css119
-rw-r--r--modules/user/helpers/group.php72
-rw-r--r--modules/user/helpers/user.php265
-rw-r--r--modules/user/helpers/user_event.php29
-rw-r--r--modules/user/helpers/user_installer.php32
-rw-r--r--modules/user/helpers/user_theme.php35
-rw-r--r--modules/user/images/progressImg1.pngbin0 -> 390 bytes
-rw-r--r--modules/user/js/password_strength.js39
-rw-r--r--modules/user/libraries/drivers/IdentityProvider/Gallery.php161
-rw-r--r--modules/user/models/group.php2
-rw-r--r--modules/user/models/user.php6
-rw-r--r--modules/user/module.info7
-rw-r--r--modules/user/tests/No_Direct_ORM_Access_Test.php77
-rw-r--r--modules/user/views/admin_users.html.php179
-rw-r--r--modules/user/views/admin_users_group.html.php20
-rw-r--r--modules/user/views/login.html.php22
-rw-r--r--modules/user/views/login_ajax.html.php44
-rw-r--r--modules/user/views/reset_password.html.php4
-rw-r--r--modules/user/views/user_form.html.php7
-rw-r--r--modules/watermark/controllers/admin_watermarks.php2
-rw-r--r--modules/watermark/helpers/watermark.php6
-rw-r--r--modules/watermark/module.info2
-rw-r--r--modules/watermark/views/admin_watermarks.html.php58
-rw-r--r--robots.txt13
-rw-r--r--system/core/Kohana.php8
-rw-r--r--system/libraries/Database.php12
-rw-r--r--themes/admin_default/css/fix-ie.css18
-rw-r--r--themes/admin_default/css/screen.css1170
-rw-r--r--themes/admin_default/images/avatar.jpgbin914 -> 0 bytes
-rw-r--r--themes/admin_default/images/ico-view-hybrid.pngbin494 -> 0 bytes
-rw-r--r--themes/admin_default/js/ui.init.js59
-rw-r--r--themes/admin_default/views/pager.html.php44
-rw-r--r--themes/admin_wind/css/fix-ie.css18
-rw-r--r--themes/admin_wind/css/screen.css480
-rw-r--r--themes/admin_wind/images/avatar.jpg (renamed from themes/default/images/avatar.jpg)bin1172 -> 1172 bytes
-rw-r--r--themes/admin_wind/js/ui.init.js60
-rw-r--r--themes/admin_wind/theme.info (renamed from themes/admin_default/theme.info)2
-rw-r--r--themes/admin_wind/thumbnail.png (renamed from themes/admin_default/thumbnail.png)bin28330 -> 28330 bytes
-rw-r--r--themes/admin_wind/views/admin.html.php (renamed from themes/admin_default/views/admin.html.php)37
-rw-r--r--themes/admin_wind/views/block.html.php (renamed from themes/admin_default/views/block.html.php)6
-rw-r--r--themes/admin_wind/views/pager.html.php44
-rw-r--r--themes/default/css/screen.css1128
-rw-r--r--themes/default/images/ico-album.pngbin397 -> 0 bytes
-rw-r--r--themes/default/images/ico-error.pngbin701 -> 0 bytes
-rw-r--r--themes/default/images/ico-info.pngbin778 -> 0 bytes
-rw-r--r--themes/default/images/ico-print.pngbin989 -> 0 bytes
-rw-r--r--themes/default/images/ico-separator.gifbin106 -> 0 bytes
-rw-r--r--themes/default/images/ico-success.pngbin537 -> 0 bytes
-rw-r--r--themes/default/images/ico-view-comments.pngbin768 -> 0 bytes
-rw-r--r--themes/default/images/ico-view-fullsize.pngbin1046 -> 0 bytes
-rw-r--r--themes/default/images/ico-view-hybrid.pngbin494 -> 0 bytes
-rw-r--r--themes/default/images/ico-view-slideshow.pngbin960 -> 0 bytes
-rw-r--r--themes/default/images/ico-warning.pngbin666 -> 0 bytes
-rw-r--r--themes/default/js/ui.init.js136
-rw-r--r--themes/default/views/movie.html.php37
-rw-r--r--themes/default/views/pager.html.php44
-rw-r--r--themes/default/views/photo.html.php59
-rw-r--r--themes/default/views/sidebar.html.php18
-rw-r--r--themes/wind/css/fix-ie.css (renamed from themes/default/css/fix-ie.css)18
-rw-r--r--themes/wind/css/screen.css445
-rw-r--r--themes/wind/images/avatar.jpgbin0 -> 1172 bytes
-rw-r--r--themes/wind/images/ico-album.png (renamed from themes/admin_default/images/ico-album.png)bin397 -> 397 bytes
-rw-r--r--themes/wind/images/ico-help.png (renamed from themes/default/images/ico-help.png)bin786 -> 786 bytes
-rw-r--r--themes/wind/images/ico-print.png (renamed from themes/admin_default/images/ico-print.png)bin989 -> 989 bytes
-rw-r--r--themes/wind/images/ico-view-comments.png (renamed from themes/admin_default/images/ico-view-comments.png)bin768 -> 768 bytes
-rw-r--r--themes/wind/images/ico-view-fullsize.png (renamed from themes/admin_default/images/ico-view-fullsize.png)bin1046 -> 1046 bytes
-rw-r--r--themes/wind/images/ico-view-slideshow.png (renamed from themes/admin_default/images/ico-view-slideshow.png)bin960 -> 960 bytes
-rw-r--r--themes/wind/images/select-photos-backg.png (renamed from themes/default/images/select-photos-backg.png)bin1154 -> 1154 bytes
-rw-r--r--themes/wind/js/ui.init.js111
-rw-r--r--themes/wind/theme.info (renamed from themes/default/theme.info)2
-rw-r--r--themes/wind/thumbnail.png (renamed from themes/default/thumbnail.png)bin26946 -> 26946 bytes
-rw-r--r--themes/wind/views/album.html.php (renamed from themes/default/views/album.html.php)22
-rw-r--r--themes/wind/views/block.html.php (renamed from themes/default/views/block.html.php)4
-rw-r--r--themes/wind/views/dynamic.html.php (renamed from themes/default/views/dynamic.html.php)14
-rw-r--r--themes/wind/views/movie.html.php18
-rw-r--r--themes/wind/views/no_sidebar.html.php6
-rw-r--r--themes/wind/views/page.html.php (renamed from themes/default/views/page.html.php)33
-rw-r--r--themes/wind/views/paginator.html.php86
-rw-r--r--themes/wind/views/photo.html.php39
-rw-r--r--themes/wind/views/sidebar.html.php16
331 files changed, 8843 insertions, 6829 deletions
diff --git a/index.php b/index.php
index d0e12cfc..f6285257 100644
--- a/index.php
+++ b/index.php
@@ -50,6 +50,9 @@ define("SYSPATH", realpath("system") . "/");
// We only accept a few controllers on the command line
if (PHP_SAPI == "cli") {
switch ($arg_1 = $_SERVER["argv"][1]) {
+ case "install":
+ include("installer/index.php");
+ exit(0);
case "upgrade":
case "package":
$_SERVER["argv"] = array("index.php", "{$arg_1}r/$arg_1");
@@ -66,6 +69,7 @@ if (PHP_SAPI == "cli") {
break;
default:
+ print "To install:\n php index.php install -d database -h host -u user -p password -x table_prefix \n\n\n";
print "To upgrade:\n php index.php upgrade\n\n\n";
print "Developer-only features:\n ** CAUTION! THESE FEATURES -WILL- DAMAGE YOUR INSTALL **\n";
print " php index.php package # create new installer files\n";
diff --git a/installer/cli.php b/installer/cli.php
index 182c3d26..f736ffcb 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -95,7 +95,7 @@ function parse_cli_params() {
$config["dbname"] = $argv[++$i];
break;
case "-h":
- $config["host"] = $argv[++$i];
+ list ($config["host"], $config["port"]) = explode(":", $argv[++$i]);
break;
case "-u":
$config["user"] = $argv[++$i];
diff --git a/installer/database_config.php b/installer/database_config.php
index 0f04b95c..8abf35e7 100644
--- a/installer/database_config.php
+++ b/installer/database_config.php
@@ -33,7 +33,7 @@ $config['default'] = array(
'user' => '<?php print $user ?>',
'pass' => '<?php print str_replace("'", "\\'", $password) ?>',
'host' => '<?php print $host ?>',
- 'port' => false,
+ 'port' => <?php if (!empty($port)): ?>'<?php print $port ?>' <?php else: ?>false<?php endif ?>,
'socket' => false,
'database' => '<?php print $dbname ?>'
),
diff --git a/installer/install.sql b/installer/install.sql
index e8aaa681..38851eff 100755..100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -88,8 +88,8 @@ CREATE TABLE {graphics_rules} (
PRIMARY KEY (`id`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','resize',100,'thumb');
-INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','resize',100,'resize');
+INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'thumb');
+INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'resize');
DROP TABLE IF EXISTS {groups};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -175,7 +175,7 @@ CREATE TABLE {items} (
KEY `weight` (`weight`)
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,NULL,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
+INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,2,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
DROP TABLE IF EXISTS {items_tags};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -228,8 +228,8 @@ CREATE TABLE {modules} (
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {modules} VALUES (1,1,'gallery',12);
-INSERT INTO {modules} VALUES (2,1,'user',1);
+INSERT INTO {modules} VALUES (1,1,'gallery',19);
+INSERT INTO {modules} VALUES (2,1,'user',2);
INSERT INTO {modules} VALUES (3,1,'comment',2);
INSERT INTO {modules} VALUES (4,1,'organize',1);
INSERT INTO {modules} VALUES (5,1,'info',1);
@@ -264,7 +264,7 @@ CREATE TABLE {permissions} (
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {permissions} VALUES (1,'View','view');
-INSERT INTO {permissions} VALUES (2,'View Full Size','view_full');
+INSERT INTO {permissions} VALUES (2,'View full size','view_full');
INSERT INTO {permissions} VALUES (3,'Edit','edit');
INSERT INTO {permissions} VALUES (4,'Add','add');
DROP TABLE IF EXISTS {search_records};
@@ -331,8 +331,8 @@ CREATE TABLE {themes} (
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {themes} VALUES (1,'default',1);
-INSERT INTO {themes} VALUES (2,'admin_default',1);
+INSERT INTO {themes} VALUES (1,'wind',1);
+INSERT INTO {themes} VALUES (2,'admin_wind',1);
DROP TABLE IF EXISTS {users};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -366,10 +366,10 @@ CREATE TABLE {vars} (
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `module_name` (`module_name`,`name`)
-) AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
+) AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','default');
-INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_default');
+INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','wind');
+INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_wind');
INSERT INTO {vars} VALUES (3,'gallery','page_size','9');
INSERT INTO {vars} VALUES (4,'gallery','thumb_size','200');
INSERT INTO {vars} VALUES (5,'gallery','resize_size','640');
@@ -382,6 +382,9 @@ INSERT INTO {vars} VALUES (23,'gallery','credits','Powered by <a href=\"%url\">G
INSERT INTO {vars} VALUES (10,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}');
INSERT INTO {vars} VALUES (20,'gallery','date_time_format','Y-M-d H:i:s');
INSERT INTO {vars} VALUES (19,'gallery','date_format','Y-M-d');
-INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:4:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}i:9;a:2:{i:0;s:7:\"comment\";i:1;s:15:\"recent_comments\";}}');
+INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}');
INSERT INTO {vars} VALUES (18,'gallery','choose_default_tookit','1');
-INSERT INTO {vars} VALUES (25,'comment','spam_caught','0');
+INSERT INTO {vars} VALUES (26,'user','mininum_password_length','5');
+INSERT INTO {vars} VALUES (27,'comment','spam_caught','0');
+INSERT INTO {vars} VALUES (25,'gallery','identity_provider','user');
+INSERT INTO {vars} VALUES (29,'gallery','blocks_site_sidebar','a:3:{i:9;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:10;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:11;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}');
diff --git a/installer/installer.php b/installer/installer.php
index 70afc440..3b1716e2 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -77,7 +77,8 @@ class installer {
// counterparts.
if (!function_exists("mysql_query")) {
function mysql_connect($host, $user, $pass) {
- installer::$mysqli = new mysqli($host, $user, $pass);
+ list ($host, $port) = explode(":", $host);
+ installer::$mysqli = new mysqli($host, $user, $pass, $port);
// http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of
// $mysqli->connect_error because of bugs before PHP 5.2.9
$error = mysqli_connect_error();
@@ -97,7 +98,8 @@ class installer {
}
}
- return @mysql_connect($config["host"], $config["user"], $config["password"]);
+ $host = empty($config["port"]) ? $config['host'] : "{$config['host']}:{$config['port']}";
+ return @mysql_connect($host, $config["user"], $config["password"]);
}
static function select_db($config) {
diff --git a/installer/web.php b/installer/web.php
index c46f072a..65233b31 100644
--- a/installer/web.php
+++ b/installer/web.php
@@ -38,6 +38,7 @@ if (installer::already_installed()) {
"dbname" => $_POST["dbname"],
"prefix" => $_POST["prefix"],
"type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
+ list ($config["host"], $config["port"]) = explode(":", $config["host"]);
if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");
diff --git a/lib/gallery.common.css b/lib/gallery.common.css
index f4d46a4e..1ebeadbe 100644
--- a/lib/gallery.common.css
+++ b/lib/gallery.common.css
@@ -1,38 +1,233 @@
/**
- * Gallery 3 commonly reused screen styles
+ * Gallery 3 commonly re-used screen styles
*
* Sheet organization:
+ *
* 1) Text
- * 2) States and interactions
- * 3) Positioning and order
- * 4) Reusable containers/widgets
+ * 2) Forms
+ * 3) Dimension and scale
+ * 4) States and interactions
+ * 5) Positioning and order
+ * 6) Containers/widgets
+ * 7) Right to left language styles
+ *
+ * @todo Update .g-message-block, don't force it to 100%, bad things happen is themes when you do.
*/
/** *******************************************************************
* 1) Text
**********************************************************************/
+.g-text-small {
+ font-size: .8em;
+}
+
+.g-text-big {
+ font-size: 1.2em;
+}
+
+.g-text-right {
+ text-align: right;
+}
+
+/** *******************************************************************
+ * 2) Forms
+ **********************************************************************/
+
+form {
+ margin: 0;
+}
+
+fieldset {
+ border: 1px solid #ccc;
+ padding: 0 1em .8em 1em;
+}
+
+#g-banner fieldset,
+#g-sidebar fieldset {
+ border: none;
+ padding: 0;
+}
+
+legend {
+ font-weight: bold;
+ margin: 0;
+ padding: 0 .2em;
+}
+
+#g-banner legend,
+#g-sidebar legend,
+input[type="hidden"] {
+ display: none;
+}
+
+input.textbox,
+input[type="text"],
+input[type="password"],
+textarea {
+ border: 1px solid #e8e8e8;
+ border-top-color: #ccc;
+ border-left-color: #ccc;
+ clear: both;
+ color: #333;
+ width: 50%;
+}
+
+textarea {
+ height: 12em;
+ width: 97%;
+}
+
+input:focus,
+input.textbox:focus,
+input[type=text]:focus,
+textarea:focus,
+option:focus {
+ background-color: #ffc;
+ color: #000;
+}
+
+input.checkbox,
+input[type=checkbox],
+input.radio,
+input[type=radio] {
+ float: left;
+ margin-right: .4em;
+}
+
+/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+form li {
+ margin: 0;
+ padding: 0 0 .2em 0;
+}
+
+form ul {
+ margin-top: 0;
+}
+
+form ul ul {
+ clear: both;
+}
+
+form ul ul li {
+ float: left;
+}
+
+input,
+select,
+textarea {
+ display: block;
+ clear: both;
+ padding: .2em;
+}
+
+input[type="submit"],
+input[type="reset"] {
+ display: inline;
+ clear: none;
+ float: left;
+}
+
+/* Forms in dialogs and panels ~~~~~~~~~ */
+
+#g-dialog ul li {
+ padding-bottom: .8em;
+}
+
+#g-dialog fieldset,
+#g-panel fieldset {
+ border: none;
+ padding: 0;
+}
+
+#g-panel legend {
+ display: none;
+}
+
+#g-dialog input.textbox,
+#g-dialog input[type=text],
+#g-dialog input[type=password],
+#g-dialog textarea {
+ width: 97%;
+}
+
+/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-short-form legend,
+.g-short-form label {
+ display: none;
+}
+
+.g-short-form fieldset {
+ border: none;
+ padding: 0;
+}
+
+.g-short-form li {
+ float: left;
+ margin: 0 !important;
+ padding: .4em 0;
+}
+
+.g-short-form .textbox,
+.g-short-form input[type=text] {
+ color: #666;
+ padding: .3em .6em;
+ width: 100%;
+}
+
+.g-short-form .textbox.g-error {
+ border: 1px solid #f00;
+ color: #f00;
+ padding-left: 24px;
+}
+
+.g-short-form .g-cancel {
+ display: block;
+ padding: .2em .8em;
+}
+
+#g-sidebar .g-short-form li {
+ padding-left: 0;
+ padding-right: 0;
+}
+
+/** *******************************************************************
+ * 3) Dimension and scale
+ **********************************************************************/
+
+.g-one-quarter {
+ width: 25%;
+}
+
+.g-one-third {
+ width: 33%;
+}
+
+.g-one-half {
+ width: 50%;
+}
-.g-txt-small {
- font-size: .8em;
+.g-two-thirds {
+ width: 66%;
}
-.g-txt-big {
- font-size: 1.2em;
+.g-three-quarters {
+ width: 75%;
}
-.g-txt-right {
- text-align: right;
+.g-whole {
+ width: 100%;
}
/** *******************************************************************
- * 2) States and interactions
+ * 4) States and interactions
**********************************************************************/
.g-active,
.g-enabled,
.g-available,
-.g-editable,
.g-selected,
.g-highlight {
font-weight: bold;
@@ -43,42 +238,80 @@
.g-unavailable,
.g-uneditable,
.g-locked,
-.g-unselected,
+.g-deselected,
.g-understate {
color: #ccc;
font-weight: normal;
}
+.g-editable {
+ padding: .2em .3em;
+}
+
+.g-editable:hover {
+ background-color: #ffc;
+ cursor: text;
+}
+
.g-error,
.g-info,
.g-success,
.g-warning {
- background-position: .4em 50%;
- background-repeat: no-repeat;
- padding: .4em .5em .4em 30px;
+ padding-left: 30px;
+}
+
+form li.g-error,
+form li.g-info,
+form li.g-success,
+form li.g-warning {
+ background-image: none;
+ padding: .3em .8em .3em 1em;
+}
+
+.g-short-form li.g-error {
+ padding: .3em 0 .3em 0;
+}
+
+form.g-error input[type="text"],
+li.g-error input[type="text"],
+form.g-error input[type="password"],
+li.g-error input[type="password"],
+form.g-error input[type="checkbox"],
+li.g-error input[type="checkbox"],
+form.g-error input[type="radio"],
+li.g-error input[type="radio"],
+form.g-error textarea,
+li.g-error textarea,
+form.g-error select,
+li.g-error select {
+ border: 2px solid #f00;
+ margin-bottom: .2em;
}
.g-error,
-.g-denied {
- background-color: #f6cbca;
+.g-denied,
+tr.g-error td.g-error {
+ background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%;
color: #f00;
- background-image: url('lib/images/ico-error.png');
}
.g-info {
- background-color: #e8e8e8;
- background-image: url('lib/images/ico-info.png');
+ background: #e8e8e8 url('images/ico-info.png') no-repeat .4em 50%;
}
.g-success,
-.g-allowed {
- background-color: #d9efc2;
- background-image: url('lib/images/ico-success.png');
+.g-allowed,
+tr.g-success td.g-success {
+ background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%;
}
-.g-warning {
- background-color: #fcf9ce;
- background-image: url('lib/images/ico-warning.png');
+tr.g-success td.g-success {
+ background-color: transparent;
+}
+
+.g-warning,
+tr.g-warning td.g-warning {
+ background: #fcf9ce url('images/ico-warning.png') no-repeat .4em 50%;
}
form .g-error {
@@ -92,29 +325,55 @@ form .g-error {
}
.g-installed {
+ background-color: #eeeeee;
}
.g-default {
+ background-color: #c5dbec;
+ font-weight: bold;
+}
+
+.g-draggable {
+ cursor: move;
+}
+
+.g-draggable:hover {
+ border: 1px dashed #000;
+}
+
+.ui-sortable .g-target,
+.ui-state-highlight {
+ background-color: #fcf9ce;
+ border: 2px dotted #999;
+ height: 2em;
+ margin: 1em 0;
}
-.g-draggable,
-.ui-draggable {
- cursor: move;
+/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */
+
+.g-loading-large,
+.g-dialog-loading-large {
+ background: #e8e8e8 url('images/loading-large.gif') no-repeat center center;
+ font-size: 0;
}
-.g-target {
+.g-loading-small {
+ background: #e8e8e8 url('images/loading-small.gif') no-repeat center center;
+ font-size: 0;
}
/** *******************************************************************
- * 3) Positioning and order
+ * 5) Positioning and order
**********************************************************************/
-.g-right {
- float: right;
+.g-left {
+ clear: none;
+ float: left;
}
-.g-left {
- float: left;
+.g-right {
+ clear: none;
+ float: right;
}
.g-first {
@@ -123,39 +382,346 @@ form .g-error {
.g-last {
}
-.g-even-row {
+.g-even {
+ background-color: #fff;
}
-.g-odd-row {
+.g-odd {
+ background-color: #eee;
}
/** *******************************************************************
- * 4) Reusable containers/widgets
+ * 6) Containers/widgets
**********************************************************************/
-.g-dialog {
+/* Generic block container ~~~~~~~~~~~~~~~ */
+
+.g-block {
+ clear: both;
+ margin-bottom: 2.5em;
}
+.g-block-content {
+}
+
+/* Superfish menu overrides ~~~~~~~~~~~~~~ */
+
+.sf-menu ul {
+ width: 12em;
+}
+
+ul.sf-menu li li:hover ul,
+ul.sf-menu li li.sfHover ul {
+ left: 12em;
+}
+
+ul.sf-menu li li li:hover ul,
+ul.sf-menu li li li.sfHover ul {
+ left: 12em;
+}
+
+/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */
+
+.ui-widget-overlay {
+ background: #000;
+ opacity: .7;
+}
+
+/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
.g-button {
+ display: inline-block;
+ margin: 0 4px 0 0;
+ padding: .2em .4em;
}
-.g-progressbar {
+.g-button,
+.g-button:hover,
+.g-button:active {
+ cursor: pointer !important;
+ outline: 0;
+ text-decoration: none;
+ -moz-outline-style: none;
}
-.g-block {
+/* jQuery UI ThemeRoller buttons ~~~~~~~~~ */
+
+.g-buttonset {
+ padding-left: 1px;
+}
+
+.g-buttonset li {
+ float: left;
+}
+
+.g-buttonset .g-button {
+ margin: 0;
+}
+
+.ui-icon-left .ui-icon {
+ float: left;
+ margin-right: .2em;
+}
+
+.ui-icon-right .ui-icon {
+ float: right;
+ margin-left: .2em;
+}
+
+/* Rotate icon, ThemeRoller only provides one of these */
+
+.ui-icon-rotate-ccw {
+ background-position: -192px -64px;
+}
+
+.ui-icon-rotate-cw {
+ background-position: -208px -64px;
}
-.g-message-box {
+.g-progress-bar {
+ height: 1em;
width: 100%;
+ margin-top: .5em;
+ display: inline-block;
}
-.g-message {
+/* Status and validation messages ~~~~ */
+
+.g-message-block {
border: 1px solid #ccc;
- margin-bottom: .4em;
+ padding: 0 !important;
+ width: 100%;
+}
+
+#g-action-status {
+ margin-bottom: 1em;
}
+#g-action-status li,
+p#g-action-status,
+div#g-action-status {
+ padding-top: .4em;
+ padding-bottom: .3em;
+}
+
+#g-site-status li {
+ border-bottom: 1px solid #ccc;
+ padding: .3em .3em .3em 30px;
+}
+
+.g-module-status {
+ clear: both;
+ margin-bottom: 1em;
+}
+
+/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-breadcrumbs {
+ clear: both;
+ padding: 0 20px;
+}
+
+.g-breadcrumbs li {
+ background: transparent url('images/ico-separator.gif') no-repeat scroll left center;
+ float: left;
+ padding: 1em 8px 1em 18px;
+}
+
+.g-breadcrumbs .g-first {
+ background: none;
+ padding-left: 0;
+}
+
+.g-breadcrumbs li a,
+.g-breadcrumbs li span {
+ display: block;
+}
+
+#g-dialog ul.g-breadcrumbs {
+ margin-left: 0;
+ padding-left: 0;
+}
+
+/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
.g-pager {
+ padding: .2em 0;
+ width: 100%;
+}
+
+.g-pager li {
+ float: left;
+ width: 30%;
+}
+
+.g-pager .g-info {
+ background: none;
+ padding: .2em 0;
+ text-align: center;
+ width: 40%;
+}
+
+/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */
+
+#g-dialog {
+ text-align: left;
+}
+
+#g-dialog legend {
+ display: none;
+}
+
+#g-dialog .g-cancel {
+ margin: .4em 1em;
+}
+
+#g-panel {
+ display: none;
+ padding: 1em;
+}
+
+/* Inline layout ~~~~~~~~~~ */
+
+.g-inline li {
+ float: left;
+ margin-left: 1.8em;
+ padding-left: 0 !important;
+}
+
+.g-inline li.g-first {
+ margin-left: 0;
+}
+
+/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-add-photos-canvas {
+ border: 1px solid #ccc;
+ height: 200px;
+ margin: .5em 0;
+ overflow: auto;
+ width: 469px;
+}
+
+#g-add-photos-status {
+ border: 1px solid #ccc;
+ height: 125px;
+ margin: .5em 0;
+ overflow: auto;
+ width: 469px;
+}
+
+#g-add-photos button {
+ float: right;
+ margin-bottom: .5em;
+ margin-left: .5em;
+}
+
+#g-add-photos-status li {
+ text-align: left;
+ padding-left: 2em;
+}
+
+#g-add-photos-status li.g-success {
+ background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%;
+}
+
+#g-add-photos-status li.g-error {
+ background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%;
+/* color: #f00;*/
+}
+
+#g-add-photos-button {
+ background: #DFEFFC;
+ border: 1px solid #C5DBEC;
+ color: #2E6E9E
+}
+
+#g-add-photos p {
+ margin: 0
+}
+
+#g-add-photos .g-breadcrumbs li {
+ padding-top: .5em;
+}
+
+/** *******************************************************************
+ * 7) Right to left language styles
+ **********************************************************************/
+
+.rtl {
+ direction: rtl;
+}
+
+.rtl #g-header,
+.rtl #g-content,
+.rtl #g-sidebar,
+.rtl #g-footer,
+.rtl caption,
+.rtl th,
+.rtl #g-dialog,
+.rtl .g-context-menu li a,
+.rtl .g-message-box li,
+.rtl #g-site-status li {
+ text-align: right;
+}
+
+.rtl .g-text-right {
+ text-align: left;
+}
+
+.rtl .g-error,
+.rtl .g-info,
+.rtl .g-success,
+.rtl .g-warning {
+ background-position: center right;
+ padding-right: 30px !important;
+}
+
+.rtl .g-left,
+.rtl .g-inline li,
+.rtl form ul ul li,
+.rtl input[type="submit"],
+.rtl input[type="reset"],
+.rtl #g-content #g-album-grid .g-item,
+.rtl .sf-menu li,
+.rtl .g-breadcrumbs li,
+.rtl .g-pager li,
+.rtl .g-buttonset li,
+.rtl .ui-icon-left .ui-icon,
+.rtl input.checkbox {
+ float: right;
+}
+
+.rtl .g-right,
+.rtl .ui-icon-right .ui-icon {
+ float: left;
+}
+
+.rtl .g-inline li {
+ margin-right: 1em;
+}
+
+.rtl .g-inline li.g-first {
+ margin-right: 0;
+}
+
+.rtl .g-breadcrumbs li {
+ background-position: right center;
+ padding: 1em 18px 1em 8px;
+}
+
+.rtl .g-breadcrumbs .g-first {
+ padding-right: 0;
+}
+
+.rtl .g-pager .g-info {
+ width: 35%;
+}
+
+.rtl .g-pager .g-text-right {
+ margin-left: 0;
}
-.g-list-horizontal {
+.rtl input.checkbox {
+ margin-right: .4em;
}
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index c6a619c1..9aaac1ce 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -1,9 +1,21 @@
(function ($) {
- $.fn.gallery_show_message = function(message) {
+
+ // Fade in action status message background color
+ $.fn.gallery_show_message = function() {
return this.each(function(i){
- $(this).effect("highlight", {"color": "white"}, 3000);
- $(this).animate({opacity: 1.0}, 6000);
+ $(this).hide().fadeIn(3000)
+ });
+ };
+
+ // Make the height of all items the same as the tallest item within the set
+ $.fn.equal_heights = function() {
+ var tallest_height = 0;
+ $(this).each(function(){
+ if ($(this).height() > tallest_height) {
+ tallest_height = $(this).height();
+ }
});
+ return $(this).height(tallest_height);
};
// Vertically align a block element's content
@@ -12,8 +24,8 @@
if (container == null) {
container = 'div';
}
- $(this).html("<" + container + " class=\"gValign\">" + $(this).html() + "</" + container + ">");
- var el = $(this).children(container + ".gValign");
+ $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + "</" + container + ">");
+ var el = $(this).children(container + ".g-valign");
var elh = $(el).height();
var ph = $(this).height();
var nh = (ph - elh) / 2;
@@ -35,21 +47,21 @@
/**
* Toggle the processing indicator, both large and small
- * @param elementID Target ID, including #, to apply .gLoadingSize
+ * @param elementID Target ID, including #, to apply .g-loading-size
*/
$.fn.gallery_show_loading = function() {
return this.each(function(i){
var size;
switch ($(this).attr("id")) {
- case "#gDialog":
- case "#gPanel":
- size = "Large";
+ case "#g-dialog":
+ case "#g-panel":
+ size = "large";
break;
default:
- size = "Small";
+ size = "small";
break;
}
- $(this).toggleClass("gLoading" + size);
+ $(this).toggleClass("g-loading" + size);
});
};
@@ -77,7 +89,7 @@
*/
$.fn.gallery_get_photo = function() {
var photo = $(this).find("img").filter(function() {
- return this.id.match(/gPhotoId-\d+/);
+ return this.id.match(/g-photo-id-\d+/);
});
return photo;
};
@@ -111,24 +123,29 @@
$(thumb).attr({src: data.src, width: data.width, height: data.height});
};
+ // Initialize context menus
$.fn.gallery_context_menu = function() {
- var in_progress = 0;
- $(".gContextMenu *").removeAttr('title');
- $(".gContextMenu ul").hide();
- $(".gContextMenu").hover(
- function() {
- if (in_progress == 0) {
- $(this).find("ul").slideDown("fast", function() { in_progress = 1; });
- $(this).find(".gDialogLink").gallery_dialog();
- $(this).find(".gAjaxLink").gallery_ajax();
+ if ($(".g-context-menu li").length) {
+ var hover_target = ".g-context-menu";
+ var in_progress = 0;
+ $(hover_target + " *").removeAttr('title');
+ $(hover_target + " ul").hide();
+ $(hover_target).hover(
+ function() {
+ if (in_progress == 0) {
+ $(this).find("ul").slideDown("fast", function() { in_progress = 1; });
+ $(this).find(".g-dialog-link").gallery_dialog();
+ $(this).find(".g-ajax-link").gallery_ajax();
+ }
+ },
+ function() {
+ $(this).find("ul").slideUp("slow", function() { in_progress = 0; });
}
- },
- function() {
- $(this).find("ul").slideUp("slow", function() { in_progress = 0; });
- }
- );
+ );
+ }
};
+ // Size a container to fit within the browser window
$.gallery_auto_fit_window = function(imageWidth, imageHeight) {
var size = $.gallery_get_viewport_size();
var width = size.width() - 6,
@@ -154,4 +171,40 @@
};
};
+ // Initialize a short form. Short forms may contain only one text input.
+ $.fn.gallery_short_form = function() {
+ return this.each(function(i){
+ var label = $(this).find("label:first");
+ var input = $(this).find("input[type=text]:first");
+ var button = $(this).find("input[type=submit]");
+
+ $(".g-short-form").addClass("ui-helper-clearfix");
+ $(".g-short-form input[type=text]").addClass("ui-corner-left");
+ $(".g-short-form input[type=submit]").addClass("ui-state-default ui-corner-right");
+
+ // Set the input value equal to label text
+ if (input.val() == "") {
+ input.val(label.html());
+ button.enable(false);
+ }
+
+ // Attach event listeners to the input
+ input.bind("focus", function(e) {
+ // Empty input value if it equals it's label
+ if ($(this).val() == label.html()) {
+ $(this).val("");
+ }
+ button.enable(true);
+ });
+
+ input.bind("blur", function(e){
+ // Reset the input value if it's empty
+ if ($(this).val() == "") {
+ $(this).val(label.html());
+ button.enable(false);
+ }
+ });
+ });
+ };
+
})(jQuery);
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 39c451e3..3587108c 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -15,75 +15,75 @@
_show: function(sHref) {
var self = this;
- var eDialog = '<div id="gDialog"></div>';
+ var eDialog = '<div id="g-dialog"></div>';
$("body").append(eDialog);
if (!self.options.close) {
self.options.close = self.close_dialog;
}
- $("#gDialog").dialog(self.options);
+ $("#g-dialog").dialog(self.options);
- $("#gDialog").gallery_show_loading();
+ $("#g-dialog").gallery_show_loading();
$.get(sHref, function(data) {
- $("#gDialog").html(data).gallery_show_loading();
+ $("#g-dialog").html(data).gallery_show_loading();
- if ($("#gDialog form").length) {
- self.form_loaded(null, $("#gDialog form"));
+ if ($("#g-dialog form").length) {
+ self.form_loaded(null, $("#g-dialog form"));
}
self._layout();
- $("#gDialog").dialog("open");
+ $("#g-dialog").dialog("open");
// Remove titlebar for progress dialogs or set title
- if ($("#gDialog #gProgress").length) {
+ if ($("#g-dialog #g-progress").length) {
$(".ui-dialog-titlebar").remove();
- } else if ($("#gDialog h1").length) {
- $("#gDialog").dialog('option', 'title', $("#gDialog h1:eq(0)").html());
- } else if ($("#gDialog fieldset legend").length) {
- $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html());
+ } else if ($("#g-dialog h1").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html());
+ } else if ($("#g-dialog fieldset legend").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html());
}
- if ($("#gDialog form").length) {
+ if ($("#g-dialog form").length) {
self._ajaxify_dialog();
}
});
- $("#gDialog").dialog("option", "self", self);
+ $("#g-dialog").dialog("option", "self", self);
},
_layout: function() {
var dialogWidth;
- var dialogHeight = $("#gDialog").height();
- var cssWidth = new String($("#gDialog form").css("width"));
+ var dialogHeight = $("#g-dialog").height();
+ var cssWidth = new String($("#g-dialog form").css("width"));
var childWidth = cssWidth.replace(/[^0-9]/g,"");
var size = $.gallery_get_viewport_size();
- if ($("#gDialog iframe").length) {
+ if ($("#g-dialog iframe").length) {
dialogWidth = size.width() - 100;
// Set the iframe width and height
- $("#gDialog iframe").width("100%").height(size.height() - 100);
- } else if ($("#gDialog .gDialogPanel").length) {
+ $("#g-dialog iframe").width("100%").height(size.height() - 100);
+ } else if ($("#g-dialog .g-dialog-panel").length) {
dialogWidth = size.width() - 100;
- $("#gDialog").dialog("option", "height", size.height() - 100);
+ $("#g-dialog").dialog("option", "height", size.height() - 100);
} else if (childWidth == "" || childWidth > 300) {
dialogWidth = 500;
}
- $("#gDialog").dialog('option', 'width', dialogWidth);
+ $("#g-dialog").dialog('option', 'width', dialogWidth);
},
form_loaded: function(event, ui) {
// Should be defined (and localized) in the theme
MSG_CANCEL = MSG_CANCEL || 'Cancel';
- var eCancel = '<a href="#" class="gCancel">' + MSG_CANCEL + '</a>';
- if ($("#gDialog .submit").length) {
- $("#gDialog .submit").addClass("ui-state-default ui-corner-all");
+ var eCancel = '<a href="#" class="g-cancel g-left">' + MSG_CANCEL + '</a>';
+ if ($("#g-dialog .submit").length) {
+ $("#g-dialog .submit").addClass("ui-state-default ui-corner-all");
$.fn.gallery_hover_init();
- $("#gDialog .submit").parent().append(eCancel);
- $("#gDialog .gCancel").click(function(event) {
- $("#gDialog").dialog("close");
+ $("#g-dialog .submit").parent().append(eCancel);
+ $("#g-dialog .g-cancel").click(function(event) {
+ $("#g-dialog").dialog("close");
event.preventDefault();
});
}
- $("#gDialog .ui-state-default").hover(
+ $("#g-dialog .ui-state-default").hover(
function() {
$(this).addClass("ui-state-hover");
},
@@ -94,23 +94,31 @@
},
close_dialog: function(event, ui) {
- var self = $("#gDialog").dialog("option", "self");
- if ($("#gDialog form").length) {
- self._trigger("form_closing", null, $("#gDialog form"));
+ var self = $("#g-dialog").dialog("option", "self");
+ if ($("#g-dialog form").length) {
+ self._trigger("form_closing", null, $("#g-dialog form"));
}
- self._trigger("dialog_closing", null, $("#gDialog"));
- $("#gDialog").dialog("destroy").remove();
+ self._trigger("dialog_closing", null, $("#g-dialog"));
+ $("#g-dialog").dialog("destroy").remove();
},
_ajaxify_dialog: function() {
var self = this;
- $("#gDialog form").ajaxForm({
+ $("#g-dialog form").ajaxForm({
dataType: "json",
+ beforeSubmit: function(formData, form, options) {
+ form.find(":submit")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
success: function(data) {
if (data.form) {
- $("#gDialog form").replaceWith(data.form);
+ $("#g-dialog form").replaceWith(data.form);
+ $("#g-dialog form :submit").removeClass("ui-state-disabled")
+ .attr("disabled", null);
self._ajaxify_dialog();
- self.form_loaded(null, $("#gDialog form"));
+ self.form_loaded(null, $("#g-dialog form"));
if (typeof data.reset == 'function') {
eval(data.reset + '()');
}
diff --git a/lib/gallery.form.js b/lib/gallery.form.js
deleted file mode 100644
index 77ce3b7d..00000000
--- a/lib/gallery.form.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Initialize a short form. Short forms may contain only one text input.
- *
- * @param form_id string The form's CSS id
- */
-function short_form_init(form_id) {
- var form = $(form_id);
- var label = form.find("label:first");
- var input = form.find("input[type=text]:first");
- var button = form.find("input[type=submit]");
-
- // Set the input value equal to label text
- if (input.val() == "") {
- input.val(label.html());
- button.enable(false);
- }
-
- // Attach event listeners to the input
- input.bind("focus", function(e) {
- // Empty input value if it equals it's label
- if ($(this).val() == label.html()) {
- $(this).val("");
- }
- button.enable(true);
- });
-
- input.bind("blur", function(e){
- // Reset the input value if it's empty
- if ($(this).val() == "") {
- $(this).val(label.html());
- button.enable(false);
- }
- });
-}
diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js
new file mode 100644
index 00000000..681688e5
--- /dev/null
+++ b/lib/gallery.in_place_edit.js
@@ -0,0 +1,78 @@
+(function($) {
+ $.widget("ui.gallery_in_place_edit", {
+ _init: function() {
+ var self = this;
+ this.element.click(function(event) {
+ event.preventDefault();
+ self._show(event.currentTarget);
+ return false;
+ });
+ },
+
+ _show: function(target) {
+ var self = this;
+ var tag_width = $(target).width();
+ $(self).data("tag_width", tag_width);
+
+ var form = $("#g-in-place-edit-form");
+ if (form.length > 0) {
+ self._cancel();
+ }
+
+ $.get(self.options.form_url.replace("__ID__", $(target).attr('rel')), function(data) {
+ var parent = $(target).parent();
+ parent.children().hide();
+ parent.append(data);
+ parent.find("form :text")
+ .width(tag_width)
+ .focus();
+ $(".g-short-form").gallery_short_form();
+ parent.find("form .g-cancel").click(function(event) {
+ self._cancel();
+ event.preventDefault();
+ return false;
+ });
+ self._ajaxify_edit();
+ });
+
+ },
+
+ _cancel: function() {
+ var parent = $("#g-in-place-edit-form").parent();
+ $(parent).find("form").remove();
+ $(parent).children().show();
+ $("#g-in-place-edit-message").remove();
+ },
+
+ _ajaxify_edit: function() {
+ var self = this;
+ var form = $("#g-in-place-edit-form");
+ $(form).ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.result == "success") {
+ window.location.reload();
+ } else {
+ var parent = $(form).parent();
+ $(form).replaceWith(data.form);
+ var width = $(self).data("tag_width");
+ $(parent).find("form :text")
+ .width(width)
+ .focus();
+ $(".g-short-form").gallery_short_form();
+ $(parent).find("form .g-cancel").click(function(event) {
+ self._cancel();
+ event.preventDefault();
+ return false;
+ });
+ self._ajaxify_edit();
+ }
+ }
+ });
+ }
+ });
+
+ $.extend($.ui.gallery_in_place_edit, {
+ defaults: {}
+ });
+})(jQuery);
diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js
index 6115297d..8d627369 100644
--- a/lib/gallery.panel.js
+++ b/lib/gallery.panel.js
@@ -8,7 +8,7 @@
var parent = $(element).parent().parent();
var sHref = $(element).attr("href");
var parentClass = $(parent).attr("class");
- var ePanel = "<tr id=\"gPanel\"><td colspan=\"6\"></td></tr>";
+ var ePanel = "<tr id=\"g-panel\"><td colspan=\"6\"></td></tr>";
// We keep track of the open vs. closed state by looking to see if there'
// an orig_text attr. If that attr is missing, then the panel is closed
@@ -16,12 +16,12 @@
var should_open = !$(element).attr("orig_text");
// Close any open panels and reset their button text
- if ($("#gPanel").length) {
- $("#gPanel").slideUp("slow").remove();
- $.each($(".gPanelLink"),
+ if ($("#g-panel").length) {
+ $("#g-panel").slideUp("slow").remove();
+ $.each($(".g-panel-link"),
function() {
if ($(this).attr("orig_text")) {
- $(this).children(".gButtonText").text($(this).attr("orig_text"));
+ $(this).children(".g-button-text").text($(this).attr("orig_text"));
$(this).attr("orig_text", "");
}
}
@@ -30,15 +30,15 @@
if (should_open) {
$(parent).after(ePanel);
- $("#gPanel td").html(sHref);
+ $("#g-panel td").html(sHref);
$.get(sHref, function(data) {
- $("#gPanel td").html(data);
+ $("#g-panel td").html(data);
self._ajaxify_panel();
if ($(element).attr("open_text")) {
- $(element).attr("orig_text", $(element).children(".gButtonText").text());
- $(element).children(".gButtonText").text($(element).attr("open_text"));
+ $(element).attr("orig_text", $(element).children(".g-button-text").text());
+ $(element).children(".g-button-text").text($(element).attr("open_text"));
}
- $("#gPanel").addClass(parentClass).show().slideDown("slow");
+ $("#g-panel").addClass(parentClass).show().slideDown("slow");
});
}
@@ -48,11 +48,17 @@
_ajaxify_panel: function () {
var self = this;
- $("#gPanel td form").ajaxForm({
+ $("#g-panel td form").ajaxForm({
dataType: "json",
+ beforeSubmit: function(formData, form, options) {
+ form.find(":submit")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
success: function(data) {
if (data.form) {
- $("#gPanel td form").replaceWith(data.form);
+ $("#g-panel td form").replaceWith(data.form);
self._ajaxify_panel();
}
if (data.result == "success") {
diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js
index 7e826c32..49dc620a 100644
--- a/lib/gallery.show_full_size.js
+++ b/lib/gallery.show_full_size.js
@@ -7,7 +7,7 @@
var height = $(document).height();
var size = $.gallery_get_viewport_size();
- $("body").append('<div id="gFullsizeOverlay" class="ui-dialog-overlay" ' +
+ $("body").append('<div id="g-fullsize-overlay" class="ui-dialog-overlay" ' +
'style="border: none; margin: 0; padding: 0; background-color: #000; ' +
'position: absolute; top: 0px; left: 0px; ' +
'width: ' + width + 'px; height: ' + height + 'px;' +
@@ -15,34 +15,43 @@
'-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' +
'-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>');
- var image_size = $.gallery_auto_fit_window(image_width, image_height);
+ var image_size;
+ if (image_width >= size.width() - 6 || image_height >= size.height() - 6) {
+ image_size = $.gallery_auto_fit_window(image_width, image_height);
+ } else {
+ image_size = {
+ top: Number((height - image_height) / 2), left: Number((width - image_width) / 2),
+ width: Number(image_width), height: Number(image_height)
+ };
+ }
+
- $("body").append('<div id="gFullsize" class="ui-dialog ui-widget" ' +
+ $("body").append('<div id="g-fullsize" class="ui-dialog ui-widget" ' +
'style="overflow: hidden; display: block; ' +
'position: absolute; z-index: 1002; outline-color: -moz-use-text-color; ' +
'outline-style: none; outline-width: 0px; ' +
'height: ' + image_size.height + 'px; ' +
'width: ' + image_size.width + 'px; ' +
'top: ' + image_size.top + 'px; left: ' + image_size.left + 'px;">' +
- '<img id="gFullSizeImage" src="' + image_url + '"' +
+ '<img id="g-fullsize-image" src="' + image_url + '"' +
'height="' + image_size.height + '" width="' + image_size.width + '"/></div>');
$().click(function() {
- $("#gFullsizeOverlay*").remove();
- $("#gFullsize").remove();
+ $("#g-fullsize-overlay*").remove();
+ $("#g-fullsize").remove();
});
$().bind("keypress", function() {
- $("#gFullsizeOverlay*").remove();
- $("#gFullsize").remove();
+ $("#g-fullsize-overlay*").remove();
+ $("#g-fullsize").remove();
});
$(window).resize(function() {
- $("#gFullsizeOverlay").width($(document).width()).height($(document).height());
+ $("#g-fullsize-overlay").width($(document).width()).height($(document).height());
image_size = $.gallery_auto_fit_window(image_width, image_height);
- $("#gFullsize").height(image_size.height)
+ $("#g-fullsize").height(image_size.height)
.width(image_size.width)
.css("top", image_size.top)
.css("left", image_size.left);
- $("#gFullSizeImage").height(image_size.height).width(image_size.width);
+ $("#g-fullsize-image").height(image_size.height).width(image_size.width);
});
};
})(jQuery);
diff --git a/themes/default/images/ico-denied-gray.png b/lib/images/ico-denied-inactive.png
index 56db3ff5..56db3ff5 100644
--- a/themes/default/images/ico-denied-gray.png
+++ b/lib/images/ico-denied-inactive.png
Binary files differ
diff --git a/themes/default/images/ico-denied-pale.png b/lib/images/ico-denied-passive.png
index 1e992230..1e992230 100644
--- a/themes/default/images/ico-denied-pale.png
+++ b/lib/images/ico-denied-passive.png
Binary files differ
diff --git a/themes/default/images/ico-denied.png b/lib/images/ico-denied.png
index 08f24936..08f24936 100644
--- a/themes/default/images/ico-denied.png
+++ b/lib/images/ico-denied.png
Binary files differ
diff --git a/themes/admin_default/images/ico-error.png b/lib/images/ico-error.png
index c37bd062..c37bd062 100644
--- a/themes/admin_default/images/ico-error.png
+++ b/lib/images/ico-error.png
Binary files differ
diff --git a/themes/admin_default/images/ico-info.png b/lib/images/ico-info.png
index 12cd1aef..12cd1aef 100644
--- a/themes/admin_default/images/ico-info.png
+++ b/lib/images/ico-info.png
Binary files differ
diff --git a/themes/default/images/ico-lock.png b/lib/images/ico-lock.png
index 2ebc4f6f..2ebc4f6f 100644
--- a/themes/default/images/ico-lock.png
+++ b/lib/images/ico-lock.png
Binary files differ
diff --git a/themes/admin_default/images/ico-separator.gif b/lib/images/ico-separator.gif
index 3de2d0d3..3de2d0d3 100644
--- a/themes/admin_default/images/ico-separator.gif
+++ b/lib/images/ico-separator.gif
Binary files differ
diff --git a/themes/default/images/ico-success-gray.png b/lib/images/ico-success-inactive.png
index 74b2032f..74b2032f 100644
--- a/themes/default/images/ico-success-gray.png
+++ b/lib/images/ico-success-inactive.png
Binary files differ
diff --git a/themes/default/images/ico-success-pale.png b/lib/images/ico-success-passive.png
index dc8d1ded..dc8d1ded 100644
--- a/themes/default/images/ico-success-pale.png
+++ b/lib/images/ico-success-passive.png
Binary files differ
diff --git a/themes/admin_default/images/ico-success.png b/lib/images/ico-success.png
index a9925a06..a9925a06 100644
--- a/themes/admin_default/images/ico-success.png
+++ b/lib/images/ico-success.png
Binary files differ
diff --git a/themes/admin_default/images/ico-warning.png b/lib/images/ico-warning.png
index 628cf2da..628cf2da 100644
--- a/themes/admin_default/images/ico-warning.png
+++ b/lib/images/ico-warning.png
Binary files differ
diff --git a/lib/jquery.autocomplete.js b/lib/jquery.autocomplete.js
index 271014a2..02f2b54d 100644
--- a/lib/jquery.autocomplete.js
+++ b/lib/jquery.autocomplete.js
@@ -10,4 +10,4 @@
* Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
*
*/
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i<a.7;i++){4(a[i].M.O()==q.O()){b=a[i];N}}}4(Y c=="3")c(b);A u.15("M",b&&[b.w,b.H])}$.K(1g(u.J()),3(i,a){1R(a,23,23)})}).X("20",3(){n.18()}).X("1Y",3(){$.1o(r,1n[1]);4("w"2G 1n[1])n.1f()}).X("1X",3(){l.1u();u.1u();$(o.2K).1u(".12")});3 1U(){5 b=l.26();4(!b)6 B;5 v=b.M;m=v;4(r.19){5 a=1g(u.J());4(a.7>1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i<b.7;i++){5 a=$.1p(b[i]);4(a){a=a.1Z("|");d[d.7]={w:a,H:a[0],M:r.1v&&r.1v(a,a[0])||a[0]}}}6 d};3 1B(){u.1e(r.21)}};$.D.1L={24:"3R",2H:"3P",21:"3O",22:1,1D:3M,1C:B,1a:C,1V:B,1j:10,Z:3K,2U:B,2R:{},1S:C,1K:3(a){6 a[0]},1q:14,1A:B,E:0,19:B,R:", ",1t:3(b,a){6 b.2C(1E 3J("(?![^&;]+;)(?!<[^<>]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1</2z>")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++<g.Z){f[""].1O(b)}};$.K(f,3(i,a){g.1j++;1h(i,a)})}1H(1f,25);3 18(){h={};j=0}6{18:18,1h:1h,1f:1f,2S:3(q){4(!g.1j||!j)6 14;4(!g.11&&g.1V){5 a=[];16(5 k 2G h){4(k.7>0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c<z.1c()){z.1c(c)}}};3 2h(a){y+=a;4(y<0){y=j.1b()-1}A 4(y>=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z<a?e.Z:a}3 2f(){z.2B();5 b=2g(w.7);16(5 i=0;i<b;i++){4(!w[i])1P;5 a=e.1K(w[i].w,i+1,b,w[i].H,1m);4(a===B)1P;5 c=$("<1F/>").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{})) \ No newline at end of file
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i<a.7;i++){4(a[i].M.O()==q.O()){b=a[i];N}}}4(Y c=="3")c(b);A u.15("M",b&&[b.w,b.H])}$.K(1g(u.J()),3(i,a){1R(a,23,23)})}).X("20",3(){n.18()}).X("1Y",3(){$.1o(r,1n[1]);4("w"2G 1n[1])n.1f()}).X("1X",3(){l.1u();u.1u();$(o.2K).1u(".12")});3 1U(){5 b=l.26();4(!b)6 B;5 v=b.M;m=v;4(r.19){5 a=1g(u.J());4(a.7>1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i<b.7;i++){5 a=$.1p(b[i]);4(a){a=a.1Z("|");d[d.7]={w:a,H:a[0],M:r.1v&&r.1v(a,a[0])||a[0]}}}6 d};3 1B(){u.1e(r.21)}};$.D.1L={24:"3R",2H:"3P",21:"3O",22:1,1D:3M,1C:B,1a:C,1V:B,1j:10,Z:3K,2U:B,2R:{},1S:C,1K:3(a){6 a[0]},1q:14,1A:B,E:0,19:B,R:", ",1t:3(b,a){6 b.2C(1E 3J("(?![^&;]+;)(?!<[^<>]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1</2z>")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++<g.Z){f[""].1O(b)}};$.K(f,3(i,a){g.1j++;1h(i,a)})}1H(1f,25);3 18(){h={};j=0}6{18:18,1h:1h,1f:1f,2S:3(q){4(!g.1j||!j)6 14;4(!g.11&&g.1V){5 a=[];16(5 k 2G h){4(k.7>0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c<z.1c()){z.1c(c)}}};3 2h(a){y+=a;4(y<0){y=j.1b()-1}A 4(y>=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z<a?e.Z:a}3 2f(){z.2B();5 b=2g(w.7);16(5 i=0;i<b;i++){4(!w[i])1P;5 a=e.1K(w[i].w,i+1,b,w[i].H,1m);4(a===B)1P;5 c=$("<1F/>").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{}));
diff --git a/lib/swfobject.js b/lib/swfobject.js
new file mode 100644
index 00000000..87e61553
--- /dev/null
+++ b/lib/swfobject.js
@@ -0,0 +1,4 @@
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+encodeURI(O.location).toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); \ No newline at end of file
diff --git a/lib/uploadify/cancel.png b/lib/uploadify/cancel.png
new file mode 100644
index 00000000..1c062ae5
--- /dev/null
+++ b/lib/uploadify/cancel.png
Binary files differ
diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js
new file mode 100644
index 00000000..43053119
--- /dev/null
+++ b/lib/uploadify/jquery.uploadify.min.js
@@ -0,0 +1,26 @@
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full. The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)}; \ No newline at end of file
diff --git a/lib/uploadify/uploadify.allglyphs.swf b/lib/uploadify/uploadify.allglyphs.swf
new file mode 100644
index 00000000..4bad0117
--- /dev/null
+++ b/lib/uploadify/uploadify.allglyphs.swf
Binary files differ
diff --git a/lib/uploadify/uploadify.css b/lib/uploadify/uploadify.css
new file mode 100644
index 00000000..a0279443
--- /dev/null
+++ b/lib/uploadify/uploadify.css
@@ -0,0 +1,53 @@
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+.uploadifyQueueItem {
+ font: 11px Verdana, Geneva, sans-serif;
+ border: 2px solid #E5E5E5;
+ background-color: #F5F5F5;
+ margin-top: 5px;
+ padding: 10px;
+ width: auto;
+}
+.uploadifyError {
+ border: 2px solid #FBCBBC !important;
+ background-color: #FDE5DD !important;
+}
+.uploadifyQueueItem .cancel {
+ float: right;
+}
+.uploadifyProgress {
+ background-color: #FFFFFF;
+ border-top: 1px solid #808080;
+ border-left: 1px solid #808080;
+ border-right: 1px solid #C5C5C5;
+ border-bottom: 1px solid #C5C5C5;
+ margin-top: 10px;
+ width: 100%;
+}
+.uploadifyProgressBar {
+ background-color: #0099FF;
+ width: 1px;
+ height: 3px;
+}
diff --git a/lib/uploadify/uploadify.fla b/lib/uploadify/uploadify.fla
new file mode 100644
index 00000000..c07bbaf3
--- /dev/null
+++ b/lib/uploadify/uploadify.fla
Binary files differ
diff --git a/lib/uploadify/uploadify.swf b/lib/uploadify/uploadify.swf
new file mode 100644
index 00000000..0385d9e6
--- /dev/null
+++ b/lib/uploadify/uploadify.swf
Binary files differ
diff --git a/modules/akismet/helpers/akismet.php b/modules/akismet/helpers/akismet.php
index acd5cb3e..43549ffa 100644
--- a/modules/akismet/helpers/akismet.php
+++ b/modules/akismet/helpers/akismet.php
@@ -21,7 +21,7 @@ class akismet_Core {
public static $test_mode = TEST_MODE;
static function get_configure_form() {
- $form = new Forge("admin/akismet", "", "post", array("id" => "gConfigureAkismetForm"));
+ $form = new Forge("admin/akismet", "", "post", array("id" => "g-configure-akismet-form"));
$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."));
diff --git a/modules/akismet/tests/Akismet_Helper_Test.php b/modules/akismet/tests/Akismet_Helper_Test.php
index d001d3ad..745b455c 100644
--- a/modules/akismet/tests/Akismet_Helper_Test.php
+++ b/modules/akismet/tests/Akismet_Helper_Test.php
@@ -26,7 +26,7 @@ class Akismet_Helper_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$this->_comment = comment::create(
- $root, user::guest(), "This is a comment",
+ $root, identity::guest(), "This is a comment",
"John Doe", "john@gallery2.org", "http://gallery2.org");
foreach ($this->_comment->list_fields("comments") as $name => $field) {
if (strpos($name, "server_") === 0) {
diff --git a/modules/akismet/views/admin_akismet.html.php b/modules/akismet/views/admin_akismet.html.php
index 009d8810..399053d8 100644
--- a/modules/akismet/views/admin_akismet.html.php
+++ b/modules/akismet/views/admin_akismet.html.php
@@ -1,17 +1,18 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminAkismet">
- <h1> <?= t("Akismet Spam Filtering") ?> </h1>
+<div id="g-admin-akismet" class="g-block">
+ <h1> <?= t("Akismet spam filtering") ?> </h1>
<p>
<?= t("Akismet is a free, automated spam filtering service. In order to use it, you need to sign up for a <a href=\"%api_key_url\">Wordpress.com API Key</a>, which is also free. Your comments will be automatically relayed to <a href=\"%akismet_url\">Akismet.com</a> where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.",
array("api_key_url" => "http://wordpress.com/api-keys",
"akismet_url" => "http://akismet.com")) ?>
</p>
+ <div class="g-block-content">
+ <? if ($valid_key): ?>
+ <div class="g-module-status g-success">
+ <?= t("Your API key is valid. Your comments will be filtered!") ?>
+ </div>
+ <? endif ?>
- <? if ($valid_key): ?>
- <div class="gModuleStatus gSuccess">
- <?= t("Your API Key is valid. Your comments will be filtered!") ?>
+ <?= $form ?>
</div>
- <? endif ?>
-
- <?= $form ?>
</div>
diff --git a/modules/akismet/views/admin_akismet_stats.html.php b/modules/akismet/views/admin_akismet_stats.html.php
index 41bad15b..32908ba0 100644
--- a/modules/akismet/views/admin_akismet_stats.html.php
+++ b/modules/akismet/views/admin_akismet_stats.html.php
@@ -1,11 +1,11 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javscript">
$(document).ready(function() {
- $("#gAkismetExternalStats").css("height", "600");
+ $("#g-akismet-external-stats").css("height", "600");
});
</script>
-<div id="gAkismetStats">
- <iframe id="gAkismetExternalStats" width="100%" height="500" frameborder="0"
+<div id="g-akismet-stats">
+ <iframe id="g-akismet-external-stats" width="100%" height="500" frameborder="0"
src="http://<?= $api_key ?>.web.akismet.com/1.0/user-stats.php?blog=<?= urlencode($blog_url) ?>">
</iframe>
</div>
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php
index a164f79f..2c278d64 100644
--- a/modules/comment/controllers/admin_comments.php
+++ b/modules/comment/controllers/admin_comments.php
@@ -33,10 +33,10 @@ class Admin_Comments_Controller extends Admin_Controller {
public function menu_labels() {
$menu = $this->_menu($this->_counts());
- print json_encode(array($menu->get("unpublished")->label,
- $menu->get("published")->label,
- $menu->get("spam")->label,
- $menu->get("deleted")->label));
+ print json_encode(array($menu->get("unpublished")->label->for_js(),
+ $menu->get("published")->label->for_js(),
+ $menu->get("spam")->label->for_js(),
+ $menu->get("deleted")->label->for_js()));
}
public function queue($state) {
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 82b12893..09b9c607 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -65,7 +65,7 @@ class Comments_Controller extends REST_Controller {
$form = comment::get_add_form($item);
$valid = $form->validate();
if ($valid) {
- if (user::active()->guest && !$form->add_comment->inputs["name"]->value) {
+ if (identity::active_user()->guest && !$form->add_comment->inputs["name"]->value) {
$form->add_comment->inputs["name"]->add_error("missing", 1);
$valid = false;
}
@@ -78,13 +78,13 @@ class Comments_Controller extends REST_Controller {
if ($valid) {
$comment = comment::create(
- $item, user::active(),
+ $item, identity::active_user(),
$form->add_comment->text->value,
$form->add_comment->inputs["name"]->value,
$form->add_comment->email->value,
$form->add_comment->url->value);
- $active = user::active();
+ $active = identity::active_user();
if ($active->guest) {
$form->add_comment->inputs["name"]->value("");
$form->add_comment->email->value("");
@@ -192,7 +192,7 @@ class Comments_Controller extends REST_Controller {
* @see REST_Controller::form_edit($resource)
*/
public function _form_edit($comment) {
- if (!user::active()->admin) {
+ if (!identity::active_user()->admin) {
access::forbidden();
}
print comment::get_edit_form($comment);
diff --git a/modules/comment/css/comment.css b/modules/comment/css/comment.css
new file mode 100644
index 00000000..f58391b0
--- /dev/null
+++ b/modules/comment/css/comment.css
@@ -0,0 +1,45 @@
+#g-content #g-comment-form {
+ margin-top: 2em;
+}
+
+#g-content #g-comments {
+ margin-top: 2em;
+ position: relative;
+}
+
+#g-content #g-comments ul li {
+ margin: 1em 0;
+}
+
+#g-content #g-comments .g-author {
+ border-bottom: 1px solid #ccc;
+ color: #999;
+ height: 32px;
+ line-height: 32px;
+}
+
+#g-content #g-comments ul li div {
+ padding: 0 8px 8px 43px;
+}
+
+#g-content #g-comments .g-avatar {
+ height: 32px;
+ margin-right: .4em;
+ width: 32px;
+}
+
+#g-admin-comment-button {
+ position: absolute;
+ right: 0;
+ top: 2px;
+}
+
+#g-admin-comments-menu {
+ margin: 1em 0;
+}
+
+#g-admin-comments-menu a {
+ margin: 0;
+ padding: .2em .6em;
+}
+
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index f74a8644..35685d8c 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -65,17 +65,17 @@ class comment_Core {
}
static function get_add_form($item) {
- $form = new Forge("comments", "", "post", array("id" => "gAddCommentForm"));
+ $form = new Forge("comments", "", "post", array("id" => "g-comment-form"));
$group = $form->group("add_comment")->label(t("Add comment"));
- $group->input("name") ->label(t("Name")) ->id("gAuthor");
- $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->input("name") ->label(t("Name")) ->id("g-author");
+ $group->input("email") ->label(t("Email (hidden)")) ->id("g-email");
+ $group->input("url") ->label(t("Website (hidden)"))->id("g-url");
+ $group->textarea("text")->label(t("Comment")) ->id("g-text");
$group->hidden("item_id")->value($item->id);
module::event("comment_add_form", $form);
- $group->submit("")->value(t("Add"));
+ $group->submit("")->value(t("Add"))->class("ui-state-default ui-corner-all");
- $active = user::active();
+ $active = identity::active_user();
if (!$active->guest) {
$group->inputs["name"]->value($active->full_name)->disabled("disabled");
$group->email->value($active->email)->disabled("disabled");
@@ -90,12 +90,12 @@ class comment_Core {
static function get_edit_form($comment) {
$form = new Forge("comments/{$comment->id}?_method=put", "", "post",
- array("id" => "gEditCommentForm"));
+ array("id" => "g-edit-comment-form"));
$group = $form->group("edit_comment")->label(t("Edit comment"));
- $group->input("name") ->label(t("Author")) ->id("gAuthor");
- $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->input("name") ->label(t("Author")) ->id("g-author");
+ $group->input("email") ->label(t("Email (hidden)")) ->id("g-email");
+ $group->input("url") ->label(t("Website (hidden)"))->id("g-url");
+ $group->textarea("text")->label(t("Comment")) ->id("g-text");
$group->submit("")->value(t("Edit"));
$group->text = $comment->text;
diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php
index 08182905..7cd5d429 100644
--- a/modules/comment/helpers/comment_block.php
+++ b/modules/comment/helpers/comment_block.php
@@ -18,16 +18,16 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class comment_block_Core {
- static function get_list() {
- return array("recent_comments" => t("Recent Comments"));
+ static function get_admin_list() {
+ return array("recent_comments" => t("Recent comments"));
}
static function get($block_id) {
$block = new Block();
switch ($block_id) {
case "recent_comments":
- $block->css_id = "gRecentComments";
- $block->title = t("Recent Comments");
+ $block->css_id = "g-recent-comments";
+ $block->title = t("Recent comments");
$block->content = new View("admin_block_recent_comments.html");
$block->content->comments =
ORM::factory("comment")->orderby("created", "DESC")->limit(5)->find_all();
diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php
index 0234aea9..a72102b9 100644
--- a/modules/comment/helpers/comment_event.php
+++ b/modules/comment/helpers/comment_event.php
@@ -22,6 +22,28 @@ class comment_event_Core {
Database::instance()->delete("comments", array("item_id" => $item->id));
}
+ static function user_deleted($user) {
+ $guest = identity::guest();
+ Database::instance()->from("comments")
+ ->set(array("author_id" => $guest->id,
+ "guest_email" => null,
+ "guest_name" => "guest",
+ "guest_url" => null))
+ ->where(array("author_id" => $user->id))
+ ->update();
+ }
+
+ static function identity_provider_changed($old_provider, $new_provider) {
+ $guest = identity::guest();
+ Database::instance()->from("comments")
+ ->set(array("author_id" => $guest->id,
+ "guest_email" => null,
+ "guest_name" => "guest",
+ "guest_url" => null))
+ ->where("1 = 1")
+ ->update();
+ }
+
static function admin_menu($menu, $theme) {
$menu->get("content_menu")
->append(Menu::factory("link")
@@ -36,7 +58,7 @@ class comment_event_Core {
->id("comments")
->label(t("View comments on this item"))
->url("#comments")
- ->css_id("gCommentsLink"));
+ ->css_id("g-comments-link"));
}
static function item_index_data($item, $data) {
diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php
index 80594c16..707a98d1 100644
--- a/modules/comment/helpers/comment_installer.php
+++ b/modules/comment/helpers/comment_installer.php
@@ -46,7 +46,6 @@ class comment_installer {
PRIMARY KEY (`id`))
DEFAULT CHARSET=utf8;");
- block_manager::add("dashboard_center", "comment", "recent_comments");
module::set_var("comment", "spam_caught", 0);
module::set_version("comment", 2);
}
diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php
index 4424981d..3692a30d 100644
--- a/modules/comment/helpers/comment_rss.php
+++ b/modules/comment/helpers/comment_rss.php
@@ -61,7 +61,7 @@ class comment_rss_Core {
$feed->max_pages = ceil($comments->count_all() / $limit);
$feed->title = htmlspecialchars(t("Recent Comments"));
$feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id));
- $feed->description = t("Recent Comments");
+ $feed->description = t("Recent comments");
return $feed;
}
diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php
index e9b402f6..af0e1ca4 100644
--- a/modules/comment/helpers/comment_theme.php
+++ b/modules/comment/helpers/comment_theme.php
@@ -19,13 +19,19 @@
*/
class comment_theme_Core {
static function head($theme) {
+ $theme->css("comment.css");
$theme->script("comment.js");
return "";
}
+ static function admin_head($theme) {
+ $theme->css("comment.css");
+ return "";
+ }
+
static function photo_bottom($theme) {
$block = new Block;
- $block->css_id = "gComments";
+ $block->css_id = "g-comments";
$block->title = t("Comments");
$block->anchor = "comments";
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index bff83770..96370fb1 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -1,31 +1,43 @@
$("document").ready(function() {
- $("#gAddCommentButton").click(function(event) {
+ $("#g-admin-comment-button").click(function(event) {
event.preventDefault();
- if (!$("#gAddCommentForm").length) {
+ if (!$("#g-comment-form").length) {
$.get($(this).attr("href"),
{},
function(data) {
- $("#gCommentDetail").append(data);
+ $("#g-comment-detail").append(data);
ajaxify_comment_form();
});
}
});
+ $("#g-no-comments").click(function(event) {
+ event.preventDefault();
+ if (!$("#g-comment-form").length) {
+ $.get($(this).attr("href"),
+ {},
+ function(data) {
+ $("#g-comment-detail").append(data);
+ ajaxify_comment_form();
+ });
+ $("#g-no-comments-yet").remove();
+ }
+ });
});
function ajaxify_comment_form() {
- $("#gComments form").ajaxForm({
+ $("#g-comments form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
- $("#gComments form").replaceWith(data.form);
+ $("#g-comments form").replaceWith(data.form);
ajaxify_comment_form();
}
if (data.result == "success") {
$.get(data.resource, function(data, textStatus) {
- $("#gComments .gBlockContent ul:first").append("<li>"+data+"</li>");
- $("#gComments .gBlockContent ul:first li:last").effect("highlight", {color: "#cfc"}, 8000);
- $("#gAddCommentForm").hide(2000).remove();
- $("#gNoCommentsYet").hide(2000);
+ $("#g-comments .g-block-content ul:first").append("<li>"+data+"</li>");
+ $("#g-comments .g-block-content ul:first li:last").effect("highlight", {color: "#cfc"}, 8000);
+ $("#g-comment-form").hide(2000).remove();
+ $("#g-no-comments-yet").hide(2000);
});
}
}
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index de9b0cd6..bb9b8833 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -23,7 +23,7 @@ class Comment_Model extends ORM {
}
function author() {
- return user::lookup($this->author_id);
+ return identity::lookup_user($this->author_id);
}
function author_name() {
diff --git a/modules/comment/tests/Comment_Event_Test.php b/modules/comment/tests/Comment_Event_Test.php
index c51c65c9..f650cabf 100644
--- a/modules/comment/tests/Comment_Event_Test.php
+++ b/modules/comment/tests/Comment_Event_Test.php
@@ -22,7 +22,7 @@ class Comment_Event_Test extends Unit_Test_Case {
$rand = rand();
$album = album::create(ORM::factory("item", 1), "test_$rand", "test_$rand");
$comment = comment::create(
- $album, user::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand");
+ $album, identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand");
$album->delete();
diff --git a/modules/comment/tests/Comment_Helper_Test.php b/modules/comment/tests/Comment_Helper_Test.php
index f84fe0f9..82b7ebd2 100644
--- a/modules/comment/tests/Comment_Helper_Test.php
+++ b/modules/comment/tests/Comment_Helper_Test.php
@@ -24,6 +24,7 @@ class Comment_Helper_Test extends Unit_Test_Case {
public function setup() {
$this->_ip_address = Input::instance()->ip_address;
$this->_user_agent = Kohana::$user_agent;
+ $this->_save = $_SERVER;
$_SERVER["HTTP_ACCEPT"] = "HTTP_ACCEPT";
$_SERVER["HTTP_ACCEPT_CHARSET"] = "HTTP_ACCEPT_CHARSET";
@@ -42,13 +43,14 @@ class Comment_Helper_Test extends Unit_Test_Case {
public function teardown() {
Input::instance()->ip_address = $this->_ip_address;
Kohana::$user_agent = $this->_user_agent;
+ $_SERVER = $this->_save;
}
public function create_comment_for_guest_test() {
$rand = rand();
$root = ORM::factory("item", 1);
$comment = comment::create(
- $root, user::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand");
+ $root, identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand");
$this->assert_equal("name_$rand", $comment->author_name());
$this->assert_equal("email_$rand", $comment->author_email());
@@ -77,7 +79,7 @@ class Comment_Helper_Test extends Unit_Test_Case {
public function create_comment_for_user_test() {
$rand = rand();
$root = ORM::factory("item", 1);
- $admin = user::lookup(2);
+ $admin = identity::admin_user();
$comment = comment::create(
$root, $admin, "text_$rand", "name_$rand", "email_$rand", "url_$rand");
diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php
index f4c68b15..de19648d 100644
--- a/modules/comment/tests/Comment_Model_Test.php
+++ b/modules/comment/tests/Comment_Model_Test.php
@@ -22,17 +22,17 @@ class Comment_Model_Test extends Unit_Test_Case {
public function cant_view_comments_for_unviewable_items_test() {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), rand(), rand());
- $comment = comment::create($album, user::guest(), "text", "name", "email", "url");
- user::set_active(user::guest());
+ $comment = comment::create($album, identity::guest(), "text", "name", "email", "url");
+ identity::set_active_user(identity::guest());
// We can see the comment when permissions are granted on the album
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
$this->assert_equal(
1,
ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all());
// We can't see the comment when permissions are denied on the album
- access::deny(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $album);
$this->assert_equal(
0,
ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all());
diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php
index 2afa5bf8..d9776def 100644
--- a/modules/comment/views/admin_block_recent_comments.html.php
+++ b/modules/comment/views/admin_block_recent_comments.html.php
@@ -1,9 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
- <? foreach ($comments as $i => $comment): ?>
- <li class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
+ <? foreach ($comments as $comment): ?>
+ <li class="<?= text::alternate("g-even", "g-odd") ?>">
<img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
- class="gAvatar"
+ class="g-avatar"
alt="<?= html::clean_attribute($comment->author_name()) ?>"
width="32"
height="32" />
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php
index 455cd714..20236a7a 100644
--- a/modules/comment/views/admin_comments.html.php
+++ b/modules/comment/views/admin_comments.html.php
@@ -6,7 +6,7 @@
$.get(set_state_url.replace("__STATE__", state).replace("__ID__", id),
{},
function() {
- $("#gComment-" + id).slideUp();
+ $("#g-comment-" + id).slideUp();
update_menu();
});
}
@@ -18,7 +18,7 @@
$.get(delete_url.replace("__ID__", id),
{},
function() {
- $("#gComment-" + id).slideUp();
+ $("#g-comment-" + id).slideUp();
update_menu();
});
}
@@ -27,172 +27,175 @@
$.get(<?= html::js_string(url::site("admin/comments/menu_labels")) ?>, {},
function(data) {
for (var i = 0; i < data.length; i++) {
- $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]);
+ $("#g-admin-comments-menu li:eq(" + i + ") a").html(data[i]);
}
},
"json");
}
</script>
-<div id="gAdminComments">
- <h1> <?= t("Manage Comments") ?> </h1>
+<div id="g-admin-comments" class="g-block">
+ <h1> <?= t("Manage comments") ?> </h1>
- <!-- @todo: Highlight active menu option -->
- <div id="gAdminCommentsMenu">
- <?= $menu ?>
- </div>
+ <div class="g-block-content">
+ <!-- @todo: Highlight active menu option -->
+ <div id="g-admin-comments-menu" class="ui-helper-clearfix">
+ <?= $menu->render() ?>
+ </div>
- <!-- @todo: Remove after setting active option? -->
- <h2>
- <? if ($state == "published"): ?>
- <?= t("Approved Comments") ?>
- <? elseif ($state == "unpublished"): ?>
- <?= t("Comments Awaiting Moderation") ?>
- <? elseif ($state == "spam"): ?>
- <?= t("Spam Comments") ?>
- <? elseif ($state == "deleted"): ?>
- <?= t("Recently Deleted Comments") ?>
- <? endif ?>
- </h2>
+ <!-- @todo: Remove after setting active option? -->
+ <h2>
+ <? if ($state == "published"): ?>
+ <?= t("Approved comments") ?>
+ <? elseif ($state == "unpublished"): ?>
+ <?= t("Comments awaiting moderation") ?>
+ <? elseif ($state == "spam"): ?>
+ <?= t("Spam comments") ?>
+ <? elseif ($state == "deleted"): ?>
+ <?= t("Recently deleted comments") ?>
+ <? endif ?>
+ </h2>
- <? if ($state == "spam"): ?>
- <div>
- <? $spam_caught = module::get_var("comment", "spam_caught") ?>
- <? if ($spam_caught > 0): ?>
- <p>
- <?= t2("Gallery has caught %count spam for you since you installed spam filtering.",
- "Gallery has caught %count spam for you since you installed spam filtering.",
- $spam_caught) ?>
- </p>
- <? endif ?>
- <p>
- <? if ($counts->spam): ?>
- <?= t2("There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam.",
- "There are currently %count comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. All spam messages will be deleted after 7 days automatically.",
- $counts->spam) ?>
- </p>
- <p>
- <a href="<?= url::site("admin/comments/delete_all_spam?csrf=$csrf") ?>">
- <?= t("Delete all spam") ?>
- </a>
- <? else: ?>
- <?= t("Your spam queue is empty!") ?>
+ <? if ($state == "spam"): ?>
+ <div>
+ <? $spam_caught = module::get_var("comment", "spam_caught") ?>
+ <? if ($spam_caught > 0): ?>
+ <p>
+ <?= t2("Gallery has caught %count spam for you since you installed spam filtering.",
+ "Gallery has caught %count spam for you since you installed spam filtering.",
+ $spam_caught) ?>
+ </p>
<? endif ?>
- </p>
- </div>
- <? endif ?>
+ <p>
+ <? if ($counts->spam): ?>
+ <?= t2("There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam.",
+ "There are currently %count comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. All spam messages will be deleted after 7 days automatically.",
+ $counts->spam) ?>
+ </p>
+ <p>
+ <a href="<?= url::site("admin/comments/delete_all_spam?csrf=$csrf") ?>">
+ <?= t("Delete all spam") ?>
+ </a>
+ <? else: ?>
+ <?= t("Your spam queue is empty!") ?>
+ <? endif ?>
+ </p>
+ </div>
+ <? endif ?>
- <? if ($state == "deleted"): ?>
- <div>
- <p>
- <?= t("These are messages that have been recently deleted. They will be permanently erased automatically after 7 days.") ?>
- </p>
- </div>
- <? endif ?>
+ <? if ($state == "deleted"): ?>
+ <div>
+ <p>
+ <?= t("These are messages that have been recently deleted. They will be permanently erased automatically after 7 days.") ?>
+ </p>
+ </div>
+ <? endif ?>
- <table id="gAdminCommentsList">
- <tr>
- <th>
- <?= t("Author") ?>
- </th>
- <th>
- <?= t("Comment") ?>
- </th>
- <th>
- <?= t("Actions") ?>
- </th>
- </tr>
- <? foreach ($comments as $i => $comment): ?>
- <tr id="gComment-<?= $comment->id ?>" class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?>">
- <td>
- <a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
- class="gAvatar"
- alt="<?= html::clean_attribute($comment->author_name()) ?>"
- width="40"
- height="40" />
- </a>
- <p><a href="mailto:<?= html::clean_attribute($comment->author_email()) ?>"
- title="<?= html::clean_attribute($comment->author_email()) ?>"> <?= html::clean($comment->author_name()) ?> </a></p>
- </td>
- <td>
- <div class="right">
- <? $item = $comment->item() ?>
- <div class="gItem gPhoto">
- <a href="<?= $item->url() ?>">
- <? if ($item->has_thumb()): ?>
- <img src="<?= $item->thumb_url() ?>"
- alt="<?= html::purify($item->title)->for_html_attr() ?>"
- <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
- />
- <? else: ?>
- <?= t("No thumbnail") ?>
- <? endif ?>
- </a>
+ <table id="g-admin-comments-list">
+ <tr>
+ <th>
+ <?= t("Author") ?>
+ </th>
+ <th>
+ <?= t("Comment") ?>
+ </th>
+ <th>
+ <?= t("Actions") ?>
+ </th>
+ </tr>
+ <? foreach ($comments as $comment): ?>
+ <tr id="g-comment-<?= $comment->id ?>" class="<?= text::alternate("g-odd", "g-even") ?>">
+ <td>
+ <a href="#">
+ <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
+ class="g-avatar"
+ alt="<?= html::clean_attribute($comment->author_name()) ?>"
+ width="40"
+ height="40" />
+ </a>
+ <p><a href="mailto:<?= html::clean_attribute($comment->author_email()) ?>"
+ title="<?= html::clean_attribute($comment->author_email()) ?>"> <?= html::clean($comment->author_name()) ?> </a></p>
+ </td>
+ <td>
+ <div class="g-right">
+ <? $item = $comment->item() ?>
+ <div class="g-item g-photo">
+ <a href="<?= $item->url() ?>">
+ <? if ($item->has_thumb()): ?>
+ <img src="<?= $item->thumb_url() ?>"
+ alt="<?= html::purify($item->title)->for_html_attr() ?>"
+ <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
+ />
+ <? else: ?>
+ <?= t("No thumbnail") ?>
+ <? endif ?>
+ </a>
+ </div>
</div>
- </div>
- <p><?= gallery::date($comment->created) ?></p>
- <?= nl2br(html::purify($comment->text)) ?>
- </td>
- <td>
- <ul class="gButtonSetVertical">
- <? if ($comment->state != "unpublished"): ?>
- <li>
- <a href="javascript:set_state('unpublished',<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-check"></span>
- <?= t("Unapprove") ?>
- </a>
- </li>
- <? endif ?>
- <? if ($comment->state != "published"): ?>
- <li>
- <a href="javascript:set_state('published',<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-check"></span>
- <?= t("Approve") ?>
- </a>
- </li>
- <? endif ?>
- <? if ($comment->state != "spam"): ?>
- <li>
- <a href="javascript:set_state('spam',<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-cancel"></span>
- <?= t("Spam") ?>
- </a>
- </li>
- <? endif ?>
- <!--
- <li>
- <a href="javascript:reply(<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>
- <?= t("Reply") ?>
- </a>
- </li>
- <li>
- <a href="javascript:Edit(<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-pencil"></span>
- <?= t("Edit") ?>
- </a>
- </li>
- -->
- <li>
- <a href="javascript:set_state('deleted',<?=$comment->id?>)"
- class="gButtonLink ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-trash"></span>
- <?= t("Delete") ?>
- </a>
- </li>
- </ul>
- </td>
- </tr>
- <? endforeach ?>
- </table>
+ <p><?= gallery::date($comment->created) ?></p>
+ <?= nl2br(html::purify($comment->text)) ?>
+ </td>
+ <td>
+ <ul class="g-buttonset-vertical">
+ <? if ($comment->state != "unpublished"): ?>
+ <li>
+ <a href="javascript:set_state('unpublished',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-check"></span>
+ <?= t("Unapprove") ?>
+ </a>
+ </li>
+ <? endif ?>
+ <? if ($comment->state != "published"): ?>
+ <li>
+ <a href="javascript:set_state('published',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-check"></span>
+ <?= t("Approve") ?>
+ </a>
+ </li>
+ <? endif ?>
+ <? if ($comment->state != "spam"): ?>
+ <li>
+ <a href="javascript:set_state('spam',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-cancel"></span>
+ <?= t("Spam") ?>
+ </a>
+ </li>
+ <? endif ?>
+ <!--
+ <li>
+ <a href="javascript:reply(<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>
+ <?= t("Reply") ?>
+ </a>
+ </li>
+ <li>
+ <a href="javascript:Edit(<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-pencil"></span>
+ <?= t("Edit") ?>
+ </a>
+ </li>
+ -->
+ <li>
+ <a href="javascript:set_state('deleted',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-trash"></span>
+ <?= t("Delete") ?>
+ </a>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+
+ <div class="g-pager">
+ <?= $pager ?>
+ </div>
- <div class="pager">
- <?= $pager ?>
</div>
</div>
diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php
index ce4e197d..c7957c15 100644
--- a/modules/comment/views/comment.html.php
+++ b/modules/comment/views/comment.html.php
@@ -1,9 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<li id="gComment-<?= $comment->id; ?>">
- <p class="gAuthor">
+<li id="g-comment-<?= $comment->id; ?>">
+ <p class="g-author">
<a href="#">
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
- class="gAvatar"
+ class="g-avatar"
alt="<?= html::clean_attribute($comment->author_name()) ?>"
width="40"
height="40" />
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 7eb34c20..fc54e3d2 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -1,23 +1,23 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
- <a href="<?= url::site("form/add/comments/{$item->id})") ?>" id="gAddCommentButton"
- class="gButtonLink ui-corner-all ui-icon-left ui-state-default right">
+ <a href="<?= url::site("form/add/comments/{$item->id}") ?>" id="g-admin-comment-button"
+ class="g-button ui-corner-all ui-icon-left ui-state-default right">
<span class="ui-icon ui-icon-comment"></span>
<?= t("Add a comment") ?>
</a>
-<div id="gCommentDetail">
+<div id="g-comment-detail">
<? if (!$comments->count()): ?>
-<p id="gNoCommentsYet">
+<p id="g-no-comments-yet">
<?= t("No comments yet. Be the first to <a %attrs>comment</a>!",
- array("attrs" => html::mark_clean("href=\"#add_comment_form\" class=\"showCommentForm\""))) ?>
+ array("attrs" => html::mark_clean("id= \"g-no-comments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?>
</p>
<? endif ?>
<ul>
<? foreach ($comments as $comment): ?>
- <li id="gComment-<?= $comment->id ?>">
- <p class="gAuthor">
+ <li id="g-comment-<?= $comment->id ?>">
+ <p class="g-author">
<a href="#">
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
- class="gAvatar"
+ class="g-avatar"
alt="<?= html::clean_attribute($comment->author_name()) ?>"
width="40"
height="40" />
diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php
index 0939704b..1bb2691b 100644
--- a/modules/digibug/controllers/digibug.php
+++ b/modules/digibug/controllers/digibug.php
@@ -23,7 +23,7 @@ class Digibug_Controller extends Controller {
$item = ORM::factory("item", $id);
access::required("view", $item);
- if (access::group_can(group::everybody(), "view_full", $item)) {
+ if (access::group_can(identity::everybody(), "view_full", $item)) {
$full_url = $item->file_url(true);
$thumb_url = $item->thumb_url(true);
} else {
diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php
index d2830b80..37fa57e5 100644
--- a/modules/digibug/helpers/digibug_event.php
+++ b/modules/digibug/helpers/digibug_event.php
@@ -32,8 +32,8 @@ class digibug_event_Core {
->id("digibug")
->label(t("Print with Digibug"))
->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf"))
- ->css_id("gDigibugLink")
- ->css_class("ui-icon-print"));
+ ->css_id("g-print-digibug-link")
+ ->css_class("g-print-digibug-link ui-icon-print"));
}
static function context_menu($menu, $theme, $item) {
@@ -43,8 +43,7 @@ class digibug_event_Core {
->id("digibug")
->label(t("Print with Digibug"))
->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf"))
- ->css_id("gDigibugLink")
- ->css_class("ui-icon-print"));
+ ->css_class("g-print-digibug-link ui-icon-print"));
}
}
}
diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js
index 30bff47d..46ddac52 100644
--- a/modules/digibug/js/digibug.js
+++ b/modules/digibug/js/digibug.js
@@ -1,10 +1,5 @@
$(document).ready(function() {
- $(".gDigibugPrintButton a").click(function(e) {
- e.preventDefault();
- return digibug_popup(e.currentTarget.href, { width: 800, height: 600 } );
- });
-
- $("#gDigibugLink").click(function(e) {
+ $(".g-print-digibug-link").click(function(e) {
e.preventDefault();
return digibug_popup(e.currentTarget.href, { width: 800, height: 600 } );
});
diff --git a/modules/digibug/tests/Digibug_Controller_Test.php b/modules/digibug/tests/Digibug_Controller_Test.php
index 859ff637..a56d58bb 100644
--- a/modules/digibug/tests/Digibug_Controller_Test.php
+++ b/modules/digibug/tests/Digibug_Controller_Test.php
@@ -35,8 +35,8 @@ class Digibug_Controller_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$this->_album = album::create($root, rand(), "test album");
- access::deny(group::everybody(), "view_full", $this->_album);
- access::deny(group::registered_users(), "view_full", $this->_album);
+ access::deny(identity::everybody(), "view_full", $this->_album);
+ access::deny(identity::registered_users(), "view_full", $this->_album);
$rand = rand();
$this->_item = photo::create($this->_album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg",
diff --git a/modules/digibug/views/admin_digibug.html.php b/modules/digibug/views/admin_digibug.html.php
index 9a1838f7..5d07eb68 100644
--- a/modules/digibug/views/admin_digibug.html.php
+++ b/modules/digibug/views/admin_digibug.html.php
@@ -1,18 +1,16 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminDigibug">
- <div class="gAdminDigibugIntro">
- <img id="DigibugLogo" src="<?= url::file("modules/digibug/images/digibug_logo.png") ?>">
- <h2> <?= t("Digibug Photo Printing") ?> </h2>
+<div class="g-block">
+ <img src="<?= url::file("modules/digibug/images/digibug_logo.png") ?>" alt="Digibug logo" class="g-right"/>
+ <h1> <?= t("Digibug Photo Printing") ?> </h1>
+ <div class="g-block-content">
<p>
<?= t("Turn your photos into a wide variety of prints, gifts and games!") ?>
</p>
-
- <ul id="gMessage">
- <li class="gSuccess">
+ <ul>
+ <li class="g-module-status g-success">
<?= t("You're ready to print photos!") ?>
</li>
</ul>
-
<p>
<?= t("You don't need an account with Digibug, but if you <a href=\"%signup_url\">register with Digibug</a> and enter your Digibug id in the <a href=\"%advanced_settings_url\">Advanced Settings</a> page you can make money off of your photos!",
array("signup_url" => "http://www.digibug.com/signup.php",
diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php
index 83540622..5ddd09d4 100644
--- a/modules/exif/helpers/exif.php
+++ b/modules/exif/helpers/exif.php
@@ -163,7 +163,7 @@ class exif_Core {
list ($remaining) = exif::stats();
if ($remaining) {
site_status::warning(
- t('Your Exif index needs to be updated. <a href="%url" class="gDialogLink">Fix this now</a>',
+ t('Your Exif index needs to be updated. <a href="%url" class="g-dialog-link">Fix this now</a>',
array("url" => html::mark_clean(url::site("admin/maintenance/start/exif_task::update_index?csrf=__CSRF__")))),
"exif_index_out_of_date");
}
diff --git a/modules/exif/helpers/exif_event.php b/modules/exif/helpers/exif_event.php
index 81ac5f44..826ec959 100644
--- a/modules/exif/helpers/exif_event.php
+++ b/modules/exif/helpers/exif_event.php
@@ -18,14 +18,6 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class exif_event_Core {
- static function gallery_ready() {
- if (!function_exists("gettext")) {
- function gettext($message) {
- return (string) t($message);
- }
- }
- }
-
static function item_created($item) {
if (!$item->is_album()) {
exif::extract($item);
diff --git a/modules/exif/lib/exif.php b/modules/exif/lib/exif.php
index bd72f237..189f61b5 100644
--- a/modules/exif/lib/exif.php
+++ b/modules/exif/lib/exif.php
@@ -158,10 +158,15 @@ function intel2Moto($intel) {
return $cache[$intel];
}
- $len = strlen($intel);
$cache[$intel] = '';
- for($i = 0; $i <= $len; $i += 2) {
- $cache[$intel] .= substr($intel, $len-$i, 2);
+ $len = strlen($intel);
+ if ($len > 1000) {
+ debugLogBacktrace('intel2Moto called with unreasonable data string: length='.$len);
+ trigger_error(sprintf((string) t('intel2Moto called with unreasonable data string: length=%s. See debug log for details. (Setting DEBUG_EXIF to true might help locate problem images.)'),$len));
+ } else {
+ for($i = 0; $i <= $len; $i += 2) {
+ $cache[$intel] .= substr($intel, $len-$i, 2);
+ }
}
return $cache[$intel];
}
@@ -414,125 +419,125 @@ function formatData($type,$tag,$intel,$data) {
if ($tag == '0112') { // Orientation
// Example of how all of these tag formatters should be...
switch ($data) {
- case 1 : $data = gettext('1: Normal (0 deg)'); break;
- case 2 : $data = gettext('2: Mirrored'); break;
- case 3 : $data = gettext('3: Upsidedown'); break;
- case 4 : $data = gettext('4: Upsidedown Mirrored'); break;
- case 5 : $data = gettext('5: 90 deg CW Mirrored'); break;
- case 6 : $data = gettext('6: 90 deg CCW'); break;
- case 7 : $data = gettext('7: 90 deg CCW Mirrored'); break;
- case 8 : $data = gettext('8: 90 deg CW'); break;
- default : $data = gettext('Unknown').': '.$data;
+ case 1 : $data = (string) t('1: Normal (0 deg)'); break;
+ case 2 : $data = (string) t('2: Mirrored'); break;
+ case 3 : $data = (string) t('3: Upsidedown'); break;
+ case 4 : $data = (string) t('4: Upsidedown Mirrored'); break;
+ case 5 : $data = (string) t('5: 90 deg CW Mirrored'); break;
+ case 6 : $data = (string) t('6: 90 deg CCW'); break;
+ case 7 : $data = (string) t('7: 90 deg CCW Mirrored'); break;
+ case 8 : $data = (string) t('8: 90 deg CW'); break;
+ default : $data = (string) t('Unknown').': '.$data;
}
} else if ($tag == '0128' || $tag == 'a210' || $tag == '0128') { // ResolutionUnit and FocalPlaneResolutionUnit and ThumbnailResolutionUnit
- if ($data == 1) $data = gettext('No Unit');
- else if ($data == 2) $data = gettext('Inch');
- else if ($data == 3) $data = gettext('Centimeter');
+ if ($data == 1) $data = (string) t('No Unit');
+ else if ($data == 2) $data = (string) t('Inch');
+ else if ($data == 3) $data = (string) t('Centimeter');
} else if ($tag == '0213') { // YCbCrPositioning
- if ($data == 1) $data = gettext('Center of Pixel Array');
- else if ($data == 2) $data = gettext('Datum Point');
+ if ($data == 1) $data = (string) t('Center of Pixel Array');
+ else if ($data == 2) $data = (string) t('Datum Point');
} else if ($tag == '8822') { // ExposureProgram
- if ($data == 1) $data = gettext('Manual');
- else if ($data == 2) $data = gettext('Program');
- else if ($data == 3) $data = gettext('Aperture Priority');
- else if ($data == 4) $data = gettext('Shutter Priority');
- else if ($data == 5) $data = gettext('Program Creative');
- else if ($data == 6) $data = gettext('Program Action');
- else if ($data == 7) $data = gettext('Portrat');
- else if ($data == 8) $data = gettext('Landscape');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 1) $data = (string) t('Manual');
+ else if ($data == 2) $data = (string) t('Program');
+ else if ($data == 3) $data = (string) t('Aperture Priority');
+ else if ($data == 4) $data = (string) t('Shutter Priority');
+ else if ($data == 5) $data = (string) t('Program Creative');
+ else if ($data == 6) $data = (string) t('Program Action');
+ else if ($data == 7) $data = (string) t('Portrat');
+ else if ($data == 8) $data = (string) t('Landscape');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == '9207') { // MeteringMode
- if ($data == 0) $data = gettext('Unknown');
- else if ($data == 1) $data = gettext('Average');
- else if ($data == 2) $data = gettext('Center Weighted Average');
- else if ($data == 3) $data = gettext('Spot');
- else if ($data == 4) $data = gettext('Multi-Spot');
- else if ($data == 5) $data = gettext('Multi-Segment');
- else if ($data == 6) $data = gettext('Partial');
- else if ($data == 255) $data = gettext('Other');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 0) $data = (string) t('Unknown');
+ else if ($data == 1) $data = (string) t('Average');
+ else if ($data == 2) $data = (string) t('Center Weighted Average');
+ else if ($data == 3) $data = (string) t('Spot');
+ else if ($data == 4) $data = (string) t('Multi-Spot');
+ else if ($data == 5) $data = (string) t('Multi-Segment');
+ else if ($data == 6) $data = (string) t('Partial');
+ else if ($data == 255) $data = (string) t('Other');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == '9208') { // LightSource
- if ($data == 0) $data = gettext('Unknown or Auto');
- else if ($data == 1) $data = gettext('Daylight');
- else if ($data == 2) $data = gettext('Flourescent');
- else if ($data == 3) $data = gettext('Tungsten'); // 3 Tungsten (Incandescent light)
+ if ($data == 0) $data = (string) t('Unknown or Auto');
+ else if ($data == 1) $data = (string) t('Daylight');
+ else if ($data == 2) $data = (string) t('Flourescent');
+ else if ($data == 3) $data = (string) t('Tungsten'); // 3 Tungsten (Incandescent light)
// 4 Flash
// 9 Fine Weather
- else if ($data == 10) $data = gettext('Flash'); // 10 Cloudy Weather
+ else if ($data == 10) $data = (string) t('Flash'); // 10 Cloudy Weather
// 11 Shade
// 12 Daylight Fluorescent (D 5700 - 7100K)
// 13 Day White Fluorescent (N 4600 - 5400K)
// 14 Cool White Fluorescent (W 3900 -4500K)
// 15 White Fluorescent (WW 3200 - 3700K)
// 10 Flash
- else if ($data == 17) $data = gettext('Standard Light A');
- else if ($data == 18) $data = gettext('Standard Light B');
- else if ($data == 19) $data = gettext('Standard Light C');
- else if ($data == 20) $data = gettext('D55');
- else if ($data == 21) $data = gettext('D65');
- else if ($data == 22) $data = gettext('D75');
- else if ($data == 23) $data = gettext('D50');
- else if ($data == 24) $data = gettext('ISO Studio Tungsten');
- else if ($data == 255) $data = gettext('Other');
- else $data = gettext('Unknown').': '.$data;
+ else if ($data == 17) $data = (string) t('Standard Light A');
+ else if ($data == 18) $data = (string) t('Standard Light B');
+ else if ($data == 19) $data = (string) t('Standard Light C');
+ else if ($data == 20) $data = (string) t('D55');
+ else if ($data == 21) $data = (string) t('D65');
+ else if ($data == 22) $data = (string) t('D75');
+ else if ($data == 23) $data = (string) t('D50');
+ else if ($data == 24) $data = (string) t('ISO Studio Tungsten');
+ else if ($data == 255) $data = (string) t('Other');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == '9209') { // Flash
- if ($data == 0) $data = gettext('No Flash');
- else if ($data == 1) $data = gettext('Flash');
- else if ($data == 5) $data = gettext('Flash, strobe return light not detected');
- else if ($data == 7) $data = gettext('Flash, strobe return light detected');
- else if ($data == 9) $data = gettext('Compulsory Flash');
- else if ($data == 13) $data = gettext('Compulsory Flash, Return light not detected');
- else if ($data == 15) $data = gettext('Compulsory Flash, Return light detected');
- else if ($data == 16) $data = gettext('No Flash');
- else if ($data == 24) $data = gettext('No Flash');
- else if ($data == 25) $data = gettext('Flash, Auto-Mode');
- else if ($data == 29) $data = gettext('Flash, Auto-Mode, Return light not detected');
- else if ($data == 31) $data = gettext('Flash, Auto-Mode, Return light detected');
- else if ($data == 32) $data = gettext('No Flash');
- else if ($data == 65) $data = gettext('Red Eye');
- else if ($data == 69) $data = gettext('Red Eye, Return light not detected');
- else if ($data == 71) $data = gettext('Red Eye, Return light detected');
- else if ($data == 73) $data = gettext('Red Eye, Compulsory Flash');
- else if ($data == 77) $data = gettext('Red Eye, Compulsory Flash, Return light not detected');
- else if ($data == 79) $data = gettext('Red Eye, Compulsory Flash, Return light detected');
- else if ($data == 89) $data = gettext('Red Eye, Auto-Mode');
- else if ($data == 93) $data = gettext('Red Eye, Auto-Mode, Return light not detected');
- else if ($data == 95) $data = gettext('Red Eye, Auto-Mode, Return light detected');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 0) $data = (string) t('No Flash');
+ else if ($data == 1) $data = (string) t('Flash');
+ else if ($data == 5) $data = (string) t('Flash, strobe return light not detected');
+ else if ($data == 7) $data = (string) t('Flash, strobe return light detected');
+ else if ($data == 9) $data = (string) t('Compulsory Flash');
+ else if ($data == 13) $data = (string) t('Compulsory Flash, Return light not detected');
+ else if ($data == 15) $data = (string) t('Compulsory Flash, Return light detected');
+ else if ($data == 16) $data = (string) t('No Flash');
+ else if ($data == 24) $data = (string) t('No Flash');
+ else if ($data == 25) $data = (string) t('Flash, Auto-Mode');
+ else if ($data == 29) $data = (string) t('Flash, Auto-Mode, Return light not detected');
+ else if ($data == 31) $data = (string) t('Flash, Auto-Mode, Return light detected');
+ else if ($data == 32) $data = (string) t('No Flash');
+ else if ($data == 65) $data = (string) t('Red Eye');
+ else if ($data == 69) $data = (string) t('Red Eye, Return light not detected');
+ else if ($data == 71) $data = (string) t('Red Eye, Return light detected');
+ else if ($data == 73) $data = (string) t('Red Eye, Compulsory Flash');
+ else if ($data == 77) $data = (string) t('Red Eye, Compulsory Flash, Return light not detected');
+ else if ($data == 79) $data = (string) t('Red Eye, Compulsory Flash, Return light detected');
+ else if ($data == 89) $data = (string) t('Red Eye, Auto-Mode');
+ else if ($data == 93) $data = (string) t('Red Eye, Auto-Mode, Return light not detected');
+ else if ($data == 95) $data = (string) t('Red Eye, Auto-Mode, Return light detected');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == 'a001') { // ColorSpace
- if ($data == 1) $data = gettext('sRGB');
- else $data = gettext('Uncalibrated');
+ if ($data == 1) $data = (string) t('sRGB');
+ else $data = (string) t('Uncalibrated');
} else if ($tag == 'a002' || $tag == 'a003') { // ExifImageWidth/Height
- $data = $data. ' '.gettext('pixels');
+ $data = $data. ' '.(string) t('pixels');
} else if ($tag == '0103') { // Compression
- if ($data == 1) $data = gettext('No Compression');
- else if ($data == 6) $data = gettext('Jpeg Compression');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 1) $data = (string) t('No Compression');
+ else if ($data == 6) $data = (string) t('Jpeg Compression');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == 'a217') { // SensingMethod
- if ($data == 1) $data = gettext('Not defined');
- if ($data == 2) $data = gettext('One Chip Color Area Sensor');
- if ($data == 3) $data = gettext('Two Chip Color Area Sensor');
- if ($data == 4) $data = gettext('Three Chip Color Area Sensor');
- if ($data == 5) $data = gettext('Color Sequential Area Sensor');
- if ($data == 7) $data = gettext('Trilinear Sensor');
- if ($data == 8) $data = gettext('Color Sequential Linear Sensor');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 1) $data = (string) t('Not defined');
+ if ($data == 2) $data = (string) t('One Chip Color Area Sensor');
+ if ($data == 3) $data = (string) t('Two Chip Color Area Sensor');
+ if ($data == 4) $data = (string) t('Three Chip Color Area Sensor');
+ if ($data == 5) $data = (string) t('Color Sequential Area Sensor');
+ if ($data == 7) $data = (string) t('Trilinear Sensor');
+ if ($data == 8) $data = (string) t('Color Sequential Linear Sensor');
+ else $data = (string) t('Unknown').': '.$data;
} else if ($tag == '0106') { // PhotometricInterpretation
- if ($data == 1) $data = gettext('Monochrome');
- else if ($data == 2) $data = gettext('RGB');
- else if ($data == 6) $data = gettext('YCbCr');
- else $data = gettext('Unknown').': '.$data;
+ if ($data == 1) $data = (string) t('Monochrome');
+ else if ($data == 2) $data = (string) t('RGB');
+ else if ($data == 6) $data = (string) t('YCbCr');
+ else $data = (string) t('Unknown').': '.$data;
}
//} else if($tag=="a408" || $tag=="a40a") { // Contrast, Sharpness
// switch($data) {
@@ -559,17 +564,17 @@ function formatData($type,$tag,$intel,$data) {
} else if ($type == 'UNDEFINED') {
if ($tag == '9000' || $tag == 'a000' || $tag == '0002') { // ExifVersion,FlashPixVersion,InteroperabilityVersion
- $data=gettext('version').' '.$data/100;
+ $data=(string) t('version').' '.$data/100;
}
if ($tag == 'a300') { // FileSource
$data = bin2hex($data);
$data = str_replace('00','',$data);
- $data = str_replace('03',gettext('Digital Still Camera'),$data);
+ $data = str_replace('03',(string) t('Digital Still Camera'),$data);
}
if ($tag == 'a301') { // SceneType
$data = bin2hex($data);
$data = str_replace('00','',$data);
- $data = str_replace('01',gettext('Directly Photographed'),$data);
+ $data = str_replace('01',(string) t('Directly Photographed'),$data);
}
if ($tag == '9101') { // ComponentsConfiguration
$data = bin2hex($data);
@@ -596,14 +601,14 @@ function formatData($type,$tag,$intel,$data) {
function formatExposure($data) {
if ($data > 0) {
if ($data > 1) {
- return round($data, 2).' '.gettext('sec');
+ return round($data, 2).' '.(string) t('sec');
} else {
$n=0; $d=0;
ConvertToFraction($data, $n, $d);
- return $n.'/'.$d.' '.gettext('sec');
+ return $n.'/'.$d.' '.(string) t('sec');
}
} else {
- return gettext('Bulb');
+ return (string) t('Bulb');
}
}
@@ -740,7 +745,7 @@ function read_exif_data_raw($path,$verbose) {
if (!$in || !$seek) { // if the path was invalid, this error will catch it
$result['Errors'] = 1;
- $result['Error'][$result['Errors']] = gettext('The file could not be found.');
+ $result['Error'][$result['Errors']] = (string) t('The file could not be found.');
return $result;
}
@@ -907,7 +912,7 @@ if ($result['ValidJpeg'] == 1) {
$v = fseek($in,$globalOffset+$ExitOffset);
if ($v == -1) {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Couldnt Find SubIFD');
+ $result['Error'][$result['Errors']] = (string) t('Couldnt Find SubIFD');
}
//===========================================================
@@ -923,7 +928,7 @@ if ($result['ValidJpeg'] == 1) {
}
} else {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Illegal size for SubIFD');
+ $result['Error'][$result['Errors']] = (string) t('Illegal size for SubIFD');
}
// Add the 35mm equivalent focal length:
@@ -939,7 +944,7 @@ if ($result['ValidJpeg'] == 1) {
$v = fseek($in,$globalOffset+$result['IFD1Offset']);
if ($v == -1) {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Couldnt Find IFD1');
+ $result['Error'][$result['Errors']] = (string) t('Couldnt Find IFD1');
}
//===========================================================
@@ -955,7 +960,7 @@ if ($result['ValidJpeg'] == 1) {
}
} else {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Illegal size for IFD1');
+ $result['Error'][$result['Errors']] = (string) t('Illegal size for IFD1');
}
// If verbose output is on, include the thumbnail raw data...
if ($result['VerboseOutput'] == 1 && $result['IFD1']['JpegIFOffset']>0 && $result['IFD1']['JpegIFByteCount']>0) {
@@ -979,7 +984,7 @@ if ($result['ValidJpeg'] == 1) {
$v = fseek($in,$globalOffset+$result['SubIFD']['ExifInteroperabilityOffset']);
if ($v == -1) {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Couldnt Find InteroperabilityIFD');
+ $result['Error'][$result['Errors']] = (string) t('Couldnt Find InteroperabilityIFD');
}
//===========================================================
@@ -995,7 +1000,7 @@ if ($result['ValidJpeg'] == 1) {
}
} else {
$result['Errors'] = $result['Errors']+1;
- $result['Error'][$result['Errors']] = gettext('Illegal size for InteroperabilityIFD');
+ $result['Error'][$result['Errors']] = (string) t('Illegal size for InteroperabilityIFD');
}
fclose($in);
fclose($seek);
@@ -1059,4 +1064,10 @@ function get35mmEquivFocalLength(&$result) {
return null;
}
+if (!function_exists('debugLogBacktrace')) {
+ // define this function for stand-alone uses if exifier
+ function debugLogBacktrace($msg) {
+ }
+}
+
?>
diff --git a/modules/exif/lib/makers/canon.php b/modules/exif/lib/makers/canon.php
index 2470568b..75cf0b7b 100644
--- a/modules/exif/lib/makers/canon.php
+++ b/modules/exif/lib/makers/canon.php
@@ -79,151 +79,151 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
if ($result['Bytes'] != strlen($data) / 2) return $result; //Bad chunk
$result['Macro']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//1
switch($result['Macro']) {
- case 1: $result['Macro'] = gettext("Macro"); break;
- case 2: $result['Macro'] = gettext("Normal"); break;
- default: $result['Macro'] = gettext("Unknown");
+ case 1: $result['Macro'] = (string) t("Macro"); break;
+ case 2: $result['Macro'] = (string) t("Normal"); break;
+ default: $result['Macro'] = (string) t("Unknown");
}
$result['SelfTimer']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//2
switch($result['SelfTimer']) {
- case 0: $result['SelfTimer'] = gettext("Off"); break;
- default: $result['SelfTimer'] .= gettext("/10s");
+ case 0: $result['SelfTimer'] = (string) t("Off"); break;
+ default: $result['SelfTimer'] .= (string) t("/10s");
}
$result['Quality']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//3
switch($result['Quality']) {
- case 2: $result['Quality'] = gettext("Normal"); break;
- case 3: $result['Quality'] = gettext("Fine"); break;
- case 5: $result['Quality'] = gettext("Superfine"); break;
- default: $result['Quality'] = gettext("Unknown");
+ case 2: $result['Quality'] = (string) t("Normal"); break;
+ case 3: $result['Quality'] = (string) t("Fine"); break;
+ case 5: $result['Quality'] = (string) t("Superfine"); break;
+ default: $result['Quality'] = (string) t("Unknown");
}
$result['Flash']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//4
switch($result['Flash']) {
- case 0: $result['Flash'] = gettext("Off"); break;
- case 1: $result['Flash'] = gettext("Auto"); break;
- case 2: $result['Flash'] = gettext("On"); break;
- case 3: $result['Flash'] = gettext("Red Eye Reduction"); break;
- case 4: $result['Flash'] = gettext("Slow Synchro"); break;
- case 5: $result['Flash'] = gettext("Auto + Red Eye Reduction"); break;
- case 6: $result['Flash'] = gettext("On + Red Eye Reduction"); break;
- case 16: $result['Flash'] = gettext("External Flash"); break;
- default: $result['Flash'] = gettext("Unknown");
+ case 0: $result['Flash'] = (string) t("Off"); break;
+ case 1: $result['Flash'] = (string) t("Auto"); break;
+ case 2: $result['Flash'] = (string) t("On"); break;
+ case 3: $result['Flash'] = (string) t("Red Eye Reduction"); break;
+ case 4: $result['Flash'] = (string) t("Slow Synchro"); break;
+ case 5: $result['Flash'] = (string) t("Auto + Red Eye Reduction"); break;
+ case 6: $result['Flash'] = (string) t("On + Red Eye Reduction"); break;
+ case 16: $result['Flash'] = (string) t("External Flash"); break;
+ default: $result['Flash'] = (string) t("Unknown");
}
$result['DriveMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//5
switch($result['DriveMode']) {
- case 0: $result['DriveMode'] = gettext("Single/Timer"); break;
- case 1: $result['DriveMode'] = gettext("Continuous"); break;
- default: $result['DriveMode'] = gettext("Unknown");
+ case 0: $result['DriveMode'] = (string) t("Single/Timer"); break;
+ case 1: $result['DriveMode'] = (string) t("Continuous"); break;
+ default: $result['DriveMode'] = (string) t("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
$result['FocusMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
switch($result['FocusMode']) {
- case 0: $result['FocusMode'] = gettext("One-Shot"); break;
- case 1: $result['FocusMode'] = gettext("AI Servo"); break;
- case 2: $result['FocusMode'] = gettext("AI Focus"); break;
- case 3: $result['FocusMode'] = gettext("Manual Focus"); break;
- case 4: $result['FocusMode'] = gettext("Single"); break;
- case 5: $result['FocusMode'] = gettext("Continuous"); break;
- case 6: $result['FocusMode'] = gettext("Manual Focus"); break;
- default: $result['FocusMode'] = gettext("Unknown");
+ case 0: $result['FocusMode'] = (string) t("One-Shot"); break;
+ case 1: $result['FocusMode'] = (string) t("AI Servo"); break;
+ case 2: $result['FocusMode'] = (string) t("AI Focus"); break;
+ case 3: $result['FocusMode'] = (string) t("Manual Focus"); break;
+ case 4: $result['FocusMode'] = (string) t("Single"); break;
+ case 5: $result['FocusMode'] = (string) t("Continuous"); break;
+ case 6: $result['FocusMode'] = (string) t("Manual Focus"); break;
+ default: $result['FocusMode'] = (string) t("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
$result['ImageSize']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//10
switch($result['ImageSize']) {
- case 0: $result['ImageSize'] = gettext("Large"); break;
- case 1: $result['ImageSize'] = gettext("Medium"); break;
- case 2: $result['ImageSize'] = gettext("Small"); break;
- default: $result['ImageSize'] = gettext("Unknown");
+ case 0: $result['ImageSize'] = (string) t("Large"); break;
+ case 1: $result['ImageSize'] = (string) t("Medium"); break;
+ case 2: $result['ImageSize'] = (string) t("Small"); break;
+ default: $result['ImageSize'] = (string) t("Unknown");
}
$result['EasyShooting']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//11
switch($result['EasyShooting']) {
- case 0: $result['EasyShooting'] = gettext("Full Auto"); break;
- case 1: $result['EasyShooting'] = gettext("Manual"); break;
- case 2: $result['EasyShooting'] = gettext("Landscape"); break;
- case 3: $result['EasyShooting'] = gettext("Fast Shutter"); break;
- case 4: $result['EasyShooting'] = gettext("Slow Shutter"); break;
- case 5: $result['EasyShooting'] = gettext("Night"); break;
- case 6: $result['EasyShooting'] = gettext("Black & White"); break;
- case 7: $result['EasyShooting'] = gettext("Sepia"); break;
- case 8: $result['EasyShooting'] = gettext("Portrait"); break;
- case 9: $result['EasyShooting'] = gettext("Sport"); break;
- case 10: $result['EasyShooting'] = gettext("Macro/Close-Up"); break;
- case 11: $result['EasyShooting'] = gettext("Pan Focus"); break;
- default: $result['EasyShooting'] = gettext("Unknown");
+ case 0: $result['EasyShooting'] = (string) t("Full Auto"); break;
+ case 1: $result['EasyShooting'] = (string) t("Manual"); break;
+ case 2: $result['EasyShooting'] = (string) t("Landscape"); break;
+ case 3: $result['EasyShooting'] = (string) t("Fast Shutter"); break;
+ case 4: $result['EasyShooting'] = (string) t("Slow Shutter"); break;
+ case 5: $result['EasyShooting'] = (string) t("Night"); break;
+ case 6: $result['EasyShooting'] = (string) t("Black & White"); break;
+ case 7: $result['EasyShooting'] = (string) t("Sepia"); break;
+ case 8: $result['EasyShooting'] = (string) t("Portrait"); break;
+ case 9: $result['EasyShooting'] = (string) t("Sport"); break;
+ case 10: $result['EasyShooting'] = (string) t("Macro/Close-Up"); break;
+ case 11: $result['EasyShooting'] = (string) t("Pan Focus"); break;
+ default: $result['EasyShooting'] = (string) t("Unknown");
}
$result['DigitalZoom']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//12
switch($result['DigitalZoom']) {
case 0:
- case 65535: $result['DigitalZoom'] = gettext("None"); break;
- case 1: $result['DigitalZoom'] = gettext("2x"); break;
- case 2: $result['DigitalZoom'] = gettext("4x"); break;
- default: $result['DigitalZoom'] = gettext("Unknown");
+ case 65535: $result['DigitalZoom'] = (string) t("None"); break;
+ case 1: $result['DigitalZoom'] = (string) t("2x"); break;
+ case 2: $result['DigitalZoom'] = (string) t("4x"); break;
+ default: $result['DigitalZoom'] = (string) t("Unknown");
}
$result['Contrast']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
switch($result['Contrast']) {
- case 0: $result['Contrast'] = gettext("Normal"); break;
- case 1: $result['Contrast'] = gettext("High"); break;
- case 65535: $result['Contrast'] = gettext("Low"); break;
- default: $result['Contrast'] = gettext("Unknown");
+ case 0: $result['Contrast'] = (string) t("Normal"); break;
+ case 1: $result['Contrast'] = (string) t("High"); break;
+ case 65535: $result['Contrast'] = (string) t("Low"); break;
+ default: $result['Contrast'] = (string) t("Unknown");
}
$result['Saturation']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
switch($result['Saturation']) {
- case 0: $result['Saturation'] = gettext("Normal"); break;
- case 1: $result['Saturation'] = gettext("High"); break;
- case 65535: $result['Saturation'] = gettext("Low"); break;
- default: $result['Saturation'] = gettext("Unknown");
+ case 0: $result['Saturation'] = (string) t("Normal"); break;
+ case 1: $result['Saturation'] = (string) t("High"); break;
+ case 65535: $result['Saturation'] = (string) t("Low"); break;
+ default: $result['Saturation'] = (string) t("Unknown");
}
$result['Sharpness']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//15
switch($result['Sharpness']) {
- case 0: $result['Sharpness'] = gettext("Normal"); break;
- case 1: $result['Sharpness'] = gettext("High"); break;
- case 65535: $result['Sharpness'] = gettext("Low"); break;
- default: $result['Sharpness'] = gettext("Unknown");
+ case 0: $result['Sharpness'] = (string) t("Normal"); break;
+ case 1: $result['Sharpness'] = (string) t("High"); break;
+ case 65535: $result['Sharpness'] = (string) t("Low"); break;
+ default: $result['Sharpness'] = (string) t("Unknown");
}
$result['ISO']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
switch($result['ISO']) {
case 32767:
case 0: $result['ISO'] = isset($exif['SubIFD']['ISOSpeedRatings'])
? $exif['SubIFD']['ISOSpeedRatings'] : 'Unknown'; break;
- case 15: $result['ISO'] = gettext("Auto"); break;
- case 16: $result['ISO'] = gettext("50"); break;
- case 17: $result['ISO'] = gettext("100"); break;
- case 18: $result['ISO'] = gettext("200"); break;
- case 19: $result['ISO'] = gettext("400"); break;
- default: $result['ISO'] = gettext("Unknown");
+ case 15: $result['ISO'] = (string) t("Auto"); break;
+ case 16: $result['ISO'] = (string) t("50"); break;
+ case 17: $result['ISO'] = (string) t("100"); break;
+ case 18: $result['ISO'] = (string) t("200"); break;
+ case 19: $result['ISO'] = (string) t("400"); break;
+ default: $result['ISO'] = (string) t("Unknown");
}
$result['MeteringMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
switch($result['MeteringMode']) {
- case 3: $result['MeteringMode'] = gettext("Evaluative"); break;
- case 4: $result['MeteringMode'] = gettext("Partial"); break;
- case 5: $result['MeteringMode'] = gettext("Center-weighted"); break;
- default: $result['MeteringMode'] = gettext("Unknown");
+ case 3: $result['MeteringMode'] = (string) t("Evaluative"); break;
+ case 4: $result['MeteringMode'] = (string) t("Partial"); break;
+ case 5: $result['MeteringMode'] = (string) t("Center-weighted"); break;
+ default: $result['MeteringMode'] = (string) t("Unknown");
}
$result['FocusType']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//18
switch($result['FocusType']) {
- case 0: $result['FocusType'] = gettext("Manual"); break;
- case 1: $result['FocusType'] = gettext("Auto"); break;
- case 3: $result['FocusType'] = gettext("Close-up (Macro)"); break;
- case 8: $result['FocusType'] = gettext("Locked (Pan Mode)"); break;
- default: $result['FocusType'] = gettext("Unknown");
+ case 0: $result['FocusType'] = (string) t("Manual"); break;
+ case 1: $result['FocusType'] = (string) t("Auto"); break;
+ case 3: $result['FocusType'] = (string) t("Close-up (Macro)"); break;
+ case 8: $result['FocusType'] = (string) t("Locked (Pan Mode)"); break;
+ default: $result['FocusType'] = (string) t("Unknown");
}
$result['AFPointSelected']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//19
switch($result['AFPointSelected']) {
- case 12288: $result['AFPointSelected'] = gettext("Manual Focus"); break;
- case 12289: $result['AFPointSelected'] = gettext("Auto Selected"); break;
- case 12290: $result['AFPointSelected'] = gettext("Right"); break;
- case 12291: $result['AFPointSelected'] = gettext("Center"); break;
- case 12292: $result['AFPointSelected'] = gettext("Left"); break;
- default: $result['AFPointSelected'] = gettext("Unknown");
+ case 12288: $result['AFPointSelected'] = (string) t("Manual Focus"); break;
+ case 12289: $result['AFPointSelected'] = (string) t("Auto Selected"); break;
+ case 12290: $result['AFPointSelected'] = (string) t("Right"); break;
+ case 12291: $result['AFPointSelected'] = (string) t("Center"); break;
+ case 12292: $result['AFPointSelected'] = (string) t("Left"); break;
+ default: $result['AFPointSelected'] = (string) t("Unknown");
}
$result['ExposureMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//20
switch($result['ExposureMode']) {
- case 0: $result['ExposureMode'] = gettext("EasyShoot"); break;
- case 1: $result['ExposureMode'] = gettext("Program"); break;
- case 2: $result['ExposureMode'] = gettext("Tv"); break;
- case 3: $result['ExposureMode'] = gettext("Av"); break;
- case 4: $result['ExposureMode'] = gettext("Manual"); break;
- case 5: $result['ExposureMode'] = gettext("Auto-DEP"); break;
- default: $result['ExposureMode'] = gettext("Unknown");
+ case 0: $result['ExposureMode'] = (string) t("EasyShoot"); break;
+ case 1: $result['ExposureMode'] = (string) t("Program"); break;
+ case 2: $result['ExposureMode'] = (string) t("Tv"); break;
+ case 3: $result['ExposureMode'] = (string) t("Av"); break;
+ case 4: $result['ExposureMode'] = (string) t("Manual"); break;
+ case 5: $result['ExposureMode'] = (string) t("Auto-DEP"); break;
+ default: $result['ExposureMode'] = (string) t("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//21
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//22
@@ -237,26 +237,26 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//27
$result['FlashActivity']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//28
switch($result['FlashActivity']) {
- case 0: $result['FlashActivity'] = gettext("Flash Did Not Fire"); break;
- case 1: $result['FlashActivity'] = gettext("Flash Fired"); break;
- default: $result['FlashActivity'] = gettext("Unknown");
+ case 0: $result['FlashActivity'] = (string) t("Flash Did Not Fire"); break;
+ case 1: $result['FlashActivity'] = (string) t("Flash Fired"); break;
+ default: $result['FlashActivity'] = (string) t("Unknown");
}
$result['FlashDetails']=str_pad(base_convert(intel2Moto(substr($data,$place,4)), 16, 2), 16, "0", STR_PAD_LEFT);$place+=4;//29
$flashDetails = array();
- if (substr($result['FlashDetails'], 1, 1) == 1) { $flashDetails[] = gettext('External E-TTL'); }
- if (substr($result['FlashDetails'], 2, 1) == 1) { $flashDetails[] = gettext('Internal Flash'); }
- if (substr($result['FlashDetails'], 4, 1) == 1) { $flashDetails[] = gettext('FP sync used'); }
- if (substr($result['FlashDetails'], 8, 1) == 1) { $flashDetails[] = gettext('2nd(rear)-curtain sync used'); }
- if (substr($result['FlashDetails'], 12, 1) == 1) { $flashDetails[] = gettext('1st curtain sync'); }
+ if (substr($result['FlashDetails'], 1, 1) == 1) { $flashDetails[] = (string) t('External E-TTL'); }
+ if (substr($result['FlashDetails'], 2, 1) == 1) { $flashDetails[] = (string) t('Internal Flash'); }
+ if (substr($result['FlashDetails'], 4, 1) == 1) { $flashDetails[] = (string) t('FP sync used'); }
+ if (substr($result['FlashDetails'], 8, 1) == 1) { $flashDetails[] = (string) t('2nd(rear)-curtain sync used'); }
+ if (substr($result['FlashDetails'], 12, 1) == 1) { $flashDetails[] = (string) t('1st curtain sync'); }
$result['FlashDetails']=implode(",", $flashDetails);
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//30
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//31
$anotherFocusMode=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//32
if(strpos(strtoupper($exif['IFD0']['Model']), "G1") !== false) {
switch($anotherFocusMode) {
- case 0: $result['FocusMode'] = gettext("Single"); break;
- case 1: $result['FocusMode'] = gettext("Continuous"); break;
- default: $result['FocusMode'] = gettext("Unknown");
+ case 0: $result['FocusMode'] = (string) t("Single"); break;
+ case 1: $result['FocusMode'] = (string) t("Continuous"); break;
+ default: $result['FocusMode'] = (string) t("Unknown");
}
}
@@ -271,14 +271,14 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
$result['WhiteBalance']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
switch($result['WhiteBalance']) {
- case 0: $result['WhiteBalance'] = gettext("Auto"); break;
- case 1: $result['WhiteBalance'] = gettext("Sunny"); break;
- case 2: $result['WhiteBalance'] = gettext("Cloudy"); break;
- case 3: $result['WhiteBalance'] = gettext("Tungsten"); break;
- case 4: $result['WhiteBalance'] = gettext("Fluorescent"); break;
- case 5: $result['WhiteBalance'] = gettext("Flash"); break;
- case 6: $result['WhiteBalance'] = gettext("Custom"); break;
- default: $result['WhiteBalance'] = gettext("Unknown");
+ case 0: $result['WhiteBalance'] = (string) t("Auto"); break;
+ case 1: $result['WhiteBalance'] = (string) t("Sunny"); break;
+ case 2: $result['WhiteBalance'] = (string) t("Cloudy"); break;
+ case 3: $result['WhiteBalance'] = (string) t("Tungsten"); break;
+ case 4: $result['WhiteBalance'] = (string) t("Fluorescent"); break;
+ case 5: $result['WhiteBalance'] = (string) t("Flash"); break;
+ case 6: $result['WhiteBalance'] = (string) t("Custom"); break;
+ default: $result['WhiteBalance'] = (string) t("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
$result['SequenceNumber']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
@@ -288,13 +288,13 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
$result['AFPointUsed']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
$afPointUsed = array();
- if ($result['AFPointUsed'] & 0x0001) $afPointUsed[] = gettext("Right"); //bit 0
- if ($result['AFPointUsed'] & 0x0002) $afPointUsed[] = gettext("Center"); //bit 1
- if ($result['AFPointUsed'] & 0x0004) $afPointUsed[] = gettext("Left"); //bit 2
- if ($result['AFPointUsed'] & 0x0800) $afPointUsed[] = gettext("12"); //bit 12
- if ($result['AFPointUsed'] & 0x1000) $afPointUsed[] = gettext("13"); //bit 13
- if ($result['AFPointUsed'] & 0x2000) $afPointUsed[] = gettext("14"); //bit 14
- if ($result['AFPointUsed'] & 0x4000) $afPointUsed[] = gettext("15"); //bit 15
+ if ($result['AFPointUsed'] & 0x0001) $afPointUsed[] = (string) t("Right"); //bit 0
+ if ($result['AFPointUsed'] & 0x0002) $afPointUsed[] = (string) t("Center"); //bit 1
+ if ($result['AFPointUsed'] & 0x0004) $afPointUsed[] = (string) t("Left"); //bit 2
+ if ($result['AFPointUsed'] & 0x0800) $afPointUsed[] = (string) t("12"); //bit 12
+ if ($result['AFPointUsed'] & 0x1000) $afPointUsed[] = (string) t("13"); //bit 13
+ if ($result['AFPointUsed'] & 0x2000) $afPointUsed[] = (string) t("14"); //bit 14
+ if ($result['AFPointUsed'] & 0x4000) $afPointUsed[] = (string) t("15"); //bit 15
$result['AFPointUsed'] = implode(",", $afPointUsed);
$result['FlashBias']=intel2Moto(substr($data,$place,4));$place+=4;//15
switch($result['FlashBias']) {
@@ -315,7 +315,7 @@ function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
case '0030': $result['FlashBias'] = "1.5 EV"; break;
case '0034': $result['FlashBias'] = "1.67 EV"; break;
case '0040': $result['FlashBias'] = "2 EV"; break;
- default: $result['FlashBias'] = gettext("Unknown");
+ default: $result['FlashBias'] = (string) t("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
diff --git a/modules/exif/lib/makers/fujifilm.php b/modules/exif/lib/makers/fujifilm.php
index 53f8dfb7..a88e51c3 100644
--- a/modules/exif/lib/makers/fujifilm.php
+++ b/modules/exif/lib/makers/fujifilm.php
@@ -84,89 +84,89 @@ function formatFujifilmData($type,$tag,$intel,$data) {
$data=hexdec($data);
if($tag=="1001") { //Sharpness
- if($data == 1) $data = gettext("Soft");
- else if($data == 2) $data = gettext("Soft");
- else if($data == 3) $data = gettext("Normal");
- else if($data == 4) $data = gettext("Hard");
- else if($data == 5) $data = gettext("Hard");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 1) $data = (string) t("Soft");
+ else if($data == 2) $data = (string) t("Soft");
+ else if($data == 3) $data = (string) t("Normal");
+ else if($data == 4) $data = (string) t("Hard");
+ else if($data == 5) $data = (string) t("Hard");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="1002") { //WhiteBalance
- if($data == 0) $data = gettext("Auto");
- else if($data == 256) $data = gettext("Daylight");
- else if($data == 512) $data = gettext("Cloudy");
- else if($data == 768) $data = gettext("DaylightColor-fluorescence");
- else if($data == 769) $data = gettext("DaywhiteColor-fluorescence");
- else if($data == 770) $data = gettext("White-fluorescence");
- else if($data == 1024) $data = gettext("Incandescence");
- else if($data == 3840) $data = gettext("Custom");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Auto");
+ else if($data == 256) $data = (string) t("Daylight");
+ else if($data == 512) $data = (string) t("Cloudy");
+ else if($data == 768) $data = (string) t("DaylightColor-fluorescence");
+ else if($data == 769) $data = (string) t("DaywhiteColor-fluorescence");
+ else if($data == 770) $data = (string) t("White-fluorescence");
+ else if($data == 1024) $data = (string) t("Incandescence");
+ else if($data == 3840) $data = (string) t("Custom");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="1003") { //Color
- if($data == 0) $data = gettext("Chroma Saturation Normal(STD)");
- else if($data == 256) $data = gettext("Chroma Saturation High");
- else if($data == 512) $data = gettext("Chroma Saturation Low(ORG)");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Chroma Saturation Normal(STD)");
+ else if($data == 256) $data = (string) t("Chroma Saturation High");
+ else if($data == 512) $data = (string) t("Chroma Saturation Low(ORG)");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1004") { //Tone
- if($data == 0) $data = gettext("Contrast Normal(STD)");
- else if($data == 256) $data = gettext("Contrast High(HARD)");
- else if($data == 512) $data = gettext("Contrast Low(ORG)");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Contrast Normal(STD)");
+ else if($data == 256) $data = (string) t("Contrast High(HARD)");
+ else if($data == 512) $data = (string) t("Contrast Low(ORG)");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1010") { //FlashMode
- if($data == 0) $data = gettext("Auto");
- else if($data == 1) $data = gettext("On");
- else if($data == 2) $data = gettext("Off");
- else if($data == 3) $data = gettext("Red-Eye Reduction");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Auto");
+ else if($data == 1) $data = (string) t("On");
+ else if($data == 2) $data = (string) t("Off");
+ else if($data == 3) $data = (string) t("Red-Eye Reduction");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1020") { //Macro
- if($data == 0) $data = gettext("Off");
- else if($data == 1) $data = gettext("On");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Off");
+ else if($data == 1) $data = (string) t("On");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1021") { //FocusMode
- if($data == 0) $data = gettext("Auto");
- else if($data == 1) $data = gettext("Manual");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Auto");
+ else if($data == 1) $data = (string) t("Manual");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1030") { //SlowSync
- if($data == 0) $data = gettext("Off");
- else if($data == 1) $data = gettext("On");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Off");
+ else if($data == 1) $data = (string) t("On");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1031") { //PictureMode
- if($data == 0) $data = gettext("Auto");
- else if($data == 1) $data = gettext("Portrait");
- else if($data == 2) $data = gettext("Landscape");
- else if($data == 4) $data = gettext("Sports");
- else if($data == 5) $data = gettext("Night");
- else if($data == 6) $data = gettext("Program AE");
- else if($data == 256) $data = gettext("Aperture Priority AE");
- else if($data == 512) $data = gettext("Shutter Priority");
- else if($data == 768) $data = gettext("Manual Exposure");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Auto");
+ else if($data == 1) $data = (string) t("Portrait");
+ else if($data == 2) $data = (string) t("Landscape");
+ else if($data == 4) $data = (string) t("Sports");
+ else if($data == 5) $data = (string) t("Night");
+ else if($data == 6) $data = (string) t("Program AE");
+ else if($data == 256) $data = (string) t("Aperture Priority AE");
+ else if($data == 512) $data = (string) t("Shutter Priority");
+ else if($data == 768) $data = (string) t("Manual Exposure");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1100") { //ContinuousTakingBracket
- if($data == 0) $data = gettext("Off");
- else if($data == 1) $data = gettext("On");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Off");
+ else if($data == 1) $data = (string) t("On");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1300") { //BlurWarning
- if($data == 0) $data = gettext("No Warning");
- else if($data == 1) $data = gettext("Warning");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("No Warning");
+ else if($data == 1) $data = (string) t("Warning");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1301") { //FocusWarning
- if($data == 0) $data = gettext("Auto Focus Good");
- else if($data == 1) $data = gettext("Out of Focus");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("Auto Focus Good");
+ else if($data == 1) $data = (string) t("Out of Focus");
+ else $data = (string) t("Unknown: ").$data;
}
if($tag=="1302") { //AEWarning
- if($data == 0) $data = gettext("AE Good");
- else if($data == 1) $data = gettext("Over Exposure");
- else $data = gettext("Unknown: ").$data;
+ if($data == 0) $data = (string) t("AE Good");
+ else if($data == 1) $data = (string) t("Over Exposure");
+ else $data = (string) t("Unknown: ").$data;
}
} else if($type=="UNDEFINED") {
diff --git a/modules/exif/lib/makers/nikon.php b/modules/exif/lib/makers/nikon.php
index c7d706db..ebc2af7c 100644
--- a/modules/exif/lib/makers/nikon.php
+++ b/modules/exif/lib/makers/nikon.php
@@ -42,7 +42,7 @@ function lookup_Nikon_tag($tag,$model) {
case "0008": $tag = "Focus";break;
case "0009": $tag = "Unknown2";break;
case "000a": $tag = "DigitalZoom";break;
- case "000b": $tag = gettext("Converter");break;
+ case "000b": $tag = (string) t("Converter");break;
default: $tag = "unknown:".$tag;break;
}
@@ -113,48 +113,48 @@ function formatNikonData($type,$tag,$intel,$model,$data) {
$data=hexdec($data);
if($tag=="0003" && $model==0) { //Quality
- if($data == 1) $data = gettext("VGA Basic");
- else if($data == 2) $data = gettext("VGA Normal");
- else if($data == 3) $data = gettext("VGA Fine");
- else if($data == 4) $data = gettext("SXGA Basic");
- else if($data == 5) $data = gettext("SXGA Normal");
- else if($data == 6) $data = gettext("SXGA Fine");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 1) $data = (string) t("VGA Basic");
+ else if($data == 2) $data = (string) t("VGA Normal");
+ else if($data == 3) $data = (string) t("VGA Fine");
+ else if($data == 4) $data = (string) t("SXGA Basic");
+ else if($data == 5) $data = (string) t("SXGA Normal");
+ else if($data == 6) $data = (string) t("SXGA Fine");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0004" && $model==0) { //Color
- if($data == 1) $data = gettext("Color");
- else if($data == 2) $data = gettext("Monochrome");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 1) $data = (string) t("Color");
+ else if($data == 2) $data = (string) t("Monochrome");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0005" && $model==0) { //Image Adjustment
- if($data == 0) $data = gettext("Normal");
- else if($data == 1) $data = gettext("Bright+");
- else if($data == 2) $data = gettext("Bright-");
- else if($data == 3) $data = gettext("Contrast+");
- else if($data == 4) $data = gettext("Contrast-");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Normal");
+ else if($data == 1) $data = (string) t("Bright+");
+ else if($data == 2) $data = (string) t("Bright-");
+ else if($data == 3) $data = (string) t("Contrast+");
+ else if($data == 4) $data = (string) t("Contrast-");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0006" && $model==0) { //CCD Sensitivity
if($data == 0) $data = "ISO-80";
else if($data == 2) $data = "ISO-160";
else if($data == 4) $data = "ISO-320";
else if($data == 5) $data = "ISO-100";
- else $data = gettext("Unknown").": ".$data;
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0007" && $model==0) { //White Balance
- if($data == 0) $data = gettext("Auto");
- else if($data == 1) $data = gettext("Preset");
- else if($data == 2) $data = gettext("Daylight");
- else if($data == 3) $data = gettext("Incandescense");
- else if($data == 4) $data = gettext("Flourescence");
- else if($data == 5) $data = gettext("Cloudy");
- else if($data == 6) $data = gettext("SpeedLight");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Auto");
+ else if($data == 1) $data = (string) t("Preset");
+ else if($data == 2) $data = (string) t("Daylight");
+ else if($data == 3) $data = (string) t("Incandescense");
+ else if($data == 4) $data = (string) t("Flourescence");
+ else if($data == 5) $data = (string) t("Cloudy");
+ else if($data == 6) $data = (string) t("SpeedLight");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="000b" && $model==0) { //Converter
- if($data == 0) $data = gettext("None");
- else if($data == 1) $data = gettext("Fisheye");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("None");
+ else if($data == 1) $data = (string) t("Fisheye");
+ else $data = (string) t("Unknown").": ".$data;
}
} else if($type=="UNDEFINED") {
@@ -162,7 +162,7 @@ function formatNikonData($type,$tag,$intel,$model,$data) {
$data=$data/100;
}
if($tag=="0088" && $model==1) { //AF Focus Position
- $temp = gettext("Center");
+ $temp = (string) t("Center");
$data = bin2hex($data);
$data = str_replace("01","Top",$data);
$data = str_replace("02","Bottom",$data);
@@ -178,20 +178,20 @@ function formatNikonData($type,$tag,$intel,$model,$data) {
if($tag=="0083" && $model==1) { //Lens Type
$data = hexdec(substr($data,0,2));
- if($data == 0) $data = gettext("AF non D");
- else if($data == 1) $data = gettext("Manual");
+ if($data == 0) $data = (string) t("AF non D");
+ else if($data == 1) $data = (string) t("Manual");
else if($data == 2) $data = "AF-D or AF-S";
else if($data == 6) $data = "AF-D G";
else if($data == 10) $data = "AF-D VR";
- else $data = gettext("Unknown").": ".$data;
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0087" && $model==1) { //Flash type
$data = hexdec(substr($data,0,2));
- if($data == 0) $data = gettext("Did Not Fire");
- else if($data == 4) $data = gettext("Unknown");
- else if($data == 7) $data = gettext("External");
- else if($data == 9) $data = gettext("On Camera");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Did Not Fire");
+ else if($data == 4) $data = (string) t("Unknown");
+ else if($data == 7) $data = (string) t("External");
+ else if($data == 9) $data = (string) t("On Camera");
+ else $data = (string) t("Unknown").": ".$data;
}
}
diff --git a/modules/exif/lib/makers/olympus.php b/modules/exif/lib/makers/olympus.php
index 3f254570..17334bd8 100644
--- a/modules/exif/lib/makers/olympus.php
+++ b/modules/exif/lib/makers/olympus.php
@@ -80,12 +80,12 @@ function formatOlympusData($type,$tag,$intel,$data) {
if($data == 1) $data = "SQ";
else if($data == 2) $data = "HQ";
else if($data == 3) $data = "SHQ";
- else $data = gettext("Unknown").": ".$data;
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0202") { //Macro
if($data == 0) $data = "Normal";
else if($data == 1) $data = "Macro";
- else $data = gettext("Unknown").": ".$data;
+ else $data = (string) t("Unknown").": ".$data;
}
} else if($type=="UNDEFINED") {
diff --git a/modules/exif/lib/makers/panasonic.php b/modules/exif/lib/makers/panasonic.php
index c56707e6..d82d374d 100644
--- a/modules/exif/lib/makers/panasonic.php
+++ b/modules/exif/lib/makers/panasonic.php
@@ -77,10 +77,10 @@ function formatPanasonicData($type,$tag,$intel,$data) {
if($tag=="000f") { //AFMode
if($data == 256) $data = "9-area-focusing";
else if($data == 16) $data = "1-area-focusing";
- else if($data == 4096) $data = gettext("3-area-focusing (High speed)");
- else if($data == 4112) $data = gettext("1-area-focusing (High speed)");
- else if($data == 16) $data = gettext("1-area-focusing");
- else if($data == 1) $data = gettext("Spot-focusing");
+ else if($data == 4096) $data = (string) t("3-area-focusing (High speed)");
+ else if($data == 4112) $data = (string) t("1-area-focusing (High speed)");
+ else if($data == 16) $data = (string) t("1-area-focusing");
+ else if($data == 1) $data = (string) t("Spot-focusing");
else $data = "Unknown (".$data.")";
}
@@ -99,69 +99,69 @@ function formatPanasonicData($type,$tag,$intel,$data) {
$data=hexdec($data);
if($tag=="0001") { //Image Quality
- if($data == 2) $data = gettext("High");
- else if($data == 3) $data = gettext("Standard");
- else if($data == 6) $data = gettext("Very High");
- else if($data == 7) $data = gettext("RAW");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 2) $data = (string) t("High");
+ else if($data == 3) $data = (string) t("Standard");
+ else if($data == 6) $data = (string) t("Very High");
+ else if($data == 7) $data = (string) t("RAW");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0003") { //White Balance
- if($data == 1) $data = gettext("Auto");
- else if($data == 2) $data = gettext("Daylight");
- else if($data == 3) $data = gettext("Cloudy");
- else if($data == 4) $data = gettext("Halogen");
- else if($data == 5) $data = gettext("Manual");
- else if($data == 8) $data = gettext("Flash");
- else if($data == 10) $data = gettext("Black and White");
- else if($data == 11) $data = gettext("Manual");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Auto");
+ else if($data == 2) $data = (string) t("Daylight");
+ else if($data == 3) $data = (string) t("Cloudy");
+ else if($data == 4) $data = (string) t("Halogen");
+ else if($data == 5) $data = (string) t("Manual");
+ else if($data == 8) $data = (string) t("Flash");
+ else if($data == 10) $data = (string) t("Black and White");
+ else if($data == 11) $data = (string) t("Manual");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0007") { //Focus Mode
- if($data == 1) $data = gettext("Auto");
- else if($data == 2) $data = gettext("Manual");
- else if($data == 4) $data = gettext("Auto, Focus button");
- else if($data == 5) $data = gettext("Auto, Continuous");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Auto");
+ else if($data == 2) $data = (string) t("Manual");
+ else if($data == 4) $data = (string) t("Auto, Focus button");
+ else if($data == 5) $data = (string) t("Auto, Continuous");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="001a") { //Image Stabilizer
- if($data == 2) $data = gettext("Mode 1");
- else if($data == 3) $data = gettext("Off");
- else if($data == 4) $data = gettext("Mode 2");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 2) $data = (string) t("Mode 1");
+ else if($data == 3) $data = (string) t("Off");
+ else if($data == 4) $data = (string) t("Mode 2");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="001c") { //Macro mode
- if($data == 1) $data = gettext("On");
- else if($data == 2) $data = gettext("Off");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("On");
+ else if($data == 2) $data = (string) t("Off");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="001f") { //Shooting Mode
- if($data == 1) $data = gettext("Normal");
- else if($data == 2) $data = gettext("Portrait");
- else if($data == 3) $data = gettext("Scenery");
- else if($data == 4) $data = gettext("Sports");
- else if($data == 5) $data = gettext("Night Portrait");
- else if($data == 6) $data = gettext("Program");
- else if($data == 7) $data = gettext("Aperture Priority");
- else if($data == 8) $data = gettext("Shutter Priority");
- else if($data == 9) $data = gettext("Macro");
- else if($data == 11) $data = gettext("Manual");
- else if($data == 13) $data = gettext("Panning");
- else if($data == 14) $data = gettext("Simple");
- else if($data == 18) $data = gettext("Fireworks");
- else if($data == 19) $data = gettext("Party");
- else if($data == 20) $data = gettext("Snow");
- else if($data == 21) $data = gettext("Night Scenery");
- else if($data == 22) $data = gettext("Food");
- else if($data == 23) $data = gettext("Baby");
- else if($data == 27) $data = gettext("High Sensitivity");
- else if($data == 29) $data = gettext("Underwater");
- else if($data == 33) $data = gettext("Pet");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Normal");
+ else if($data == 2) $data = (string) t("Portrait");
+ else if($data == 3) $data = (string) t("Scenery");
+ else if($data == 4) $data = (string) t("Sports");
+ else if($data == 5) $data = (string) t("Night Portrait");
+ else if($data == 6) $data = (string) t("Program");
+ else if($data == 7) $data = (string) t("Aperture Priority");
+ else if($data == 8) $data = (string) t("Shutter Priority");
+ else if($data == 9) $data = (string) t("Macro");
+ else if($data == 11) $data = (string) t("Manual");
+ else if($data == 13) $data = (string) t("Panning");
+ else if($data == 14) $data = (string) t("Simple");
+ else if($data == 18) $data = (string) t("Fireworks");
+ else if($data == 19) $data = (string) t("Party");
+ else if($data == 20) $data = (string) t("Snow");
+ else if($data == 21) $data = (string) t("Night Scenery");
+ else if($data == 22) $data = (string) t("Food");
+ else if($data == 23) $data = (string) t("Baby");
+ else if($data == 27) $data = (string) t("High Sensitivity");
+ else if($data == 29) $data = (string) t("Underwater");
+ else if($data == 33) $data = (string) t("Pet");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0020") { //Audio
- if($data == 1) $data = gettext("Yes");
- else if($data == 2) $data = gettext("No");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Yes");
+ else if($data == 2) $data = (string) t("No");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0023") { //White Balance Bias
$data=$data." EV";
@@ -170,47 +170,47 @@ function formatPanasonicData($type,$tag,$intel,$data) {
$data = $data;
}
if($tag=="0028") { //Colour Effect
- if($data == 1) $data = gettext("Off");
- else if($data == 2) $data = gettext("Warm");
- else if($data == 3) $data = gettext("Cool");
- else if($data == 4) $data = gettext("Black and White");
- else if($data == 5) $data = gettext("Sepia");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Off");
+ else if($data == 2) $data = (string) t("Warm");
+ else if($data == 3) $data = (string) t("Cool");
+ else if($data == 4) $data = (string) t("Black and White");
+ else if($data == 5) $data = (string) t("Sepia");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="002a") { //Burst Mode
- if($data == 0) $data = gettext("Off");
- else if($data == 1) $data = gettext("Low/High Quality");
- else if($data == 2) $data = gettext("Infinite");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 0) $data = (string) t("Off");
+ else if($data == 1) $data = (string) t("Low/High Quality");
+ else if($data == 2) $data = (string) t("Infinite");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="002c") { //Contrast
- if($data == 0) $data = gettext("Standard");
- else if($data == 1) $data = gettext("Low");
- else if($data == 2) $data = gettext("High");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 0) $data = (string) t("Standard");
+ else if($data == 1) $data = (string) t("Low");
+ else if($data == 2) $data = (string) t("High");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="002d") { //Noise Reduction
- if($data == 0) $data = gettext("Standard");
- else if($data == 1) $data = gettext("Low");
- else if($data == 2) $data = gettext("High");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 0) $data = (string) t("Standard");
+ else if($data == 1) $data = (string) t("Low");
+ else if($data == 2) $data = (string) t("High");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="002e") { //Self Timer
- if($data == 1) $data = gettext("Off");
- else if($data == 2) $data = gettext("10s");
- else if($data == 3) $data = gettext("2s");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Off");
+ else if($data == 2) $data = (string) t("10s");
+ else if($data == 3) $data = (string) t("2s");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0030") { //Rotation
- if($data == 1) $data = gettext("Horizontal (normal)");
- else if($data == 6) $data = gettext("Rotate 90 CW");
- else if($data == 8) $data = gettext("Rotate 270 CW");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 1) $data = (string) t("Horizontal (normal)");
+ else if($data == 6) $data = (string) t("Rotate 90 CW");
+ else if($data == 8) $data = (string) t("Rotate 270 CW");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0032") { //Color Mode
- if($data == 0) $data = gettext("Normal");
- else if($data == 1) $data = gettext("Natural");
- else $data = gettext("Unknown")." (".$data.")";
+ if($data == 0) $data = (string) t("Normal");
+ else if($data == 1) $data = (string) t("Natural");
+ else $data = (string) t("Unknown")." (".$data.")";
}
if($tag=="0036") { //Travel Day
$data=$data;
diff --git a/modules/exif/lib/makers/sanyo.php b/modules/exif/lib/makers/sanyo.php
index f8887970..661741dd 100644
--- a/modules/exif/lib/makers/sanyo.php
+++ b/modules/exif/lib/makers/sanyo.php
@@ -69,16 +69,16 @@ function formatSanyoData($type,$tag,$intel,$data) {
$data=hexdec($data);
if($tag=="0200") { //SpecialMode
- if($data == 0) $data = gettext("Normal");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Normal");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0201") { //Quality
- if($data == 2) $data = gettext("High");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 2) $data = (string) t("High");
+ else $data = (string) t("Unknown").": ".$data;
}
if($tag=="0202") { //Macro
- if($data == 0) $data = gettext("Normal");
- else $data = gettext("Unknown").": ".$data;
+ if($data == 0) $data = (string) t("Normal");
+ else $data = (string) t("Unknown").": ".$data;
}
} else if($type=="UNDEFINED") {
diff --git a/modules/exif/views/exif_dialog.html.php b/modules/exif/views/exif_dialog.html.php
index 11d1e212..22744e2d 100644
--- a/modules/exif/views/exif_dialog.html.php
+++ b/modules/exif/views/exif_dialog.html.php
@@ -1,30 +1,30 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<style>
- #gExifData {font-size: .85em;}
- .gOdd {background: #BDD2FF;}
- .gEven {background: #DFEFFC;}
+<style type="text/css">
+ #g-exif-data { font-size: .85em; }
+ .g-odd { background: #bdd2ff; }
+ .g-even { background: #dfeffc; }
</style>
-<h1 style="display: none;"><?= t("Photo Detail") ?></h1>
-<div id="gExifData">
- <table class="gMetadata" >
+<h1 style="display: none;"><?= t("Photo detail") ?></h1>
+<div id="g-exif-data">
+ <table class="g-metadata" >
<tbody>
<? for ($i = 0; $i < count($details); $i++): ?>
<tr>
- <td class="gEven">
+ <td class="g-even">
<?= $details[$i]["caption"] ?>
</td>
- <td class="gOdd">
+ <td class="g-odd">
<?= html::clean($details[$i]["value"]) ?>
</td>
<? if (!empty($details[++$i])): ?>
- <td class="gEven">
+ <td class="g-even">
<?= $details[$i]["caption"] ?>
</td>
- <td class="gOdd">
+ <td class="g-odd">
<?= html::clean($details[$i]["value"]) ?>
</td>
<? else: ?>
- <td class="gEven"></td><td class="gOdd"></td>
+ <td class="g-even"></td><td class="g-odd"></td>
<? endif ?>
</tr>
<? endfor ?>
diff --git a/modules/exif/views/exif_sidebar.html.php b/modules/exif/views/exif_sidebar.html.php
index 60c0e1d4..8af2eb12 100644
--- a/modules/exif/views/exif_sidebar.html.php
+++ b/modules/exif/views/exif_sidebar.html.php
@@ -1,7 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<a id="gExifDataLink" href="<?= url::site("exif/show/{$item->id}") ?>" title="<?= t("Photo Details")->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
+<a id="g-exif-data-link" href="<?= url::site("exif/show/{$item->id}") ?>" title="<?= t("Photo details")->for_html_attr() ?>"
+ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all">
<span class="ui-icon ui-icon-info"></span>
<?= t("View more information") ?>
</a>
-
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 18d09363..1c65f482 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -68,7 +68,7 @@ class Admin_g2_import_Controller extends Admin_Controller {
private function _get_import_form() {
$form = new Forge(
- "admin/g2_import/save", "", "post", array("id" => "gAdminConfigureG2ImportForm"));
+ "admin/g2_import/save", "", "post", array("id" => "g-admin-configure-g2-import-form"));
$group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import"));
$group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file"))
->value(module::get_var("g2_import", "embed_path", ""));
diff --git a/modules/g2_import/css/g2_import.css b/modules/g2_import/css/g2_import.css
new file mode 100644
index 00000000..d53564d7
--- /dev/null
+++ b/modules/g2_import/css/g2_import.css
@@ -0,0 +1,30 @@
+#g-admin-g2-import-notes {
+ padding-bottom: 20px;
+}
+
+#g-admin-g2-import-details {
+ padding-top: 20px;
+}
+
+#g-admin-g2-import-details .g-warning {
+ margin-top: 4px;
+}
+
+#g-admin-g2-import-details .g-info {
+ padding: 2px;
+ border: 1px solid #999;
+ margin-bottom: 10px;
+}
+
+#g-admin-g2-import-notes p,
+#g-admin-g2-import-details .g-info p {
+ padding: 0;
+ margin: 0;
+}
+
+#g-admin-g2-import-notes ul li,
+#g-admin-g2-import .g-info ul li {
+ padding-left: 0;
+ margin-left: 20px;
+ list-style-type: disc;
+}
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 7e5c6f75..202a0e92 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -217,7 +217,7 @@ class g2_import_Core {
static function import_group(&$queue) {
$g2_group_id = array_shift($queue);
if (self::map($g2_group_id)) {
- return t("Group with id: %id already imported, skipping", array("id" => $g2_group_id));
+ return;
}
try {
@@ -230,16 +230,16 @@ class g2_import_Core {
switch ($g2_group->getGroupType()) {
case GROUP_NORMAL:
try {
- $group = group::create($g2_group->getGroupName());
+ $group = identity::create_group($g2_group->getGroupName());
} catch (Exception $e) {
// @todo For now we assume this is a "duplicate group" exception
- $group = group::lookup_by_name($g2_group->getGroupname());
+ $group = identity::lookup_user_by_name($g2_group->getGroupname());
}
$message = t("Group '%name' was imported", array("name" => $g2_group->getGroupname()));
break;
case GROUP_ALL_USERS:
- $group = group::registered_users();
+ $group = identity::registered_users();
$message = t("Group 'Registered' was converted to '%name'", array("name" => $group->name));
break;
@@ -248,7 +248,7 @@ class g2_import_Core {
break; // This is not a group in G3
case GROUP_EVERYBODY:
- $group = group::everybody();
+ $group = identity::everybody();
$message = t("Group 'Everybody' was converted to '%name'", array("name" => $group->name));
break;
}
@@ -270,8 +270,8 @@ class g2_import_Core {
}
if (g2(GalleryCoreApi::isAnonymousUser($g2_user_id))) {
- self::set_map($g2_user_id, user::guest()->id);
- return t("Skipping Anonymous User");
+ self::set_map($g2_user_id, identity::guest()->id);
+ return t("Skipping anonymous user");
}
$g2_admin_group_id =
@@ -285,11 +285,11 @@ class g2_import_Core {
$g2_groups = g2(GalleryCoreApi::fetchGroupsForUser($g2_user->getId()));
try {
- $user = user::create($g2_user->getUsername(), $g2_user->getfullname(), "");
+ $user = identity::create_user($g2_user->getUsername(), $g2_user->getfullname(), "");
$message = t("Created user: '%name'.", array("name" => $user->name));
} catch (Exception $e) {
// @todo For now we assume this is a "duplicate user" exception
- $user = user::lookup_by_name($g2_user->getUsername());
+ $user = identity::lookup_user_by_name($g2_user->getUsername());
$message = t("Loaded existing user: '%name'.", array("name" => $user->name));
}
@@ -301,7 +301,7 @@ class g2_import_Core {
$user->admin = true;
$message .= t("\n\tAdded 'admin' flag to user");
} else {
- $group = ORM::factory("group", self::map($g2_group_id));
+ $group = identity::lookup_group(self::map($g2_group_id));
$user->add($group);
$message .= t("\n\tAdded user to group '%group'.", array("group" => $group->name));
}
@@ -313,7 +313,6 @@ class g2_import_Core {
return $message;
}
-
/**
* Import a single album.
*/
@@ -331,7 +330,7 @@ class g2_import_Core {
}
if (self::map($g2_album_id)) {
- return t("Album with id: %id already imported, skipping", array("id" => $g2_album_id));
+ return;
}
try {
@@ -425,7 +424,7 @@ class g2_import_Core {
$g2_item_id = array_shift($queue);
if (self::map($g2_item_id)) {
- return t("Item with id: %id already imported, skipping", array("id" => $g2_item_id));
+ return;
}
try {
diff --git a/modules/g2_import/helpers/g2_import_theme.php b/modules/g2_import/helpers/g2_import_theme.php
new file mode 100644
index 00000000..b1aaac00
--- /dev/null
+++ b/modules/g2_import/helpers/g2_import_theme.php
@@ -0,0 +1,28 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class g2_import_theme_Core {
+ static function head($theme) {
+ $theme->css("g2_import.css");
+ }
+
+ static function admin_head($theme) {
+ $theme->css("g2_import.css");
+ }
+} \ No newline at end of file
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 23ff27a8..b2665a5f 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -1,94 +1,96 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminG2Import">
- <h1> <?= t("Gallery 2 Import") ?> </h1>
+<div id="g-admin-g2-import" class="g-block">
+ <h1> <?= t("Gallery 2 import") ?> </h1>
<p>
<?= t("Import your Gallery 2 users, photos, movies, comments and tags into your new Gallery 3 installation.") ?>
</p>
- <div id="gAdminG2ImportNotes">
- <h2> <?= t("Notes") ?> </h2>
- <p>
- <?= t("The import process is a work in progress with some known issues:") ?>
- </p>
- <ul>
- <li>
- <?= t("Permissions are <b>not imported</b>. You will have to set them again manually (for now).") ?>
- </li>
- <li>
- <?= t("The only supported image formats are JPG, PNG and GIF. Other formats will be skipped.") ?>
- </li>
- <li>
- <?= t("The only supported movie formats are FLV and MP4. Other formats will be skipped.") ?>
- </li>
- <li>
- <?= t("The eAccelerator PHP performance extension is known to cause issues. If you're using eAccelerator and having problems, please disable it while you do your import. One way to do that is to put <code>php_value eaccelerator.enable 0</code> in gallery3/.htaccess") ?>
- </li>
- </ul>
- </div>
- <?= $form ?>
-
- <? if (g2_import::is_initialized()): ?>
- <div id="gAdminG2ImportDetails">
- <h2> <?= t("Import") ?> </h2>
- <ul id="gMessage">
- <li class="gSuccess">
- <?= t("Gallery version %version detected", array("version" => g2_import::version())) ?>
- </li>
- <? if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]): ?>
- <li class="gWarning">
- <?= t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
- array("g2_pixels" => $g2_sizes["thumb"]["size"],
- "g3_pixels" => $thumb_size,
- "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
- </li>
- <? endif ?>
-
- <? if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]): ?>
- <li class="gWarning">
- <?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
- array("g2_pixels" => $g2_sizes["resize"]["size"],
- "g3_pixels" => $resize_size,
- "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
- </li>
- <? endif ?>
- </ul>
-
- <div class="gInfo">
+ <div class="g-block-content">
+ <div id="g-admin-g2-import-notes">
+ <h2> <?= t("Notes") ?> </h2>
<p>
- <?= t("Your Gallery 2 has the following importable data in it") ?>
+ <?= t("The import process is a work in progress with some known issues:") ?>
</p>
<ul>
<li>
- <?= t2("1 user", "%count users", $g2_stats["users"]) ?>
+ <?= t("Permissions are <b>not imported</b>. You will have to set them again manually (for now).") ?>
</li>
<li>
- <?= t2("1 group", "%count groups", $g2_stats["groups"]) ?>
+ <?= t("The only supported image formats are JPG, PNG and GIF. Other formats will be skipped.") ?>
</li>
<li>
- <?= t2("1 album", "%count albums", $g2_stats["albums"]) ?>
+ <?= t("The only supported movie formats are FLV and MP4. Other formats will be skipped.") ?>
</li>
<li>
- <?= t2("1 photo", "%count photos", $g2_stats["photos"]) ?>
+ <?= t("The eAccelerator PHP performance extension is known to cause issues. If you're using eAccelerator and having problems, please disable it while you do your import. One way to do that is to put <code>php_value eaccelerator.enable 0</code> in gallery3/.htaccess") ?>
</li>
- <li>
- <?= t2("1 movie", "%count movies", $g2_stats["movies"]) ?>
+ </ul>
+ </div>
+ <?= $form ?>
+
+ <? if (g2_import::is_initialized()): ?>
+ <div id="g-admin-g2-import-details">
+ <h2> <?= t("Import") ?> </h2>
+ <ul id="g-action-status" class="g-message-block">
+ <li class="g-success">
+ <?= t("Gallery version %version detected", array("version" => g2_import::version())) ?>
</li>
- <li>
- <?= t2("1 comment", "%count comments", $g2_stats["comments"]) ?>
+ <? if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]): ?>
+ <li class="g-warning">
+ <?= t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
+ array("g2_pixels" => $g2_sizes["thumb"]["size"],
+ "g3_pixels" => $thumb_size,
+ "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
</li>
- <li>
- <?= t2("1 tagged photo/movie/album",
- "%count tagged photos/movies/albums", $g2_stats["tags"]) ?>
+ <? endif ?>
+
+ <? if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]): ?>
+ <li class="g-warning">
+ <?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
+ array("g2_pixels" => $g2_sizes["resize"]["size"],
+ "g3_pixels" => $resize_size,
+ "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
</li>
+ <? endif ?>
</ul>
- </div>
- <p>
- <a class="gButtonLink gDialogLink ui-state-default ui-corner-all"
- href="<?= url::site("admin/maintenance/start/g2_import_task::import?csrf=$csrf") ?>">
- <?= t("Begin import!") ?>
- </a>
- </p>
+ <div class="g-info">
+ <p>
+ <?= t("Your Gallery 2 has the following importable data in it") ?>
+ </p>
+ <ul>
+ <li>
+ <?= t2("1 user", "%count users", $g2_stats["users"]) ?>
+ </li>
+ <li>
+ <?= t2("1 group", "%count groups", $g2_stats["groups"]) ?>
+ </li>
+ <li>
+ <?= t2("1 album", "%count albums", $g2_stats["albums"]) ?>
+ </li>
+ <li>
+ <?= t2("1 photo", "%count photos", $g2_stats["photos"]) ?>
+ </li>
+ <li>
+ <?= t2("1 movie", "%count movies", $g2_stats["movies"]) ?>
+ </li>
+ <li>
+ <?= t2("1 comment", "%count comments", $g2_stats["comments"]) ?>
+ </li>
+ <li>
+ <?= t2("1 tagged photo/movie/album",
+ "%count tagged photos/movies/albums", $g2_stats["tags"]) ?>
+ </li>
+ </ul>
+ </div>
+
+ <p>
+ <a class="g-button g-dialog-link ui-state-default ui-corner-all"
+ href="<?= url::site("admin/maintenance/start/g2_import_task::import?csrf=$csrf") ?>">
+ <?= t("Begin import!") ?>
+ </a>
+ </p>
+ </div>
+ <? endif ?>
</div>
- <? endif ?>
</div>
diff --git a/modules/gallery/config/upload.php b/modules/gallery/config/upload.php
index 897ecacf..69ea7768 100644
--- a/modules/gallery/config/upload.php
+++ b/modules/gallery/config/upload.php
@@ -33,4 +33,4 @@ $config['create_directories'] = FALSE;
/**
* Remove spaces from uploaded filenames.
*/
-$config['remove_spaces'] = TRUE; \ No newline at end of file
+$config['remove_spaces'] = FALSE; \ No newline at end of file
diff --git a/modules/gallery/controllers/admin.php b/modules/gallery/controllers/admin.php
index b92a32cd..98cac557 100644
--- a/modules/gallery/controllers/admin.php
+++ b/modules/gallery/controllers/admin.php
@@ -21,7 +21,7 @@ class Admin_Controller extends Controller {
private $theme;
public function __construct($theme=null) {
- if (!(user::active()->admin)) {
+ if (!(identity::active_user()->admin)) {
access::forbidden();
}
diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php
index 3cb97b14..7e28f625 100644
--- a/modules/gallery/controllers/admin_dashboard.php
+++ b/modules/gallery/controllers/admin_dashboard.php
@@ -22,7 +22,7 @@ class Admin_Dashboard_Controller extends Admin_Controller {
$view = new Admin_View("admin.html");
$view->content = new View("admin_dashboard.html");
$view->content->blocks = block_manager::get_html("dashboard_center");
- $view->sidebar = "<div id=\"gAdminDashboardSidebar\">" .
+ $view->sidebar = "<div id=\"g-admin-dashboard-sidebar\">" .
block_manager::get_html("dashboard_sidebar") .
"</div>";
print $view;
@@ -34,7 +34,7 @@ class Admin_Dashboard_Controller extends Admin_Controller {
$form = gallery_block::get_add_block_form();
if ($form->validate()) {
list ($module_name, $id) = explode(":", $form->add_block->id->value);
- $available = block_manager::get_available();
+ $available = block_manager::get_available_admin_blocks();
if ($form->add_block->center->value) {
block_manager::add("dashboard_center", $module_name, $id);
@@ -66,7 +66,7 @@ class Admin_Dashboard_Controller extends Admin_Controller {
}
if (!empty($deleted)) {
- $available = block_manager::get_available();
+ $available = block_manager::get_available_admin_blocks();
$title = $available[join(":", $deleted)];
message::success(t("Removed <b>%title</b> block", array("title" => $title)));
}
diff --git a/modules/gallery/controllers/admin_identity.php b/modules/gallery/controllers/admin_identity.php
new file mode 100644
index 00000000..acf71665
--- /dev/null
+++ b/modules/gallery/controllers/admin_identity.php
@@ -0,0 +1,76 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class Admin_Identity_Controller extends Admin_Controller {
+ public function index() {
+ $view = new Admin_View("admin.html");
+ $view->content = new View("admin_identity.html");
+ $view->content->available = identity::providers();
+ $view->content->active = module::get_var("gallery", "identity_provider", "user");
+ print $view;
+ }
+
+ public function confirm() {
+ access::verify_csrf();
+
+ $v = new View("admin_identity_confirm.html");
+ $v->new_provider = $this->input->post("provider");
+
+ print $v;
+ }
+
+ public function change() {
+ access::verify_csrf();
+
+ $active_provider = module::get_var("gallery", "identity_provider", "user");
+ $providers = identity::providers();
+ $new_provider = $this->input->post("provider");
+
+ if ($new_provider != $active_provider) {
+
+ module::deactivate($active_provider);
+
+ // Switch authentication
+ identity::reset();
+ module::set_var("gallery", "identity_provider", $new_provider);
+
+ module::install($new_provider);
+ module::activate($new_provider);
+
+ module::event("identity_provider_changed", $active_provider, $new_provider);
+
+ module::uninstall($active_provider);
+
+ message::success(t("Changed to %description",
+ array("description" => $providers->$new_provider)));
+
+ try {
+ Session::instance()->destroy();
+ } catch (Exception $e) {
+ // We don't care if there was a problem destroying the session.
+ }
+ url::redirect(item::root()->abs_url());
+ }
+
+ message::info(t("The selected provider \"%description\" is already active.",
+ array("description" => $providers->$new_provider)));
+ url::redirect("admin/identity");
+ }
+}
+
diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php
index d91e5205..27537c7f 100644
--- a/modules/gallery/controllers/admin_languages.php
+++ b/modules/gallery/controllers/admin_languages.php
@@ -24,7 +24,7 @@ class Admin_Languages_Controller extends Admin_Controller {
$v->content->available_locales = locales::available();
$v->content->installed_locales = locales::installed();
$v->content->default_locale = module::get_var("gallery", "default_locale");
-
+
if (empty($share_translations_form)) {
$share_translations_form = $this->_share_translations_form();
}
@@ -35,21 +35,21 @@ class Admin_Languages_Controller extends Admin_Controller {
public function save() {
access::verify_csrf();
-
- locales::update_installed($this->input->post("installed_locales"));
-
- $installed_locales = array_keys(locales::installed());
+
+ locales::update_installed($this->input->post("installed_locales"));
+
+ $installed_locales = array_keys(locales::installed());
$new_default_locale = $this->input->post("default_locale");
- if (!in_array($new_default_locale, $installed_locales)) {
- if (!empty($installed_locales)) {
- $new_default_locale = $installed_locales[0];
- } else {
- $new_default_locale = "en_US";
- }
- }
- module::set_var("gallery", "default_locale", $new_default_locale);
-
- print json_encode(array("result" => "success"));
+ if (!in_array($new_default_locale, $installed_locales)) {
+ if (!empty($installed_locales)) {
+ $new_default_locale = $installed_locales[0];
+ } else {
+ $new_default_locale = "en_US";
+ }
+ }
+ module::set_var("gallery", "default_locale", $new_default_locale);
+
+ print json_encode(array("result" => "success"));
}
public function share() {
@@ -88,6 +88,8 @@ class Admin_Languages_Controller extends Admin_Controller {
message::success(t("Your API key has been changed."));
} else if (!$old_key && $new_key) {
message::success(t("Your API key has been saved."));
+ } else if ($old_key && $new_key && $old_key == $new_key) {
+ message::info(t("Your API key was not changed."));
}
log::success(t("gallery"), t("l10n_client API key changed."));
@@ -103,16 +105,17 @@ class Admin_Languages_Controller extends Admin_Controller {
}
private function _share_translations_form() {
- $form = new Forge("admin/languages/share", "", "post", array("id" => "gShareTranslationsForm"));
+ $form = new Forge("admin/languages/share", "", "post", array("id" => "g-share-translations-form"));
$group = $form->group("sharing")
->label(t("Sharing your own translations with the Gallery community is easy. Please do!"));
$api_key = l10n_client::api_key();
$server_link = l10n_client::server_api_key_url();
$group->input("api_key")
->label(empty($api_key)
- ? t("This is a unique key that will allow you to send translations to the remote server. To get your API key go to %server-link.",
+ ? t("This is a unique key that will allow you to send translations to the remote
+ server. To get your API key go to %server-link.",
array("server-link" => html::mark_clean(html::anchor($server_link))))
- : t("API Key"))
+ : t("API key"))
->value($api_key)
->error_messages("invalid", t("The API key you provided is invalid."));
$group->submit("save")->value(t("Save settings"));
diff --git a/modules/gallery/controllers/admin_sidebar.php b/modules/gallery/controllers/admin_sidebar.php
new file mode 100644
index 00000000..77e83bc2
--- /dev/null
+++ b/modules/gallery/controllers/admin_sidebar.php
@@ -0,0 +1,68 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class Admin_Sidebar_Controller extends Admin_Controller {
+ public function index() {
+ $view = new Admin_View("admin.html");
+ $view->content = new View("admin_sidebar.html");
+ $view->content->csrf = access::csrf_token();
+ $view->content->available = new View("admin_sidebar_blocks.html");
+ $view->content->active = new View("admin_sidebar_blocks.html");
+ list($view->content->available->blocks, $view->content->active->blocks) = $this->_get_blocks();
+ print $view;
+ }
+
+ public function update() {
+ access::verify_csrf();
+
+ $available_blocks = block_manager::get_available_site_blocks();
+
+ $active_blocks = array();
+ foreach ($this->input->get("block", array()) as $block_id) {
+ $active_blocks[md5($block_id)] = explode(":", (string) $block_id);
+ }
+ block_manager::set_active("site_sidebar", $active_blocks);
+
+ $result = array("result" => "success");
+ list($available, $active) = $this->_get_blocks();
+ $v = new View("admin_sidebar_blocks.html");
+ $v->blocks = $available;
+ $result["available"] = $v->render();
+ $v = new View("admin_sidebar_blocks.html");
+ $v->blocks = $active;
+ $result["active"] = $v->render();
+ $message = t("Updated sidebar blocks");
+ $result["message"] = (string) $message;
+ print json_encode($result);
+ }
+
+ private function _get_blocks() {
+ $active_blocks = array();
+ $available_blocks = block_manager::get_available_site_blocks();
+ foreach (block_manager::get_active("site_sidebar") as $block) {
+ $id = "{$block[0]}:{$block[1]}";
+ if (!empty($available_blocks[$id])) {
+ $active_blocks[$id] = $available_blocks[$id];
+ unset($available_blocks[$id]);
+ }
+ }
+ return array($available_blocks, $active_blocks);
+ }
+}
+
diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php
index 8970c3c9..27a67bdb 100644
--- a/modules/gallery/controllers/admin_theme_options.php
+++ b/modules/gallery/controllers/admin_theme_options.php
@@ -35,9 +35,9 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
$thumb_size = $form->edit_theme->thumb_size->value;
$thumb_dirty = false;
if (module::get_var("gallery", "thumb_size") != $thumb_size) {
- graphics::remove_rule("gallery", "thumb", "resize");
+ graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize");
graphics::add_rule(
- "gallery", "thumb", "resize",
+ "gallery", "thumb", "gallery_graphics::resize",
array("width" => $thumb_size, "height" => $thumb_size, "master" => Image::AUTO),
100);
module::set_var("gallery", "thumb_size", $thumb_size);
@@ -46,9 +46,9 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
$resize_size = $form->edit_theme->resize_size->value;
$resize_dirty = false;
if (module::get_var("gallery", "resize_size") != $resize_size) {
- graphics::remove_rule("gallery", "resize", "resize");
+ graphics::remove_rule("gallery", "resize", "gallery_graphics::resize");
graphics::add_rule(
- "gallery", "resize", "resize",
+ "gallery", "resize", "gallery_graphics::resize",
array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO),
100);
module::set_var("gallery", "resize_size", $resize_size);
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 08a60132..4e37649c 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -28,7 +28,8 @@ class Albums_Controller extends Items_Controller {
if ($album->id == 1) {
$view = new Theme_View("page.html", "login");
$view->page_title = t("Log in to Gallery");
- $view->content = user::get_login_form("login/auth_html");
+ $view->content = new View("login_ajax.html");
+ $view->content->form = auth::get_login_form("login/auth_html");
print $view;
return;
} else {
@@ -39,7 +40,8 @@ class Albums_Controller extends Items_Controller {
$show = $this->input->get("show");
if ($show) {
- $index = $album->get_position($show);
+ $child = ORM::factory("item", $show);
+ $index = $album->get_position($child);
if ($index) {
$page = ceil($index / $page_size);
if ($page == 1) {
@@ -63,6 +65,8 @@ class Albums_Controller extends Items_Controller {
}
$template = new Theme_View("page.html", "album");
+ $template->set_global("page", $page);
+ $template->set_global("max_pages", $max_pages);
$template->set_global("page_size", $page_size);
$template->set_global("item", $album);
$template->set_global("children", $album->viewable()->children($page_size, $offset));
@@ -109,7 +113,7 @@ class Albums_Controller extends Items_Controller {
$this->input->post("name"),
$this->input->post("title", $this->input->post("name")),
$this->input->post("description"),
- user::active()->id,
+ identity::active_user()->id,
$this->input->post("slug"));
log::success("content", "Created an album",
@@ -144,7 +148,7 @@ class Albums_Controller extends Items_Controller {
$_FILES["file"]["name"],
$this->input->post("title", $this->input->post("name")),
$this->input->post("description"),
- user::active()->id);
+ identity::active_user()->id);
log::success("content", "Added a photo", html::anchor("photos/$photo->id", "view photo"));
message::success(t("Added photo %photo_title",
@@ -198,6 +202,8 @@ class Albums_Controller extends Items_Controller {
}
if ($valid) {
+ $watching_album = $album->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH));
+
$album->title = $form->edit_item->title->value;
$album->description = $form->edit_item->description->value;
$album->sort_column = $form->edit_item->sort_order->column->value;
@@ -214,7 +220,8 @@ class Albums_Controller extends Items_Controller {
array("album_title" => html::purify($album->title))));
print json_encode(
- array("result" => "success"));
+ array("result" => "success",
+ "location" => $watching_album ? $location : $album->url()));
} else {
print json_encode(
array("result" => "error",
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 8cb90c50..acfd6eb9 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -32,10 +32,6 @@ class File_Proxy_Controller extends Controller {
$request_uri = $this->input->server("REQUEST_URI");
$request_uri = preg_replace("/\?.*/", "", $request_uri);
- // Unescape %7E (~), %20 ( ) and %27 (')
- // @todo: figure out why we have to do this and unescape everything appropriate
- $request_uri = str_replace(array("%7E", "%20", "%27"), array("~", " ", "'"), $request_uri);
-
// var_uri: http://example.com/gallery3/var/
$var_uri = url::file("var/");
diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php
index 6e19310b..6db67d3b 100644
--- a/modules/gallery/controllers/l10n_client.php
+++ b/modules/gallery/controllers/l10n_client.php
@@ -20,7 +20,7 @@
class L10n_Client_Controller extends Controller {
public function save() {
access::verify_csrf();
- if (!user::active()->admin) {
+ if (!identity::active_user()->admin) {
access::forbidden();
}
@@ -85,7 +85,7 @@ class L10n_Client_Controller extends Controller {
public function toggle_l10n_mode() {
access::verify_csrf();
- if (!user::active()->admin) {
+ if (!identity::active_user()->admin) {
access::forbidden();
}
@@ -102,9 +102,9 @@ class L10n_Client_Controller extends Controller {
}
private static function _l10n_client_search_form() {
- $form = new Forge("l10n_client/search", "", "post", array("id" => "gL10nSearchForm"));
+ $form = new Forge("l10n_client/search", "", "post", array("id" => "g-l10n-search-form"));
$group = $form->group("l10n_search");
- $group->input("l10n-search")->id("gL10nSearch");
+ $group->input("l10n-search")->id("g-l10n-search");
$group->submit("l10n-search-filter-clear")->value(t("X"));
return $form;
diff --git a/modules/user/controllers/login.php b/modules/gallery/controllers/login.php
index 8bee7db5..75ee6b9c 100644
--- a/modules/user/controllers/login.php
+++ b/modules/gallery/controllers/login.php
@@ -21,7 +21,7 @@ class Login_Controller extends Controller {
public function ajax() {
$view = new View("login_ajax.html");
- $view->form = user::get_login_form("login/auth_ajax");
+ $view->form = auth::get_login_form("login/auth_ajax");
print $view;
}
@@ -40,7 +40,7 @@ class Login_Controller extends Controller {
}
public function html() {
- print user::get_login_form("login/auth_html");
+ print auth::get_login_form("login/auth_html");
}
public function auth_html() {
@@ -55,11 +55,11 @@ class Login_Controller extends Controller {
}
private function _auth($url) {
- $form = user::get_login_form($url);
+ $form = auth::get_login_form($url);
$valid = $form->validate();
if ($valid) {
- $user = ORM::factory("user")->where("name", $form->login->inputs["name"]->value)->find();
- if (!$user->loaded || !user::is_correct_password($user, $form->login->password->value)) {
+ $user = identity::lookup_user_by_name($form->login->inputs["name"]->value);
+ if (empty($user) || !identity::is_correct_password($user, $form->login->password->value)) {
log::warning(
"user",
t("Failed login for %name",
@@ -70,8 +70,7 @@ class Login_Controller extends Controller {
}
if ($valid) {
- user::login($user);
- log::info("user", t("User %name logged in", array("name" => $user->name)));
+ auth::login($user);
}
// Either way, regenerate the session id to avoid session trapping
diff --git a/modules/user/controllers/logout.php b/modules/gallery/controllers/logout.php
index 45d397ad..2b93655d 100644
--- a/modules/user/controllers/logout.php
+++ b/modules/gallery/controllers/logout.php
@@ -19,12 +19,7 @@
*/
class Logout_Controller extends Controller {
public function index() {
- //access::verify_csrf();
-
- $user = user::active();
- user::logout();
- log::info("user", t("User %name logged out", array("name" => $user->name)),
- html::anchor("user/$user->id", html::clean($user->name)));
+ auth::logout();
if ($continue_url = $this->input->get("continue")) {
$item = url::get_item_from_uri($continue_url);
if (access::can("view", $item)) {
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index 04e15315..5e78376b 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -22,42 +22,33 @@ class Movies_Controller extends Items_Controller {
/**
* @see REST_Controller::_show($resource)
*/
- public function _show($photo) {
- access::required("view", $photo);
+ public function _show($movie) {
+ access::required("view", $movie);
- // We sort by id ascending so for now, find sibling info by doing id based queries.
- $next_item = ORM::factory("item")
- ->viewable()
- ->where("parent_id", $photo->parent_id)
- ->where("id >", $photo->id)
- ->orderby("id", "ASC")
- ->find();
- $previous_item = ORM::factory("item")
- ->viewable()
- ->where("parent_id", $photo->parent_id)
- ->where("id <", $photo->id)
- ->orderby("id", "DESC")
- ->find();
- $position = ORM::factory("item")
- ->viewable()
- ->where("parent_id", $photo->parent_id)
- ->where("id <=", $photo->id)
- ->count_all();
+ $where = array("type != " => "album");
+ $position = $movie->parent()->get_position($movie, $where);
+ if ($position > 1) {
+ list ($previous_item, $ignore, $next_item) =
+ $movie->parent()->children(3, $position - 2, $where);
+ } else {
+ $previous_item = null;
+ list ($next_item) = $movie->parent()->viewable()->children(1, $position, $where);
+ }
$template = new Theme_View("page.html", "movie");
- $template->set_global("item", $photo);
+ $template->set_global("item", $movie);
$template->set_global("children", array());
- $template->set_global("children_count", $photo->children_count());
- $template->set_global("parents", $photo->parents());
- $template->set_global("next_item", $next_item->loaded ? $next_item : null);
- $template->set_global("previous_item", $previous_item->loaded ? $previous_item : null);
- $template->set_global("sibling_count", $photo->parent()->children_count());
+ $template->set_global("children_count", 0);
+ $template->set_global("parents", $movie->parents());
+ $template->set_global("next_item", $next_item);
+ $template->set_global("previous_item", $previous_item);
+ $template->set_global("sibling_count", $movie->parent()->viewable()->children_count($where));
$template->set_global("position", $position);
$template->content = new View("movie.html");
- $photo->view_count++;
- $photo->save();
+ $movie->view_count++;
+ $movie->save();
print $template;
}
@@ -65,21 +56,32 @@ class Movies_Controller extends Items_Controller {
/**
* @see REST_Controller::_update($resource)
*/
- public function _update($photo) {
+ public function _update($movie) {
access::verify_csrf();
- access::required("view", $photo);
- access::required("edit", $photo);
+ access::required("view", $movie);
+ access::required("edit", $movie);
+
+ $form = movie::get_edit_form($movie);
+ $valid = $form->validate();
+
+ if ($valid) {
+ $new_ext = pathinfo($form->edit_item->filename->value, PATHINFO_EXTENSION);
+ $old_ext = pathinfo($movie->name, PATHINFO_EXTENSION);
+ if (strcasecmp($new_ext, $old_ext)) {
+ $form->edit_item->filename->add_error("illegal_extension", 1);
+ $valid = false;
+ }
+ }
- $form = photo::get_edit_form($photo);
- if ($valid = $form->validate()) {
- if ($form->edit_item->filename->value != $photo->name ||
- $form->edit_item->slug->value != $photo->slug) {
+ if ($valid) {
+ if ($form->edit_item->filename->value != $movie->name ||
+ $form->edit_item->slug->value != $movie->slug) {
// Make sure that there's not a name or slug conflict
if ($row = Database::instance()
->select(array("name", "slug"))
->from("items")
- ->where("parent_id", $photo->parent_id)
- ->where("id <>", $photo->id)
+ ->where("parent_id", $movie->parent_id)
+ ->where("id <>", $movie->id)
->open_paren()
->where("name", $form->edit_item->filename->value)
->orwhere("slug", $form->edit_item->slug->value)
@@ -98,16 +100,16 @@ class Movies_Controller extends Items_Controller {
}
if ($valid) {
- $photo->title = $form->edit_item->title->value;
- $photo->description = $form->edit_item->description->value;
- $photo->slug = $form->edit_item->slug->value;
- $photo->rename($form->edit_item->filename->value);
- $photo->save();
- module::event("item_edit_form_completed", $photo, $form);
+ $movie->title = $form->edit_item->title->value;
+ $movie->description = $form->edit_item->description->value;
+ $movie->slug = $form->edit_item->slug->value;
+ $movie->rename($form->edit_item->filename->value);
+ $movie->save();
+ module::event("item_edit_form_completed", $movie, $form);
- log::success("content", "Updated movie", "<a href=\"{$photo->url()}\">view</a>");
+ log::success("content", "Updated movie", "<a href=\"{$movie->url()}\">view</a>");
message::success(
- t("Saved movie %movie_title", array("movie_title" => $photo->title)));
+ t("Saved movie %movie_title", array("movie_title" => $movie->title)));
print json_encode(
array("result" => "success"));
@@ -121,9 +123,9 @@ class Movies_Controller extends Items_Controller {
/**
* @see REST_Controller::_form_edit($resource)
*/
- public function _form_edit($photo) {
- access::required("view", $photo);
- access::required("edit", $photo);
- print photo::get_edit_form($photo);
+ public function _form_edit($movie) {
+ access::required("view", $movie);
+ access::required("edit", $movie);
+ print movie::get_edit_form($movie);
}
}
diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php
index ae87d74b..82c3c938 100644
--- a/modules/gallery/controllers/packager.php
+++ b/modules/gallery/controllers/packager.php
@@ -62,6 +62,7 @@ class Packager_Controller extends Controller {
srand(0);
gallery_installer::install(true);
+
module::load_modules();
foreach (array("user", "comment", "organize", "info", "rss",
@@ -75,18 +76,18 @@ class Packager_Controller extends Controller {
// We now have a clean install with just the packages that we want. Make sure that the
// database is clean too.
$i = 1;
- foreach (array("blocks_dashboard_sidebar", "blocks_dashboard_center") as $key) {
+ foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $key) {
$blocks = array();
- foreach (unserialize(module::get_var("gallery", $key)) as $rnd => $value) {
+ foreach (unserialize(module::get_var("gallery", "blocks_{$key}")) as $rnd => $value) {
$blocks[++$i] = $value;
}
- module::set_var("gallery", $key, serialize($blocks));
+ module::set_var("gallery", "blocks_{$key}", serialize($blocks));
}
$db = Database::instance();
$db->query("TRUNCATE {sessions}");
$db->query("TRUNCATE {logs}");
- $db->query("DELETE FROM {vars} WHERE `module_name` = 'core' AND `name` = '_cache'");
+ $db->query("DELETE FROM {vars} WHERE `module_name` = 'gallery' AND `name` = '_cache'");
$db->update("users", array("password" => ""), array("id" => 1));
$db->update("users", array("password" => ""), array("id" => 2));
diff --git a/modules/gallery/controllers/permissions.php b/modules/gallery/controllers/permissions.php
index 8d75862e..99943fbb 100644
--- a/modules/gallery/controllers/permissions.php
+++ b/modules/gallery/controllers/permissions.php
@@ -51,13 +51,13 @@ class Permissions_Controller extends Controller {
function change($command, $group_id, $perm_id, $item_id) {
access::verify_csrf();
- $group = ORM::factory("group", $group_id);
+ $group = identity::lookup_group($group_id);
$perm = ORM::factory("permission", $perm_id);
$item = ORM::factory("item", $item_id);
access::required("view", $item);
access::required("edit", $item);
- if ($group->loaded && $perm->loaded && $item->loaded) {
+ if (!empty($group) && $perm->loaded && $item->loaded) {
switch($command) {
case "allow":
access::allow($group, $perm->name, $item);
@@ -74,7 +74,7 @@ class Permissions_Controller extends Controller {
// If the active user just took away their own edit permissions, give it back.
if ($perm->name == "edit") {
- if (!access::user_can(user::active(), "edit", $item)) {
+ if (!access::user_can(identity::active_user(), "edit", $item)) {
access::allow($group, $perm->name, $item);
}
}
@@ -84,7 +84,7 @@ class Permissions_Controller extends Controller {
private function _get_form($item) {
$view = new View("permissions_form.html");
$view->item = $item;
- $view->groups = ORM::factory("group")->find_all();
+ $view->groups = identity::groups();
$view->permissions = ORM::factory("permission")->find_all();
return $view;
}
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 79ad674a..b9adfd90 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -25,23 +25,24 @@ class Photos_Controller extends Items_Controller {
public function _show($photo) {
access::required("view", $photo);
- $position = $photo->parent()->get_position($photo->id);
+ $where = array("type != " => "album");
+ $position = $photo->parent()->get_position($photo, $where);
if ($position > 1) {
list ($previous_item, $ignore, $next_item) =
- $photo->parent()->children(3, $position - 2);
+ $photo->parent()->children(3, $position - 2, $where);
} else {
$previous_item = null;
- list ($next_item) = $photo->parent()->children(1, $position);
+ list ($next_item) = $photo->parent()->viewable()->children(1, $position, $where);
}
$template = new Theme_View("page.html", "photo");
$template->set_global("item", $photo);
$template->set_global("children", array());
- $template->set_global("children_count", $photo->children_count());
+ $template->set_global("children_count", 0);
$template->set_global("parents", $photo->parents());
$template->set_global("next_item", $next_item);
$template->set_global("previous_item", $previous_item);
- $template->set_global("sibling_count", $photo->parent()->children_count());
+ $template->set_global("sibling_count", $photo->parent()->viewable()->children_count($where));
$template->set_global("position", $position);
$template->content = new View("photo.html");
@@ -63,7 +64,17 @@ class Photos_Controller extends Items_Controller {
$form = photo::get_edit_form($photo);
$valid = $form->validate();
- if ($valid = $form->validate()) {
+
+ if ($valid) {
+ $new_ext = pathinfo($form->edit_item->filename->value, PATHINFO_EXTENSION);
+ $old_ext = pathinfo($photo->name, PATHINFO_EXTENSION);
+ if (strcasecmp($new_ext, $old_ext)) {
+ $form->edit_item->filename->add_error("illegal_extension", 1);
+ $valid = false;
+ }
+ }
+
+ if ($valid) {
if ($form->edit_item->filename->value != $photo->name ||
$form->edit_item->slug->value != $photo->slug) {
// Make sure that there's not a name or slug conflict
@@ -90,6 +101,8 @@ class Photos_Controller extends Items_Controller {
}
if ($valid) {
+ $watching_album = $photo->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH));
+
$photo->title = $form->edit_item->title->value;
$photo->description = $form->edit_item->description->value;
$photo->slug = $form->edit_item->slug->value;
@@ -103,7 +116,8 @@ class Photos_Controller extends Items_Controller {
array("photo_title" => html::purify($photo->title))));
print json_encode(
- array("result" => "success"));
+ array("result" => "success",
+ "location" => $watching_album ? $location : $photo->url()));
} else {
print json_encode(
array("result" => "error",
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index 2ac54754..a1e7dcc3 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -36,7 +36,8 @@ class Quick_Controller extends Controller {
}
if ($degrees) {
- graphics::rotate($item->file_path(), $item->file_path(), array("degrees" => $degrees));
+ gallery_graphics::rotate($item->file_path(), $item->file_path(),
+ array("degrees" => $degrees));
list($item->width, $item->height) = getimagesize($item->file_path());
$item->resize_dirty= 1;
diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php
index bc508319..d43d2f9d 100644
--- a/modules/gallery/controllers/simple_uploader.php
+++ b/modules/gallery/controllers/simple_uploader.php
@@ -79,7 +79,7 @@ class Simple_Uploader_Controller extends Controller {
print "FILEID: $item->id";
} else {
header("HTTP/1.1 400 Bad Request");
- print "ERROR: Invalid Upload";
+ print "ERROR: " . t("Invalid Upload");
}
}
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
index 0f6cbc2c..48769bce 100644
--- a/modules/gallery/controllers/upgrader.php
+++ b/modules/gallery/controllers/upgrader.php
@@ -40,10 +40,10 @@ class Upgrader_Controller extends Controller {
}
$view = new View("upgrader.html");
- $view->can_upgrade = user::active()->admin || $session->get("can_upgrade");
+ $view->can_upgrade = identity::active_user()->admin || $session->get("can_upgrade");
$view->upgrade_token = $upgrade_token;
$view->available = module::available();
- $view->done = ($available_upgrades == 0);
+ $view->done = $available_upgrades == 0;
print $view;
}
@@ -52,13 +52,17 @@ class Upgrader_Controller extends Controller {
// @todo this may screw up some module installers, but we don't have a better answer at
// this time.
$_SERVER["HTTP_HOST"] = "example.com";
- } else if (!user::active()->admin && !Session::instance()->get("can_upgrade", false)) {
+ } else if (!identity::active_user()->admin && !Session::instance()->get("can_upgrade", false)) {
access::forbidden();
}
- // Upgrade gallery and user first
- module::upgrade("gallery");
- module::upgrade("user");
+ $available = module::available();
+ // Upgrade gallery first
+ $gallery = $available["gallery"];
+ if ($gallery->code_version != $gallery->version) {
+ module::upgrade("gallery");
+ module::activate("gallery");
+ }
// Then upgrade the rest
foreach (module::available() as $id => $module) {
diff --git a/modules/gallery/controllers/welcome_message.php b/modules/gallery/controllers/welcome_message.php
index 8fd1e0a0..af0d6997 100644
--- a/modules/gallery/controllers/welcome_message.php
+++ b/modules/gallery/controllers/welcome_message.php
@@ -19,12 +19,12 @@
*/
class Welcome_Message_Controller extends Controller {
public function index() {
- if (!user::active()->admin) {
+ if (!identity::active_user()->admin) {
url::redirect(item::root()->abs_url());
}
$v = new View("welcome_message.html");
- $v->user = user::active();
+ $v->user = identity::active_user();
print $v;
}
}
diff --git a/modules/gallery/css/debug.css b/modules/gallery/css/debug.css
index fe5665ad..6808da09 100644
--- a/modules/gallery/css/debug.css
+++ b/modules/gallery/css/debug.css
@@ -1,4 +1,4 @@
-.gAnnotatedThemeBlock {
+.g-annotated-theme-block {
border: 1px solid #C00;
clear: both;
margin: 1em;
@@ -6,15 +6,15 @@
position: relative;
}
-.gAnnotatedThemeBlock_album_top {
+.g-annotated-theme-block_album_top {
float: right;
}
-.gAnnotatedThemeBlock_header_bottom {
+.g-annotated-theme-block_header_bottom {
float: right;
}
-.gAnnotatedThemeBlock div.title {
+.g-annotated-theme-block div.title {
background: #C00;
border: 1px solid black;
color: white;
diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css
new file mode 100644
index 00000000..113f0e09
--- /dev/null
+++ b/modules/gallery/css/gallery.css
@@ -0,0 +1,89 @@
+/**
+ * Gallery 3 core module styles
+ *
+ * Sheet organization:
+ * 1) End-user
+ * 2) Admin
+ */
+
+/** *******************************************************************
+ * 1) End-user
+ **********************************************************************/
+
+/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-edit-permissions-form {
+ clear: both;
+}
+
+#g-edit-permissions-form td {
+ background-image: none;
+}
+
+#g-edit-permissions-form fieldset {
+ border: 1px solid #ccc;
+}
+
+#g-permissions .g-denied,
+#g-permissions .g-allowed {
+ text-align: center;
+ vertical-align: middle;
+}
+
+#g-permissions .g-denied {
+ background-color: #fcc;
+}
+
+#g-permissions .g-allowed {
+ background-color: #cfc;
+}
+
+/* Move items ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-move ul {
+ padding-left: 1em;
+}
+
+#g-move .selected {
+ background: #999;
+}
+
+/* In-place edit ~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-in-place-edit-form ul {
+ margin: 0;
+}
+
+/** *******************************************************************
+ * 2) Admin
+ **********************************************************************/
+
+.g-task-log {
+ border: 1px solid #000;
+ height: 400px;
+ margin: .6em 0;
+ overflow: auto;
+ padding: .4em
+}
+
+#g-languages-form table {
+ width: 40%;
+ margin: 0 3em 1em 0;
+}
+
+#g-languages-form input {
+ clear: both;
+}
+
+#g-translations ol {
+ margin: 0 0 1em 2em;
+}
+#g-translations ol li {
+ list-style-type: decimal;
+ line-height: 150%;
+}
+
+#g-translations .g-button {
+ padding: .5em;
+ margin-bottom: 1em;
+}
diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css
index 9c1b12d0..542da8e6 100644
--- a/modules/gallery/css/l10n_client.css
+++ b/modules/gallery/css/l10n_client.css
@@ -1,6 +1,8 @@
-// TODO(andy_st): Add original copyright notice from Drupal l10_client.
-// TODO(andy_st): Add G3 copyright notice.
-// TODO(andy_st): clean up formatting to match our other CSS files.
+/**
+ * TODO(andy_st): Add original copyright notice from Drupal l10_client.
+ * TODO(andy_st): Add G3 copyright notice.
+ * TODO(andy_st): clean up formatting to match our other CSS files.
+ */
/* $Id: l10n_client.css,v 1.6 2008/09/09 10:48:20 goba Exp $ */
@@ -50,7 +52,7 @@
font-size: 1em;
padding: .5em;
}
-#l10n-client-toggler #gMinimizeL10n {
+#l10n-client-toggler #g-minimize-l10n {
border-right: 1px solid #ffffff;
}
@@ -126,31 +128,31 @@
#l10n-client .string-list li.active {
font-weight:bold;}
-#l10n-client #gL10nSearchForm {
+#l10n-client #g-l10n-search-form {
background:#eee;
text-align:center;
height:2em; line-height:2em;
margin:0em; padding:.5em .5em;
}
-#l10n-client #gL10nSearchForm .form-item,
-#l10n-client #gL10nSearchForm input.form-text,
-#l10n-client #gL10nSearchForm #search-filter-go,
-#l10n-client #gL10nSearchForm #search-filter-clear {
+#l10n-client #g-l10n-search-form .form-item,
+#l10n-client #g-l10n-search-form input.form-text,
+#l10n-client #g-l10n-search-form #search-filter-go,
+#l10n-client #g-l10n-search-form #search-filter-clear {
display:inline;
vertical-align:middle;
}
-#l10n-client #gL10nSearchForm .form-item {
+#l10n-client #g-l10n-search-form .form-item {
margin:0em;
padding:0em;
}
-#l10n-client #gL10nSearchForm input.form-text {
+#l10n-client #g-l10n-search-form input.form-text {
width:80%;
}
-#l10n-client #gL10nSearchForm #search-filter-clear {
+#l10n-client #g-l10n-search-form #search-filter-clear {
width:10%;
margin:0em;
}
@@ -178,7 +180,7 @@
overflow:hidden;
width:49%; float:right;}
-#gL10nClientSaveForm {
+#g-l10n-client-save-form {
padding:0em;}
#l10n-client form ul,
diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css
index 7c377817..73da0ff4 100644
--- a/modules/gallery/css/upgrader.css
+++ b/modules/gallery/css/upgrader.css
@@ -1,6 +1,6 @@
body {
background: #eee;
- font-family: Trebuchet MS;
+ font-family: 'Trebuchet MS';
font-size: 1.1em;
}
@@ -37,7 +37,7 @@ td {
}
tr.current td {
- color: #999;
+ opacity: 0.5;
font-style: italic;
}
@@ -87,11 +87,13 @@ div.button a {
text-decoration: none;
}
-div.button:hover {
+div.button-active:hover {
background: #ccc;
}
-div#confirmation {
+div#dialog {
+ width: 340px;
+ height: 200px;
position: absolute;
background: blue;
z-index: 1000;
@@ -99,21 +101,23 @@ div#confirmation {
text-align: center;
}
-div#confirmation a.close {
+div#dialog a.close {
float: right;
padding: 10px;
text-decoration: none;
}
-div#confirmation div {
+div#dialog div {
+ width: 292px;
+ height: 152px;
margin: 2px;
padding: 20px;
border: 2px solid #999;
background: #eee;
}
-.gray_on_done {
- opacity: <?= $done ? "0.5" : "1" ?>;
+.muted {
+ opacity: 0.5;
}
pre {
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php
index 949aea84..c1c1f9d1 100644
--- a/modules/gallery/helpers/access.php
+++ b/modules/gallery/helpers/access.php
@@ -79,7 +79,7 @@ class access_Core {
* @return boolean
*/
static function can($perm_name, $item) {
- return self::user_can(user::active(), $perm_name, $item);
+ return self::user_can(identity::active_user(), $perm_name, $item);
}
/**
@@ -197,8 +197,8 @@ class access_Core {
* @param Item_Model $item
* @param boolean $value
*/
- private static function _set(Group_Model $group, $perm_name, $album, $value) {
- if (get_class($group) != "Group_Model") {
+ private static function _set(Group_Definition $group, $perm_name, $album, $value) {
+ if (!($group instanceof Group_Definition)) {
throw new Exception("@todo PERMISSIONS_ONLY_WORK_ON_GROUPS");
}
if (!$album->loaded) {
@@ -419,10 +419,10 @@ class access_Core {
* @return ORM_Iterator
*/
private static function _get_all_groups() {
- // When we build the gallery package, it's possible that the user module is not installed yet.
+ // When we build the gallery package, it's possible that there is no identity provider installed yet.
// This is ok at packaging time, so work around it.
- if (module::is_active("user")) {
- return ORM::factory("group")->find_all();
+ if (module::is_active(module::get_var("gallery", "identity_provider", "user"))) {
+ return identity::groups();
} else {
return array();
}
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index 9cd746d7..72a79a75 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -92,7 +92,7 @@ class album_Core {
}
static function get_add_form($parent) {
- $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddAlbumForm"));
+ $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-add-album-form"));
$group = $form->group("add_album")
->label(t("Add an album to %album_title", array("album_title" => $parent->title)));
$group->input("title")->label(t("Title"));
@@ -114,7 +114,7 @@ class album_Core {
}
static function get_edit_form($parent) {
- $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
+ $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-edit-album-form"));
$form->hidden("_method")->value("put");
$group = $form->group("edit_item")->label(t("Edit Album"));
@@ -123,14 +123,15 @@ class album_Core {
if ($parent->id != 1) {
$group->input("dirname")->label(t("Directory Name"))->value($parent->name)
->rules("required")
- ->error_messages("name_conflict", t("There is already a photo or album with this name"))
+ ->error_messages(
+ "name_conflict", t("There is already a movie, photo or album with this name"))
->callback("item::validate_no_slashes")
->error_messages("no_slashes", t("The directory name can't contain a \"/\""))
->callback("item::validate_no_trailing_period")
->error_messages("no_trailing_period", t("The directory name can't end in \".\""));
$group->input("slug")->label(t("Internet Address"))->value($parent->slug)
->error_messages(
- "slug_conflict", t("There is already a photo or album with this internet address"))
+ "slug_conflict", t("There is already a movie, photo or album with this internet address"))
->callback("item::validate_url_safe")
->error_messages(
"not_url_safe",
@@ -140,14 +141,14 @@ class album_Core {
$group->hidden("slug")->value($parent->slug);
}
- $sort_order = $group->group("sort_order", array("id" => "gAlbumSortOrder"))
+ $sort_order = $group->group("sort_order", array("id" => "g-album-sort-order"))
->label(t("Sort Order"));
- $sort_order->dropdown("column", array("id" => "gAlbumSortColumn"))
+ $sort_order->dropdown("column", array("id" => "g-album-sort-column"))
->label(t("Sort by"))
->options(album::get_sort_order_options())
->selected($parent->sort_column);
- $sort_order->dropdown("direction", array("id" => "gAlbumSortDirection"))
+ $sort_order->dropdown("direction", array("id" => "g-album-sort-direction"))
->label(t("Order"))
->options(array("ASC" => t("Ascending"),
"DESC" => t("Descending")))
diff --git a/modules/gallery/helpers/auth.php b/modules/gallery/helpers/auth.php
new file mode 100644
index 00000000..9c69cecd
--- /dev/null
+++ b/modules/gallery/helpers/auth.php
@@ -0,0 +1,56 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class auth_Core {
+ static function get_login_form($url) {
+ $form = new Forge($url, "", "post", array("id" => "g-login-form"));
+ $form->set_attr('class', "g-narrow");
+ $group = $form->group("login")->label(t("Login"));
+ $group->input("name")->label(t("Username"))->id("g-username")->class(null);
+ $group->password("password")->label(t("Password"))->id("g-password")->class(null);
+ $group->inputs["name"]->error_messages("invalid_login", t("Invalid name or password"));
+ $group->submit("")->value(t("Login"));
+ return $form;
+ }
+
+ static function login($user) {
+ if (identity::is_writable()) {
+ $user->login_count += 1;
+ $user->last_login = time();
+ $user->save();
+ }
+ identity::set_active_user($user);
+ log::info("user", t("User %name logged in", array("name" => $user->name)));
+ module::event("user_login", $user);
+ }
+
+ static function logout() {
+ $user = identity::active_user();
+ if (!$user->guest) {
+ try {
+ Session::instance()->destroy();
+ } catch (Exception $e) {
+ Kohana::log("error", $e);
+ }
+ module::event("user_logout", $user);
+ }
+ log::info("user", t("User %name logged out", array("name" => $user->name)),
+ html::anchor("user/$user->id", html::clean($user->name)));
+ }
+} \ No newline at end of file
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php
index 20b641d4..b003f1d8 100644
--- a/modules/gallery/helpers/block_manager.php
+++ b/modules/gallery/helpers/block_manager.php
@@ -29,22 +29,68 @@ class block_manager_Core {
static function add($location, $module_name, $block_id) {
$blocks = self::get_active($location);
$blocks[rand()] = array($module_name, $block_id);
+
self::set_active($location, $blocks);
}
+ static function activate_blocks($module_name) {
+ $block_class = "{$module_name}_block";
+ if (method_exists($block_class, "get_site_list")) {
+ $blocks = call_user_func(array($block_class, "get_site_list"));
+ foreach (array_keys($blocks) as $block_id) {
+ self::add("site_sidebar", $module_name, $block_id);
+ }
+ }
+ }
+
static function remove($location, $block_id) {
$blocks = self::get_active($location);
unset($blocks[$block_id]);
self::set_active($location, $blocks);
}
- static function get_available() {
+ static function remove_blocks_for_module($location, $module_name) {
+ $blocks = self::get_active($location);
+ foreach ($blocks as $key => $block) {
+ if ($block[0] == $module_name) {
+ unset($blocks[$key]);
+ }
+ }
+ self::set_active($location, $blocks);
+ }
+
+ static function deactivate_blocks($module_name) {
+ $block_class = "{$module_name}_block";
+ if (method_exists($block_class, "get_site_list")) {
+ $blocks = call_user_func(array($block_class, "get_site_list"));
+ foreach (array_keys($blocks) as $block_id) {
+ self::remove_blocks_for_module("site_sidebar", $module_name);
+ }
+ }
+
+ if (method_exists($block_class, "get_admin_list")) {
+ $blocks = call_user_func(array($block_class, "get_admin_list"));
+ foreach (array("dashboard_sidebar", "dashboard_center") as $location) {
+ self::remove_blocks_for_module($location, $module_name);
+ }
+ }
+ }
+
+ static function get_available_admin_blocks() {
+ return self::_get_blocks("get_admin_list");
+ }
+
+ static function get_available_site_blocks() {
+ return self::_get_blocks("get_site_list");
+ }
+
+ private static function _get_blocks($function) {
$blocks = array();
foreach (module::active() as $module) {
$class_name = "{$module->name}_block";
- if (method_exists($class_name, "get_list")) {
- foreach (call_user_func(array($class_name, "get_list")) as $id => $title) {
+ if (method_exists($class_name, $function)) {
+ foreach (call_user_func(array($class_name, $function)) as $id => $title) {
$blocks["{$module->name}:$id"] = $title;
}
}
@@ -52,14 +98,16 @@ class block_manager_Core {
return $blocks;
}
- static function get_html($location) {
+ static function get_html($location, $theme=null) {
$active = self::get_active($location);
$result = "";
foreach ($active as $id => $desc) {
if (method_exists("$desc[0]_block", "get")) {
- $block = call_user_func(array("$desc[0]_block", "get"), $desc[1]);
- $block->id = $id;
- $result .= $block;
+ $block = call_user_func(array("$desc[0]_block", "get"), $desc[1], $theme);
+ if (!empty($block)) {
+ $block->id = $id;
+ $result .= $block;
+ }
}
}
return $result;
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 80ae65bd..84f8a7fb 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -27,7 +27,7 @@ class gallery_Core {
static function maintenance_mode() {
$maintenance_mode = Kohana::config("core.maintenance_mode", false, false);
- if (Router::$controller != "login" && !empty($maintenance_mode) && !user::active()->admin) {
+ if (Router::$controller != "login" && !empty($maintenance_mode) && !identity::active_user()->admin) {
Router::$controller = "maintenance";
Router::$controller_path = MODPATH . "gallery/controllers/maintenance.php";
Router::$method = "index";
@@ -79,238 +79,39 @@ class gallery_Core {
return date(module::get_var("gallery", "time_format", "H:i:s"), $timestamp);
}
- static function site_menu($menu, $theme) {
- if ($theme->page_type != "login") {
- $menu->append(Menu::factory("link")
- ->id("home")
- ->label(t("Home"))
- ->url(item::root()->url()));
-
- $item = $theme->item();
-
- $can_edit = $item && access::can("edit", $item);
- $can_add = $item && access::can("add", $item);
-
- if ($can_add) {
- $menu->append($add_menu = Menu::factory("submenu")
- ->id("add_menu")
- ->label(t("Add")));
- $is_album_writable =
- is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path());
- if ($is_album_writable) {
- $add_menu->append(Menu::factory("dialog")
- ->id("add_photos_item")
- ->label(t("Add photos"))
- ->url(url::site("simple_uploader/app/$item->id")));
- if ($item->is_album()) {
- $add_menu->append(Menu::factory("dialog")
- ->id("add_album_item")
- ->label(t("Add an album"))
- ->url(url::site("form/add/albums/$item->id?type=album")));
- }
- } else {
- message::warning(t("The album '%album_name' is not writable.",
- array("album_name" => $item->title)));
- }
- }
-
- $menu->append($options_menu = Menu::factory("submenu")
- ->id("options_menu")
- ->label(t("Photo options")));
- if ($item && ($can_edit || $can_add)) {
- if ($can_edit) {
- $options_menu->append(Menu::factory("dialog")
- ->id("edit_item")
- ->label($item->is_album() ? t("Edit album") : t("Edit photo"))
- ->url(url::site("form/edit/{$item->type}s/$item->id")));
- }
-
- if ($item->is_album()) {
- $options_menu->label(t("Album options"));
- if ($can_edit) {
- $options_menu->append(Menu::factory("dialog")
- ->id("edit_permissions")
- ->label(t("Edit permissions"))
- ->url(url::site("permissions/browse/$item->id")));
- }
- }
- }
-
- if (user::active()->admin) {
- $menu->append($admin_menu = Menu::factory("submenu")
- ->id("admin_menu")
- ->label(t("Admin")));
- gallery::admin_menu($admin_menu, $theme);
- module::event("admin_menu", $admin_menu, $theme);
+ /**
+ * Provide a wrapper function for Kohana::find_file that first strips the extension and
+ * then calls the Kohana::find_file and supplies the extension as the type.
+ * @param string directory to search in
+ * @param string filename to look for
+ * @param boolean file required (optional: default false)
+ * @return array if the extension is config, i18n or l10n
+ * @return string if the file is found (relative to the DOCROOT)
+ * @return false if the file is not found
+ */
+ static function find_file($directory, $file, $required=false) {
+ $file_name = substr($file, 0, -strlen($ext = strrchr($file, '.')));
+ $file_name = Kohana::find_file($directory, $file_name, $required, substr($ext, 1));
+ if (!$file_name) {
+ if (file_exists(DOCROOT . "lib/$directory/$file")) {
+ return "lib/$directory/$file";
+ } else if (file_exists(DOCROOT . "lib/$file")) {
+ return "lib/$file";
}
-
- module::event("site_menu", $menu, $theme);
}
- }
-
- static function admin_menu($menu, $theme) {
- $menu
- ->append(Menu::factory("link")
- ->id("dashboard")
- ->label(t("Dashboard"))
- ->url(url::site("admin")))
- ->append(Menu::factory("submenu")
- ->id("settings_menu")
- ->label(t("Settings"))
- ->append(Menu::factory("link")
- ->id("graphics_toolkits")
- ->label(t("Graphics"))
- ->url(url::site("admin/graphics")))
- ->append(Menu::factory("link")
- ->id("languages")
- ->label(t("Languages"))
- ->url(url::site("admin/languages")))
- ->append(Menu::factory("link")
- ->id("advanced")
- ->label(t("Advanced"))
- ->url(url::site("admin/advanced_settings"))))
- ->append(Menu::factory("link")
- ->id("modules")
- ->label(t("Modules"))
- ->url(url::site("admin/modules")))
- ->append(Menu::factory("submenu")
- ->id("content_menu")
- ->label(t("Content")))
- ->append(Menu::factory("submenu")
- ->id("appearance_menu")
- ->label(t("Appearance"))
- ->append(Menu::factory("link")
- ->id("themes")
- ->label(t("Theme Choice"))
- ->url(url::site("admin/themes")))
- ->append(Menu::factory("link")
- ->id("theme_options")
- ->label(t("Theme Options"))
- ->url(url::site("admin/theme_options"))))
- ->append(Menu::factory("submenu")
- ->id("statistics_menu")
- ->label(t("Statistics")))
- ->append(Menu::factory("link")
- ->id("maintenance")
- ->label(t("Maintenance"))
- ->url(url::site("admin/maintenance")));
- return $menu;
- }
- static function context_menu($menu, $theme, $item, $thumb_css_selector) {
- $menu->append($options_menu = Menu::factory("submenu")
- ->id("options_menu")
- ->label(t("Options"))
- ->css_class("ui-icon-carat-1-n"));
-
- if (access::can("edit", $item)) {
- $page_type = $theme->page_type();
- switch ($item->type) {
- case "movie":
- $edit_title = t("Edit this movie");
- $delete_title = t("Delete this movie");
- break;
-
- case "album":
- $edit_title = t("Edit this album");
- $delete_title = t("Delete this album");
- break;
-
- default:
- $edit_title = t("Edit this photo");
- $delete_title = t("Delete this photo");
- break;
- }
- $cover_title = t("Choose as the album cover");
- $move_title = t("Move to another album");
-
- $csrf = access::csrf_token();
-
- $options_menu->append(Menu::factory("dialog")
- ->id("edit")
- ->label($edit_title)
- ->css_class("ui-icon-pencil")
- ->url(url::site("quick/form_edit/$item->id?page_type=$page_type")));
-
-
- if ($item->is_photo() && graphics::can("rotate")) {
- $options_menu
- ->append(
- Menu::factory("ajax_link")
- ->id("rotate_ccw")
- ->label(t("Rotate 90&deg; counter clockwise"))
- ->css_class("ui-icon-rotate-ccw")
- ->ajax_handler("function(data) { " .
- "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
- ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&page_type=$page_type")))
- ->append(
- Menu::factory("ajax_link")
- ->id("rotate_cw")
- ->label(t("Rotate 90&deg; clockwise"))
- ->css_class("ui-icon-rotate-cw")
- ->ajax_handler("function(data) { " .
- "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
- ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&page_type=$page_type")));
- }
-
- // Don't move photos from the photo page; we don't yet have a good way of redirecting after
- // move
- if ($page_type == "album") {
- $options_menu
- ->append(Menu::factory("dialog")
- ->id("move")
- ->label($move_title)
- ->css_class("ui-icon-folder-open")
- ->url(url::site("move/browse/$item->id")));
- }
-
- $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 = " ";
+ if (is_string($file_name)) {
+ // make relative to DOCROOT
+ $parts = explode("/", $file_name);
+ foreach ($parts as $idx => $part) {
+ if (in_array($part, array("application", "modules", "themes", "lib"))) {
+ break;
}
- if ($item->parent()->id != 1) {
- $options_menu
- ->append(Menu::factory("ajax_link")
- ->id("make_album_cover")
- ->label($cover_title)
- ->css_class("ui-icon-star")
- ->ajax_handler("function(data) { window.location.reload() }")
- ->url(url::site("quick/make_album_cover/$item->id?csrf=$csrf")));
- }
- $options_menu
- ->append(Menu::factory("dialog")
- ->id("delete")
- ->label($delete_title)
- ->css_class("ui-icon-trash")
- ->css_id("gQuickDelete")
- ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&page_type=$page_type")));
- }
-
- if ($item->is_album()) {
- $options_menu
- ->append(Menu::factory("dialog")
- ->id("add_item")
- ->label(t("Add a photo"))
- ->css_class("ui-icon-plus")
- ->url(url::site("simple_uploader/app/$item->id")))
- ->append(Menu::factory("dialog")
- ->id("add_album")
- ->label(t("Add an album"))
- ->css_class("ui-icon-note")
- ->url(url::site("form/add/albums/$item->id?type=album")))
- ->append(Menu::factory("dialog")
- ->id("edit_permissions")
- ->label(t("Edit permissions"))
- ->css_class("ui-icon-key")
- ->url(url::site("permissions/browse/$item->id")));
+ unset($parts[$idx]);
}
+ $file_name = implode("/", $parts);
}
+ return $file_name;
}
+
} \ No newline at end of file
diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php
index b7816954..b5c32ad2 100644
--- a/modules/gallery/helpers/gallery_block.php
+++ b/modules/gallery/helpers/gallery_block.php
@@ -18,44 +18,48 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class gallery_block_Core {
- static function get_list() {
+ static function get_admin_list() {
return array(
"welcome" => t("Welcome to Gallery 3!"),
- "photo_stream" => t("Photo Stream"),
- "log_entries" => t("Log Entries"),
- "stats" => t("Gallery Stats"),
- "platform_info" => t("Platform Information"),
- "project_news" => t("Gallery Project News"));
+ "photo_stream" => t("Photo stream"),
+ "log_entries" => t("Log entries"),
+ "stats" => t("Gallery stats"),
+ "platform_info" => t("Platform information"),
+ "project_news" => t("Gallery project news"));
+ }
+
+ static function get_site_list() {
+ return array("language" => t("Language preference"));
}
static function get($block_id) {
$block = new Block();
switch($block_id) {
case "welcome":
- $block->css_id = "gWelcome";
+ $block->css_id = "g-welcome";
$block->title = t("Welcome to Gallery 3");
$block->content = new View("admin_block_welcome.html");
break;
case "photo_stream":
- $block->css_id = "gPhotoStream";
- $block->title = t("Photo Stream");
+ $block->css_id = "g-photo-stream";
+ $block->title = t("Photo stream");
$block->content = new View("admin_block_photo_stream.html");
$block->content->photos =
ORM::factory("item")->where("type", "photo")->orderby("created", "DESC")->find_all(10);
break;
case "log_entries":
- $block->css_id = "gLogEntries";
- $block->title = t("Log Entries");
+ $block->css_id = "g-log-entries";
+ $block->title = t("Log entries");
$block->content = new View("admin_block_log_entries.html");
$block->content->entries = ORM::factory("log")
->orderby(array("timestamp" => "DESC", "id" => "DESC"))->find_all(5);
break;
case "stats":
- $block->css_id = "gStats";
- $block->title = t("Gallery Stats");
+ $block->css_id = "g-stats";
+ $block->title = t("Gallery stats");
$block->content = new View("admin_block_stats.html");
$block->content->album_count =
ORM::factory("item")->where("type", "album")->where("id <>", 1)->count_all();
@@ -63,38 +67,57 @@ class gallery_block_Core {
break;
case "platform_info":
- $block->css_id = "gPlatform";
- $block->title = t("Platform Information");
+ $block->css_id = "g-platform";
+ $block->title = t("Platform information");
$block->content = new View("admin_block_platform.html");
if (is_readable("/proc/loadavg")) {
$block->content->load_average =
- join(" ", array_slice(split(" ", array_shift(file("/proc/loadavg"))), 0, 3));
+ join(" ", array_slice(explode(" ", array_shift(file("/proc/loadavg"))), 0, 3));
} else {
$block->content->load_average = t("Unavailable");
}
break;
case "project_news":
- $block->css_id = "gProjectNews";
- $block->title = t("Gallery Project News");
+ $block->css_id = "g-project-news";
+ $block->title = t("Gallery project news");
$block->content = new View("admin_block_news.html");
$block->content->feed = feed::parse("http://gallery.menalto.com/node/feed", 3);
break;
case "block_adder":
- $block->css_id = "gBlockAdder";
- $block->title = t("Dashboard Content");
+ $block->css_id = "g-block-adder";
+ $block->title = t("Dashboard content");
$block->content = self::get_add_block_form();
- }
+ break;
+ case "language":
+ $locales = locales::installed();
+ if (count($locales)) {
+ foreach ($locales as $locale => $display_name) {
+ $locales[$locale] = SafeString::of_safe_html($display_name);
+ }
+ $block = new Block();
+ $block->css_id = "g-user-language-block";
+ $block->title = t("Language preference");
+ $block->content = new View("user_languages_block.html");
+ $block->content->installed_locales =
+ array_merge(array("" => t("« none »")), $locales);
+ $block->content->selected = (string) locales::cookie_locale();
+ } else {
+ $block = "";
+ }
+ break;
+ }
return $block;
}
static function get_add_block_form() {
$form = new Forge("admin/dashboard/add_block", "", "post",
- array("id" => "gAddDashboardBlockForm"));
+ array("id" => "g-add-dashboard-block-form"));
$group = $form->group("add_block")->label(t("Add Block"));
- $group->dropdown("id")->label(t("Available Blocks"))->options(block_manager::get_available());
+ $group->dropdown("id")->label(t("Available Blocks"))
+ ->options(block_manager::get_available_admin_blocks());
$group->submit("center")->value(t("Add to center"));
$group->submit("sidebar")->value(t("Add to sidebar"));
return $form;
diff --git a/modules/gallery/helpers/gallery_error.php b/modules/gallery/helpers/gallery_error.php
new file mode 100644
index 00000000..551f8c63
--- /dev/null
+++ b/modules/gallery/helpers/gallery_error.php
@@ -0,0 +1,30 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class gallery_error_Core {
+ static function error_handler($severity, $message, $filename, $lineno) {
+ if (error_reporting() == 0) {
+ return;
+ }
+
+ if (error_reporting() & $severity) {
+ throw new ErrorException($message, 0, $severity, $filename, $lineno);
+ }
+ }
+} \ No newline at end of file
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 64f2a9ff..cd72d01e 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -19,6 +19,49 @@
*/
class gallery_event_Core {
+ /**
+ * Initialization.
+ */
+ static function gallery_ready() {
+ identity::load_user();
+ theme::load_themes();
+ locales::set_request_locale();
+ }
+
+ static function user_deleted($user) {
+ $admin = identity::admin_user();
+ $db = Database::instance();
+ $db->from("tasks")
+ ->set(array("owner_id" => $admin->id))
+ ->where(array("owner_id" => $user->id))
+ ->update();
+ $db->from("items")
+ ->set(array("owner_id" => $admin->id))
+ ->where(array("owner_id" => $user->id))
+ ->update();
+ $db->from("logs")
+ ->set(array("user_id" => $admin->id))
+ ->where(array("user_id" => $user->id))
+ ->update();
+ }
+
+ static function identity_provider_changed($old_provider, $new_provider) {
+ $admin = identity::admin_user();
+ $db = Database::instance();
+ $db->from("tasks")
+ ->set(array("owner_id" => $admin->id))
+ ->where("1 = 1")
+ ->update();
+ $db->from("items")
+ ->set(array("owner_id" => $admin->id))
+ ->where("1 = 1")
+ ->update();
+ $db->from("logs")
+ ->set(array("user_id" => $admin->id))
+ ->where("1 = 1")
+ ->update();
+ }
+
static function group_created($group) {
access::add_group($group);
}
@@ -53,4 +96,287 @@ class gallery_event_Core {
$data[] = $item->name;
$data[] = $item->title;
}
+
+ static function user_menu($menu, $theme) {
+ if ($theme->page_type != "login") {
+ $user = identity::active_user();
+ if ($user->guest) {
+ $menu->append(Menu::factory("dialog")
+ ->id("user_menu_login")
+ ->css_id("g-login-link")
+ ->url(url::site("login/ajax"))
+ ->label(t("Login")));
+ } else {
+ $csrf = access::csrf_token();
+ $menu->append(Menu::factory("dialog")
+ ->id("user_menu_edit_profile")
+ ->css_id("g-user-profile-link")
+ ->view("login_current_user.html")
+ ->url(url::site("form/edit/users/{$user->id}"))
+ ->label($user->display_name()));
+ $menu->append(Menu::factory("link")
+ ->id("user_menu_logout")
+ ->css_id("g-logout-link")
+ ->url(url::site("logout?csrf=$csrf&amp;continue=" .
+ urlencode(url::current(true))))
+ ->label(t("Logout")));
+ }
+ }
+ }
+
+ static function site_menu($menu, $theme) {
+ if ($theme->page_type != "login") {
+ $menu->append(Menu::factory("link")
+ ->id("home")
+ ->label(t("Home"))
+ ->url(item::root()->url()));
+
+
+ $item = $theme->item();
+
+ if (!empty($item)) {
+ $can_edit = $item && access::can("edit", $item);
+ $can_add = $item && access::can("add", $item);
+
+ if ($can_add) {
+ $menu->append($add_menu = Menu::factory("submenu")
+ ->id("add_menu")
+ ->label(t("Add")));
+ $is_album_writable =
+ is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path());
+ if ($is_album_writable) {
+ $add_menu->append(Menu::factory("dialog")
+ ->id("add_photos_item")
+ ->label(t("Add photos"))
+ ->url(url::site("simple_uploader/app/$item->id")));
+ if ($item->is_album()) {
+ $add_menu->append(Menu::factory("dialog")
+ ->id("add_album_item")
+ ->label(t("Add an album"))
+ ->url(url::site("form/add/albums/$item->id?type=album")));
+ }
+ } else {
+ message::warning(t("The album '%album_name' is not writable.",
+ array("album_name" => $item->title)));
+ }
+ }
+
+ switch ($item->type) {
+ case "album":
+ $option_text = t("Album options");
+ $edit_text = t("Edit album");
+ break;
+ case "movie":
+ $option_text = t("Movie options");
+ $edit_text = t("Edit movie");
+ break;
+ default:
+ $option_text = t("Photo options");
+ $edit_text = t("Edit photo");
+ }
+
+ $menu->append($options_menu = Menu::factory("submenu")
+ ->id("options_menu")
+ ->label($option_text));
+ if ($item && ($can_edit || $can_add)) {
+ if ($can_edit) {
+ $options_menu->append(Menu::factory("dialog")
+ ->id("edit_item")
+ ->label($edit_text)
+ ->url(url::site("form/edit/{$item->type}s/$item->id")));
+ }
+
+ if ($item->is_album()) {
+ if ($can_edit) {
+ $options_menu->append(Menu::factory("dialog")
+ ->id("edit_permissions")
+ ->label(t("Edit permissions"))
+ ->url(url::site("permissions/browse/$item->id")));
+ }
+ }
+ }
+ }
+
+ if (identity::active_user()->admin) {
+ $menu->append($admin_menu = Menu::factory("submenu")
+ ->id("admin_menu")
+ ->label(t("Admin")));
+ module::event("admin_menu", $admin_menu, $theme);
+ }
+ }
+ }
+
+ static function admin_menu($menu, $theme) {
+ $menu
+ ->append(Menu::factory("link")
+ ->id("dashboard")
+ ->label(t("Dashboard"))
+ ->url(url::site("admin")))
+ ->append(Menu::factory("submenu")
+ ->id("settings_menu")
+ ->label(t("Settings"))
+ ->append(Menu::factory("link")
+ ->id("graphics_toolkits")
+ ->label(t("Graphics"))
+ ->url(url::site("admin/graphics")))
+ ->append(Menu::factory("link")
+ ->id("languages")
+ ->label(t("Languages"))
+ ->url(url::site("admin/languages")))
+ ->append(Menu::factory("link")
+ ->id("advanced")
+ ->label(t("Advanced"))
+ ->url(url::site("admin/advanced_settings")))
+ ->append(Menu::factory("link")
+ ->id("identity_drivers")
+ ->label(t("Identity drivers"))
+ ->url(url::site("admin/identity"))))
+ ->append(Menu::factory("link")
+ ->id("modules")
+ ->label(t("Modules"))
+ ->url(url::site("admin/modules")))
+ ->append(Menu::factory("submenu")
+ ->id("content_menu")
+ ->label(t("Content")))
+ ->append(Menu::factory("submenu")
+ ->id("appearance_menu")
+ ->label(t("Appearance"))
+ ->append(Menu::factory("link")
+ ->id("themes")
+ ->label(t("Theme choice"))
+ ->url(url::site("admin/themes")))
+ ->append(Menu::factory("link")
+ ->id("theme_options")
+ ->label(t("Theme options"))
+ ->url(url::site("admin/theme_options")))
+ ->append(Menu::factory("link")
+ ->id("sidebar")
+ ->label(t("Manage sidebar"))
+ ->url(url::site("admin/sidebar"))))
+ ->append(Menu::factory("submenu")
+ ->id("statistics_menu")
+ ->label(t("Statistics")))
+ ->append(Menu::factory("link")
+ ->id("maintenance")
+ ->label(t("Maintenance"))
+ ->url(url::site("admin/maintenance")));
+ return $menu;
+ }
+
+ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
+ $menu->append($options_menu = Menu::factory("submenu")
+ ->id("options_menu")
+ ->label(t("Options"))
+ ->css_class("ui-icon-carat-1-n"));
+
+ if (access::can("edit", $item)) {
+ $page_type = $theme->page_type();
+ switch ($item->type) {
+ case "movie":
+ $edit_title = t("Edit this movie");
+ $delete_title = t("Delete this movie");
+ break;
+
+ case "album":
+ $edit_title = t("Edit this album");
+ $delete_title = t("Delete this album");
+ break;
+
+ default:
+ $edit_title = t("Edit this photo");
+ $delete_title = t("Delete this photo");
+ break;
+ }
+ $cover_title = t("Choose as the album cover");
+ $move_title = t("Move to another album");
+
+ $csrf = access::csrf_token();
+
+ $options_menu->append(Menu::factory("dialog")
+ ->id("edit")
+ ->label($edit_title)
+ ->css_class("ui-icon-pencil")
+ ->url(url::site("quick/form_edit/$item->id?page_type=$page_type")));
+
+
+ if ($item->is_photo() && graphics::can("rotate")) {
+ $options_menu
+ ->append(
+ Menu::factory("ajax_link")
+ ->id("rotate_ccw")
+ ->label(t("Rotate 90&deg; counter clockwise"))
+ ->css_class("ui-icon-rotate-ccw")
+ ->ajax_handler("function(data) { " .
+ "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
+ ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&page_type=$page_type")))
+ ->append(
+ Menu::factory("ajax_link")
+ ->id("rotate_cw")
+ ->label(t("Rotate 90&deg; clockwise"))
+ ->css_class("ui-icon-rotate-cw")
+ ->ajax_handler("function(data) { " .
+ "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
+ ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&page_type=$page_type")));
+ }
+
+ // @todo Don't move photos from the photo page; we don't yet have a good way of redirecting after
+ // move
+ if ($page_type == "album") {
+ $options_menu
+ ->append(Menu::factory("dialog")
+ ->id("move")
+ ->label($move_title)
+ ->css_class("ui-icon-folder-open")
+ ->url(url::site("move/browse/$item->id")));
+ }
+
+ $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 = " ";
+ }
+ if ($item->parent()->id != 1) {
+ $options_menu
+ ->append(Menu::factory("ajax_link")
+ ->id("make_album_cover")
+ ->label($cover_title)
+ ->css_class("ui-icon-star")
+ ->ajax_handler("function(data) { window.location.reload() }")
+ ->url(url::site("quick/make_album_cover/$item->id?csrf=$csrf")));
+ }
+ $options_menu
+ ->append(Menu::factory("dialog")
+ ->id("delete")
+ ->label($delete_title)
+ ->css_class("ui-icon-trash")
+ ->css_id("g-quick-delete")
+ ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&page_type=$page_type")));
+ }
+
+ if ($item->is_album()) {
+ $options_menu
+ ->append(Menu::factory("dialog")
+ ->id("add_item")
+ ->label(t("Add a photo"))
+ ->css_class("ui-icon-plus")
+ ->url(url::site("simple_uploader/app/$item->id")))
+ ->append(Menu::factory("dialog")
+ ->id("add_album")
+ ->label(t("Add an album"))
+ ->css_class("ui-icon-note")
+ ->url(url::site("form/add/albums/$item->id?type=album")))
+ ->append(Menu::factory("dialog")
+ ->id("edit_permissions")
+ ->label(t("Edit permissions"))
+ ->css_class("ui-icon-key")
+ ->url(url::site("permissions/browse/$item->id")));
+ }
+ }
+ }
}
diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php
new file mode 100644
index 00000000..c24d2bde
--- /dev/null
+++ b/modules/gallery/helpers/gallery_graphics.php
@@ -0,0 +1,129 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class gallery_graphics_Core {
+ /**
+ * Rotate an image. Valid options are degrees
+ *
+ * @param string $input_file
+ * @param string $output_file
+ * @param array $options
+ */
+ static function rotate($input_file, $output_file, $options) {
+ graphics::init_toolkit();
+
+ module::event("graphics_rotate", $input_file, $output_file, $options);
+
+ Image::factory($input_file)
+ ->quality(module::get_var("gallery", "image_quality"))
+ ->rotate($options["degrees"])
+ ->save($output_file);
+
+ module::event("graphics_rotate_completed", $input_file, $output_file, $options);
+ }
+
+ /**
+ * Resize an image. Valid options are width, height and master. Master is one of the Image
+ * master dimension constants.
+ *
+ * @param string $input_file
+ * @param string $output_file
+ * @param array $options
+ */
+ static function resize($input_file, $output_file, $options) {
+ graphics::init_toolkit();
+
+ module::event("graphics_resize", $input_file, $output_file, $options);
+
+ if (@filesize($input_file) == 0) {
+ throw new Exception("@todo EMPTY_INPUT_FILE");
+ }
+
+ $dims = getimagesize($input_file);
+ if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) {
+ // Image would get upscaled; do nothing
+ copy($input_file, $output_file);
+ } else {
+ $image = Image::factory($input_file)
+ ->resize($options["width"], $options["height"], $options["master"])
+ ->quality(module::get_var("gallery", "image_quality"));
+ if (graphics::can("sharpen")) {
+ $image->sharpen(module::get_var("gallery", "image_sharpen"));
+ }
+ $image->save($output_file);
+ }
+
+ module::event("graphics_resize_completed", $input_file, $output_file, $options);
+ }
+
+ /**
+ * Overlay an image on top of the input file.
+ *
+ * Valid options are: file, mime_type, position, transparency_percent, padding
+ *
+ * Valid positions: northwest, north, northeast,
+ * west, center, east,
+ * southwest, south, southeast
+ *
+ * padding is in pixels
+ *
+ * @param string $input_file
+ * @param string $output_file
+ * @param array $options
+ */
+ static function composite($input_file, $output_file, $options) {
+ try {
+ graphics::init_toolkit();
+
+ module::event("graphics_composite", $input_file, $output_file, $options);
+
+ list ($width, $height) = getimagesize($input_file);
+ list ($w_width, $w_height) = getimagesize($options["file"]);
+
+ $pad = isset($options["padding"]) ? $options["padding"] : 10;
+ $top = $pad;
+ $left = $pad;
+ $y_center = max($height / 2 - $w_height / 2, $pad);
+ $x_center = max($width / 2 - $w_width / 2, $pad);
+ $bottom = max($height - $w_height - $pad, $pad);
+ $right = max($width - $w_width - $pad, $pad);
+
+ switch ($options["position"]) {
+ case "northwest": $x = $left; $y = $top; break;
+ case "north": $x = $x_center; $y = $top; break;
+ case "northeast": $x = $right; $y = $top; break;
+ case "west": $x = $left; $y = $y_center; break;
+ case "center": $x = $x_center; $y = $y_center; break;
+ case "east": $x = $right; $y = $y_center; break;
+ case "southwest": $x = $left; $y = $bottom; break;
+ case "south": $x = $x_center; $y = $bottom; break;
+ case "southeast": $x = $right; $y = $bottom; break;
+ }
+
+ Image::factory($input_file)
+ ->composite($options["file"], $x, $y, $options["transparency"])
+ ->quality(module::get_var("gallery", "image_quality"))
+ ->save($output_file);
+
+ module::event("graphics_composite_completed", $input_file, $output_file, $options);
+ } catch (ErrorException $e) {
+ Kohana::log("error", $e->get_message());
+ }
+ }
+}
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 6500482b..57a5ee9f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -199,12 +199,12 @@ class gallery_installer {
}
access::register_permission("view", "View");
- access::register_permission("view_full", "View Full Size");
+ access::register_permission("view_full", "View full size");
access::register_permission("edit", "Edit");
access::register_permission("add", "Add");
// Mark for translation (must be the same strings as used above)
- t("View Full Size");
+ t("View full size");
t("View");
t("Edit");
t("Add");
@@ -224,8 +224,8 @@ class gallery_installer {
$root->save();
access::add_item($root);
- module::set_var("gallery", "active_site_theme", "default");
- module::set_var("gallery", "active_admin_theme", "admin_default");
+ module::set_var("gallery", "active_site_theme", "wind");
+ module::set_var("gallery", "active_admin_theme", "admin_wind");
module::set_var("gallery", "page_size", 9);
module::set_var("gallery", "thumb_size", 200);
module::set_var("gallery", "resize_size", 640);
@@ -235,16 +235,16 @@ class gallery_installer {
// Add rules for generating our thumbnails and resizes
graphics::add_rule(
- "gallery", "thumb", "resize",
+ "gallery", "thumb", "gallery_graphics::resize",
array("width" => 200, "height" => 200, "master" => Image::AUTO),
100);
graphics::add_rule(
- "gallery", "resize", "resize",
+ "gallery", "resize", "gallery_graphics::resize",
array("width" => 640, "height" => 480, "master" => Image::AUTO),
100);
// Instantiate default themes (site and admin)
- foreach (array("default", "admin_default") as $theme_name) {
+ foreach (array("wind", "admin_wind") as $theme_name) {
$theme_info = new ArrayObject(parse_ini_file(THEMEPATH . $theme_name . "/theme.info"),
ArrayObject::ARRAY_AS_PROPS);
$theme = ORM::factory("theme");
@@ -268,7 +268,7 @@ class gallery_installer {
module::set_var("gallery", "show_credits", 1);
// @todo this string needs to be picked up by l10n_scanner
module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>");
- module::set_version("gallery", 12);
+ module::set_version("gallery", 19);
}
static function upgrade($version) {
@@ -317,7 +317,7 @@ class gallery_installer {
}
if ($version == 7) {
- $groups = ORM::factory("group")->find_all();
+ $groups = identity::groups();
$permissions = ORM::factory("permission")->find_all();
foreach($groups as $group) {
foreach($permissions as $permission) {
@@ -364,6 +364,74 @@ class gallery_installer {
$db->query("UPDATE {items} SET `relative_url_cache` = NULL, `relative_path_cache` = NULL");
module::set_version("gallery", $version = 12);
}
+
+ if ($version == 12) {
+ if (module::get_var("gallery", "active_site_theme") == "default") {
+ module::set_var("gallery", "active_site_theme", "wind");
+ }
+ if (module::get_var("gallery", "active_admin_theme") == "admin_default") {
+ module::set_var("gallery", "active_admin_theme", "admin_wind");
+ }
+ module::set_version("gallery", $version = 13);
+ }
+
+ if ($version == 13) {
+ // Add rules for generating our thumbnails and resizes
+ Database::instance()->query(
+ "UPDATE {graphics_rules} SET `operation` = CONCAT('gallery_graphics::', `operation`);");
+ module::set_version("gallery", $version = 14);
+ }
+
+ if ($version == 14) {
+ $sidebar_blocks = block_manager::get_active("site_sidebar");
+ if (empty($sidebar_blocks)) {
+ $available_blocks = block_manager::get_available_site_blocks();
+ foreach (array_keys(block_manager::get_available_site_blocks()) as $id) {
+ $sidebar_blocks[] = explode(":", $id);
+ }
+ block_manager::set_active("site_sidebar", $sidebar_blocks);
+ }
+ module::set_version("gallery", $version = 15);
+ }
+
+ if ($version == 15) {
+ module::set_var("gallery", "identity_provider", "user");
+ module::set_version("gallery", $version = 16);
+ }
+
+ // Convert block keys to an md5 hash of the module and block name
+ if ($version == 16) {
+ foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $location) {
+ $blocks = block_manager::get_active($location);
+ $new_blocks = array();
+ foreach ($blocks as $block) {
+ $new_blocks[md5("{$block[0]}:{$block[1]}")] = $block;
+ }
+ block_manager::set_active($location, $new_blocks);
+ }
+ module::set_version("gallery", $version = 17);
+ }
+
+ // We didn't like md5 hashes so convert block keys back to random keys to allow duplicates.
+ if ($version == 17) {
+ foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $location) {
+ $blocks = block_manager::get_active($location);
+ $new_blocks = array();
+ foreach ($blocks as $block) {
+ $new_blocks[rand()] = $block;
+ }
+ block_manager::set_active($location, $new_blocks);
+ }
+ module::set_version("gallery", $version = 18);
+ }
+
+ // Rename blocks_site.sidebar to blocks_site_sidebar
+ if ($version == 18) {
+ $blocks = block_manager::get_active("site.sidebar");
+ block_manager::set_active("site_sidebar", $blocks);
+ module::clear_var("gallery", "blocks_site.sidebar");
+ module::set_version("gallery", $version = 19);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php
index feeab88a..155edfb5 100644
--- a/modules/gallery/helpers/gallery_rss.php
+++ b/modules/gallery/helpers/gallery_rss.php
@@ -39,8 +39,8 @@ class gallery_rss_Core {
->orderby("created", "DESC");
$feed->max_pages = ceil($all_children->find_all()->count() / $limit);
- $feed->title = t("Recent Updates");
- $feed->description = t("Recent Updates");
+ $feed->title = t("Recent updates");
+ $feed->description = t("Recent updates");
return $feed;
case "album":
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php
index 1b56ab97..95216cf0 100644
--- a/modules/gallery/helpers/gallery_task.php
+++ b/modules/gallery/helpers/gallery_task.php
@@ -48,9 +48,16 @@ class gallery_task_Core {
$errors = array();
try {
$result = graphics::find_dirty_images_query();
+ $total_count = $task->get("total_count", $result->count());
+ $mode = $task->get("mode", "init");
+ if ($mode == "init") {
+ $task->set("total_count", $total_count);
+ $task->set("mode", "process");
+ batch::start();
+ }
+
$completed = $task->get("completed", 0);
$ignored = $task->get("ignored", array());
- $remaining = $result->count() - count($ignored);
$i = 0;
foreach ($result as $row) {
@@ -62,19 +69,18 @@ class gallery_task_Core {
if ($item->loaded) {
try {
graphics::generate($item);
- $ignored[$item->id] = 1;
+ $completed++;
+
$errors[] = t("Successfully rebuilt images for '%title'",
array("title" => html::purify($item->title)));
} catch (Exception $e) {
$errors[] = t("Unable to rebuild images for '%title'",
array("title" => html::purify($item->title)));
$errors[] = $e->__toString();
+ $ignored[$item->id] = 1;
}
}
- $completed++;
- $remaining--;
-
if (++$i == 2) {
break;
}
@@ -83,19 +89,20 @@ class gallery_task_Core {
$task->status = t2("Updated: 1 image. Total: %total_count.",
"Updated: %count images. Total: %total_count.",
$completed,
- array("total_count" => ($remaining + $completed)));
+ array("total_count" => $total_count));
- if ($completed + $remaining > 0) {
- $task->percent_complete = (int)(100 * $completed / ($completed + $remaining));
+ if ($completed < $total_count) {
+ $task->percent_complete = (int)(100 * ($completed + count($ignored)) / $total_count);
} else {
$task->percent_complete = 100;
}
$task->set("completed", $completed);
$task->set("ignored", $ignored);
- if ($remaining == 0) {
+ if ($task->percent_complete == 100) {
$task->done = true;
$task->state = "success";
+ batch::stop();
site_status::clear("graphics_dirty");
}
} catch (Exception $e) {
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index 20dfeb04..0018fd9a 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -21,6 +21,7 @@ class gallery_theme_Core {
static function head($theme) {
$session = Session::instance();
$buf = "";
+ $theme->css("gallery.css");
if ($session->get("debug")) {
$theme->css("debug.css");
}
@@ -37,16 +38,23 @@ class gallery_theme_Core {
}
}
+ if (count(locales::installed())) {
+ // Needed by the languages block
+ $theme->script("jquery.cookie.js");
+ }
+
if ($session->get("l10n_mode", false)) {
$theme->css("l10n_client.css");
$theme->script("jquery.cookie.js");
$theme->script("l10n_client.js");
}
+ $theme->css("uploadify/uploadify.css");
return $buf;
}
static function admin_head($theme) {
+ $theme->css("gallery.css");
$theme->script("gallery.panel.js");
$session = Session::instance();
if ($session->get("debug")) {
@@ -88,7 +96,7 @@ class gallery_theme_Core {
}
static function credits() {
- return "<li class=\"first\">" .
+ return "<li class=\"g-first\">" .
t(module::get_var("gallery", "credits"),
array("url" => "http://gallery.menalto.com", "version" => gallery::VERSION)) .
"</li>";
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index 78812794..d6a2f00c 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -19,6 +19,7 @@
*/
class graphics_Core {
private static $init;
+ private static $_rules_cache = array();
/**
* Add a new graphics rule.
@@ -26,7 +27,7 @@ class graphics_Core {
* Rules are applied to targets (thumbnails and resizes) in priority order. Rules are functions
* in the graphics class. So for example, the following rule:
*
- * graphics::add_rule("gallery", "thumb", "resize",
+ * graphics::add_rule("gallery", "thumb", "gallery_graphics::resize",
* array("width" => 200, "height" => 200, "master" => Image::AUTO), 100);
*
* Specifies that "gallery" is adding a rule to resize thumbnails down to a max of 200px on
@@ -35,7 +36,7 @@ class graphics_Core {
*
* @param string $module_name the module that added the rule
* @param string $target the target for this operation ("thumb" or "resize")
- * @param string $operation the name of the operation
+ * @param string $operation the name of the operation (<defining class>::method)
* @param array $args arguments to the operation
* @param integer $priority the priority for this rule (lower priorities are run first)
*/
@@ -56,7 +57,7 @@ class graphics_Core {
* Remove any matching graphics rules
* @param string $module_name the module that added the rule
* @param string $target the target for this operation ("thumb" or "resize")
- * @param string $operation the name of the operation
+ * @param string $operation the name of the operation(<defining class>::method)
*/
static function remove_rule($module_name, $target, $operation) {
ORM::factory("graphics_rule")
@@ -146,13 +147,9 @@ class graphics_Core {
$working_file = $input_file;
}
- foreach (ORM::factory("graphics_rule")
- ->where("target", $target)
- ->where("active", true)
- ->orderby("priority", "asc")
- ->find_all() as $rule) {
+ foreach (self::_get_rules($target) as $rule) {
$args = array($working_file, $output_file, unserialize($rule->args));
- call_user_func_array(array("graphics", $rule->operation), $args);
+ call_user_func_array($rule->operation, $args);
$working_file = $output_file;
}
}
@@ -180,116 +177,19 @@ class graphics_Core {
}
}
- /**
- * Resize an image. Valid options are width, height and master. Master is one of the Image
- * master dimension constants.
- *
- * @param string $input_file
- * @param string $output_file
- * @param array $options
- */
- static function resize($input_file, $output_file, $options) {
- if (!self::$init) {
- self::init_toolkit();
- }
-
- module::event("graphics_resize", $input_file, $output_file, $options);
-
- if (@filesize($input_file) == 0) {
- throw new Exception("@todo EMPTY_INPUT_FILE");
- }
-
- $dims = getimagesize($input_file);
- if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) {
- // Image would get upscaled; do nothing
- copy($input_file, $output_file);
- } else {
- $image = Image::factory($input_file)
- ->resize($options["width"], $options["height"], $options["master"])
- ->quality(module::get_var("gallery", "image_quality"));
- if (graphics::can("sharpen")) {
- $image->sharpen(module::get_var("gallery", "image_sharpen"));
+ private static function _get_rules($target) {
+ if (empty(self::$_rules_cache[$target])) {
+ $rules = array();
+ foreach (ORM::factory("graphics_rule")
+ ->where("target", $target)
+ ->where("active", true)
+ ->orderby("priority", "asc")
+ ->find_all() as $rule) {
+ $rules[] = (object)$rule->as_array();
}
- $image->save($output_file);
- }
-
- module::event("graphics_resize_completed", $input_file, $output_file, $options);
- }
-
- /**
- * Rotate an image. Valid options are degrees
- *
- * @param string $input_file
- * @param string $output_file
- * @param array $options
- */
- static function rotate($input_file, $output_file, $options) {
- if (!self::$init) {
- self::init_toolkit();
- }
-
- module::event("graphics_rotate", $input_file, $output_file, $options);
-
- Image::factory($input_file)
- ->quality(module::get_var("gallery", "image_quality"))
- ->rotate($options["degrees"])
- ->save($output_file);
-
- module::event("graphics_rotate_completed", $input_file, $output_file, $options);
- }
-
- /**
- * Overlay an image on top of the input file.
- *
- * Valid options are: file, mime_type, position, transparency_percent, padding
- *
- * Valid positions: northwest, north, northeast,
- * west, center, east,
- * southwest, south, southeast
- *
- * padding is in pixels
- *
- * @param string $input_file
- * @param string $output_file
- * @param array $options
- */
- static function composite($input_file, $output_file, $options) {
- if (!self::$init) {
- self::init_toolkit();
- }
-
- module::event("graphics_composite", $input_file, $output_file, $options);
-
- list ($width, $height) = getimagesize($input_file);
- list ($w_width, $w_height) = getimagesize($options["file"]);
-
- $pad = isset($options["padding"]) ? $options["padding"] : 10;
- $top = $pad;
- $left = $pad;
- $y_center = max($height / 2 - $w_height / 2, $pad);
- $x_center = max($width / 2 - $w_width / 2, $pad);
- $bottom = max($height - $w_height - $pad, $pad);
- $right = max($width - $w_width - $pad, $pad);
-
- switch ($options["position"]) {
- case "northwest": $x = $left; $y = $top; break;
- case "north": $x = $x_center; $y = $top; break;
- case "northeast": $x = $right; $y = $top; break;
- case "west": $x = $left; $y = $y_center; break;
- case "center": $x = $x_center; $y = $y_center; break;
- case "east": $x = $right; $y = $y_center; break;
- case "southwest": $x = $left; $y = $bottom; break;
- case "south": $x = $x_center; $y = $bottom; break;
- case "southeast": $x = $right; $y = $bottom; break;
+ self::$_rules_cache[$target] = $rules;
}
-
- Image::factory($input_file)
- ->composite($options["file"], $x, $y, $options["transparency"])
- ->quality(module::get_var("gallery", "image_quality"))
- ->save($output_file);
-
-
- module::event("graphics_composite_completed", $input_file, $output_file, $options);
+ return self::$_rules_cache[$target];
}
/**
@@ -327,7 +227,7 @@ class graphics_Core {
"%count of your photos are out of date. <a %attrs>Click here to fix them</a>",
$count,
array("attrs" => html::mark_clean(sprintf(
- 'href="%s" class="gDialogLink"',
+ 'href="%s" class="g-dialog-link"',
url::site("admin/maintenance/start/gallery_task::rebuild_dirty_images?csrf=__CSRF__"))))),
"graphics_dirty");
}
@@ -378,7 +278,10 @@ class graphics_Core {
$toolkits->graphicsmagick->installed = false;
$toolkits->graphicsmagick->error = t("GraphicsMagick requires the <b>exec</b> function");
} else {
- putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin:/opt/bin");
+ $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
+
+ putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
+ ":/usr/local/bin:/opt/local/bin:/opt/bin");
// @todo: consider refactoring the two segments below into a loop since they are so
// similar.
@@ -463,6 +366,9 @@ class graphics_Core {
* Choose which driver the Kohana Image library uses.
*/
static function init_toolkit() {
+ if (self::$init) {
+ return;
+ }
switch(module::get_var("gallery", "graphics_toolkit")) {
case "gd":
Kohana::config_set("image.driver", "GD");
diff --git a/modules/gallery/helpers/identity.php b/modules/gallery/helpers/identity.php
new file mode 100644
index 00000000..72e3312d
--- /dev/null
+++ b/modules/gallery/helpers/identity.php
@@ -0,0 +1,244 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+class identity_Core {
+ protected static $available;
+
+ /**
+ * Return a list of installed Identity Drivers.
+ *
+ * @return boolean true if the driver supports updates; false if read only
+ */
+ static function providers() {
+ if (empty(self::$available)) {
+ $drivers = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
+ foreach (module::available() as $module_name => $module) {
+ if (file_exists(MODPATH . "{$module_name}/config/identity.php")) {
+ $drivers->$module_name = $module->description;
+ }
+ }
+ self::$available = $drivers;
+ }
+ return self::$available;
+ }
+
+ /**
+ * Frees the current instance of the identity provider so the next call to instance will reload
+ *
+ * @param string configuration
+ * @return Identity_Core
+ */
+ static function reset() {
+ IdentityProvider::reset();
+ }
+
+ /**
+ * Make sure that we have a session and group_ids cached in the session.
+ */
+ static function load_user() {
+ try {
+ // Call IdentityProvider::instance() now to force the load of the user interface classes.
+ // We are about to load the active user from the session and which needs the user definition
+ // class, which can't be reached by Kohana's heiracrchical lookup.
+ IdentityProvider::instance();
+
+ $session = Session::instance();
+ if (!($user = $session->get("user"))) {
+ self::set_active_user($user = self::guest());
+ }
+
+ // The installer cannot set a user into the session, so it just sets an id which we should
+ // upconvert into a user.
+ // @todo set the user name into the session instead of 2 and then use it to get the user object
+ if ($user === 2) {
+ $user = IdentityProvider::instance()->admin_user();
+ self::set_active_user($user);
+ $session->set("user", $user);
+ }
+
+ if (!$session->get("group_ids")) {
+ $ids = array();
+ foreach ($user->groups as $group) {
+ $ids[] = $group->id;
+ }
+ $session->set("group_ids", $ids);
+ }
+ } catch (Exception $e) {
+ // Log it, so we at least have so notification that we swallowed the exception.
+ Kohana::log("error", "Load_user Exception: " . $e->__toString());
+ try {
+ Session::instance()->destroy();
+ } catch (Exception $e) {
+ // We don't care if there was a problem destroying the session.
+ }
+ url::redirect(item::root()->abs_url());
+ }
+ }
+
+ /**
+ * Return the array of group ids this user belongs to
+ *
+ * @return array
+ */
+ static function group_ids_for_active_user() {
+ return Session::instance()->get("group_ids", array(1));
+ }
+
+ /**
+ * Return the active user. If there's no active user, return the guest user.
+ *
+ * @return User_Definition
+ */
+ static function active_user() {
+ // @todo (maybe) cache this object so we're not always doing session lookups.
+ $user = Session::instance()->get("user", null);
+ if (!isset($user)) {
+ // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary
+ // work.
+ $user = identity::guest();
+ }
+ return $user;
+ }
+
+ /**
+ * Change the active user.
+ * @param User_Definition $user
+ */
+ static function set_active_user($user) {
+ $session = Session::instance();
+ $session->set("user", $user);
+ $session->delete("group_ids");
+ self::load_user();
+ }
+
+ /**
+ * Determine if if the current driver supports updates.
+ *
+ * @return boolean true if the driver supports updates; false if read only
+ */
+ static function is_writable() {
+ return IdentityProvider::instance()->is_writable();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::guest.
+ */
+ static function guest() {
+ return IdentityProvider::instance()->guest();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::admin_user.
+ */
+ static function admin_user() {
+ return IdentityProvider::instance()->admin_user();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_user.
+ */
+ static function create_user($name, $full_name, $password) {
+ return IdentityProvider::instance()->create_user($name, $full_name, $password);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::is_correct_password.
+ */
+ static function is_correct_password($user, $password) {
+ return IdentityProvider::instance()->is_correct_password($user, $password);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user.
+ */
+ static function lookup_user($id) {
+ return IdentityProvider::instance()->lookup_user($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user_by_name.
+ */
+ static function lookup_user_by_name($name) {
+ return IdentityProvider::instance()->lookup_user_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_group.
+ */
+ static function create_group($name) {
+ return IdentityProvider::instance()->create_group($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::everybody.
+ */
+ static function everybody() {
+ return IdentityProvider::instance()->everybody();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::registered_users.
+ */
+ static function registered_users() {
+ return IdentityProvider::instance()->registered_users();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group.
+ */
+ static function lookup_group($id) {
+ return IdentityProvider::instance()->lookup_group($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group_by_name.
+ */
+ static function lookup_group_by_name($name) {
+ return IdentityProvider::instance()->lookup_group_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::get_user_list.
+ */
+ static function get_user_list($ids) {
+ return IdentityProvider::instance()->get_user_list($ids);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::groups.
+ */
+ static function groups() {
+ return IdentityProvider::instance()->groups();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::add_user_to_group.
+ */
+ static function add_user_to_group($user, $group_id) {
+ return IdentityProvider::instance()->add_user_to_group($user, $group_id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::remove_user_to_group.
+ */
+ static function remove_user_from_group($user, $group_id) {
+ return IdentityProvider::instance()->remove_user_from_group($user, $group_id);
+ }
+} \ No newline at end of file
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 588c08d4..b3b6d0bb 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -130,7 +130,7 @@ class item_Core {
$page_type = "photo";
}
$form = new Forge(
- "quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "gConfirmDelete"));
+ "quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "g-confirm-delete"));
$form->hidden("_method")->value("put");
$group = $form->group("confirm_delete")->label(t("Confirm Deletion"));
$group->submit("")->value(t("Delete"));
@@ -158,8 +158,8 @@ class item_Core {
*/
static function viewable($model) {
$view_restrictions = array();
- if (!user::active()->admin) {
- foreach (user::group_ids() as $id) {
+ if (!identity::active_user()->admin) {
+ foreach (identity::group_ids_for_active_user() as $id) {
// Separate the first restriction from the rest to make it easier for us to formulate
// our where clause below
if (empty($view_restrictions)) {
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php
index ab7f7526..2de029ff 100644
--- a/modules/gallery/helpers/locales.php
+++ b/modules/gallery/helpers/locales.php
@@ -219,4 +219,36 @@ class locales_Core {
}
return array(null, 0);
}
-} \ No newline at end of file
+
+ static function set_request_locale() {
+ // 1. Check the session specific preference (cookie)
+ $locale = self::cookie_locale();
+ // 2. Check the user's preference
+ if (!$locale) {
+ $locale = identity::active_user()->locale;
+ }
+ // 3. Check the browser's / OS' preference
+ if (!$locale) {
+ $locale = self::locale_from_http_request();
+ }
+ // If we have any preference, override the site's default locale
+ if ($locale) {
+ I18n::instance()->locale($locale);
+ }
+ }
+
+ static function cookie_locale() {
+ $cookie_data = Input::instance()->cookie("g_locale");
+ $locale = null;
+ if ($cookie_data) {
+ if (preg_match("/^([a-z]{2,3}(?:_[A-Z]{2})?)$/", trim($cookie_data), $matches)) {
+ $requested_locale = $matches[1];
+ $installed_locales = locales::installed();
+ if (isset($installed_locales[$requested_locale])) {
+ $locale = $requested_locale;
+ }
+ }
+ }
+ return $locale;
+ }
+}
diff --git a/modules/gallery/helpers/log.php b/modules/gallery/helpers/log.php
index 451f985a..184b0b97 100644
--- a/modules/gallery/helpers/log.php
+++ b/modules/gallery/helpers/log.php
@@ -80,7 +80,7 @@ class log_Core {
$log->url = substr(url::abs_current(true), 0, 255);
$log->referer = request::referrer(null);
$log->timestamp = time();
- $log->user_id = user::active()->id;
+ $log->user_id = identity::active_user()->id;
$log->save();
}
@@ -93,16 +93,16 @@ class log_Core {
static function severity_class($severity) {
switch($severity) {
case self::SUCCESS:
- return "gSuccess";
+ return "g-success";
case self::INFO:
- return "gInfo";
+ return "g-info";
case self::WARNING:
- return "gWarning";
+ return "g-warning";
case self::ERROR:
- return "gError";
+ return "g-error";
}
}
}
diff --git a/modules/gallery/helpers/message.php b/modules/gallery/helpers/message.php
index af3b96cc..02680655 100644
--- a/modules/gallery/helpers/message.php
+++ b/modules/gallery/helpers/message.php
@@ -81,7 +81,7 @@ class message_Core {
$buf[] = "<li class=\"" . self::severity_class($msg[1]) . "\">$msg[0]</li>";
}
if ($buf) {
- return "<ul id=\"gMessage\">" . implode("", $buf) . "</ul>";
+ return "<ul id=\"g-action-status\" class=\"g-message-block\">" . implode("", $buf) . "</ul>";
}
}
@@ -93,16 +93,16 @@ class message_Core {
static function severity_class($severity) {
switch($severity) {
case self::SUCCESS:
- return "gSuccess";
+ return "g-success";
case self::INFO:
- return "gInfo";
+ return "g-info";
case self::WARNING:
- return "gWarning";
+ return "g-warning";
case self::ERROR:
- return "gError";
+ return "g-error";
}
}
}
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index a3088c38..e6c196ce 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -50,8 +50,20 @@ class module_Core {
* @param string $module_name
*/
static function get($module_name) {
- // @todo can't easily use model_cache here because it throw an exception on missing models.
- return ORM::factory("module", array("name" => $module_name));
+ if (empty(self::$modules[$module_name])) {
+ return ORM::factory("module", array("name" => $module_name));
+ }
+ return self::$modules[$module_name];
+ }
+
+ /**
+ * Get the information about a module
+ * @returns ArrayObject containing the module information from the module.info file or false if
+ * not found
+ */
+ static function info($module_name) {
+ $module_list = self::available();
+ return isset($module_list->$module_name) ? $module_list->$module_name : false;
}
/**
@@ -79,18 +91,20 @@ class module_Core {
$modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
foreach (glob(MODPATH . "*/module.info") as $file) {
$module_name = basename(dirname($file));
- $modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
+ $modules->$module_name =
+ new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
$m =& $modules->$module_name;
$m->installed = self::is_installed($module_name);
$m->active = self::is_active($module_name);
$m->code_version = $m->version;
$m->version = self::get_version($module_name);
- $m->locked = false;
+ $m->locked = !empty($m->no_module_admin);
}
// Lock certain modules
$modules->gallery->locked = true;
- $modules->user->locked = true;
+ $identity_module = self::get_var("gallery", "identity_provider", "user");
+ $modules->$identity_module->locked = true;
$modules->ksort();
self::$available = $modules;
}
@@ -116,6 +130,8 @@ class module_Core {
array_unshift($kohana_modules, MODPATH . $module_name);
Kohana::config_set("core.modules", $kohana_modules);
+ // Rebuild the include path so the module installer can benefit from auto loading
+ Kohana::include_paths(true);
$installer_class = "{$module_name}_installer";
if (method_exists($installer_class, "install")) {
call_user_func_array(array($installer_class, "install"), array());
@@ -139,10 +155,6 @@ class module_Core {
* @param string $module_name
*/
static function upgrade($module_name) {
- $kohana_modules = Kohana::config("core.modules");
- array_unshift($kohana_modules, MODPATH . $module_name);
- Kohana::config_set("core.modules", $kohana_modules);
-
$version_before = module::get_version($module_name);
$installer_class = "{$module_name}_installer";
if (method_exists($installer_class, "upgrade")) {
@@ -155,11 +167,14 @@ class module_Core {
throw new Exception("@todo UNKNOWN_MODULE");
}
}
- module::load_modules();
- // Now the module is upgraded but inactive, so don't leave it in the active path
- array_shift($kohana_modules);
- Kohana::config_set("core.modules", $kohana_modules);
+ // Now the module is upgraded so deactivate it, but we can'it deactivae gallery or the
+ // current identity provider.
+ $identity_provider = module::get_var("gallery", "identity_provider", "user");
+ if (!in_array($module_name, array("gallery", $identity_provider)) ) {
+ self::deactivate($module_name);
+ }
+ module::load_modules();
$version_after = module::get_version($module_name);
if ($version_before != $version_after) {
@@ -195,6 +210,9 @@ class module_Core {
module::load_modules();
graphics::activate_rules($module_name);
+
+ block_manager::activate_blocks($module_name);
+
log::success(
"module", t("Activated module %module_name", array("module_name" => $module_name)));
}
@@ -219,6 +237,9 @@ class module_Core {
module::load_modules();
graphics::deactivate_rules($module_name);
+
+ block_manager::deactivate_blocks($module_name);
+
log::success(
"module", t("Deactivated module %module_name", array("module_name" => $module_name)));
}
@@ -234,7 +255,7 @@ class module_Core {
call_user_func(array($installer_class, "uninstall"));
}
- graphics::remove_rule($module_name);
+ graphics::remove_rules($module_name);
$module = self::get($module_name);
if ($module->loaded) {
$module->delete();
@@ -283,9 +304,32 @@ class module_Core {
array_shift($args);
$function = str_replace(".", "_", $name);
- // @todo: consider calling gallery_event first, since for things menus we need it to do some
- // setup
+ if (method_exists("gallery_event", $function)) {
+ switch (count($args)) {
+ case 0:
+ gallery_event::$function();
+ break;
+ case 1:
+ gallery_event::$function($args[0]);
+ break;
+ case 2:
+ gallery_event::$function($args[0], $args[1]);
+ break;
+ case 3:
+ gallery_event::$function($args[0], $args[1], $args[2]);
+ break;
+ case 4: // Context menu events have 4 arguments so lets optimize them
+ gallery_event::$function($args[0], $args[1], $args[2], $args[3]);
+ break;
+ default:
+ call_user_func_array(array("gallery_event", $function), $args);
+ }
+ }
+
foreach (self::$active as $module) {
+ if ($module->name == "gallery") {
+ continue;
+ }
$class = "{$module->name}_event";
if (method_exists($class, $function)) {
call_user_func_array(array($class, $function), $args);
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 59bf5c19..e84e8ea6 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -77,7 +77,7 @@ class movie_Core {
$movie->title = $title;
$movie->description = $description;
$movie->name = $name;
- $movie->owner_id = $owner_id ? $owner_id : user::active();
+ $movie->owner_id = $owner_id ? $owner_id : identity::active_user()->id;
$movie->width = $movie_info[0];
$movie->height = $movie_info[1];
$movie->mime_type = strtolower($pi["extension"]) == "mp4" ? "video/mp4" : "video/x-flv";
@@ -128,6 +128,38 @@ class movie_Core {
return $movie;
}
+ static function get_edit_form($movie) {
+ $form = new Forge("movies/$movie->id", "", "post", array("id" => "g-edit-movie-form"));
+ $form->hidden("_method")->value("put");
+ $group = $form->group("edit_item")->label(t("Edit Movie"));
+ $group->input("title")->label(t("Title"))->value($movie->title);
+ $group->textarea("description")->label(t("Description"))->value($movie->description);
+ $group->input("filename")->label(t("Filename"))->value($movie->name)
+ ->rules("required")
+ ->error_messages(
+ "name_conflict", t("There is already a movie, photo or album with this name"))
+ ->callback("item::validate_no_slashes")
+ ->error_messages("no_slashes", t("The movie name can't contain a \"/\""))
+ ->callback("item::validate_no_trailing_period")
+ ->error_messages("no_trailing_period", t("The movie name can't end in \".\""))
+ ->error_messages("illegal_extension", t("You cannot change the filename extension"));
+ $group->input("slug")->label(t("Internet Address"))->value($movie->slug)
+ ->callback("item::validate_url_safe")
+ ->error_messages(
+ "slug_conflict", t("There is already a movie, photo or album with this internet address"))
+ ->error_messages(
+ "not_url_safe",
+ t("The internet address should contain only letters, numbers, hyphens and underscores"));
+
+ module::event("item_edit_form", $movie, $form);
+
+ $group = $form->group("buttons")->label("");
+ $group->submit("")->value(t("Modify"));
+ $form->add_rules_from(ORM::factory("item"));
+ return $form;
+ }
+
+
static function getmoviesize($filename) {
$ffmpeg = self::find_ffmpeg();
if (empty($ffmpeg)) {
@@ -158,7 +190,10 @@ class movie_Core {
static function find_ffmpeg() {
if (!$ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) {
- putenv("PATH=" . getenv("PATH") . ":/usr/local/bin:/opt/local/bin:/opt/bin");
+ $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
+
+ putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
+ ":/usr/local/bin:/opt/local/bin:/opt/bin");
if (function_exists("exec")) {
$ffmpeg_path = exec("which ffmpeg");
}
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index 3d9fbe69..01cf5278 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -26,7 +26,7 @@
class photo_Core {
/**
* Create a new photo.
- * @param integer $parent_id id of parent album
+ * @param integer $parent parent album
* @param string $filename path to the photo file on disk
* @param string $name the filename to use for this photo in the album
* @param integer $title the title of the new photo
@@ -76,7 +76,7 @@ class photo_Core {
$photo->title = $title;
$photo->description = $description;
$photo->name = $name;
- $photo->owner_id = $owner_id ? $owner_id : user::active();
+ $photo->owner_id = $owner_id ? $owner_id : identity::active_user()->id;
$photo->width = $image_info[0];
$photo->height = $image_info[1];
$photo->mime_type = empty($image_info['mime']) ? "application/unknown" : $image_info['mime'];
@@ -138,7 +138,7 @@ class photo_Core {
}
static function get_add_form($parent) {
- $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddPhotoForm"));
+ $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-add-photo-form"));
$group = $form->group("add_photo")->label(
t("Add Photo to %album_title", array("album_title" => $parent->title)));
$group->input("title")->label(t("Title"));
@@ -157,21 +157,24 @@ class photo_Core {
}
static function get_edit_form($photo) {
- $form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
+ $form = new Forge("photos/$photo->id", "", "post", array("id" => "g-edit-photo-form"));
$form->hidden("_method")->value("put");
$group = $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)
- ->error_messages("name_conflict", t("There is already a photo or album with this name"))
+ ->rules("required")
+ ->error_messages(
+ "name_conflict", t("There is already a movie, photo or album with this name"))
->callback("item::validate_no_slashes")
->error_messages("no_slashes", t("The photo name can't contain a \"/\""))
->callback("item::validate_no_trailing_period")
- ->error_messages("no_trailing_period", t("The photo name can't end in \".\""));
+ ->error_messages("no_trailing_period", t("The photo name can't end in \".\""))
+ ->error_messages("illegal_extension", t("You cannot change the filename extension"));
$group->input("slug")->label(t("Internet Address"))->value($photo->slug)
->callback("item::validate_url_safe")
->error_messages(
- "slug_conflict", t("There is already a photo or album with this internet address"))
+ "slug_conflict", t("There is already a movie, photo or album with this internet address"))
->error_messages(
"not_url_safe",
t("The internet address should contain only letters, numbers, hyphens and underscores"));
diff --git a/modules/gallery/helpers/site_status.php b/modules/gallery/helpers/site_status.php
index 6d47e565..2b090776 100644
--- a/modules/gallery/helpers/site_status.php
+++ b/modules/gallery/helpers/site_status.php
@@ -95,7 +95,7 @@ class site_status_Core {
* @return html text
*/
static function get() {
- if (!user::active()->admin) {
+ if (!identity::active_user()->admin) {
return;
}
$buf = array();
@@ -105,7 +105,7 @@ class site_status_Core {
}
if ($buf) {
- return "<ul id=\"gSiteStatus\">" . implode("", $buf) . "</ul>";
+ return "<ul id=\"g-site-status\">" . implode("", $buf) . "</ul>";
}
}
@@ -117,16 +117,16 @@ class site_status_Core {
static function severity_class($severity) {
switch($severity) {
case self::SUCCESS:
- return "gSuccess";
+ return "g-success";
case self::INFO:
- return "gInfo";
+ return "g-info";
case self::WARNING:
- return "gWarning";
+ return "g-warning";
case self::ERROR:
- return "gError";
+ return "g-error";
}
}
}
diff --git a/modules/gallery/helpers/task.php b/modules/gallery/helpers/task.php
index 9fa04305..dac5f9d3 100644
--- a/modules/gallery/helpers/task.php
+++ b/modules/gallery/helpers/task.php
@@ -42,7 +42,7 @@ class task_Core {
$task->percent_complete = 0;
$task->status = "";
$task->state = "started";
- $task->owner_id = user::active()->id;
+ $task->owner_id = identity::active_user()->id;
$task->context = serialize($context);
$task->save();
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php
index b46a2c14..da57a37e 100644
--- a/modules/gallery/helpers/theme.php
+++ b/modules/gallery/helpers/theme.php
@@ -29,33 +29,39 @@ class theme_Core {
* active for any given request.
*/
static function load_themes() {
- $modules = Kohana::config("core.modules");
- if (Router::$controller == "admin") {
- array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_admin_theme"));
- } else {
- array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_site_theme"));
+ $path = Input::instance()->server("PATH_INFO");
+ $input = Input::instance();
+ if (empty($path)) {
+ $path = "/" . $input->get("kohana_uri");
}
+ if (!(identity::active_user()->admin && $theme_name = $input->get("theme"))) {
+ $theme_name = module::get_var(
+ "gallery",
+ !strncmp($path, "/admin", 6) ? "active_admin_theme" : "active_site_theme");
+ }
+ $modules = Kohana::config("core.modules");
+ array_unshift($modules, THEMEPATH . $theme_name);
Kohana::config_set("core.modules", $modules);
}
static function get_edit_form_admin() {
- $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"gThemeOptionsForm"));
+ $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"g-theme-options-form"));
$group = $form->group("edit_theme");
- $group->input("page_size")->label(t("Items per page"))->id("gPageSize")
+ $group->input("page_size")->label(t("Items per page"))->id("g-page-size")
->rules("required|valid_digit")
->value(module::get_var("gallery", "page_size"));
- $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("gThumbSize")
+ $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("g-thumb-size")
->rules("required|valid_digit")
->value(module::get_var("gallery", "thumb_size"));
- $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("gResizeSize")
+ $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("g-resize-size")
->rules("required|valid_digit")
->value(module::get_var("gallery", "resize_size"));
- $group->textarea("header_text")->label(t("Header text"))->id("gHeaderText")
+ $group->textarea("header_text")->label(t("Header text"))->id("g-header-text")
->value(module::get_var("gallery", "header_text"));
- $group->textarea("footer_text")->label(t("Footer text"))->id("gFooterText")
+ $group->textarea("footer_text")->label(t("Footer text"))->id("g-footer-text")
->value(module::get_var("gallery", "footer_text"));
- $group->checkbox("show_credits")->label(t("Show site credits"))->id("gFooterText")
+ $group->checkbox("show_credits")->label(t("Show site credits"))->id("g-footer-text")
->checked(module::get_var("gallery", "show_credits"));
$group->submit("")->value(t("Save"));
return $form;
diff --git a/modules/gallery/hooks/init_gallery.php b/modules/gallery/hooks/init_gallery.php
index 5735e7dc..b2d9c4de 100644
--- a/modules/gallery/hooks/init_gallery.php
+++ b/modules/gallery/hooks/init_gallery.php
@@ -27,11 +27,13 @@ if (!file_exists(VARPATH . "database.php")) {
Event::add("system.ready", array("I18n", "instance"));
Event::add("system.ready", array("module", "load_modules"));
Event::add("system.ready", array("gallery", "ready"));
-Event::add("system.post_routing", array("theme", "load_themes"));
Event::add("system.post_routing", array("url", "parse_url"));
Event::add("system.post_routing", array("gallery", "maintenance_mode"));
Event::add("system.shutdown", array("gallery", "shutdown"));
+// @todo once we convert to Kohana 2.4 this doesn't have to be here
+set_error_handler(array("gallery_error", "error_handler"));
+
// Override the cookie if we have a session id in the URL.
// @todo This should probably be an event callback
$input = Input::instance();
diff --git a/modules/gallery/js/albums_form_add.js b/modules/gallery/js/albums_form_add.js
index 43166f27..a568f35d 100644
--- a/modules/gallery/js/albums_form_add.js
+++ b/modules/gallery/js/albums_form_add.js
@@ -1,22 +1,22 @@
-$("#gAddAlbumForm input[name=title]").change(
+$("#g-add-album-form input[name=title]").change(
function() {
- $("#gAddAlbumForm input[name=name]").attr(
- "value", $("#gAddAlbumForm input[name=title]").attr("value")
+ $("#g-add-album-form input[name=name]").attr(
+ "value", $("#g-add-album-form input[name=title]").attr("value")
.replace(/[\s\/]+/g, "-").replace(/\.+$/, ""));
- $("#gAddAlbumForm input[name=slug]").attr(
- "value", $("#gAddAlbumForm input[name=title]").attr("value")
+ $("#g-add-album-form input[name=slug]").attr(
+ "value", $("#g-add-album-form input[name=title]").attr("value")
.replace(/[^A-Za-z0-9-_]+/g, "-")
.replace(/^-+/, "")
.replace(/-+$/, ""));
});
-$("#gAddAlbumForm input[name=title]").keyup(
+$("#g-add-album-form input[name=title]").keyup(
function() {
- $("#gAddAlbumForm input[name=name]").attr(
- "value", $("#gAddAlbumForm input[name=title]").attr("value")
+ $("#g-add-album-form input[name=name]").attr(
+ "value", $("#g-add-album-form input[name=title]").attr("value")
.replace(/[\s\/]+/g, "-")
.replace(/\.+$/, ""));
- $("#gAddAlbumForm input[name=slug]").attr(
- "value", $("#gAddAlbumForm input[name=title]").attr("value")
+ $("#g-add-album-form input[name=slug]").attr(
+ "value", $("#g-add-album-form input[name=title]").attr("value")
.replace(/[^A-Za-z0-9-_]+/g, "-")
.replace(/^-+/, "")
.replace(/-+$/, ""));
diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js
index 35986e5a..9acb6ca8 100644
--- a/modules/gallery/js/l10n_client.js
+++ b/modules/gallery/js/l10n_client.js
@@ -35,12 +35,12 @@ jQuery.extend(Gallery, {
if(userSelection.length > 0) {
Gallery.l10nClient.filter(userSelection);
Gallery.l10nClient.toggle(1);
- $('#l10n-client #gL10nSearch').focus();
+ $('#l10n-client #g-l10n-search').focus();
} else {
if($('#l10n-client').is('.hidden')) {
Gallery.l10nClient.toggle(1);
if(!$.browser.safari) {
- $('#l10n-client #gL10nSearch').focus();
+ $('#l10n-client #g-l10n-search').focus();
}
} else {
Gallery.l10nClient.toggle(0);
@@ -59,7 +59,7 @@ jQuery.extend(Gallery, {
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').show();
$('#l10n-client').height('22em').removeClass('hidden');
//$('#l10n-client').slideUp();
- $('#gMinimizeL10n').text("_");
+ $('#g-minimize-l10n').text("_");
/*
* This CSS clashes with Gallery's CSS, probably due to
* YUI's grid / floats.
@@ -73,7 +73,7 @@ jQuery.extend(Gallery, {
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').hide();
$('#l10n-client').height('2em').addClass('hidden');
// TODO: Localize this message
- $('#gMinimizeL10n').text(MSG_TRANSLATE_TEXT);
+ $('#g-minimize-l10n').text(MSG_TRANSLATE_TEXT);
/*
if(!$.browser.msie) {
$('body').css('border-bottom', '0px');
@@ -131,13 +131,13 @@ jQuery.extend(Gallery, {
if(search == false || search == '') {
$('#l10n-client #l10n-search-filter-clear').focus();
$('#l10n-client-string-select li').show();
- $('#l10n-client #gL10nSearch').val('');
- $('#l10n-client #gL10nSearch').focus();
+ $('#l10n-client #g-l10n-search').val('');
+ $('#l10n-client #g-l10n-search').focus();
} else {
if(search.length > 0) {
$('#l10n-client-string-select li').hide();
$('#l10n-client-string-select li:contains('+search+')').show();
- $('#l10n-client #gL10nSearch').val(search);
+ $('#l10n-client #g-l10n-search').val(search);
}
}
}
@@ -193,12 +193,12 @@ Gallery.behaviors.l10nClient = function(context) {
var is_plural = Gallery.l10nClient.isPluralMessage(source);
Gallery.l10nClient.showSourceMessage(source, is_plural);
Gallery.l10nClient.updateTranslationForm(Gallery.l10nClient.getString(index, 'translation'), is_plural);
- $("#gL10nClientSaveForm input[name='l10n-message-key']").val(key);
+ $("#g-l10n-client-save-form input[name='l10n-message-key']").val(key);
Gallery.l10nClient.selected = index;
});
// When l10n_client window is clicked, toggle based on current state.
- $('#gMinimizeL10n').click(function() {
+ $('#g-minimize-l10n').click(function() {
if($('#l10n-client').is('.hidden')) {
Gallery.l10nClient.toggle(1);
} else {
@@ -207,7 +207,7 @@ Gallery.behaviors.l10nClient = function(context) {
});
// Close the l10n client using an AJAX call and refreshing the page
- $('#gCloseL10n').click(function(event) {
+ $('#g-close-l10n').click(function(event) {
$.ajax({
type: "GET",
url: toggle_l10n_mode_url,
@@ -223,12 +223,12 @@ Gallery.behaviors.l10nClient = function(context) {
// TODO: Either remove hotkeys code or add query.hotkeys.js.
if($.hotkeys) {
$.hotkeys.add(Gallery.l10nClient.keys['toggle'], function(){Gallery.l10nClient.key('toggle')});
- $.hotkeys.add(Gallery.l10nClient.keys['clear'], {target:'#l10n-client #gL10nSearch', type:'keyup'}, function(){Gallery.l10nClient.key('clear')});
+ $.hotkeys.add(Gallery.l10nClient.keys['clear'], {target:'#l10n-client #g-l10n-search', type:'keyup'}, function(){Gallery.l10nClient.key('clear')});
}
// Custom listener for l10n_client livesearch
- $('#l10n-client #gL10nSearch').keyup(function(key) {
- Gallery.l10nClient.filter($('#l10n-client #gL10nSearch').val());
+ $('#l10n-client #g-l10n-search').keyup(function(key) {
+ Gallery.l10nClient.filter($('#l10n-client #g-l10n-search').val());
});
// Clear search
@@ -238,7 +238,7 @@ Gallery.behaviors.l10nClient = function(context) {
});
// Send AJAX POST data on form submit.
- $('#gL10nClientSaveForm').ajaxForm({
+ $('#g-l10n-client-save-form').ajaxForm({
dataType: "json",
success: function(data) {
var source = Gallery.l10nClient.getString(Gallery.l10nClient.selected, 'source');
@@ -250,7 +250,7 @@ Gallery.behaviors.l10nClient = function(context) {
var translation = {};
for (var i = 0; i < num_plural_forms; i++) {
var form = plural_forms[i];
- translation[form] = $('#gL10nClientSaveForm #l10n-edit-plural-translation-' + form).attr('value');
+ translation[form] = $('#g-l10n-client-save-form #l10n-edit-plural-translation-' + form).attr('value');
}
} else {
translation = $('#l10n-edit-translation').attr('value');
@@ -262,13 +262,13 @@ Gallery.behaviors.l10nClient = function(context) {
// Clear the translation form fields
Gallery.l10nClient.showSourceMessage('', false);
- $('#gL10nClientSaveForm #l10n-edit-translation').val('');
+ $('#g-l10n-client-save-form #l10n-edit-translation').val('');
for (var i = 0; i < num_plural_forms; i++) {
var form = plural_forms[i];
- $('#gL10nClientSaveForm #l10n-edit-plural-translation-' + form).val('');
+ $('#g-l10n-client-save-form #l10n-edit-plural-translation-' + form).val('');
}
- $("#gL10nClientSaveForm input[name='l10n-message-key']").val('');
+ $("#g-l10n-client-save-form input[name='l10n-message-key']").val('');
},
error: function(xmlhttp) {
// TODO: Localize this message
@@ -283,12 +283,12 @@ Gallery.behaviors.l10nClient = function(context) {
// TODO: Handle plurals in copy button
// Copy source text to translation field on button click.
- $('#gL10nClientSaveForm #l10n-edit-copy').click(function() {
- $('#gL10nClientSaveForm #l10n-edit-target').val($('#l10n-client-string-editor .source-text').text());
+ $('#g-l10n-client-save-form #l10n-edit-copy').click(function() {
+ $('#g-l10n-client-save-form #l10n-edit-target').val($('#l10n-client-string-editor .source-text').text());
});
// Clear translation field on button click.
- $('#gL10nClientSaveForm #l10n-edit-clear').click(function() {
- $('#gL10nClientSaveForm #l10n-edit-target').val('');
+ $('#g-l10n-client-save-form #l10n-edit-clear').click(function() {
+ $('#g-l10n-client-save-form #l10n-edit-target').val('');
});
};
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index 21b70df6..cbb781a1 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -27,29 +27,27 @@ class Admin_View_Core extends Gallery_View {
* @return void
*/
public function __construct($name) {
- $theme_name = module::get_var("gallery", "active_site_theme");
- if (!file_exists("themes/$theme_name")) {
- module::set_var("gallery", "active_site_theme", "admin_default");
+ $theme_name = module::get_var("gallery", "active_admin_theme");
+ if (!file_exists(THEMEPATH . $theme_name)) {
+ module::set_var("gallery", "active_admin_theme", "admin_wind");
theme::load_themes();
Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
}
parent::__construct($name);
$this->theme_name = module::get_var("gallery", "active_admin_theme");
- if (user::active()->admin) {
+ if (identity::active_user()->admin) {
$this->theme_name = Input::instance()->get("theme", $this->theme_name);
}
$this->sidebar = "";
$this->set_global("theme", $this);
- $this->set_global("user", user::active());
+ $this->set_global("user", identity::active_user());
}
public function admin_menu() {
$menu = Menu::factory("root");
- gallery::admin_menu($menu, $this);
module::event("admin_menu", $menu, $this);
- $menu->compact();
- return $menu;
+ return $menu->render();
}
/**
@@ -97,7 +95,7 @@ class Admin_View_Core extends Gallery_View {
if (Session::instance()->get("debug")) {
if ($function != "admin_head") {
array_unshift(
- $blocks, "<div class=\"gAnnotatedThemeBlock gAnnotatedThemeBlock_$function\">" .
+ $blocks, "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function\">" .
"<div class=\"title\">$function</div>");
$blocks[] = "</div>";
}
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index 219cc883..bdfd2fc9 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -24,12 +24,12 @@ class Gallery_View_Core extends View {
/**
* Add a script to the combined scripts list.
- * @param $file the relative path to a script from the gallery3 directory
+ * @param $file the file name or path of the script to include. If a path is specified then
+ * it needs to be relative to DOCROOT. Just specifying a file name will result
+ * in searching Kohana's cascading file system.
*/
public function script($file) {
- $base_file = str_replace(".js", "", $file);
- if (($path = Kohana::find_file("js", $base_file, false, "js")) ||
- file_exists($path = DOCROOT . "lib/$file")) {
+ if (($path = gallery::find_file("js", $file, false))) {
$this->scripts[$path] = 1;
} else {
Kohana::log("error", "Can't find script file: $file");
@@ -47,12 +47,12 @@ class Gallery_View_Core extends View {
/**
* Add a css file to the combined css list.
- * @param $file the relative path to a script from the gallery3 directory
+ * @param $file the file name or path of the script to include. If a path is specified then
+ * it needs to be relative to DOCROOT. Just specifying a file name will result
+ * in searching Kohana's cascading file system.
*/
public function css($file) {
- $base_file = str_replace(".css", "", $file);
- if (($path = Kohana::find_file("css", $base_file, false, "css")) ||
- file_exists($path = DOCROOT . "lib/$file")) {
+ if (($path = gallery::find_file("css", $file, false))) {
$this->css[$path] = 1;
} else {
Kohana::log("error", "Can't find css file: $file");
@@ -85,13 +85,11 @@ class Gallery_View_Core extends View {
if (empty($contents)) {
$contents = "";
- $docroot_len = strlen(DOCROOT);
foreach (array_keys($paths) as $path) {
- $relative = substr($path, $docroot_len);
if ($type == "css") {
- $contents .= "/* $relative */\n" . $this->process_css($path) . "\n";
+ $contents .= "/* $path */\n" . $this->process_css($path) . "\n";
} else {
- $contents .= "/* $relative */\n" . file_get_contents($path) . "\n";
+ $contents .= "/* $path */\n" . file_get_contents($path) . "\n";
}
}
diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php
new file mode 100644
index 00000000..e213ae97
--- /dev/null
+++ b/modules/gallery/libraries/IdentityProvider.php
@@ -0,0 +1,209 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * Provides a driver-based interface for managing users and groups.
+ */
+class IdentityProvider_Core {
+ protected static $instance;
+
+ // Configuration
+ protected $config;
+
+ // Driver object
+ protected $driver;
+
+ /**
+ * Returns a singleton instance of Identity.
+ * There can only be one Identity driver configured at a given point
+ *
+ * @param string configuration
+ * @return Identity_Core
+ */
+ static function &instance() {
+ if (empty(self::$instance)) {
+ // Create a new instance
+ self::$instance = new IdentityProvider();
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Frees the current instance of the identity provider so the next call to instance will reload
+ *
+ * @param string configuration
+ * @return Identity_Core
+ */
+ static function reset() {
+ self::$instance = null;
+ Kohana::config_clear("identity");
+ }
+
+ /**
+ * Loads the configured driver and validates it.
+ *
+ * @return void
+ */
+ public function __construct($config=null) {
+ if (empty($config)) {
+ $config = module::get_var("gallery", "identity_provider", "user");
+ }
+
+ // Test the config group name
+ if (($this->config = Kohana::config("identity." . $config)) === NULL) {
+ throw new Exception("@todo NO_USER_LIBRARY_CONFIGURATION_FOR: $config");
+ }
+
+ // Set driver name
+ $driver = "IdentityProvider_" . ucfirst($this->config["driver"]) ."_Driver";
+
+ // Load the driver
+ if ( ! Kohana::auto_load($driver)) {
+ throw new Kohana_Exception("core.driver_not_found", $this->config["driver"],
+ get_class($this));
+ }
+
+ // Initialize the driver
+ $this->driver = new $driver($this->config["params"]);
+
+ // Validate the driver
+ if ( !($this->driver instanceof IdentityProvider_Driver)) {
+ throw new Kohana_Exception("core.driver_implements", $this->config["driver"],
+ get_class($this), "IdentityProvider_Driver");
+ }
+
+ Kohana::log("debug", "Identity Library initialized");
+ }
+
+ /**
+ * Determine if if the current driver supports updates.
+ *
+ * @return boolean true if the driver supports updates; false if read only
+ */
+ public function is_writable() {
+ return !empty($this->config["allow_updates"]);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::guest.
+ */
+ public function guest() {
+ return $this->driver->guest();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::admin_user.
+ */
+ public function admin_user() {
+ return $this->driver->admin_user();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_user.
+ */
+ public function create_user($name, $full_name, $password) {
+ return $this->driver->create_user($name, $full_name, $password);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::is_correct_password.
+ */
+ public function is_correct_password($user, $password) {
+ return $this->driver->is_correct_password($user, $password);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user.
+ */
+ public function lookup_user($id) {
+ return $this->driver->lookup_user($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user_by_name.
+ */
+ public function lookup_user_by_name($name) {
+ return $this->driver->lookup_user_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_group.
+ */
+ public function create_group($name) {
+ return $this->driver->create_group($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::everybody.
+ */
+ public function everybody() {
+ return $this->driver->everybody();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::registered_users.
+ */
+ public function registered_users() {
+ return $this->driver->registered_users();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group.
+ */
+ public function lookup_group($id) {
+ return $this->driver->lookup_group($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group_by_name.
+ */
+ public function lookup_group_by_name($name) {
+ return $this->driver->lookup_group_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::get_user_list.
+ */
+ public function get_user_list($ids) {
+ return $this->driver->get_user_list($ids);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::groups.
+ */
+ public function groups() {
+ return $this->driver->groups();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::add_user_to_group.
+ */
+ public function add_user_to_group($user, $group_id) {
+ return $this->driver->add_user_to_group($user, $group_id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::remove_user_to_group.
+ */
+ public function remove_user_from_group($user, $group_id) {
+ return $this->driver->remove_user_from_group($user, $group_id);
+ }
+} // End Identity
diff --git a/modules/gallery/libraries/InPlaceEdit.php b/modules/gallery/libraries/InPlaceEdit.php
new file mode 100644
index 00000000..67ab3805
--- /dev/null
+++ b/modules/gallery/libraries/InPlaceEdit.php
@@ -0,0 +1,88 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class InPlaceEdit_Core {
+ private $rules = array();
+ private $messages = array();
+ private $callback = array();
+ private $initial_value;
+ private $action = "";
+ private $errors;
+ private $form;
+
+ static function factory($initial_value) {
+ $instance = new InPlaceEdit();
+ $instance->initial_value = $initial_value;
+ $instance->form = array("input" => $initial_value);
+ $instance->errors = array("input" => "");
+
+ return $instance;
+ }
+
+ public function action($action) {
+ $this->action = $action;
+ return $this;
+ }
+
+ public function rules($rules) {
+ $this->rules += $rules;
+ return $this;
+ }
+
+ public function messages($messages) {
+ $this->messages += $messages;
+ return $this;
+ }
+
+ public function callback($callback) {
+ $this->callback = $callback;
+ return $this;
+ }
+
+ public function validate() {
+ $post = Validation::factory($_POST)
+ ->add_callbacks("input", $this->callback);
+ foreach ($this->rules as $rule) {
+ $post->add_rules("input", $rule);
+ }
+
+ $valid = $post->validate();
+ $this->form = array_merge($this->form, $post->as_array());
+ $this->errors = array_merge($this->errors, $post->errors());
+ return $valid;
+ }
+
+ public function render() {
+ $v = new View("in_place_edit.html");
+ $v->hidden = array("csrf" => access::csrf_token());
+ $v->action = url::site($this->action);
+ $v->form = $this->form;
+ $v->errors = $this->errors;
+ foreach ($v->errors as $key => $error) {
+ if (!empty($error)) {
+ $v->errors[$key] = $this->messages[$error];
+ }
+ }
+ return $v->render();
+ }
+
+ public function value() {
+ return $this->form["input"];
+ }
+} \ No newline at end of file
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php
index 07b2b2b8..e2b68d1a 100644
--- a/modules/gallery/libraries/Menu.php
+++ b/modules/gallery/libraries/Menu.php
@@ -43,6 +43,11 @@ class Menu_Element {
* @chainable
*/
public function label($label) {
+ // Guard against developers who forget to internationalize label strings
+ if (!($label instanceof SafeString)) {
+ $label = new SafeString($label);
+ }
+
$this->label = $label;
return $this;
}
@@ -74,25 +79,25 @@ class Menu_Element {
return $this;
}
+ /**
+ * Specifiy a view for this menu item
+ * @chainable
+ */
+ public function view($view) {
+ $this->view = $view;
+ return $this;
+ }
+
}
/**
* Menu element that provides a link to a new page.
*/
class Menu_Element_Link extends Menu_Element {
- public function __toString() {
- if (isset($this->css_id) && !empty($this->css_id)) {
- $css_id = " id=\"$this->css_id\"";
- } else {
- $css_id = "";
- }
- if (isset($this->css_class) && !empty($this->css_class)) {
- $css_class = " $this->css_class";
- } else {
- $css_class = "";
- }
- return "<li><a$css_id class=\"gMenuLink $css_class\" href=\"$this->url\" " .
- "title=\"$this->label\">$this->label</a></li>";
+ public function render() {
+ $view = new View(isset($this->view) ? $this->view : "menu_link.html");
+ $view->menu = $this;
+ return $view;
}
}
@@ -111,19 +116,10 @@ class Menu_Element_Ajax_Link extends Menu_Element {
return $this;
}
- public function __toString() {
- if (isset($this->css_id) && !empty($this->css_id)) {
- $css_id = " id=\"$this->css_id\"";
- } else {
- $css_id = "";
- }
- if (isset($this->css_class) && !empty($this->css_class)) {
- $css_class = " $this->css_class";
- } else {
- $css_class = "";
- }
- return "<li><a$css_id class=\"gAjaxLink $css_class\" href=\"$this->url\" " .
- "title=\"$this->label\" ajax_handler=\"$this->ajax_handler\">$this->label</a></li>";
+ public function render() {
+ $view = new View(isset($this->view) ? $this->view : "menu_ajax_link.html");
+ $view->menu = $this;
+ return $view;
}
}
@@ -131,19 +127,10 @@ class Menu_Element_Ajax_Link extends Menu_Element {
* Menu element that provides a pop-up dialog
*/
class Menu_Element_Dialog extends Menu_Element {
- public function __toString() {
- if (isset($this->css_id) && !empty($this->css_id)) {
- $css_id = " id=\"$this->css_id\"";
- } else {
- $css_id = "";
- }
- if (isset($this->css_class) && !empty($this->css_class)) {
- $css_class = " $this->css_class";
- } else {
- $css_class = "";
- }
- return "<li><a$css_id class=\"gDialogLink $css_class\" href=\"$this->url\" " .
- "title=\"$this->label\">$this->label</a></li>";
+ public function render() {
+ $view = new View(isset($this->view) ? $this->view : "menu_dialog.html");
+ $view->menu = $this;
+ return $view;
}
}
@@ -171,7 +158,7 @@ class Menu_Core extends Menu_Element {
case "root":
$menu = new Menu("root");
- $menu->css_class("gMenu");
+ $menu->css_class("g-menu");
return $menu;
case "submenu":
@@ -182,19 +169,6 @@ class Menu_Core extends Menu_Element {
}
}
- public function compact() {
- foreach ($this->elements as $target_id => $element) {
- if ($element->type == "submenu") {
- if (empty($element->elements)) {
- $this->remove($target_id);
- } else {
- $element->compact();
- }
- }
- }
- return $this;
- }
-
public function __construct($type) {
parent::__construct($type);
$this->elements = array();
@@ -242,11 +216,9 @@ class Menu_Core extends Menu_Element {
return null;
}
- public function __toString() {
- $html = $this->is_root ? "<ul class=\"$this->css_class\">" :
- "<li title=\"$this->label\"><a href=\"#\">$this->label</a><ul>";
- $html .= implode("\n", $this->elements);
- $html .= $this->is_root ? "</ul>" : "</ul></li>";
- return $html;
+ public function render() {
+ $view = new View(isset($this->view) ? $this->view : "menu.html");
+ $view->menu = $this;
+ return $view;
}
}
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 130e2dce..e98914c4 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -29,21 +29,21 @@ class Theme_View_Core extends Gallery_View {
*/
public function __construct($name, $page_type) {
$theme_name = module::get_var("gallery", "active_site_theme");
- if (!file_exists("themes/$theme_name")) {
- module::set_var("gallery", "active_site_theme", "default");
+ if (!file_exists(THEMEPATH . $theme_name)) {
+ module::set_var("gallery", "active_site_theme", "wind");
theme::load_themes();
Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
}
parent::__construct($name);
$this->theme_name = module::get_var("gallery", "active_site_theme");
- if (user::active()->admin) {
+ if (identity::active_user()->admin) {
$this->theme_name = Input::instance()->get("theme", $this->theme_name);
}
$this->item = null;
$this->tag = null;
$this->set_global("theme", $this);
- $this->set_global("user", user::active());
+ $this->set_global("user", identity::active_user());
$this->set_global("page_type", $page_type);
$this->set_global("page_title", null);
if ($page_type == "album") {
@@ -78,23 +78,30 @@ class Theme_View_Core extends Gallery_View {
return $this->page_type;
}
+ public function user_menu() {
+ $menu = Menu::factory("root")
+ ->css_id("g-login-menu")
+ ->css_class("g-inline ui-helper-clear-fix");
+ module::event("user_menu", $menu, $this);
+ return $menu->render();
+ }
+
public function site_menu() {
$menu = Menu::factory("root");
- gallery::site_menu($menu, $this);
module::event("site_menu", $menu, $this);
- return $menu->compact();
+ return $menu->render();
}
public function album_menu() {
$menu = Menu::factory("root");
module::event("album_menu", $menu, $this);
- return $menu->compact();
+ return $menu->render();
}
public function tag_menu() {
$menu = Menu::factory("root");
module::event("tag_menu", $menu, $this);
- return $menu->compact();
+ return $menu->render();
}
public function photo_menu() {
@@ -104,17 +111,17 @@ class Theme_View_Core extends Gallery_View {
->id("fullsize")
->label(t("View full size"))
->url($this->item()->file_url())
- ->css_class("gFullSizeLink"));
+ ->css_class("g-fullsize-link"));
}
module::event("photo_menu", $menu, $this);
- return $menu->compact();
+ return $menu->render();
}
public function movie_menu() {
$menu = Menu::factory("root");
module::event("movie_menu", $menu, $this);
- return $menu->compact();
+ return $menu->render();
}
public function context_menu($item, $thumbnail_css_selector) {
@@ -122,23 +129,55 @@ class Theme_View_Core extends Gallery_View {
->append(Menu::factory("submenu")
->id("context_menu")
->label(t("Options")))
- ->css_class("gContextMenu");
+ ->css_class("g-context-menu");
- gallery::context_menu($menu, $this, $item, $thumbnail_css_selector);
module::event("context_menu", $menu, $this, $item, $thumbnail_css_selector);
- return $menu->compact();
- }
-
- public function pager() {
- if ($this->children_count) {
- $this->pagination = new Pagination();
- $this->pagination->initialize(
- array("query_string" => "page",
- "total_items" => $this->children_count,
- "items_per_page" => $this->page_size,
- "style" => "classic"));
- return $this->pagination->render();
+ return $menu->render();
+ }
+
+ /**
+ * Set up the data and render a pager.
+ *
+ * See themes/wind/views/pager.html for documentation on the variables generated here.
+ */
+ public function paginator() {
+ $v = new View("paginator.html");
+ $v->page_type = $this->page_type;
+ $v->first_page_url = null;
+ $v->previous_page_url = null;
+ $v->next_page_url = null;
+ $v->last_page_url = null;
+
+ if ($this->page_type == "album" || $this->page_type == "tag") {
+ $v->page = $this->page;
+ $v->max_pages = $this->max_pages;
+ $v->total = $this->children_count;
+
+ if ($this->page != 1) {
+ $v->first_page_url = url::site(url::merge(array("page" => 1)));
+ $v->previous_page_url = url::site(url::merge(array("page" => $this->page - 1)));
+ }
+
+ if ($this->page != $this->max_pages) {
+ $v->next_page_url = url::site(url::merge(array("page" => $this->page + 1)));
+ $v->last_page_url = url::site(url::merge(array("page" => $this->max_pages)));
+ }
+
+ $v->first_visible_position = ($this->page - 1) * $this->page_size + 1;
+ $v->last_visible_position = $this->page * $this->page_size;
+ } else {
+ $v->position = $this->position;
+ $v->total = $this->sibling_count;
+ if ($this->previous_item) {
+ $v->previous_page_url = $this->previous_item->url();
+ }
+
+ if ($this->next_item) {
+ $v->next_page_url = $this->next_item->url();
+ }
}
+
+ return $v;
}
/**
@@ -156,6 +195,17 @@ class Theme_View_Core extends Gallery_View {
}
/**
+ * Print out the sidebar.
+ */
+ public function sidebar_blocks() {
+ $sidebar = block_manager::get_html("site_sidebar", $this);
+ if (empty($sidebar) && identity::active_user()->admin) {
+ $sidebar = new View("no_sidebar.html");
+ }
+ return $sidebar;
+ }
+
+ /**
* Handle all theme functions that insert module content.
*/
public function __call($function, $args) {
@@ -178,7 +228,6 @@ class Theme_View_Core extends Gallery_View {
case "photo_top":
case "resize_bottom":
case "resize_top":
- case "sidebar_blocks":
case "sidebar_bottom":
case "sidebar_top":
case "thumb_bottom":
@@ -223,7 +272,7 @@ class Theme_View_Core extends Gallery_View {
if (Session::instance()->get("debug")) {
if ($function != "head") {
array_unshift(
- $blocks, "<div class=\"gAnnotatedThemeBlock gAnnotatedThemeBlock_$function gClearFix\">" .
+ $blocks, "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function g-clear-fix\">" .
"<div class=\"title\">$function</div>");
$blocks[] = "</div>";
}
diff --git a/modules/gallery/libraries/drivers/IdentityProvider.php b/modules/gallery/libraries/drivers/IdentityProvider.php
new file mode 100644
index 00000000..a808c7e8
--- /dev/null
+++ b/modules/gallery/libraries/drivers/IdentityProvider.php
@@ -0,0 +1,133 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+interface IdentityProvider_Driver {
+ /**
+ * Return the guest user.
+ *
+ * @return User_Definition the user object
+ */
+ public function guest();
+
+ /**
+ * Return the admins user.
+ *
+ * @return User_Definition the user object
+ */
+ public function admin_user();
+
+ /**
+ * Create a new user.
+ *
+ * @param string $name
+ * @param string $full_name
+ * @param string $password
+ * @return User_Definition the user object
+ */
+ public function create_user($name, $full_name, $password);
+
+ /**
+ * Is the password provided correct?
+ *
+ * @param user User_Definition the user object
+ * @param string $password a plaintext password
+ * @return boolean true if the password is correct
+ */
+ public function is_correct_password($user, $password);
+
+ /**
+ * Look up a user by id.
+ * @param integer $id
+ * @return User_Definition the user object, or null if the name was invalid.
+ */
+ public function lookup_user($id);
+
+ /**
+ * Look up a user by name.
+ * @param string $name
+ * @return User_Definition the user object, or null if the name was invalid.
+ */
+ public function lookup_user_by_name($name);
+
+ /**
+ * Create a new group.
+ *
+ * @param string $name
+ * @return Group_Definition the group object
+ */
+ public function create_group($name);
+
+ /**
+ * The group of all possible visitors. This includes the guest user.
+ *
+ * @return Group_Definition the group object
+ */
+ public function everybody();
+
+ /**
+ * The group of all logged-in visitors. This does not include guest users.
+ *
+ * @return Group_Definition the group object
+ */
+ public function registered_users();
+
+ /**
+ * List the users
+ * @param array $ids array of ids to return the user objects for
+ * @return array the user list.
+ */
+ public function get_user_list($ids);
+
+ /**
+ * Look up a group by id.
+ * @param integer $id id
+ * @return Group_Definition the user object, or null if the name was invalid.
+ */
+ public function lookup_group($id);
+
+ /**
+ * Look up the group by name.
+ * @param string $name the name of the group to locate
+ * @return Group_Definition
+ */
+ public function lookup_group_by_name($name);
+
+ /**
+ * List the groups defined in the Identity Provider
+ */
+ public function groups();
+
+ /**
+ * Add the user to the specified group
+ * @param User_Definition the user to add to the group
+ * @param int the group_id
+ */
+ static function add_user_to_group($user, $group_id);
+
+ /**
+ * Remove the user to the specified group
+ * @param User_Definition the user to add to the group
+ * @param int the group id
+ */
+ static function remove_user_from_group($user, $group_id);
+} // End Identity Driver Definition
+
+interface Group_Definition {}
+
+interface User_Definition {}
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index a87997c6..d27e331b 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -24,7 +24,8 @@ class Item_Model extends ORM_MPTT {
var $rules = array(
"name" => "required|length[0,255]",
"title" => "required|length[0,255]",
- "description" => "length[0,65535]"
+ "description" => "length[0,65535]",
+ "slug" => "required|length[0,255]"
);
/**
@@ -98,6 +99,10 @@ class Item_Model extends ORM_MPTT {
throw new Exception("@todo INVALID_MOVE_TYPE $target->type");
}
+ if (file_exists($target_file = "{$target->file_path()}/$this->name")) {
+ throw new Exception("@todo INVALID_MOVE_TARGET_EXISTS: $target_file");
+ }
+
if ($this->id == 1) {
throw new Exception("@todo INVALID_SOURCE root album");
}
@@ -146,6 +151,10 @@ class Item_Model extends ORM_MPTT {
$old_relative_path = urldecode($this->relative_path());
$new_relative_path = dirname($old_relative_path) . "/" . $new_name;
+ if (file_exists(VARPATH . "albums/$new_relative_path")) {
+ throw new Exception("@todo INVALID_RENAME_FILE_EXISTS: $new_relative_path");
+ }
+
@rename(VARPATH . "albums/$old_relative_path", VARPATH . "albums/$new_relative_path");
@rename(VARPATH . "resizes/$old_relative_path", VARPATH . "resizes/$new_relative_path");
@rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
@@ -284,6 +293,7 @@ class Item_Model extends ORM_MPTT {
->where("id <>", 1)
->orderby("left_ptr", "ASC")
->get() as $row) {
+ // Don't encode the names segment
$names[] = rawurlencode($row->name);
$slugs[] = rawurlencode($row->slug);
}
@@ -332,7 +342,7 @@ class Item_Model extends ORM_MPTT {
// This relationship depends on an outside module, which may not be present so handle
// failures gracefully.
try {
- return model_cache::get("user", $this->owner_id);
+ return identity::lookup_user($this->owner_id);
} catch (Exception $e) {
return null;
}
@@ -412,39 +422,76 @@ class Item_Model extends ORM_MPTT {
* Find the position of the given child id in this album. The resulting value is 1-indexed, so
* the first child in the album is at position 1.
*/
- public function get_position($child_id) {
+ public function get_position($child, $where=array()) {
if ($this->sort_order == "DESC") {
$comp = ">";
} else {
$comp = "<";
}
-
$db = Database::instance();
- $position = $db->query("
- SELECT COUNT(*) AS position FROM {items}
- WHERE `parent_id` = {$this->id}
- AND `{$this->sort_column}` $comp (SELECT `{$this->sort_column}`
- FROM {items} WHERE `id` = $child_id)")
- ->current()->position;
-
- // 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
- // any one of them as the child's "position".
- //
- // Fix this by doing a 2nd query where we iterate over the equivalent columns and add them to
- // our base value.
- $result = $db->query("
- SELECT id FROM {items}
- WHERE `parent_id` = {$this->id}
- AND `{$this->sort_column}` = (SELECT `{$this->sort_column}`
- FROM {items} WHERE `id` = $child_id)
- ORDER BY `id` ASC");
- foreach ($result as $row) {
- $position++;
- if ($row->id == $child_id) {
- break;
+
+ // If the comparison column has NULLs in it, we can't use comparators on it and will have to
+ // deal with it the hard way.
+ $count = $db->from("items")
+ ->where("parent_id", $this->id)
+ ->where($this->sort_column, NULL)
+ ->where($where)
+ ->count_records();
+
+ if (empty($count)) {
+ // There are no NULLs in the sort column, so we can just use it directly.
+ $sort_column = $this->sort_column;
+
+ $position = $db->from("items")
+ ->where("parent_id", $this->id)
+ ->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
+ // 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
+ // any one of them as the child's "position".
+ //
+ // Fix this by doing a 2nd query where we iterate over the equivalent columns and add them to
+ // our base value.
+ foreach ($db->from("items")
+ ->where("parent_id", $this->id)
+ ->where($sort_column, $child->$sort_column)
+ ->where($where)
+ ->orderby(array("id" => "ASC"))
+ ->get() as $row) {
+ $position++;
+ if ($row->id == $child->id) {
+ break;
+ }
+ }
+ } else {
+ // There are NULLs in the sort column, so we can't use MySQL comparators. Fall back to
+ // iterating over every child row to get to the current one. This can be wildly inefficient
+ // for really large albums, but it should be a rare case that the user is sorting an album
+ // with null values in the sort column.
+ //
+ // Reproduce the children() functionality here using Database directly to avoid loading the
+ // whole ORM for each row.
+ $orderby = array($this->sort_column => $this->sort_order);
+ // Use id as a tie breaker
+ if ($this->sort_column != "id") {
+ $orderby["id"] = "ASC";
+ }
+
+ $position = 0;
+ foreach ($db->select("id")
+ ->from("items")
+ ->where("parent_id", $this->id)
+ ->where($where)
+ ->orderby($orderby)
+ ->get() as $row) {
+ $position++;
+ if ($row->id == $child->id) {
+ break;
+ }
}
}
@@ -532,7 +579,7 @@ class Item_Model extends ORM_MPTT {
$v->attrs = array_merge($extra_attrs,
array("style" => "display:block;width:{$this->width}px;height:{$this->height}px"));
if (empty($v->attrs["id"])) {
- $v->attrs["id"] = "gMovieId-{$this->id}";
+ $v->attrs["id"] = "g-movie-id-{$this->id}";
}
return $v;
}
@@ -551,6 +598,10 @@ class Item_Model extends ORM_MPTT {
function children($limit=null, $offset=0, $where=array(), $orderby=null) {
if (empty($orderby)) {
$orderby = array($this->sort_column => $this->sort_order);
+ // Use id as a tie breaker
+ if ($this->sort_column != "id") {
+ $orderby["id"] = "ASC";
+ }
}
return parent::children($limit, $offset, $where, $orderby);
}
@@ -569,6 +620,10 @@ class Item_Model extends ORM_MPTT {
function descendants($limit=null, $offset=0, $where=array(), $orderby=null) {
if (empty($orderby)) {
$orderby = array($this->sort_column => $this->sort_order);
+ // Use id as a tie breaker
+ if ($this->sort_column != "id") {
+ $orderby["id"] = "ASC";
+ }
}
return parent::descendants($limit, $offset, $where, $orderby);
}
diff --git a/modules/gallery/models/log.php b/modules/gallery/models/log.php
index 6734afb8..c816a4a7 100644
--- a/modules/gallery/models/log.php
+++ b/modules/gallery/models/log.php
@@ -18,5 +18,21 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Log_Model extends ORM {
- protected $has_one = array("user");
+ /**
+ * @see ORM::__get()
+ */
+ public function __get($column) {
+ if ($column == "user") {
+ // This relationship depends on an outside module, which may not be present so handle
+ // failures gracefully.
+ try {
+ return identity::lookup_user($this->user_id);
+ } catch (Exception $e) {
+ Kohana::log("alert", "Unable to load user with id $this->user_id");
+ return null;
+ }
+ } else {
+ return parent::__get($column);
+ }
+ }
}
diff --git a/modules/gallery/models/task.php b/modules/gallery/models/task.php
index b7e255a2..f40be492 100644
--- a/modules/gallery/models/task.php
+++ b/modules/gallery/models/task.php
@@ -46,7 +46,7 @@ class Task_Model extends ORM {
}
public function owner() {
- return user::lookup($this->owner_id);
+ return identity::lookup_user($this->owner_id);
}
/**
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index 70bd91e2..2dc62ecd 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,3 +1,3 @@
name = "Gallery 3"
description = "Gallery core application"
-version = 12
+version = 19
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php
index 59cec453..e9e5cb26 100644
--- a/modules/gallery/tests/Access_Helper_Test.php
+++ b/modules/gallery/tests/Access_Helper_Test.php
@@ -22,8 +22,8 @@ class Access_Helper_Test extends Unit_Test_Case {
public function teardown() {
try {
- $group = ORM::factory("group")->where("name", "access_test")->find();
- if ($group->loaded) {
+ $group = identity::lookup_group_by_name("access_test");
+ if (!empty($group)) {
$group->delete();
}
} catch (Exception $e) { }
@@ -33,24 +33,24 @@ class Access_Helper_Test extends Unit_Test_Case {
} catch (Exception $e) { }
try {
- $user = ORM::factory("user")->where("name", "access_test")->find();
- if ($user->loaded) {
+ $user = identity::lookup_user_by_name("access_test");
+ if (!empty($user)) {
$user->delete();
}
} catch (Exception $e) { }
// Reset some permissions that we mangle below
$root = ORM::factory("item", 1);
- access::allow(group::everybody(), "view", $root);
+ access::allow(identity::everybody(), "view", $root);
}
public function setup() {
- user::set_active(user::guest());
+ identity::set_active_user(identity::guest());
}
public function groups_and_permissions_are_bound_to_columns_test() {
access::register_permission("access_test", "Access Test");
- $group = group::create("access_test");
+ $group = identity::create_group("access_test");
// We have a new column for this perm / group combo
$fields = Database::instance()->list_fields("access_caches");
@@ -65,17 +65,17 @@ class Access_Helper_Test extends Unit_Test_Case {
}
public function user_can_access_test() {
- $access_test = group::create("access_test");
+ $access_test = identity::create_group("access_test");
$root = ORM::factory("item", 1);
access::allow($access_test, "view", $root);
$item = album::create($root, rand(), "test album");
- access::deny(group::everybody(), "view", $item);
- access::deny(group::registered_users(), "view", $item);
+ access::deny(identity::everybody(), "view", $item);
+ access::deny(identity::registered_users(), "view", $item);
- $user = user::create("access_test", "Access Test", "");
+ $user = identity::create_user("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
@@ -89,10 +89,10 @@ class Access_Helper_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$item = album::create($root, rand(), "test album");
- access::deny(group::everybody(), "view", $item);
- access::deny(group::registered_users(), "view", $item);
+ access::deny(identity::everybody(), "view", $item);
+ access::deny(identity::registered_users(), "view", $item);
- $user = user::create("access_test", "Access Test", "");
+ $user = identity::create_user("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
@@ -121,14 +121,11 @@ class Access_Helper_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album");
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
- $photo = ORM::factory("item");
- $photo->type = "photo";
- $photo->add_to_parent($album);
- access::add_item($photo);
+ $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", "");
- $this->assert_true($photo->__get("view_" . group::everybody()->id));
+ $this->assert_true($photo->__get("view_" . identity::everybody()->id));
}
public function can_allow_deny_and_reset_intent_test() {
@@ -137,23 +134,23 @@ class Access_Helper_Test extends Unit_Test_Case {
$intent = ORM::factory("access_intent")->where("item_id", $album)->find();
// Allow
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
$this->assert_same(access::ALLOW, $intent->reload()->view_1);
// Deny
- access::deny(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $album);
$this->assert_same(
access::DENY,
ORM::factory("access_intent")->where("item_id", $album)->find()->view_1);
// Allow again. If the initial value was allow, then the first Allow clause above may not
// have actually changed any values.
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
$this->assert_same(
access::ALLOW,
ORM::factory("access_intent")->where("item_id", $album)->find()->view_1);
- access::reset(group::everybody(), "view", $album);
+ access::reset(identity::everybody(), "view", $album);
$this->assert_same(
null,
ORM::factory("access_intent")->where("item_id", $album)->find()->view_1);
@@ -161,7 +158,7 @@ class Access_Helper_Test extends Unit_Test_Case {
public function cant_reset_root_item_test() {
try {
- access::reset(group::everybody(), "view", ORM::factory("item", 1));
+ access::reset(identity::everybody(), "view", ORM::factory("item", 1));
} catch (Exception $e) {
return;
}
@@ -170,17 +167,17 @@ class Access_Helper_Test extends Unit_Test_Case {
public function can_view_item_test() {
$root = ORM::factory("item", 1);
- access::allow(group::everybody(), "view", $root);
- $this->assert_true(access::group_can(group::everybody(), "view", $root));
+ access::allow(identity::everybody(), "view", $root);
+ $this->assert_true(access::group_can(identity::everybody(), "view", $root));
}
public function can_always_fails_on_unloaded_items_test() {
$root = ORM::factory("item", 1);
- access::allow(group::everybody(), "view", $root);
- $this->assert_true(access::group_can(group::everybody(), "view", $root));
+ access::allow(identity::everybody(), "view", $root);
+ $this->assert_true(access::group_can(identity::everybody(), "view", $root));
$bogus = ORM::factory("item", -1);
- $this->assert_false(access::group_can(group::everybody(), "view", $bogus));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $bogus));
}
public function cant_view_child_of_hidden_parent_test() {
@@ -188,21 +185,21 @@ class Access_Helper_Test extends Unit_Test_Case {
$album = album::create($root, rand(), "test album");
$root->reload();
- access::deny(group::everybody(), "view", $root);
- access::reset(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $root);
+ access::reset(identity::everybody(), "view", $album);
$album->reload();
- $this->assert_false(access::group_can(group::everybody(), "view", $album));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $album));
}
public function view_permissions_propagate_down_test() {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album");
- access::allow(group::everybody(), "view", $root);
- access::reset(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $root);
+ access::reset(identity::everybody(), "view", $album);
$album->reload();
- $this->assert_true(access::group_can(group::everybody(), "view", $album));
+ $this->assert_true(access::group_can(identity::everybody(), "view", $album));
}
public function can_toggle_view_permissions_propagate_down_test() {
@@ -217,18 +214,18 @@ class Access_Helper_Test extends Unit_Test_Case {
$album3->reload();
$album4->reload();
- access::allow(group::everybody(), "view", $root);
- access::deny(group::everybody(), "view", $album1);
- access::reset(group::everybody(), "view", $album2);
- access::reset(group::everybody(), "view", $album3);
- access::reset(group::everybody(), "view", $album4);
+ access::allow(identity::everybody(), "view", $root);
+ access::deny(identity::everybody(), "view", $album1);
+ access::reset(identity::everybody(), "view", $album2);
+ access::reset(identity::everybody(), "view", $album3);
+ access::reset(identity::everybody(), "view", $album4);
$album4->reload();
- $this->assert_false(access::group_can(group::everybody(), "view", $album4));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $album4));
- access::allow(group::everybody(), "view", $album1);
+ access::allow(identity::everybody(), "view", $album1);
$album4->reload();
- $this->assert_true(access::group_can(group::everybody(), "view", $album4));
+ $this->assert_true(access::group_can(identity::everybody(), "view", $album4));
}
public function revoked_view_permissions_cant_be_allowed_lower_down_test() {
@@ -237,29 +234,29 @@ class Access_Helper_Test extends Unit_Test_Case {
$album2 = album::create($album1, rand(), "test album");
$root->reload();
- access::deny(group::everybody(), "view", $root);
- access::allow(group::everybody(), "view", $album2);
+ access::deny(identity::everybody(), "view", $root);
+ access::allow(identity::everybody(), "view", $album2);
$album1->reload();
- $this->assert_false(access::group_can(group::everybody(), "view", $album1));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $album1));
$album2->reload();
- $this->assert_false(access::group_can(group::everybody(), "view", $album2));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $album2));
}
public function can_edit_item_test() {
$root = ORM::factory("item", 1);
- access::allow(group::everybody(), "edit", $root);
- $this->assert_true(access::group_can(group::everybody(), "edit", $root));
+ access::allow(identity::everybody(), "edit", $root);
+ $this->assert_true(access::group_can(identity::everybody(), "edit", $root));
}
public function non_view_permissions_propagate_down_test() {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album");
- access::allow(group::everybody(), "edit", $root);
- access::reset(group::everybody(), "edit", $album);
- $this->assert_true(access::group_can(group::everybody(), "edit", $album));
+ access::allow(identity::everybody(), "edit", $root);
+ access::reset(identity::everybody(), "edit", $album);
+ $this->assert_true(access::group_can(identity::everybody(), "edit", $album));
}
public function non_view_permissions_can_be_revoked_lower_down_test() {
@@ -279,36 +276,36 @@ class Access_Helper_Test extends Unit_Test_Case {
$outer->reload();
$inner->reload();
- access::allow(group::everybody(), "edit", $root);
- access::deny(group::everybody(), "edit", $outer);
- access::allow(group::everybody(), "edit", $inner);
+ access::allow(identity::everybody(), "edit", $root);
+ access::deny(identity::everybody(), "edit", $outer);
+ access::allow(identity::everybody(), "edit", $inner);
// Outer album is not editable, inner one is.
- $this->assert_false(access::group_can(group::everybody(), "edit", $outer_photo));
- $this->assert_true(access::group_can(group::everybody(), "edit", $inner_photo));
+ $this->assert_false(access::group_can(identity::everybody(), "edit", $outer_photo));
+ $this->assert_true(access::group_can(identity::everybody(), "edit", $inner_photo));
}
public function i_can_edit_test() {
// Create a new user that belongs to no groups
- $user = user::create("access_test", "Access Test", "");
+ $user = identity::create_user("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
$user->save();
- user::set_active($user);
+ identity::set_active_user($user);
// This user can't edit anything
$root = ORM::factory("item", 1);
$this->assert_false(access::can("edit", $root));
// Now add them to a group that has edit permission
- $group = group::create("access_test");
+ $group = identity::create_group("access_test");
$group->add($user);
$group->save();
access::allow($group, "edit", $root);
- $user = ORM::factory("user", $user->id); // reload() does not flush related columns
- user::set_active($user);
+ $user = identity::lookup_user($user->id); // reload() does not flush related columns
+ identity::set_active_user($user);
// And verify that the user can edit.
$this->assert_true(access::can("edit", $root));
@@ -320,16 +317,16 @@ class Access_Helper_Test extends Unit_Test_Case {
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
- access::deny(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $album);
$this->assert_true(file_exists($album->file_path() . "/.htaccess"));
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
- access::deny(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $album);
$this->assert_true(file_exists($album->file_path() . "/.htaccess"));
- access::reset(group::everybody(), "view", $album);
+ access::reset(identity::everybody(), "view", $album);
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
}
@@ -341,44 +338,44 @@ class Access_Helper_Test extends Unit_Test_Case {
$this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
$this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
- access::deny(group::everybody(), "view_full", $album);
+ access::deny(identity::everybody(), "view_full", $album);
$this->assert_true(file_exists($album->file_path() . "/.htaccess"));
$this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
$this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
- access::allow(group::everybody(), "view_full", $album);
+ access::allow(identity::everybody(), "view_full", $album);
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
$this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
$this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
- access::deny(group::everybody(), "view_full", $album);
+ access::deny(identity::everybody(), "view_full", $album);
$this->assert_true(file_exists($album->file_path() . "/.htaccess"));
$this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
$this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
- access::reset(group::everybody(), "view_full", $album);
+ access::reset(identity::everybody(), "view_full", $album);
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
$this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
$this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
}
public function moved_items_inherit_new_permissions_test() {
- user::set_active(user::lookup_by_name("admin"));
+ identity::set_active_user(identity::lookup_user_by_name("admin"));
$root = ORM::factory("item", 1);
$public_album = album::create($root, rand(), "public album");
$public_photo = photo::create($public_album, MODPATH . "gallery/images/gallery.png", "", "");
- access::allow(group::everybody(), "view", $public_album);
+ access::allow(identity::everybody(), "view", $public_album);
$root->reload(); // Account for MPTT changes
$private_album = album::create($root, rand(), "private album");
- access::deny(group::everybody(), "view", $private_album);
+ access::deny(identity::everybody(), "view", $private_album);
$private_photo = photo::create($private_album, MODPATH . "gallery/images/gallery.png", "", "");
// Make sure that we now have a public photo and private photo.
- $this->assert_true(access::group_can(group::everybody(), "view", $public_photo));
- $this->assert_false(access::group_can(group::everybody(), "view", $private_photo));
+ $this->assert_true(access::group_can(identity::everybody(), "view", $public_photo));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $private_photo));
// Swap the photos
item::move($public_photo, $private_album);
@@ -394,7 +391,7 @@ class Access_Helper_Test extends Unit_Test_Case {
$public_photo->reload();
// Make sure that the public_photo is now private, and the private_photo is now public.
- $this->assert_false(access::group_can(group::everybody(), "view", $public_photo));
- $this->assert_true(access::group_can(group::everybody(), "view", $private_photo));
+ $this->assert_false(access::group_can(identity::everybody(), "view", $public_photo));
+ $this->assert_true(access::group_can(identity::everybody(), "view", $private_photo));
}
}
diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php
index d65946c7..8562355c 100644
--- a/modules/gallery/tests/Albums_Controller_Test.php
+++ b/modules/gallery/tests/Albums_Controller_Test.php
@@ -19,13 +19,13 @@
*/
class Albums_Controller_Test extends Unit_Test_Case {
public function setup() {
- $this->_post = $_POST;
- $this->_album = null;
+ $this->_save = array($_POST, $_SERVER);
+ $_SERVER["HTTP_REFERER"] = "HTTP_REFERER";
}
public function teardown() {
- $_POST = $this->_post;
- if ($this->_album) {
+ list($_POST, $_SERVER) = $this->_save;
+ if (isset($this->_album)) {
$this->_album->delete();
}
}
@@ -43,8 +43,9 @@ class Albums_Controller_Test extends Unit_Test_Case {
$_POST["column"] = "weight";
$_POST["direction"] = "ASC";
$_POST["csrf"] = access::csrf_token();
+ $_POST["slug"] = "new-name";
$_POST["_method"] = "put";
- access::allow(group::everybody(), "edit", $root);
+ access::allow(identity::everybody(), "edit", $root);
ob_start();
$controller->_update($this->_album);
@@ -52,7 +53,7 @@ class Albums_Controller_Test extends Unit_Test_Case {
ob_end_clean();
$this->assert_equal(
- json_encode(array("result" => "success")),
+ json_encode(array("result" => "success", "location" => "HTTP_REFERER")),
$results);
$this->assert_equal("new title", $this->_album->title);
$this->assert_equal("new description", $this->_album->description);
@@ -68,7 +69,7 @@ class Albums_Controller_Test extends Unit_Test_Case {
$_POST["name"] = "new name";
$_POST["title"] = "new title";
$_POST["description"] = "new description";
- access::allow(group::everybody(), "edit", $root);
+ access::allow(identity::everybody(), "edit", $root);
try {
$controller->_update($this->_album);
diff --git a/modules/gallery/tests/Controller_Auth_Test.php b/modules/gallery/tests/Controller_Auth_Test.php
index caf6d8f2..0a7076c6 100644
--- a/modules/gallery/tests/Controller_Auth_Test.php
+++ b/modules/gallery/tests/Controller_Auth_Test.php
@@ -25,13 +25,18 @@ class Controller_Auth_Test extends Unit_Test_Case {
public function find_missing_auth_test() {
$found = array();
- $controllers = glob("*/*/controllers/*.php");
- $feeds = glob("*/*/helpers/*_rss.php");
+ $controllers = explode("\n", `git ls-files '*/*/controllers/*.php'`);
+ $feeds = explode("\n", `git ls-files '*/*/helpers/*_rss.php'`);
foreach (array_merge($controllers, $feeds) as $controller) {
if (preg_match("{modules/(gallery_)?unit_test/}", $controller)) {
continue;
}
+ if (!$controller) {
+ // The last entry in each list from git ls-files appears to be an empty line
+ continue;
+ }
+
// List of all tokens without whitespace, simplifying parsing.
$tokens = array();
foreach (token_get_all(file_get_contents($controller)) as $token) {
@@ -118,7 +123,7 @@ class Controller_Auth_Test extends Unit_Test_Case {
if ($token[1] == "access" &&
self::_token_matches(array(T_DOUBLE_COLON, "::"), $tokens, $token_number + 1) &&
self::_token_matches(array(T_STRING), $tokens, $token_number + 2) &&
- in_array($tokens[$token_number + 2][1], array("forbidden", "required")) &&
+ in_array($tokens[$token_number + 2][1], array("forbidden", "required")) &&
self::_token_matches("(", $tokens, $token_number + 3)) {
$token_number += 3;
$function->checks_authorization(true);
@@ -149,7 +154,7 @@ class Controller_Auth_Test extends Unit_Test_Case {
}
}
}
- }
+ }
}
// Generate the report
diff --git a/modules/gallery/tests/Database_Test.php b/modules/gallery/tests/Database_Test.php
index d83212ad..ad2bbba1 100644
--- a/modules/gallery/tests/Database_Test.php
+++ b/modules/gallery/tests/Database_Test.php
@@ -99,7 +99,7 @@ class Database_Test extends Unit_Test_Case {
UNIQUE KEY(`name`))
ENGINE=InnoDB DEFAULT CHARSET=utf8";
$this->assert_same($expected, $converted);
-
+
$sql = "UPDATE {test_tables} SET `name` = '{test string}' " .
"WHERE `item_id` IN " .
" (SELECT `id` FROM {items} " .
@@ -116,12 +116,16 @@ class Database_Test extends Unit_Test_Case {
$this->assert_same($expected, $sql);
}
- public function setup() {
- }
+ function prefix_no_replacement_test() {
+ $update = Database_For_Test::instance()->from("test_tables")
+ ->where("1 = 1")
+ ->set(array("name" => "Test Name"))
+ ->update();
- public function teardown() {
- }
+ $expected = "UPDATE `g3test_test_tables` SET `name` = 'Test Name' WHERE 1 = 1";
+ $this->assert_same($expected, $update);
+ }
}
class Database_For_Test extends Database {
@@ -131,4 +135,12 @@ class Database_For_Test extends Database {
$db->config["table_prefix"] = "g3test_";
return $db;
}
+
+ public function query($sql = '') {
+ if (!empty($sql)) {
+ print " query($sql)\n";
+ $sql = $this->add_table_prefixes($sql);
+ }
+ return $sql;
+ }
}
diff --git a/modules/gallery/tests/DrawForm_Test.php b/modules/gallery/tests/DrawForm_Test.php
index dde54257..7ee80ca2 100644
--- a/modules/gallery/tests/DrawForm_Test.php
+++ b/modules/gallery/tests/DrawForm_Test.php
@@ -19,14 +19,14 @@
*/
class DrawForm_Test extends Unit_Test_Case {
function no_group_test() {
- $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm"));
+ $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$form->input("title")->label(t("Title"));
$form->textarea("description")->label(t("Text Area"));
$form->submit("")->value(t("Submit"));
$rendered = $form->__toString();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
- "id=\"gTestGroupForm\">\n" .
+ "id=\"g-test-group-form\">\n" .
"<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
" <ul>\n" .
" <li>\n" .
@@ -48,7 +48,7 @@ class DrawForm_Test extends Unit_Test_Case {
}
function group_test() {
- $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm"));
+ $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$group = $form->group("test_group")->label(t("Test Group"));
$group->input("title")->label(t("Title"));
$group->textarea("description")->label(t("Text Area"));
@@ -56,7 +56,7 @@ class DrawForm_Test extends Unit_Test_Case {
$rendered = $form->__toString();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
- "id=\"gTestGroupForm\">\n" .
+ "id=\"g-test-group-form\">\n" .
"<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
" <fieldset>\n" .
" <legend>Test Group</legend>\n" .
@@ -81,7 +81,7 @@ class DrawForm_Test extends Unit_Test_Case {
}
function form_script_test() {
- $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm"));
+ $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$group = $form->group("test_group")->label(t("Test Group"));
$group->input("title")->label(t("Title"));
$group->textarea("description")->label(t("Text Area"));
@@ -92,7 +92,7 @@ class DrawForm_Test extends Unit_Test_Case {
$rendered = $form->__toString();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
- "id=\"gTestGroupForm\">\n" .
+ "id=\"g-test-group-form\">\n" .
"<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
" <fieldset>\n" .
" <legend>Test Group</legend>\n" .
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php
index 9018f4c6..36342fda 100644
--- a/modules/gallery/tests/File_Structure_Test.php
+++ b/modules/gallery/tests/File_Structure_Test.php
@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
+require_once(MODPATH . "gallery/tests/Gallery_Filters.php");
+
class File_Structure_Test extends Unit_Test_Case {
public function no_trailing_closing_php_tag_test() {
$dir = new GalleryCodeFilterIterator(
@@ -233,7 +235,9 @@ class File_Structure_Test extends Unit_Test_Case {
foreach ($info_files as $file) {
foreach (file($file) as $line) {
$parts = explode("=", $line, 2);
- $values[trim($parts[0])] = trim($parts[1]);
+ if (isset($parts[1])) {
+ $values[trim($parts[0])] = trim($parts[1]);
+ }
}
$module = dirname($file);
@@ -261,33 +265,3 @@ class File_Structure_Test extends Unit_Test_Case {
}
}
}
-
-class PhpCodeFilterIterator extends FilterIterator {
- public function accept() {
- $path_name = $this->getInnerIterator()->getPathName();
- return substr($path_name, -4) == ".php";
- }
-}
-
-class GalleryCodeFilterIterator extends FilterIterator {
- public function accept() {
- // Skip anything that we didn"t write
- $path_name = $this->getInnerIterator()->getPathName();
- return !(
- strpos($path_name, ".svn") ||
- strpos($path_name, DOCROOT . "test") !== false ||
- strpos($path_name, DOCROOT . "var") !== false ||
- strpos($path_name, MODPATH . "forge") !== false ||
- strpos($path_name, MODPATH . "gallery/views/kohana_error_page.php") !== false ||
- strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false ||
- strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false ||
- strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false ||
- strpos($path_name, MODPATH . "unit_test") !== false ||
- strpos($path_name, MODPATH . "exif/lib") !== false ||
- strpos($path_name, MODPATH . "user/lib/PasswordHash") !== false ||
- strpos($path_name, DOCROOT . "lib/swfupload") !== false ||
- strpos($path_name, SYSPATH) !== false ||
- strpos($path_name, MODPATH . "gallery/libraries/HTMLPurifier") !== false ||
- substr($path_name, -1, 1) == "~");
- }
-}
diff --git a/modules/gallery/tests/Gallery_Filters.php b/modules/gallery/tests/Gallery_Filters.php
new file mode 100644
index 00000000..d1bc2cfa
--- /dev/null
+++ b/modules/gallery/tests/Gallery_Filters.php
@@ -0,0 +1,48 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class PhpCodeFilterIterator extends FilterIterator {
+ public function accept() {
+ $path_name = $this->getInnerIterator()->getPathName();
+ return substr($path_name, -4) == ".php";
+ }
+}
+
+class GalleryCodeFilterIterator extends FilterIterator {
+ public function accept() {
+ // Skip anything that we didn"t write
+ $path_name = $this->getInnerIterator()->getPathName();
+ return !(
+ strpos($path_name, ".svn") ||
+ strpos($path_name, DOCROOT . "test") !== false ||
+ strpos($path_name, DOCROOT . "var") !== false ||
+ strpos($path_name, MODPATH . "forge") !== false ||
+ strpos($path_name, MODPATH . "gallery/views/kohana_error_page.php") !== false ||
+ strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false ||
+ strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false ||
+ strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false ||
+ strpos($path_name, MODPATH . "unit_test") !== false ||
+ strpos($path_name, MODPATH . "exif/lib") !== false ||
+ strpos($path_name, MODPATH . "user/lib/PasswordHash") !== false ||
+ strpos($path_name, DOCROOT . "lib/swfupload") !== false ||
+ strpos($path_name, SYSPATH) !== false ||
+ strpos($path_name, MODPATH . "gallery/libraries/HTMLPurifier") !== false ||
+ substr($path_name, -1, 1) == "~");
+ }
+}
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php
index 33fcdb73..a364423a 100644
--- a/modules/gallery/tests/Item_Helper_Test.php
+++ b/modules/gallery/tests/Item_Helper_Test.php
@@ -23,16 +23,16 @@ class Item_Helper_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), rand(), rand());
$item = self::_create_random_item($album);
- user::set_active(user::guest());
+ identity::set_active_user(identity::guest());
// We can see the item when permissions are granted
- access::allow(group::everybody(), "view", $album);
+ access::allow(identity::everybody(), "view", $album);
$this->assert_equal(
1,
ORM::factory("item")->viewable()->where("id", $item->id)->count_all());
// We can't see the item when permissions are denied
- access::deny(group::everybody(), "view", $album);
+ access::deny(identity::everybody(), "view", $album);
$this->assert_equal(
0,
ORM::factory("item")->viewable()->where("id", $item->id)->count_all());
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index 84210e4c..e7dce893 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -24,12 +24,11 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_true(!empty($item->updated));
}
- private static function _create_random_item() {
- $item = ORM::factory("item");
- /* Set all required fields (values are irrelevant) */
- $item->name = rand();
- $item->type = "photo";
- return $item->add_to_parent(ORM::factory("item", 1));
+ private static function _create_random_item($root=null, $rand=null) {
+ $root = $root ? $root : ORM::factory("item", 1);
+ $rand = $rand ? $rand : rand();
+ $item = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ return $item;
}
public function updating_doesnt_change_created_date_test() {
@@ -62,7 +61,7 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_true(empty($item->updated));
}
- public function move_photo_test() {
+ public function rename_photo_test() {
// Create a test photo
$item = self::_create_random_item();
@@ -86,14 +85,11 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_equal("file", file_get_contents($item->file_path()));
}
- public function move_album_test() {
+ public function rename_album_test() {
// Create an album with a photo in it
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), rand(), rand());
- $photo = ORM::factory("item");
- $photo->name = rand();
- $photo->type = "photo";
- $photo->add_to_parent($album);
+ $photo = self::_create_random_item($album);
file_put_contents($photo->thumb_path(), "thumb");
file_put_contents($photo->resize_path(), "resize");
@@ -141,6 +137,24 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_false(true, "Item_Model::rename should not accept / characters");
}
+ public function item_rename_fails_with_existing_name_test() {
+ // Create a test photo
+ $item = self::_create_random_item();
+ $item2 = self::_create_random_item();
+
+ $new_name = $item2->name;
+
+ try {
+ $item->rename($new_name)->save();
+ } catch (Exception $e) {
+ // pass
+ $this->assert_true(strpos($e->getMessage(), "INVALID_RENAME_FILE_EXISTS") !== false,
+ "incorrect exception.");
+ return;
+ }
+ $this->assert_false(true, "Item_Model::rename should fail.");
+ }
+
public function save_original_values_test() {
$item = self::_create_random_item();
$item->title = "ORIGINAL_VALUE";
@@ -160,4 +174,102 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_equal("foo%20bar", $item->relative_url());
$this->assert_equal("foo%20bar.jpg", $item->relative_path());
}
+
+ public function move_album_test() {
+ // Create an album with a photo in it
+ $root = ORM::factory("item", 1);
+ $album2 = album::create($root, rand(), rand(), rand());
+ $album = album::create($album2, rand(), rand(), rand());
+ $photo = self::_create_random_item($album);
+
+ file_put_contents($photo->thumb_path(), "thumb");
+ file_put_contents($photo->resize_path(), "resize");
+ file_put_contents($photo->file_path(), "file");
+
+ // Now move the album
+ $album->move_to($root);
+ $photo->reload();
+
+ // Expected:
+ // * the album dirs are all moved
+ // * the photo's paths are all inside the albums paths
+ // * the photo files are all still intact and accessible
+
+ $this->assert_same(0, strpos($photo->file_path(), $album->file_path()));
+ $this->assert_same(0, strpos($photo->thumb_path(), dirname($album->thumb_path())));
+ $this->assert_same(0, strpos($photo->resize_path(), dirname($album->resize_path())));
+
+ $this->assert_equal("thumb", file_get_contents($photo->thumb_path()));
+ $this->assert_equal("resize", file_get_contents($photo->resize_path()));
+ $this->assert_equal("file", file_get_contents($photo->file_path()));
+ }
+
+ public function move_photo_test() {
+ // Create an album with a photo in it
+ $root = ORM::factory("item", 1);
+ $album2 = album::create($root, rand(), rand(), rand());
+ $album = album::create($album2, rand(), rand(), rand());
+ $photo = self::_create_random_item($album);
+
+ file_put_contents($photo->thumb_path(), "thumb");
+ file_put_contents($photo->resize_path(), "resize");
+ file_put_contents($photo->file_path(), "file");
+
+ // Now move the album
+ $photo->move_to($album2);
+ $photo->reload();
+
+ // Expected:
+ // * the album dirs are all moved
+ // * the photo's paths are all inside the albums paths
+ // * the photo files are all still intact and accessible
+
+ $this->assert_same(0, strpos($photo->file_path(), $album->file_path()));
+ $this->assert_same(0, strpos($photo->thumb_path(), dirname($album->thumb_path())));
+ $this->assert_same(0, strpos($photo->resize_path(), dirname($album->resize_path())));
+
+ $this->assert_equal("thumb", file_get_contents($photo->thumb_path()));
+ $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);
+ $name = rand();
+ $album = album::create($root, $name, $name, $name);
+ $source = album::create($album, $name, $name, $name);
+
+ try {
+ $source->move_to($root);
+ } catch (Exception $e) {
+ // pass
+ $this->assert_true(strpos($e->getMessage(), "INVALID_MOVE_TARGET_EXISTS") !== false,
+ "incorrect exception.");
+ return;
+ }
+
+ $this->assert_false(true, "Item_Model::rename should not accept / characters");
+ }
+
+ public function move_photo_fails_invalid_target_test() {
+ // Create an album with a photo in it
+ $root = ORM::factory("item", 1);
+ $photo_name = rand();
+ $photo1 = self::_create_random_item($root, $photo_name);
+ $name = rand();
+ $album = album::create($root, $name, $name, $name);
+ $photo2 = self::_create_random_item($album, $photo_name);
+
+ try {
+ $photo2->move_to($root);
+ } catch (Exception $e) {
+ // pass
+ $this->assert_true(strpos($e->getMessage(), "INVALID_MOVE_TARGET_EXISTS") !== false,
+ "incorrect exception.");
+ return;
+ }
+
+ $this->assert_false(true, "Item_Model::rename should not accept / characters");
+ }
}
diff --git a/modules/gallery/tests/Photos_Controller_Test.php b/modules/gallery/tests/Photos_Controller_Test.php
index 0159b420..624e6878 100644
--- a/modules/gallery/tests/Photos_Controller_Test.php
+++ b/modules/gallery/tests/Photos_Controller_Test.php
@@ -19,11 +19,12 @@
*/
class Photos_Controller_Test extends Unit_Test_Case {
public function setup() {
- $this->_post = $_POST;
+ $this->_save = array($_POST, $_SERVER);
+ $_SERVER["HTTP_REFERER"] = "HTTP_REFERER";
}
public function teardown() {
- $_POST = $this->_post;
+ list($_POST, $_SERVER) = $this->_save;
}
public function change_photo_test() {
@@ -31,7 +32,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$photo = photo::create(
$root, MODPATH . "gallery/tests/test.jpg", "test.jpeg",
- "test", "test", user::active(), "slug");
+ "test", "test", identity::active_user()->id, "slug");
$orig_name = $photo->name;
$_POST["filename"] = "test.jpeg";
@@ -40,14 +41,15 @@ class Photos_Controller_Test extends Unit_Test_Case {
$_POST["description"] = "new description";
$_POST["slug"] = "new-slug";
$_POST["csrf"] = access::csrf_token();
- access::allow(group::everybody(), "edit", $root);
+ access::allow(identity::everybody(), "edit", $root);
ob_start();
$controller->_update($photo);
$results = ob_get_contents();
ob_end_clean();
- $this->assert_equal(json_encode(array("result" => "success")), $results);
+ $this->assert_equal(
+ json_encode(array("result" => "success", "location" => "HTTP_REFERER")), $results);
$this->assert_equal("new-slug", $photo->slug);
$this->assert_equal("new title", $photo->title);
$this->assert_equal("new description", $photo->description);
@@ -64,7 +66,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
$_POST["name"] = "new name";
$_POST["title"] = "new title";
$_POST["description"] = "new description";
- access::allow(group::everybody(), "edit", $root);
+ access::allow(identity::everybody(), "edit", $root);
try {
$controller->_update($photo);
diff --git a/modules/gallery/tests/Xss_Security_Test.php b/modules/gallery/tests/Xss_Security_Test.php
index 16541017..b296d97c 100644
--- a/modules/gallery/tests/Xss_Security_Test.php
+++ b/modules/gallery/tests/Xss_Security_Test.php
@@ -248,7 +248,7 @@ class Xss_Security_Test extends Unit_Test_Case {
$frame->is_safe_attr(true);
}
}
- }
+ }
} else if ($frame && $token[0] == T_OBJECT_OPERATOR) {
$frame->expr_append($token[1]);
@@ -349,7 +349,7 @@ class Xss_Security_Test extends Unit_Test_Case {
$canonical = MODPATH . "gallery/tests/xss_data.txt";
exec("diff $canonical $new", $output, $return_value);
$this->assert_false(
- $return_value, "XSS golden file mismatch. Output:\n" . implode("\n", $output) );
+ $return_value, "XSS golden file mismatch. Output:\n" . implode("\n", $output) );
}
private static function _create_frame($token, $in_script_block,
diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt
index fdf00c5e..30102538 100644
--- a/modules/gallery/tests/controller_auth_data.txt
+++ b/modules/gallery/tests/controller_auth_data.txt
@@ -9,6 +9,11 @@ modules/gallery/controllers/albums.php _form_add
modules/gallery/controllers/combined.php javascript DIRTY_AUTH
modules/gallery/controllers/combined.php css DIRTY_AUTH
modules/gallery/controllers/file_proxy.php __call DIRTY_CSRF|DIRTY_AUTH
+modules/gallery/controllers/login.php ajax DIRTY_AUTH
+modules/gallery/controllers/login.php auth_ajax DIRTY_AUTH
+modules/gallery/controllers/login.php html DIRTY_AUTH
+modules/gallery/controllers/login.php auth_html DIRTY_AUTH
+modules/gallery/controllers/logout.php index DIRTY_CSRF|DIRTY_AUTH
modules/gallery/controllers/maintenance.php index DIRTY_AUTH
modules/gallery/controllers/rest.php __construct DIRTY_AUTH
modules/gallery/controllers/rest.php __call DIRTY_AUTH
@@ -31,10 +36,5 @@ modules/server_add/controllers/admin_server_add.php autocomplete
modules/server_add/controllers/server_add.php children DIRTY_CSRF
modules/tag/controllers/admin_tags.php index DIRTY_CSRF
modules/tag/controllers/tags.php _show DIRTY_CSRF|DIRTY_AUTH
-modules/user/controllers/login.php ajax DIRTY_AUTH
-modules/user/controllers/login.php auth_ajax DIRTY_AUTH
-modules/user/controllers/login.php html DIRTY_AUTH
-modules/user/controllers/login.php auth_html DIRTY_AUTH
-modules/user/controllers/logout.php index DIRTY_CSRF|DIRTY_AUTH
modules/user/controllers/password.php reset DIRTY_AUTH
modules/user/controllers/password.php do_reset DIRTY_CSRF|DIRTY_AUTH
diff --git a/modules/gallery/tests/selenium/Add_Comment.html b/modules/gallery/tests/selenium/Add_Comment.html
index b4b96ed2..054e7597 100644
--- a/modules/gallery/tests/selenium/Add_Comment.html
+++ b/modules/gallery/tests/selenium/Add_Comment.html
@@ -18,22 +18,22 @@
</tr>
<tr>
<td>clickAndWait</td>
- <td>gPhotoId-2</td>
+ <td>g-photo-id-2</td>
<td></td>
</tr>
<tr>
<td>type</td>
- <td>gAuthor</td>
+ <td>g-author</td>
<td>Test</td>
</tr>
<tr>
<td>type</td>
- <td>gEmail</td>
+ <td>g-email</td>
<td>test@gmail.com</td>
</tr>
<tr>
<td>type</td>
- <td>gText</td>
+ <td>g-text</td>
<td>This is a selenium test comment.</td>
</tr>
<tr>
diff --git a/modules/gallery/tests/selenium/Login.html b/modules/gallery/tests/selenium/Login.html
index 5e17a3c7..d2e45c63 100644
--- a/modules/gallery/tests/selenium/Login.html
+++ b/modules/gallery/tests/selenium/Login.html
@@ -18,17 +18,17 @@
</tr>
<tr>
<td>click</td>
- <td>gLoginLink</td>
+ <td>g-login-link</td>
<td></td>
</tr>
<tr>
<td>type</td>
- <td>gName</td>
+ <td>g-name</td>
<td>admin</td>
</tr>
<tr>
<td>type</td>
- <td>gPassword</td>
+ <td>g-password</td>
<td>admin</td>
</tr>
<tr>
@@ -38,7 +38,7 @@
</tr>
<tr>
<td>clickAndWait</td>
- <td>gUserProfileLink</td>
+ <td>g-user-profile-link</td>
<td></td>
</tr>
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index ff4a78a5..9146ddb2 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -1,24 +1,24 @@
modules/akismet/views/admin_akismet.html.php 16 DIRTY $form
modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR $api_key
modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urlencode($blog_url)
-modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"gEvenRow":"gOddRow"
+modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR text::alternate("g-even","g-odd")
modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(32,$theme->url(,true))
modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY gallery::date_time($comment->created)
-modules/comment/views/admin_comments.html.php 42 DIRTY $menu
-modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR $comment->id
-modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow"
-modules/comment/views/admin_comments.html.php 109 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true))
-modules/comment/views/admin_comments.html.php 122 DIRTY_JS $item->url()
-modules/comment/views/admin_comments.html.php 124 DIRTY_ATTR $item->thumb_url()
-modules/comment/views/admin_comments.html.php 126 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75)
-modules/comment/views/admin_comments.html.php 134 DIRTY gallery::date($comment->created)
-modules/comment/views/admin_comments.html.php 141 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 150 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 159 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 168 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 175 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 183 DIRTY_JS $comment->id
-modules/comment/views/admin_comments.html.php 196 DIRTY $pager
+modules/comment/views/admin_comments.html.php 43 DIRTY $menu->render()
+modules/comment/views/admin_comments.html.php 107 DIRTY_ATTR $comment->id
+modules/comment/views/admin_comments.html.php 107 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/comment/views/admin_comments.html.php 110 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true))
+modules/comment/views/admin_comments.html.php 123 DIRTY_JS $item->url()
+modules/comment/views/admin_comments.html.php 125 DIRTY_ATTR $item->thumb_url()
+modules/comment/views/admin_comments.html.php 127 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75)
+modules/comment/views/admin_comments.html.php 135 DIRTY gallery::date($comment->created)
+modules/comment/views/admin_comments.html.php 142 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 151 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 160 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 169 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 176 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 184 DIRTY_JS $comment->id
+modules/comment/views/admin_comments.html.php 197 DIRTY $pager
modules/comment/views/comment.html.php 2 DIRTY_ATTR $comment->id;
modules/comment/views/comment.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true))
modules/comment/views/comment.mrss.php 10 DIRTY $feed->uri
@@ -39,7 +39,8 @@ modules/digibug/views/digibug_form.html.php 5 DIRTY form::
modules/digibug/views/digibug_form.html.php 6 DIRTY form::close()
modules/exif/views/exif_dialog.html.php 14 DIRTY $details[$i]["caption"]
modules/exif/views/exif_dialog.html.php 21 DIRTY $details[$i]["caption"]
-modules/g2_import/views/admin_g2_import.html.php 28 DIRTY $form
+modules/g2_import/views/admin_g2_import.html.php 29 DIRTY $form
+modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even")
modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY $var->module_name
modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity)
modules/gallery/views/admin_block_log_entries.html.php 6 DIRTY gallery::date_time($entry->timestamp)
@@ -53,61 +54,74 @@ modules/gallery/views/admin_block_photo_stream.html.php 6 DIRTY photo:
modules/gallery/views/admin_block_photo_stream.html.php 7 DIRTY_ATTR $photo->thumb_url()
modules/gallery/views/admin_dashboard.html.php 5 DIRTY_JS $csrf
modules/gallery/views/admin_dashboard.html.php 35 DIRTY $blocks
-modules/gallery/views/admin_graphics.html.php 22 DIRTY newView("admin_graphics_none.html")
-modules/gallery/views/admin_graphics.html.php 24 DIRTY newView("admin_graphics_$active.html",array("tk"=>$tk->$active,"is_active"=>true))
-modules/gallery/views/admin_graphics.html.php 31 DIRTY newView("admin_graphics_$id.html",array("tk"=>$tk->$id,"is_active"=>false))
-modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $is_active?" gSelected":""
-modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable"
+modules/gallery/views/admin_graphics.html.php 24 DIRTY newView("admin_graphics_none.html")
+modules/gallery/views/admin_graphics.html.php 26 DIRTY newView("admin_graphics_$active.html",array("tk"=>$tk->$active,"is_active"=>true))
+modules/gallery/views/admin_graphics.html.php 33 DIRTY newView("admin_graphics_$id.html",array("tk"=>$tk->$id,"is_active"=>false))
+modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $is_active?" g-selected":""
+modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable"
modules/gallery/views/admin_graphics_gd.html.php 19 DIRTY $tk->error
-modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $is_active?" gSelected":""
-modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable"
+modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":""
+modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable"
modules/gallery/views/admin_graphics_graphicsmagick.html.php 18 DIRTY $tk->error
-modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" gSelected":""
-modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable"
+modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":""
+modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable"
modules/gallery/views/admin_graphics_imagemagick.html.php 18 DIRTY $tk->error
-modules/gallery/views/admin_languages.html.php 9 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_languages.html.php 27 DIRTY_ATTR (isset($installed_locales[$code]))?"installed":""
-modules/gallery/views/admin_languages.html.php 27 DIRTY_ATTR ($default_locale==$code)?" default":""
-modules/gallery/views/admin_languages.html.php 28 DIRTY form::checkbox("installed_locales[]",$code,isset($installed_locales[$code]))
-modules/gallery/views/admin_languages.html.php 29 DIRTY $display_name
-modules/gallery/views/admin_languages.html.php 31 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"'))
-modules/gallery/views/admin_languages.html.php 102 DIRTY $share_translations_form
-modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow"
+modules/gallery/views/admin_identity.html.php 43 DIRTY access::csrf_form_field()
+modules/gallery/views/admin_identity.html.php 50 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_identity.html.php 52 DIRTY form::radio($data,$module_name,$module_name==$active)
+modules/gallery/views/admin_identity_confirm.html.php 3 DIRTY access::csrf_form_field()
+modules/gallery/views/admin_identity_confirm.html.php 4 DIRTY form::hidden("provider",$new_provider)
+modules/gallery/views/admin_languages.html.php 43 DIRTY access::csrf_form_field()
+modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR (isset($installed_locales[$code]))?"g-available":""
+modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR ($default_locale==$code)?" g-selected":""
+modules/gallery/views/admin_languages.html.php 61 DIRTY form::checkbox("installed_locales[]",$code,isset($installed_locales[$code]))
+modules/gallery/views/admin_languages.html.php 62 DIRTY $display_name
+modules/gallery/views/admin_languages.html.php 64 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"'))
+modules/gallery/views/admin_languages.html.php 109 DIRTY $share_translations_form
+modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR text::alternate("g-odd","g-even")
modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR log::severity_class($task->severity)
modules/gallery/views/admin_maintenance.html.php 25 DIRTY_ATTR log::severity_class($task->severity)
modules/gallery/views/admin_maintenance.html.php 26 DIRTY $task->name
modules/gallery/views/admin_maintenance.html.php 29 DIRTY $task->description
-modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow"
-modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR $task->state=="stalled"?"gWarning":""
-modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR $task->state=="stalled"?"gWarning":""
-modules/gallery/views/admin_maintenance.html.php 74 DIRTY gallery::date_time($task->updated)
-modules/gallery/views/admin_maintenance.html.php 77 DIRTY $task->name
-modules/gallery/views/admin_maintenance.html.php 92 DIRTY $task->status
-modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow"
-modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError"
-modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError"
-modules/gallery/views/admin_maintenance.html.php 147 DIRTY gallery::date_time($task->updated)
-modules/gallery/views/admin_maintenance.html.php 150 DIRTY $task->name
-modules/gallery/views/admin_maintenance.html.php 162 DIRTY $task->status
+modules/gallery/views/admin_maintenance.html.php 70 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_maintenance.html.php 70 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
+modules/gallery/views/admin_maintenance.html.php 71 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
+modules/gallery/views/admin_maintenance.html.php 72 DIRTY gallery::date_time($task->updated)
+modules/gallery/views/admin_maintenance.html.php 75 DIRTY $task->name
+modules/gallery/views/admin_maintenance.html.php 90 DIRTY $task->status
+modules/gallery/views/admin_maintenance.html.php 141 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_maintenance.html.php 141 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
+modules/gallery/views/admin_maintenance.html.php 142 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
+modules/gallery/views/admin_maintenance.html.php 143 DIRTY gallery::date_time($task->updated)
+modules/gallery/views/admin_maintenance.html.php 146 DIRTY $task->name
+modules/gallery/views/admin_maintenance.html.php 158 DIRTY $task->status
modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf")
modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name
modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name
-modules/gallery/views/admin_modules.html.php 9 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow"
+modules/gallery/views/admin_modules.html.php 10 DIRTY access::csrf_form_field()
+modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR text::alternate("g-odd","g-even")
modules/gallery/views/admin_modules.html.php 22 DIRTY form::checkbox($data,'1',module::is_active($module_name))
modules/gallery/views/admin_modules.html.php 24 DIRTY $module_info->version
-modules/gallery/views/admin_theme_options.html.php 5 DIRTY $form
+modules/gallery/views/admin_sidebar.html.php 50 DIRTY $available
+modules/gallery/views/admin_sidebar.html.php 58 DIRTY $active
+modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY_ATTR $ref
+modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY $text
+modules/gallery/views/admin_theme_options.html.php 6 DIRTY $form
modules/gallery/views/admin_themes.html.php 3 DIRTY_JS url::site("admin/themes/choose")
modules/gallery/views/admin_themes.html.php 5 DIRTY_JS $csrf
-modules/gallery/views/admin_themes.html.php 20 DIRTY $themes[$site]->name
-modules/gallery/views/admin_themes.html.php 22 DIRTY $themes[$site]->description
-modules/gallery/views/admin_themes.html.php 36 DIRTY $info->name
-modules/gallery/views/admin_themes.html.php 38 DIRTY $info->description
-modules/gallery/views/admin_themes.html.php 58 DIRTY $themes[$admin]->name
-modules/gallery/views/admin_themes.html.php 60 DIRTY $themes[$admin]->description
-modules/gallery/views/admin_themes.html.php 74 DIRTY $info->name
-modules/gallery/views/admin_themes.html.php 76 DIRTY $info->description
+modules/gallery/views/admin_themes.html.php 22 DIRTY $themes[$site]->name
+modules/gallery/views/admin_themes.html.php 24 DIRTY $themes[$site]->description
+modules/gallery/views/admin_themes.html.php 38 DIRTY $info->name
+modules/gallery/views/admin_themes.html.php 40 DIRTY $info->description
+modules/gallery/views/admin_themes.html.php 60 DIRTY $themes[$admin]->name
+modules/gallery/views/admin_themes.html.php 62 DIRTY $themes[$admin]->description
+modules/gallery/views/admin_themes.html.php 76 DIRTY $info->name
+modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description
modules/gallery/views/admin_themes_preview.html.php 7 DIRTY_ATTR $url
+modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form"),$hidden)
+modules/gallery/views/in_place_edit.html.php 5 DIRTY form::input("input",$form["input"]," class='textbox'")
+modules/gallery/views/in_place_edit.html.php 12 DIRTY form::close()
+modules/gallery/views/in_place_edit.html.php 14 DIRTY $errors["input"]
modules/gallery/views/kohana_error_page.php 102 DIRTY $message
modules/gallery/views/kohana_error_page.php 116 DIRTY $trace
modules/gallery/views/kohana_profiler.php 32 DIRTY $profile->render();
@@ -125,7 +139,23 @@ modules/gallery/views/l10n_client.html.php 54 DIRTY form::
modules/gallery/views/l10n_client.html.php 58 DIRTY form::textarea("l10n-edit-plural-translation-few","",' rows="2"')
modules/gallery/views/l10n_client.html.php 62 DIRTY form::textarea("l10n-edit-plural-translation-many","",' rows="2"')
modules/gallery/views/l10n_client.html.php 67 DIRTY form::textarea("l10n-edit-plural-translation-other","",' rows="2"')
-modules/gallery/views/maintenance.html.php 46 DIRTY user::get_login_form("login/auth_html")
+modules/gallery/views/login_ajax.html.php 6 DIRTY_JS url::site("password/reset")
+modules/gallery/views/login_ajax.html.php 37 DIRTY $form
+modules/gallery/views/maintenance.html.php 46 DIRTY auth::get_login_form("login/auth_html")
+modules/gallery/views/menu.html.php 4 DIRTY isset($menu->css_id)?"id='$menu->css_id'":""
+modules/gallery/views/menu.html.php 4 DIRTY_ATTR $menu->css_class
+modules/gallery/views/menu.html.php 6 DIRTY $element->render()
+modules/gallery/views/menu.html.php 18 DIRTY $element->render()
+modules/gallery/views/menu_ajax_link.html.php 3 DIRTY_ATTR $menu->css_id
+modules/gallery/views/menu_ajax_link.html.php 4 DIRTY_ATTR $menu->css_class
+modules/gallery/views/menu_ajax_link.html.php 5 DIRTY_JS $menu->url
+modules/gallery/views/menu_ajax_link.html.php 7 DIRTY $menu->ajax_handler
+modules/gallery/views/menu_dialog.html.php 3 DIRTY_ATTR $menu->css_id
+modules/gallery/views/menu_dialog.html.php 4 DIRTY_ATTR $menu->css_class
+modules/gallery/views/menu_dialog.html.php 5 DIRTY_JS $menu->url
+modules/gallery/views/menu_link.html.php 3 DIRTY_ATTR $menu->css_id
+modules/gallery/views/menu_link.html.php 4 DIRTY_ATTR $menu->css_class
+modules/gallery/views/menu_link.html.php 5 DIRTY_JS $menu->url
modules/gallery/views/move_browse.html.php 4 DIRTY_JS url::site("move/show_sub_tree/{$source->id}/__TARGETID__")
modules/gallery/views/move_browse.html.php 39 DIRTY $tree
modules/gallery/views/move_browse.html.php 43 DIRTY access::csrf_form_field()
@@ -143,42 +173,51 @@ modules/gallery/views/movieplayer.html.php 7 DIRTY_JS url::a
modules/gallery/views/movieplayer.html.php 13 DIRTY_JS url::abs_file("lib/flowplayer.h264streaming.swf")
modules/gallery/views/permissions_browse.html.php 3 DIRTY_JS url::site("permissions/form/__ITEM__")
modules/gallery/views/permissions_browse.html.php 16 DIRTY_JS url::site("permissions/change/__CMD__/__GROUP__/__PERM__/__ITEM__?csrf=$csrf")
-modules/gallery/views/permissions_browse.html.php 42 DIRTY_ATTR $parent->id
-modules/gallery/views/permissions_browse.html.php 44 DIRTY_JS $parent->id
+modules/gallery/views/permissions_browse.html.php 43 DIRTY_ATTR $parent->id
+modules/gallery/views/permissions_browse.html.php 45 DIRTY_JS $parent->id
modules/gallery/views/permissions_browse.html.php 52 DIRTY_ATTR $item->id
modules/gallery/views/permissions_browse.html.php 53 DIRTY_JS $item->id
modules/gallery/views/permissions_browse.html.php 60 DIRTY $form
-modules/gallery/views/permissions_form.html.php 24 DIRTY_JS $lock->id
-modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $item->id
-modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $group->id
-modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $permission->id
-modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $item->id
-modules/gallery/views/upgrader.html.php 44 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable"
-modules/gallery/views/upgrader.html.php 45 DIRTY_ATTR $id
-modules/gallery/views/upgrader.html.php 49 DIRTY $module->version
-modules/gallery/views/upgrader.html.php 52 DIRTY $module->code_version
+modules/gallery/views/permissions_form.html.php 26 DIRTY_JS $lock->id
+modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $item->id
+modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $group->id
+modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $permission->id
+modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $item->id
+modules/gallery/views/simple_uploader.html.php 7 DIRTY_JS url::file("lib/uploadify/uploadify.swf")
+modules/gallery/views/simple_uploader.html.php 8 DIRTY_JS url::site("simple_uploader/add_photo/{$item->id}")
+modules/gallery/views/simple_uploader.html.php 15 DIRTY_JS url::file("lib/uploadify/cancel.png")
+modules/gallery/views/simple_uploader.html.php 43 DIRTY_JS t("Completed")
+modules/gallery/views/upgrader.html.php 57 DIRTY_ATTR $done?"muted":""
+modules/gallery/views/upgrader.html.php 61 DIRTY_ATTR $done?"muted":""
+modules/gallery/views/upgrader.html.php 69 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable"
+modules/gallery/views/upgrader.html.php 70 DIRTY_ATTR $id
+modules/gallery/views/upgrader.html.php 74 DIRTY $module->version
+modules/gallery/views/upgrader.html.php 77 DIRTY $module->code_version
+modules/gallery/views/upgrader.html.php 99 DIRTY_ATTR $done?"muted":""
+modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $done?"muted":""
+modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected)
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
-modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"gThumbnail"))
+modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
modules/info/views/info_block.html.php 29 DIRTY_JS $item->owner->url
modules/notification/views/comment_published.html.php 28 DIRTY_JS $comment->item()->abs_url()
@@ -193,24 +232,24 @@ modules/organize/views/organize_dialog.html.php 3 DIRTY_JS url::s
modules/organize/views/organize_dialog.html.php 4 DIRTY_JS url::site("organize/rearrange/__TARGET_ID__/__BEFORE__?csrf=$csrf")
modules/organize/views/organize_dialog.html.php 5 DIRTY_JS url::site("organize/sort_order/__ALBUM_ID__/__COL__/__DIR__?csrf=$csrf")
modules/organize/views/organize_dialog.html.php 6 DIRTY_JS url::site("organize/tree/__ALBUM_ID__")
-modules/organize/views/organize_dialog.html.php 22 DIRTY $album_tree
-modules/organize/views/organize_dialog.html.php 29 DIRTY $micro_thumb_grid
-modules/organize/views/organize_dialog.html.php 37 DIRTY form::dropdown(array("id"=>"gOrganizeSortColumn"),album::get_sort_order_options(),$album->sort_column)
-modules/organize/views/organize_dialog.html.php 38 DIRTY form::dropdown(array("id"=>"gOrganizeSortOrder"),array("ASC"=>"Ascending","DESC"=>"Descending"),$album->sort_order)
+modules/organize/views/organize_dialog.html.php 20 DIRTY $album_tree
+modules/organize/views/organize_dialog.html.php 27 DIRTY $micro_thumb_grid
+modules/organize/views/organize_dialog.html.php 35 DIRTY form::dropdown(array("id"=>"g-organize-sort-column"),album::get_sort_order_options(),$album->sort_column)
+modules/organize/views/organize_dialog.html.php 36 DIRTY form::dropdown(array("id"=>"g-organize-sort-order"),array("ASC"=>"Ascending","DESC"=>"Descending"),$album->sort_order)
modules/organize/views/organize_thumb_grid.html.php 3 DIRTY_ATTR $child->id
modules/organize/views/organize_thumb_grid.html.php 4 DIRTY_ATTR $child->id
-modules/organize/views/organize_thumb_grid.html.php 5 DIRTY_ATTR $child->is_album()?"gAlbum":"gPhoto"
-modules/organize/views/organize_thumb_grid.html.php 6 DIRTY $child->thumb_img(array("class"=>"gThumbnail","ref"=>$child->id),90,true)
+modules/organize/views/organize_thumb_grid.html.php 5 DIRTY_ATTR $child->is_album()?"g-album":"g-photo"
+modules/organize/views/organize_thumb_grid.html.php 6 DIRTY $child->thumb_img(array("class"=>"g-thumbnail","ref"=>$child->id),90,true)
modules/organize/views/organize_thumb_grid.html.php 14 DIRTY_JS url::site("organize/album/$album->id/".($offset+25))
-modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR access::can("edit",$album)?"":"gViewOnly"
+modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR access::can("edit",$album)?"":"g-view-only"
modules/organize/views/organize_tree.html.php 3 DIRTY_ATTR $album->id
modules/organize/views/organize_tree.html.php 6 DIRTY_ATTR $selected&&$album->id==$selected->id?"selected":""
modules/organize/views/organize_tree.html.php 7 DIRTY_ATTR $album->id
modules/organize/views/organize_tree.html.php 13 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child));
-modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"gViewOnly"
+modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only"
modules/organize/views/organize_tree.html.php 16 DIRTY_ATTR $child->id
modules/organize/views/organize_tree.html.php 19 DIRTY_ATTR $child->id
-modules/recaptcha/views/admin_recaptcha.html.php 10 DIRTY $form
+modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form
modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key
modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key
modules/rss/views/feed.mrss.php 10 DIRTY $feed->uri
@@ -220,14 +259,13 @@ modules/rss/views/feed.mrss.php 19 DIRTY_JS $feed-
modules/rss/views/feed.mrss.php 21 DIRTY $pub_date
modules/rss/views/feed.mrss.php 22 DIRTY $pub_date
modules/rss/views/feed.mrss.php 28 DIRTY date("D, d M Y H:i:s T",$child->created);
-modules/rss/views/feed.mrss.php 34 DIRTY_ATTR $child->resize_url(true)
-modules/rss/views/feed.mrss.php 36 DIRTY_ATTR $child->resize_height
-modules/rss/views/feed.mrss.php 36 DIRTY_ATTR $child->resize_width
-modules/rss/views/feed.mrss.php 39 DIRTY_ATTR $child->thumb_url(true)
-modules/rss/views/feed.mrss.php 41 DIRTY_ATTR $child->thumb_height
-modules/rss/views/feed.mrss.php 41 DIRTY_ATTR $child->thumb_width
-modules/rss/views/feed.mrss.php 47 DIRTY_ATTR $child->thumb_url(true)
-modules/rss/views/feed.mrss.php 48 DIRTY_ATTR @filesize($child->thumb_path())
+modules/rss/views/feed.mrss.php 35 DIRTY_ATTR $child->resize_url(true)
+modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $child->resize_height
+modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $child->resize_width
+modules/rss/views/feed.mrss.php 40 DIRTY_ATTR $child->thumb_url(true)
+modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $child->thumb_height
+modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $child->thumb_width
+modules/rss/views/feed.mrss.php 48 DIRTY_ATTR $child->thumb_url(true)
modules/rss/views/feed.mrss.php 49 DIRTY_ATTR $child->thumb_height
modules/rss/views/feed.mrss.php 50 DIRTY_ATTR $child->thumb_width
modules/rss/views/feed.mrss.php 54 DIRTY_ATTR $child->resize_url(true)
@@ -249,99 +287,98 @@ modules/rss/views/rss_block.html.php 6 DIRTY_JS rss::u
modules/search/views/search.html.php 30 DIRTY_ATTR $item_class
modules/search/views/search.html.php 31 DIRTY_JS $item->url()
modules/search/views/search.html.php 32 DIRTY $item->thumb_img()
+modules/search/views/search.html.php 43 DIRTY $theme->paginator()
+modules/server_add/views/admin_server_add.html.php 5 DIRTY $form
modules/server_add/views/admin_server_add.html.php 15 DIRTY_ATTR $id
-modules/server_add/views/admin_server_add.html.php 24 DIRTY $form
modules/server_add/views/server_add_tree.html.php 20 DIRTY_ATTR is_dir($file)?"ui-icon-folder-collapsed":"ui-icon-document"
-modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"gDirectory":"gFile"
+modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"g-directory":"g-file"
modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__")
modules/server_add/views/server_add_tree_dialog.html.php 4 DIRTY_JS url::site("server_add/start?item_id={$item->id}&csrf=$csrf")
-modules/server_add/views/server_add_tree_dialog.html.php 23 DIRTY $tree
-modules/tag/views/admin_tags.html.php 13 DIRTY_JS $csrf
-modules/tag/views/admin_tags.html.php 50 DIRTY_ATTR $tag->id
-modules/tag/views/admin_tags.html.php 51 DIRTY $tag->count
-modules/tag/views/tag_block.html.php 15 DIRTY $cloud
-modules/tag/views/tag_block.html.php 17 DIRTY $form
+modules/server_add/views/server_add_tree_dialog.html.php 21 DIRTY $tree
+modules/tag/views/admin_tags.html.php 45 DIRTY_ATTR $tag->id
+modules/tag/views/admin_tags.html.php 46 DIRTY $tag->count
+modules/tag/views/tag_block.html.php 27 DIRTY $cloud
+modules/tag/views/tag_block.html.php 29 DIRTY $form
modules/tag/views/tag_cloud.html.php 4 DIRTY_ATTR (int)(($tag->count/$max_count)*7)
modules/tag/views/tag_cloud.html.php 5 DIRTY $tag->count
+modules/tag/views/tag_cloud.html.php 6 DIRTY_JS $tag->url()
modules/user/views/admin_users.html.php 3 DIRTY_JS url::site("admin/users/add_user_to_group/__USERID__/__GROUPID__?csrf=$csrf")
modules/user/views/admin_users.html.php 26 DIRTY_JS url::site("admin/users/group/__GROUPID__")
modules/user/views/admin_users.html.php 36 DIRTY_JS url::site("admin/users/remove_user_from_group/__USERID__/__GROUPID__?csrf=$csrf")
-modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->id
-modules/user/views/admin_users.html.php 67 DIRTY_ATTR text::alternate("gOddRow","gEvenRow")
-modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->admin?"admin":""
-modules/user/views/admin_users.html.php 68 DIRTY_ATTR $user->id
-modules/user/views/admin_users.html.php 69 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true))
-modules/user/views/admin_users.html.php 83 DIRTY ($user->last_login==0)?"":gallery::date($user->last_login)
-modules/user/views/admin_users.html.php 121 DIRTY_ATTR $group->id
-modules/user/views/admin_users.html.php 121 DIRTY_ATTR ($group->special?"gDefaultGroup":"")
-modules/user/views/admin_users.html.php 123 DIRTY $v
+modules/user/views/admin_users.html.php 71 DIRTY_ATTR $user->id
+modules/user/views/admin_users.html.php 71 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/user/views/admin_users.html.php 71 DIRTY_ATTR $user->admin?"g-admin":""
+modules/user/views/admin_users.html.php 72 DIRTY_ATTR $user->id
+modules/user/views/admin_users.html.php 73 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true))
+modules/user/views/admin_users.html.php 87 DIRTY ($user->last_login==0)?"":gallery::date($user->last_login)
+modules/user/views/admin_users.html.php 123 DIRTY_ATTR $group->id
+modules/user/views/admin_users.html.php 123 DIRTY_ATTR ($group->special?"g-default-group":"")
+modules/user/views/admin_users.html.php 125 DIRTY $v
modules/user/views/admin_users_group.html.php 22 DIRTY_JS $user->id
modules/user/views/admin_users_group.html.php 22 DIRTY_JS $group->id
-modules/user/views/login_ajax.html.php 6 DIRTY_JS url::site("password/reset")
-modules/user/views/login_ajax.html.php 37 DIRTY $form
-modules/user/views/user_languages_block.html.php 2 DIRTY form::dropdown("gSelectSessionLocale",$installed_locales,$selected)
-modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $width
-modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $height
-modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $url
-themes/admin_default/views/admin.html.php 15 DIRTY_JS $theme->url()
-themes/admin_default/views/admin.html.php 32 DIRTY $theme->admin_head()
-themes/admin_default/views/admin.html.php 36 DIRTY $theme->admin_page_top()
-themes/admin_default/views/admin.html.php 44 DIRTY $theme->admin_header_top()
-themes/admin_default/views/admin.html.php 49 DIRTY_JS item::root()->url()
-themes/admin_default/views/admin.html.php 53 DIRTY $theme->admin_menu()
-themes/admin_default/views/admin.html.php 55 DIRTY $theme->admin_header_bottom()
-themes/admin_default/views/admin.html.php 62 DIRTY $content
-themes/admin_default/views/admin.html.php 68 DIRTY $sidebar
-themes/admin_default/views/admin.html.php 73 DIRTY $theme->admin_footer()
-themes/admin_default/views/admin.html.php 75 DIRTY $theme->admin_credits()
-themes/admin_default/views/admin.html.php 79 DIRTY $theme->admin_page_bottom()
-themes/admin_default/views/block.html.php 3 DIRTY_ATTR $anchor
-themes/admin_default/views/block.html.php 5 DIRTY $id
-themes/admin_default/views/block.html.php 5 DIRTY_ATTR $css_id
-themes/admin_default/views/block.html.php 13 DIRTY $title
-themes/admin_default/views/block.html.php 16 DIRTY $content
-themes/admin_default/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url)
-themes/admin_default/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url)
-themes/admin_default/views/pager.html.php 27 DIRTY $from_to_msg
-themes/admin_default/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url)
-themes/admin_default/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url)
-themes/default/views/album.html.php 16 DIRTY_ATTR $child->id
-themes/default/views/album.html.php 16 DIRTY_ATTR $item_class
-themes/default/views/album.html.php 18 DIRTY_JS $child->url()
-themes/default/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"gThumbnail"))
-themes/default/views/album.html.php 23 DIRTY_JS $child->url()
-themes/default/views/block.html.php 3 DIRTY_ATTR $anchor
-themes/default/views/block.html.php 5 DIRTY_ATTR $css_id
-themes/default/views/block.html.php 6 DIRTY $title
-themes/default/views/block.html.php 8 DIRTY $content
-themes/default/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"gAlbum":""
-themes/default/views/dynamic.html.php 13 DIRTY_JS $child->url()
-themes/default/views/dynamic.html.php 14 DIRTY_ATTR $child->id
-themes/default/views/dynamic.html.php 15 DIRTY_ATTR $child->thumb_url()
-themes/default/views/dynamic.html.php 16 DIRTY_ATTR $child->thumb_width
-themes/default/views/dynamic.html.php 17 DIRTY_ATTR $child->thumb_height
-themes/default/views/movie.html.php 8 DIRTY_JS $previous_item->url()
-themes/default/views/movie.html.php 18 DIRTY_JS $next_item->url()
-themes/default/views/movie.html.php 28 DIRTY $item->movie_img(array("class"=>"gMovie","id"=>"gMovieId-{$item->id}"))
-themes/default/views/page.html.php 9 DIRTY $page_title
-themes/default/views/page.html.php 32 DIRTY_JS $theme->url()
-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 82 DIRTY $header_text
-themes/default/views/page.html.php 84 DIRTY_JS item::root()->url()
-themes/default/views/page.html.php 102 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null)
-themes/default/views/page.html.php 117 DIRTY $content
-themes/default/views/page.html.php 123 DIRTY newView("sidebar.html")
-themes/default/views/page.html.php 130 DIRTY $footer_text
-themes/default/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url)
-themes/default/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url)
-themes/default/views/pager.html.php 27 DIRTY $from_to_msg
-themes/default/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url)
-themes/default/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url)
-themes/default/views/photo.html.php 8 DIRTY_JS $theme->item()->width
-themes/default/views/photo.html.php 8 DIRTY_JS $theme->item()->height
-themes/default/views/photo.html.php 21 DIRTY_JS $previous_item->url()
-themes/default/views/photo.html.php 31 DIRTY_JS $next_item->url()
-themes/default/views/photo.html.php 43 DIRTY_JS $item->file_url()
-themes/default/views/photo.html.php 45 DIRTY $item->resize_img(array("id"=>"gPhotoId-{$item->id}","class"=>"gResize"))
+modules/user/views/user_form.html.php 7 DIRTY $form
+modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width
+modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height
+modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url
+themes/admin_wind/views/admin.html.php 16 DIRTY_JS $theme->url()
+themes/admin_wind/views/admin.html.php 33 DIRTY $theme->admin_head()
+themes/admin_wind/views/admin.html.php 37 DIRTY $theme->admin_page_top()
+themes/admin_wind/views/admin.html.php 45 DIRTY $theme->admin_header_top()
+themes/admin_wind/views/admin.html.php 60 DIRTY_JS item::root()->url()
+themes/admin_wind/views/admin.html.php 64 DIRTY $theme->admin_menu()
+themes/admin_wind/views/admin.html.php 66 DIRTY $theme->admin_header_bottom()
+themes/admin_wind/views/admin.html.php 73 DIRTY $content
+themes/admin_wind/views/admin.html.php 79 DIRTY $sidebar
+themes/admin_wind/views/admin.html.php 84 DIRTY $theme->admin_footer()
+themes/admin_wind/views/admin.html.php 86 DIRTY $theme->admin_credits()
+themes/admin_wind/views/admin.html.php 90 DIRTY $theme->admin_page_bottom()
+themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor
+themes/admin_wind/views/block.html.php 5 DIRTY $id
+themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id
+themes/admin_wind/views/block.html.php 13 DIRTY $title
+themes/admin_wind/views/block.html.php 16 DIRTY $content
+themes/admin_wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url)
+themes/admin_wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url)
+themes/admin_wind/views/pager.html.php 27 DIRTY $from_to_msg
+themes/admin_wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url)
+themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url)
+themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id
+themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class
+themes/wind/views/album.html.php 18 DIRTY_JS $child->url()
+themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"g-thumbnail"))
+themes/wind/views/album.html.php 23 DIRTY_JS $child->url()
+themes/wind/views/album.html.php 41 DIRTY $theme->paginator()
+themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor
+themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id
+themes/wind/views/block.html.php 6 DIRTY $title
+themes/wind/views/block.html.php 8 DIRTY $content
+themes/wind/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"g-album":""
+themes/wind/views/dynamic.html.php 13 DIRTY_JS $child->url()
+themes/wind/views/dynamic.html.php 14 DIRTY_ATTR $child->id
+themes/wind/views/dynamic.html.php 15 DIRTY_ATTR $child->thumb_url()
+themes/wind/views/dynamic.html.php 16 DIRTY_ATTR $child->thumb_width
+themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $child->thumb_height
+themes/wind/views/dynamic.html.php 29 DIRTY $theme->paginator()
+themes/wind/views/movie.html.php 5 DIRTY $theme->paginator()
+themes/wind/views/movie.html.php 8 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-movie-id-{$item->id}"))
+themes/wind/views/page.html.php 9 DIRTY $page_title
+themes/wind/views/page.html.php 33 DIRTY_JS $theme->url()
+themes/wind/views/page.html.php 42 DIRTY $new_width
+themes/wind/views/page.html.php 43 DIRTY $new_height
+themes/wind/views/page.html.php 44 DIRTY $thumb_proportion
+themes/wind/views/page.html.php 81 DIRTY $header_text
+themes/wind/views/page.html.php 83 DIRTY_JS item::root()->url()
+themes/wind/views/page.html.php 87 DIRTY $theme->user_menu()
+themes/wind/views/page.html.php 104 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null)
+themes/wind/views/page.html.php 120 DIRTY $content
+themes/wind/views/page.html.php 126 DIRTY newView("sidebar.html")
+themes/wind/views/page.html.php 133 DIRTY $footer_text
+themes/wind/views/paginator.html.php 32 DIRTY_JS $first_page_url
+themes/wind/views/paginator.html.php 41 DIRTY_JS $previous_page_url
+themes/wind/views/paginator.html.php 69 DIRTY_JS $next_page_url
+themes/wind/views/paginator.html.php 78 DIRTY_JS $last_page_url
+themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->width
+themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->height
+themes/wind/views/photo.html.php 18 DIRTY $theme->paginator()
+themes/wind/views/photo.html.php 23 DIRTY_JS $item->file_url()
+themes/wind/views/photo.html.php 25 DIRTY $item->resize_img(array("id"=>"g-photo-id-{$item->id}","class"=>"g-resize"))
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php
index c3595da5..ff4843ab 100644
--- a/modules/gallery/views/admin_advanced_settings.html.php
+++ b/modules/gallery/views/admin_advanced_settings.html.php
@@ -1,38 +1,39 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminAdvancedSettings">
- <h1> <?= t("Advanced Settings") ?> </h1>
+<div id="g-admin-advanced-settings" class="g-block">
+ <h1> <?= t("Advanced settings") ?> </h1>
<p>
<?= t("Here are internal Gallery configuration settings. Most of these settings are accessible elsewhere in the administrative console.") ?>
</p>
- <ul id="gMessage">
- <li class="gWarning">
- <b><?= t("Change these values at your own risk!") ?></b>
- </li>
+
+ <ul id="g-action-status" class="g-message-block">
+ <li class="g-warning"><?= t("Change these values at your own risk!") ?></li>
</ul>
- <table>
- <tr>
- <th> <?= t("Module") ?> </th>
- <th> <?= t("Name") ?> </th>
- <th> <?= t("Value") ?></th>
- </tr>
- <? foreach ($vars as $var): ?>
- <? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
- <tr class="setting">
- <td> <?= $var->module_name ?> </td>
- <td> <?= html::clean($var->name) ?> </td>
- <td>
- <a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . html::clean($var->name)) ?>"
- class="gDialogLink"
- title="<?= t("Edit %var (%module_name)", array("var" => $var->name, "module_name" => $var->module_name))->for_html_attr() ?>">
- <? if ($var->value): ?>
- <?= html::clean($var->value) ?>
- <? else: ?>
- <i> <?= t("empty") ?> </i>
- <? endif ?>
- </a>
- </td>
- </tr>
- <? endforeach ?>
- </table>
+ <div class="g-block-content">
+ <table>
+ <tr>
+ <th> <?= t("Module") ?> </th>
+ <th> <?= t("Name") ?> </th>
+ <th> <?= t("Value") ?></th>
+ </tr>
+ <? foreach ($vars as $var): ?>
+ <? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
+ <td> <?= $var->module_name ?> </td>
+ <td> <?= html::clean($var->name) ?> </td>
+ <td>
+ <a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . html::clean($var->name)) ?>"
+ class="g-dialog-link"
+ title="<?= t("Edit %var (%module_name)", array("var" => $var->name, "module_name" => $var->module_name))->for_html_attr() ?>">
+ <? if ($var->value): ?>
+ <?= html::clean($var->value) ?>
+ <? else: ?>
+ <i> <?= t("empty") ?> </i>
+ <? endif ?>
+ </a>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ </div>
</div>
diff --git a/modules/gallery/views/admin_block_photo_stream.html.php b/modules/gallery/views/admin_block_photo_stream.html.php
index 4968c39b..f9725eee 100644
--- a/modules/gallery/views/admin_block_photo_stream.html.php
+++ b/modules/gallery/views/admin_block_photo_stream.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<? foreach ($photos as $photo): ?>
- <li class="gItem gPhoto">
+ <li class="g-item g-photo">
<a href="<?= $photo->url() ?>" title="<?= html::purify($photo->title)->for_html_attr() ?>">
<img <?= photo::img_dimensions($photo->width, $photo->height, 72) ?>
src="<?= $photo->thumb_url() ?>" alt="<?= html::purify($photo->title)->for_html_attr() ?>" />
diff --git a/modules/gallery/views/admin_block_platform.html.php b/modules/gallery/views/admin_block_platform.html.php
index f27b9e7a..b1b8a2f9 100644
--- a/modules/gallery/views/admin_block_platform.html.php
+++ b/modules/gallery/views/admin_block_platform.html.php
@@ -4,7 +4,7 @@
<?= t("Host name: %host_name", array("host_name" => php_uname("n"))) ?>
</li>
<li>
- <?= t("Operating System: %os %version", array("os" => php_uname("s"), "version" => php_uname("r"))) ?>
+ <?= t("Operating system: %os %version", array("os" => php_uname("s"), "version" => php_uname("r"))) ?>
</li>
<li>
<?= t("Apache: %apache_version", array("apache_version" => function_exists("apache_get_version") ? apache_get_version() : t("Unknown"))) ?>
diff --git a/modules/gallery/views/admin_dashboard.html.php b/modules/gallery/views/admin_dashboard.html.php
index 148de65f..f391547e 100644
--- a/modules/gallery/views/admin_dashboard.html.php
+++ b/modules/gallery/views/admin_dashboard.html.php
@@ -3,34 +3,34 @@
update_blocks = function() {
$.get(<?= html::js_string(url::site("admin/dashboard/reorder")) ?>,
{"csrf": "<?= $csrf ?>",
- "dashboard_center[]": $("#gAdminDashboard").sortable(
+ "dashboard_center[]": $("#g-admin-dashboard").sortable(
"toArray", {attribute: "block_id"}),
- "dashboard_sidebar[]": $("#gAdminDashboardSidebar").sortable(
+ "dashboard_sidebar[]": $("#g-admin-dashboard-sidebar").sortable(
"toArray", {attribute: "block_id"})});
};
$(document).ready(function(){
- $("#gAdminDashboard .gBlock .ui-widget-header").addClass("gDraggable");
- $("#gAdminDashboard").sortable({
- connectWith: ["#gAdminDashboardSidebar"],
+ $("#g-admin-dashboard .g-block .ui-widget-header").addClass("g-draggable");
+ $("#g-admin-dashboard").sortable({
+ connectWith: ["#g-admin-dashboard-sidebar"],
cursor: "move",
handle: $(".ui-widget-header"),
opacity: 0.6,
- placeholder: "gDropTarget",
+ placeholder: "g-target",
stop: update_blocks
});
- $("#gAdminDashboardSidebar .gBlock .ui-widget-header").addClass("gDraggable");
- $("#gAdminDashboardSidebar").sortable({
- connectWith: ["#gAdminDashboard"],
+ $("#g-admin-dashboard-sidebar .g-block .ui-widget-header").addClass("g-draggable");
+ $("#g-admin-dashboard-sidebar").sortable({
+ connectWith: ["#g-admin-dashboard"],
cursor: "move",
handle: $(".ui-widget-header"),
opacity: 0.6,
- placeholder: "gDropTarget",
+ placeholder: "g-target",
stop: update_blocks
});
});
</script>
-<div id="gAdminDashboard">
+<div id="g-admin-dashboard">
<?= $blocks ?>
</div>
diff --git a/modules/gallery/views/admin_graphics.html.php b/modules/gallery/views/admin_graphics.html.php
index f64c7f80..3a48e087 100644
--- a/modules/gallery/views/admin_graphics.html.php
+++ b/modules/gallery/views/admin_graphics.html.php
@@ -1,36 +1,39 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
$(document).ready(function() {
+ $(".g-available .g-block").equal_heights();
select_toolkit = function(el) {
- if (!$(this).hasClass("gUnavailable")) {
+ if (!$(this).hasClass("g-unavailable")) {
window.location = <?= html::js_string(url::site("admin/graphics/choose/__TK__?csrf=$csrf")) ?>
.replace("__TK__", $(this).attr("id"));
}
};
- $("#gAdminGraphics div.gAvailable .gBlock").click(select_toolkit);
+ $("#g-admin-graphics div.g-available .g-block").click(select_toolkit);
});
</script>
-<div id="gAdminGraphics">
- <h1> <?= t("Graphics Settings") ?> </h1>
+<div id="g-admin-graphics" class="g-block ui-helper-clearfix">
+ <h1> <?= t("Graphics settings") ?> </h1>
<p>
<?= t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?>
</p>
- <h2> <?= t("Active Toolkit") ?> </h2>
- <? if ($active == "none"): ?>
- <?= new View("admin_graphics_none.html") ?>
- <? else: ?>
- <?= new View("admin_graphics_$active.html", array("tk" => $tk->$active, "is_active" => true)) ?>
- <? endif ?>
-
- <div class="gAvailable">
- <h2> <?= t("Available Toolkits") ?> </h2>
- <? foreach (array_keys((array)$tk) as $id): ?>
- <? if ($id != $active): ?>
- <?= new View("admin_graphics_$id.html", array("tk" => $tk->$id, "is_active" => false)) ?>
+ <div class="g-block-content">
+ <h2> <?= t("Active toolkit") ?> </h2>
+ <? if ($active == "none"): ?>
+ <?= new View("admin_graphics_none.html") ?>
+ <? else: ?>
+ <?= new View("admin_graphics_$active.html", array("tk" => $tk->$active, "is_active" => true)) ?>
<? endif ?>
- <? endforeach ?>
+
+ <div class="g-available">
+ <h2> <?= t("Available toolkits") ?> </h2>
+ <? foreach (array_keys((array)$tk) as $id): ?>
+ <? if ($id != $active): ?>
+ <?= new View("admin_graphics_$id.html", array("tk" => $tk->$id, "is_active" => false)) ?>
+ <? endif ?>
+ <? endforeach ?>
+ </div>
</div>
</div>
diff --git a/modules/gallery/views/admin_graphics_gd.html.php b/modules/gallery/views/admin_graphics_gd.html.php
index 010a31b4..1cc9dc9e 100644
--- a/modules/gallery/views/admin_graphics_gd.html.php
+++ b/modules/gallery/views/admin_graphics_gd.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gd" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>">
+<div id="gd" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>">
<img class="logo" width="170" height="110" src="<?= url::file("modules/gallery/images/gd.png"); ?>" alt="<? t("Visit the GD lib project site") ?>" />
<h3> <?= t("GD") ?> </h3>
<p>
@@ -7,23 +7,23 @@
array("url" => "http://www.boutell.com/gd")) ?>
</p>
<? if ($tk->installed && $tk->rotate): ?>
- <div class="gModuleStatus gInfo">
+ <div class="g-module-status g-info">
<?= t("You have GD version %version.", array("version" => $tk->version)) ?>
</div>
<p>
- <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate GD") ?></a>
+ <a class="g-button ui-state-default ui-corner-all"><?= t("Activate GD") ?></a>
</p>
<? elseif ($tk->installed): ?>
<? if ($tk->error): ?>
- <p class="gModuleStatus gWarning">
+ <p class="g-module-status g-warning">
<?= $tk->error ?>
</p>
<? endif ?>
<p>
- <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate GD") ?></a>
+ <a class="g-button ui-state-default ui-corner-all"><?= t("Activate GD") ?></a>
</p>
<? else: ?>
- <div class="gModuleStatus gInfo">
+ <div class="g-module-status g-info">
<?= t("You do not have GD installed.") ?>
</div>
<? endif ?>
diff --git a/modules/gallery/views/admin_graphics_graphicsmagick.html.php b/modules/gallery/views/admin_graphics_graphicsmagick.html.php
index 97624850..5dae1442 100644
--- a/modules/gallery/views/admin_graphics_graphicsmagick.html.php
+++ b/modules/gallery/views/admin_graphics_graphicsmagick.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="graphicsmagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>">
+<div id="graphicsmagick" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>">
<img class="logo" width="107" height="76" src="<?= url::file("modules/gallery/images/graphicsmagick.png"); ?>" alt="<? t("Visit the GraphicsMagick project site") ?>" />
<h3> <?= t("GraphicsMagick") ?> </h3>
<p>
@@ -7,14 +7,14 @@
array("url" => "http://www.graphicsmagick.org")) ?>
</p>
<? if ($tk->installed): ?>
- <div class="gModuleStatus gInfo">
+ <div class="g-module-status g-info">
<?= t("GraphicsMagick version %version is available in %dir", array("version" => $tk->version, "dir" => $tk->dir)) ?>
</div>
<p>
- <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate Graphics Magic") ?></a>
+ <a class="g-button ui-state-default ui-corner-all"><?= t("Activate Graphics Magic") ?></a>
</p>
<? else: ?>
- <div class="gModuleStatus gWarning">
+ <div class="g-module-status g-warning">
<?= $tk->error ?>
</div>
<? endif ?>
diff --git a/modules/gallery/views/admin_graphics_imagemagick.html.php b/modules/gallery/views/admin_graphics_imagemagick.html.php
index cdff7c2c..9c1a9909 100644
--- a/modules/gallery/views/admin_graphics_imagemagick.html.php
+++ b/modules/gallery/views/admin_graphics_imagemagick.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="imagemagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>">
+<div id="imagemagick" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>">
<img class="logo" width="114" height="118" src="<?= url::file("modules/gallery/images/imagemagick.jpg"); ?>" alt="<? t("Visit the ImageMagick project site") ?>" />
<h3> <?= t("ImageMagick") ?> </h3>
<p>
@@ -7,14 +7,14 @@
array("url" => "http://www.imagemagick.org")) ?>
</p>
<? if ($tk->installed): ?>
- <div class="gModuleStatus gInfo">
+ <div class="g-module-status g-info">
<?= t("ImageMagick version %version is available in %dir", array("version" => $tk->version, "dir" => $tk->dir)) ?>
</div>
<p>
- <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate ImageMagick") ?></a>
+ <a class="g-button ui-state-default ui-corner-all"><?= t("Activate ImageMagick") ?></a>
</p>
<? elseif ($tk->error): ?>
- <div class="gModuleStatus gWarning">
+ <div class="g-module-status g-warning">
<?= $tk->error ?>
</div>
<? endif ?>
diff --git a/modules/gallery/views/admin_graphics_none.html.php b/modules/gallery/views/admin_graphics_none.html.php
index e6923a5a..e0fc4170 100644
--- a/modules/gallery/views/admin_graphics_none.html.php
+++ b/modules/gallery/views/admin_graphics_none.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="none" class="gModuleStatus gWarning gBlock">
- <h3> <?= t("No Active Toolkit") ?> </h3>
+<div id="none" class="g-module-status g-warning g-block">
+ <h3> <?= t("No active toolkit") ?> </h3>
<p>
<?= t("We were unable to detect a graphics program. You must install one of the toolkits below in order to use many Gallery features.") ?>
</p>
diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php
new file mode 100644
index 00000000..51eaa58a
--- /dev/null
+++ b/modules/gallery/views/admin_identity.html.php
@@ -0,0 +1,59 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#g-modules form").submit(function() {
+ var eDialog = '<div id="g-dialog"></div>';
+ var params = $(this).serialize();
+ var url = $(this).attr("action");
+ $("body").append(eDialog);
+ $.post($(this).attr("action"), $(this).serialize(), function(data, textStatus) {
+ $("#g-dialog").html(data);
+ $("#g-dialog").dialog({
+ bgiframe: true,
+ title: <?= t("Confirm identity provider change")->for_js() ?>,
+ resizable: false,
+ height:180,
+ modal: true,
+ overlay: {
+ backgroundColor: '#000',
+ opacity: 0.5
+ },
+ buttons: {
+ "Continue": function() {
+ $("#g-dialog form").submit();
+ },
+ Cancel: function() {
+ $(this).dialog('destroy').remove();
+ }
+ }
+ });
+ });
+ return false;
+ });
+ });
+
+</script>
+<div id="g-modules">
+ <h1> <?= t("Manage identity providers") ?> </h1>
+ <p>
+ <?= t("Choose a different user/group management provider.") ?>
+ </p>
+
+ <form method="post" action="<?= url::site("admin/identity/confirm") ?>">
+ <?= access::csrf_form_field() ?>
+ <table>
+ <tr>
+ <th> <?= t("Active") ?> </th>
+ <th> <?= t("Description") ?> </th>
+ </tr>
+ <? foreach ($available as $module_name => $description): ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
+ <? $data = array("name" => "provider"); ?>
+ <td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td>
+ <td> <?= t($description) ?> </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ <input type="submit" value="<?= t("Change")->for_html_attr() ?>" />
+ </form>
+</div>
diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php
new file mode 100644
index 00000000..54aae9c8
--- /dev/null
+++ b/modules/gallery/views/admin_identity_confirm.html.php
@@ -0,0 +1,10 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<form method="post" action="<?= url::site("admin/identity/change") ?>">
+ <?= access::csrf_form_field() ?>
+ <?= form::hidden("provider", $new_provider) ?>
+
+ <p><span class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 20px 0;"></span>
+ <?= t("Are you sure you want to change your Identity Provider? Continuing will delete all existing users.") ?>
+ </p>
+</form>
+
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index fb30c7ba..07134475 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -1,46 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gLanguages">
- <h1> <?= t("Languages") ?> </h1>
- <p>
- <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?>
- </p>
-
- <form id="gLanguagesForm" method="post" action="<?= url::site("admin/languages/save") ?>">
- <?= access::csrf_form_field() ?>
- <table>
- <tr>
- <th> <?= t("Installed") ?> </th>
- <th> <?= t("Language") ?> </th>
- <th> <?= t("Default language") ?> </th>
- </tr>
- <? $i = 0 ?>
- <? foreach ($available_locales as $code => $display_name): ?>
- <? if ($i == (count($available_locales)/2)): ?>
- <table>
- <tr>
- <th> <?= t("Installed") ?> </th>
- <th> <?= t("Language") ?> </th>
- <th> <?= t("Default language") ?> </th>
- </tr>
- <? endif ?>
-
- <tr class="<?= (isset($installed_locales[$code])) ? "installed" : "" ?><?= ($default_locale == $code) ? " default" : "" ?>">
- <td> <?= form::checkbox("installed_locales[]", $code, isset($installed_locales[$code])) ?> </td>
- <td> <?= $display_name ?> </td>
- <td>
- <?= form::radio("default_locale", $code, ($default_locale == $code), ((isset($installed_locales[$code]))?'':'disabled="disabled"') ) ?>
- </td>
- </tr>
- <? $i++ ?>
-
- <? endforeach ?>
- </table>
- <input type="submit" value="<?= t("Update languages")->for_html_attr() ?>" />
- </form>
-
- <script type="text/javascript">
- var old_default_locale = <?= html::js_string($default_locale) ?>;
+<script type="text/javascript">
+ var old_default_locale = <?= html::js_string($default_locale) ?>;
+ $("#g-languages-form").ready(function() {
$("input[name='installed_locales[]']").change(function (event) {
if (this.checked) {
$("input[type='radio'][value='" + this.value + "']").enable();
@@ -51,8 +13,8 @@
$("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled");
}
});
-
- $("#gLanguagesForm").ajaxForm({
+
+ $("#g-languages-form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.result == "success") {
@@ -62,42 +24,91 @@
}
}
});
- </script>
-</div>
+ });
+</script>
-<div id="gTranslations">
- <h1> <?= t("Translations") ?> </h1>
- <p>
- <?= t("Create your own translations and share them with the rest of the Gallery community.") ?>
- </p>
+<div class="g-block">
+ <h1> <?= t("Languages and translation") ?> </h1>
- <h3><?= t("Translating Gallery") ?></h3>
+ <div class="g-block-content">
- <div class="gBlock">
- <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank"
- class="gDocLink ui-state-default ui-corner-all ui-icon ui-icon-help"
- title="<?= t("Localization documentation")->for_html_attr() ?>">
- <?= t("Localization documentation") ?>
- </a>
+ <div id="g-languages" class="g-block">
+ <h2> <?= t("Languages") ?> </h2>
+ <p>
+ <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?>
+ </p>
- <p><?= t("<strong>Step 1:</strong> Make sure the target language is installed and up to date (check above).") ?></p>
+ <div class="g-block-content ui-helper-clearfix">
+ <form id="g-languages-form" method="post" action="<?= url::site("admin/languages/save") ?>">
+ <?= access::csrf_form_field() ?>
+ <table class="g-left">
+ <tr>
+ <th> <?= t("Installed") ?> </th>
+ <th> <?= t("Language") ?> </th>
+ <th> <?= t("Default language") ?> </th>
+ </tr>
+ <? $i = 0 ?>
+ <? foreach ($available_locales as $code => $display_name): ?>
+ <? if ($i == (count($available_locales)/2)): ?>
+ <table>
+ <tr>
+ <th> <?= t("Installed") ?> </th>
+ <th> <?= t("Language") ?> </th>
+ <th> <?= t("Default language") ?> </th>
+ </tr>
+ <? endif ?>
+ <tr class="<?= (isset($installed_locales[$code])) ? "g-available" : "" ?><?= ($default_locale == $code) ? " g-selected" : "" ?>">
+ <td> <?= form::checkbox("installed_locales[]", $code, isset($installed_locales[$code])) ?> </td>
+ <td> <?= $display_name ?> </td>
+ <td>
+ <?= form::radio("default_locale", $code, ($default_locale == $code), ((isset($installed_locales[$code]))?'':'disabled="disabled"') ) ?>
+ </td>
+ </tr>
+ <? $i++ ?>
+ <? endforeach ?>
+ </table>
+ <input type="submit" value="<?= t("Update languages")->for_html_attr() ?>" />
+ </form>
+ </div>
+ </div>
- <p><?= t("<strong>Step 2:</strong> Make sure you have selected the right target language (currently %default_locale).",
- array("default_locale" => locales::display_name())) ?></p>
+ <div id="g-translations" class="g-block">
+ <h2> <?= t("Translations") ?> </h2>
+ <p>
+ <?= t("Create your own translations and share them with the rest of the Gallery community.") ?>
+ </p>
- <p><?= t("<strong>Step 3:</strong> Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></p>
+ <div class="g-block-content">
+ <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank"
+ class="g-right ui-state-default ui-corner-all ui-icon ui-icon-help"
+ title="<?= t("Localization documentation")->for_html_attr() ?>">
+ <?= t("Localization documentation") ?>
+ </a>
- <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>"
- class="gButtonLink ui-state-default ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-power"></span>
- <? if (Session::instance()->get("l10n_mode", false)): ?>
- <?= t("Stop translation mode") ?>
- <? else: ?>
- <?= t("Start translation mode") ?>
- <? endif ?>
- </a>
-</div>
+ <h3><?= t("Translating Gallery") ?></h3>
+
+ <p><?= t("Follow these steps to begin translating Gallery.") ?></p>
+
+ <ol>
+ <li><?= t("Make sure the target language is installed and up to date (check above).") ?></li>
+ <li><?= t("Make sure you have selected the right target language (currently %default_locale).",
+ array("default_locale" => locales::display_name())) ?></li>
+ <li><?= t("Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></li>
+ </ol>
+ <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>"
+ class="g-button ui-state-default ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-power"></span>
+ <? if (Session::instance()->get("l10n_mode", false)): ?>
+ <?= t("Stop translation mode") ?>
+ <? else: ?>
+ <?= t("Start translation mode") ?>
+ <? endif ?>
+ </a>
+
+ <h3><?= t("Sharing your translations") ?></h3>
+ <?= $share_translations_form ?>
+ </div>
+ </div>
-<h3><?= t("Sharing your translations") ?></h3>
- <?= $share_translations_form ?>
+ </div>
</div>
diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php
index ce693d73..ac597715 100644
--- a/modules/gallery/views/admin_maintenance.html.php
+++ b/modules/gallery/views/admin_maintenance.html.php
@@ -1,193 +1,189 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminMaintenance">
- <h1> <?= t("Maintenance Tasks") ?> </h1>
+<div id="g-admin-maintenance" class="g-block">
+ <h1> <?= t("Maintenance tasks") ?> </h1>
<p>
<?= t("Occasionally your Gallery will require some maintenance. Here are some tasks you can use to keep it running smoothly.") ?>
</p>
- <div id="gAvailableTasks">
- <h2> <?= t("Available Tasks") ?> </h2>
- <table>
- <tr>
- <th>
- <?= t("Name") ?>
- </th>
- <th>
- <?= t("Description") ?>
- </th>
- <th>
- <?= t("Action") ?>
- </th>
- </tr>
- <? $i = 0; ?>
- <? foreach ($task_definitions as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= log::severity_class($task->severity) ?>">
- <td class="<?= log::severity_class($task->severity) ?>">
- <?= $task->name ?>
- </td>
- <td>
- <?= $task->description ?>
- </td>
- <td>
- <a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>"
- class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <?= t("run") ?>
- </a>
- </td>
- </tr>
- <? $i++ ?>
- <? endforeach ?>
- </table>
- </div>
+ <div class="g-block-content">
+ <div id="g-available-tasks">
+ <h2> <?= t("Available tasks") ?> </h2>
+ <table>
+ <tr>
+ <th>
+ <?= t("Name") ?>
+ </th>
+ <th>
+ <?= t("Description") ?>
+ </th>
+ <th>
+ <?= t("Action") ?>
+ </th>
+ </tr>
+ <? foreach ($task_definitions as $task): ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= log::severity_class($task->severity) ?>">
+ <td class="<?= log::severity_class($task->severity) ?>">
+ <?= $task->name ?>
+ </td>
+ <td>
+ <?= $task->description ?>
+ </td>
+ <td>
+ <a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>"
+ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all">
+ <?= t("run") ?>
+ </a>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ </div>
- <? if ($running_tasks->count()): ?>
- <div id="gRunningTasks">
- <h2> <?= t("Running Tasks") ?> </h2>
- <table>
- <tr>
- <th>
- <?= t("Last Updated") ?>
- </th>
- <th>
- <?= t("Name") ?>
- </th>
- <th>
- <?= t("Status") ?>
- </th>
- <th>
- <?= t("Info") ?>
- </th>
- <th>
- <?= t("Owner") ?>
- </th>
- <th>
- <?= t("Action") ?>
- <a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>"
- class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
- <?= t("cancel all") ?></a>
- </th>
- </tr>
- <? $i = 0; ?>
- <? foreach ($running_tasks as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= $task->state == "stalled" ? "gWarning" : "" ?>">
- <td class="<?= $task->state == "stalled" ? "gWarning" : "" ?>">
- <?= gallery::date_time($task->updated) ?>
- </td>
- <td>
- <?= $task->name ?>
- </td>
- <td>
- <? if ($task->done): ?>
- <? if ($task->state == "cancelled"): ?>
- <?= t("Cancelled") ?>
- <? endif ?>
- <?= t("Close") ?>
- <? elseif ($task->state == "stalled"): ?>
- <?= t("Stalled") ?>
- <? else: ?>
- <?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?>
- <? endif ?>
- </td>
- <td>
- <?= $task->status ?>
- </td>
- <td>
- <?= html::clean($task->owner()->name) ?>
- </td>
- <td>
- <? if ($task->state == "stalled"): ?>
- <a class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"
- href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>">
- <?= t("resume") ?>
- </a>
- <? endif ?>
- <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>"
- class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
- <?= t("cancel") ?>
- </a>
- </td>
- </tr>
- <? $i++ ?>
- <? endforeach ?>
- </table>
- </div>
- <? endif ?>
+ <? if ($running_tasks->count()): ?>
+ <div id="g-running-tasks">
+ <h2> <?= t("Running tasks") ?> </h2>
+ <table>
+ <tr>
+ <th>
+ <?= t("Last updated") ?>
+ </th>
+ <th>
+ <?= t("Name") ?>
+ </th>
+ <th>
+ <?= t("Status") ?>
+ </th>
+ <th>
+ <?= t("Info") ?>
+ </th>
+ <th>
+ <?= t("Owner") ?>
+ </th>
+ <th>
+ <a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>"
+ class="g-button g-right ui-icon-left ui-state-default ui-corner-all">
+ <?= t("cancel all") ?></a>
+ <?= t("Action") ?>
+ </th>
+ </tr>
+ <? foreach ($running_tasks as $task): ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>">
+ <td class="<?= $task->state == "stalled" ? "g-warning" : "" ?>">
+ <?= gallery::date_time($task->updated) ?>
+ </td>
+ <td>
+ <?= $task->name ?>
+ </td>
+ <td>
+ <? if ($task->done): ?>
+ <? if ($task->state == "cancelled"): ?>
+ <?= t("Cancelled") ?>
+ <? endif ?>
+ <?= t("Close") ?>
+ <? elseif ($task->state == "stalled"): ?>
+ <?= t("Stalled") ?>
+ <? else: ?>
+ <?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?>
+ <? endif ?>
+ </td>
+ <td>
+ <?= $task->status ?>
+ </td>
+ <td>
+ <?= html::clean($task->owner()->name) ?>
+ </td>
+ <td>
+ <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>"
+ class="g-button g-right ui-icon-left ui-state-default ui-corner-all">
+ <?= t("cancel") ?>
+ </a>
+ <? if ($task->state == "stalled"): ?>
+ <a class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"
+ href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>">
+ <?= t("resume") ?>
+ </a>
+ <? endif ?>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ </div>
+ <? endif ?>
- <? if ($finished_tasks->count()): ?>
- <div id="gFinishedTasks">
- <h2> <?= t("Finished Tasks") ?> </h2>
- <table>
- <tr>
- <th>
- <?= t("Last Updated") ?>
- </th>
- <th>
- <?= t("Name") ?>
- </th>
- <th>
- <?= t("Status") ?>
- </th>
- <th>
- <?= t("Info") ?>
- </th>
- <th>
- <?= t("Owner") ?>
- </th>
- <th>
- <?= t("Action") ?>
- <a href="<?= url::site("admin/maintenance/remove_finished_tasks?csrf=$csrf") ?>"
- class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
- <span class="ui-icon ui-icon-trash"></span><?= t("remove all finished") ?></a>
- </th>
- </tr>
- <? $i = 0; ?>
- <? foreach ($finished_tasks as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= $task->state == "success" ? "gSuccess" : "gError" ?>">
- <td class="<?= $task->state == "success" ? "gSuccess" : "gError" ?>">
- <?= gallery::date_time($task->updated) ?>
- </td>
- <td>
- <?= $task->name ?>
- </td>
- <td>
- <? if ($task->state == "success"): ?>
- <?= t("Success") ?>
- <? elseif ($task->state == "error"): ?>
- <?= t("Failed") ?>
- <? elseif ($task->state == "cancelled"): ?>
- <?= t("Cancelled") ?>
- <? endif ?>
- </td>
- <td>
- <?= $task->status ?>
- </td>
- <td>
- <?= html::clean($task->owner()->name) ?>
- </td>
- <td>
- <? if ($task->done): ?>
- <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all">
- <?= t("remove") ?>
- </a>
- <? if ($task->get_log()): ?>
- <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink ui-state-default ui-corner-all">
- <?= t("browse log") ?>
- </a>
- <? endif ?>
- <? else: ?>
- <a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink" ui-state-default ui-corner-all>
- <?= t("resume") ?>
- </a>
- <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all">
- <?= t("cancel") ?>
- </a>
- <? endif ?>
- </ul>
- </td>
- </tr>
- <? endforeach ?>
- <? $i++ ?>
- </table>
+ <? if ($finished_tasks->count()): ?>
+ <div id="g-finished-tasks">
+ <a href="<?= url::site("admin/maintenance/remove_finished_tasks?csrf=$csrf") ?>"
+ class="g-button g-right ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-trash"></span><?= t("remove all finished") ?></a>
+ <h2> <?= t("Finished tasks") ?> </h2>
+ <table>
+ <tr>
+ <th>
+ <?= t("Last updated") ?>
+ </th>
+ <th>
+ <?= t("Name") ?>
+ </th>
+ <th>
+ <?= t("Status") ?>
+ </th>
+ <th>
+ <?= t("Info") ?>
+ </th>
+ <th>
+ <?= t("Owner") ?>
+ </th>
+ <th>
+ <?= t("Action") ?>
+ </th>
+ </tr>
+ <? foreach ($finished_tasks as $task): ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>">
+ <td class="<?= $task->state == "success" ? "g-success" : "g-error" ?>">
+ <?= gallery::date_time($task->updated) ?>
+ </td>
+ <td>
+ <?= $task->name ?>
+ </td>
+ <td>
+ <? if ($task->state == "success"): ?>
+ <?= t("Success") ?>
+ <? elseif ($task->state == "error"): ?>
+ <?= t("Failed") ?>
+ <? elseif ($task->state == "cancelled"): ?>
+ <?= t("Cancelled") ?>
+ <? endif ?>
+ </td>
+ <td>
+ <?= $task->status ?>
+ </td>
+ <td>
+ <?= html::clean($task->owner()->name) ?>
+ </td>
+ <td>
+ <? if ($task->done): ?>
+ <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all">
+ <?= t("remove") ?>
+ </a>
+ <? if ($task->get_log()): ?>
+ <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all">
+ <?= t("browse log") ?>
+ </a>
+ <? endif ?>
+ <? else: ?>
+ <a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button" ui-state-default ui-corner-all>
+ <?= t("resume") ?>
+ </a>
+ <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all">
+ <?= t("cancel") ?>
+ </a>
+ <? endif ?>
+ </ul>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ </div>
+ <? endif ?>
</div>
- <? endif ?>
</div>
diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php
index 8ea1beb6..d2472fdc 100644
--- a/modules/gallery/views/admin_maintenance_show_log.html.php
+++ b/modules/gallery/views/admin_maintenance_show_log.html.php
@@ -2,18 +2,18 @@
<script type="text/javascript">
dismiss = function() {
window.location.reload();
- }
- download = function(){
+ };
+ download = function() {
// send request
$('<form action="<?= url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") ?>" method="post"></form>').
appendTo('body').submit().remove();
};
</script>
-<div id="gTaskLogDialog">
+<div id="g-task-log-dialog">
<h1> <?= $task->name ?> </h1>
- <div class="gTaskLog">
+ <div class="g-task-log g-text-small">
<pre><?= html::purify($task->get_log()) ?></pre>
</div>
- <button id="gCloseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Close") ?></button>
- <button id="gSaveButton" class="ui-state-default ui-corner-all" onclick="download()"><?= t("Save") ?></button>
+ <button id="g-close" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Close") ?></button>
+ <button id="g-save" class="ui-state-default ui-corner-all" onclick="download()"><?= t("Save") ?></button>
</div>
diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php
index ddd5bd17..76756b66 100644
--- a/modules/gallery/views/admin_maintenance_task.html.php
+++ b/modules/gallery/views/admin_maintenance_task.html.php
@@ -4,7 +4,7 @@
var animation = null;
var delta = 1;
animate_progress_bar = function() {
- var current_value = parseInt($(".gProgressBar div").css("width").replace("%", ""));
+ var current_value = parseInt($(".g-progress-bar div").css("width").replace("%", ""));
if (target_value > current_value) {
// speed up
delta = Math.min(delta + 0.04, 3);
@@ -14,10 +14,10 @@
}
if (target_value == 100) {
- $(".gProgressBar").progressbar("value", 100);
+ $(".g-progress-bar").progressbar("value", 100);
} else if (current_value != target_value || delta != 1) {
var new_value = Math.min(current_value + delta, target_value);
- $(".gProgressBar").progressbar("value", new_value);
+ $(".g-progress-bar").progressbar("value", new_value);
animation = setTimeout(function() { animate_progress_bar(target_value); }, 100);
} else {
animation = null;
@@ -35,30 +35,30 @@
if (!animation) {
animate_progress_bar();
}
- $("#gStatus").html("" + data.task.status);
+ $("#g-status").html("" + data.task.status);
if (data.task.done) {
- $("#gPauseButton").hide();
- $("#gDoneButton").show();
+ $("#g-pause-button").hide();
+ $("#g-done-button").show();
} else {
setTimeout(update, 100);
}
}
});
}
- $(".gProgressBar").progressbar({value: 0});
+ $(".g-progress-bar").progressbar({value: 0});
update();
dismiss = function() {
window.location.reload();
}
</script>
-<div id="gProgress">
+<div id="g-progress">
<h1> <?= $task->name ?> </h1>
- <div class="gProgressBar"></div>
- <div id="gStatus">
+ <div class="g-progress-bar"></div>
+ <div id="g-status">
<?= t("Starting up...") ?>
</div>
- <div class="txtright">
- <button id="gPauseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Pause") ?></button>
- <button id="gDoneButton" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Close") ?></button>
+ <div class="g-text-right">
+ <button id="g-pause-button" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Pause") ?></button>
+ <button id="g-done-button" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Close") ?></button>
</div>
</div>
diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php
index 9cf03cb3..aebedf09 100644
--- a/modules/gallery/views/admin_modules.html.php
+++ b/modules/gallery/views/admin_modules.html.php
@@ -1,32 +1,32 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gModules">
+<div class="g-block ui-helper-clearfix">
<h1> <?= t("Gallery Modules") ?> </h1>
<p>
<?= t("Power up your Gallery by adding more modules! Each module provides new cool features.") ?>
</p>
- <form method="post" action="<?= url::site("admin/modules/save") ?>">
- <?= access::csrf_form_field() ?>
- <table>
- <tr>
- <th> <?= t("Installed") ?> </th>
- <th> <?= t("Name") ?> </th>
- <th> <?= t("Version") ?> </th>
- <th> <?= t("Description") ?> </th>
- </tr>
- <? $i = 0 ?>
- <? foreach ($available as $module_name => $module_info): ?>
- <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?>">
- <? $data = array("name" => $module_name); ?>
- <? if ($module_info->locked) $data["disabled"] = 1; ?>
- <td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td>
- <td> <?= t($module_info->name) ?> </td>
- <td> <?= $module_info->version ?> </td>
- <td> <?= t($module_info->description) ?> </td>
- </tr>
- <? $i++ ?>
- <? endforeach ?>
- </table>
- <input type="submit" value="<?= t("Update")->for_html_attr() ?>"/>
- </form>
+ <div class="g-block-content">
+ <form method="post" action="<?= url::site("admin/modules/save") ?>">
+ <?= access::csrf_form_field() ?>
+ <table>
+ <tr>
+ <th> <?= t("Installed") ?> </th>
+ <th> <?= t("Name") ?> </th>
+ <th> <?= t("Version") ?> </th>
+ <th> <?= t("Description") ?> </th>
+ </tr>
+ <? foreach ($available as $module_name => $module_info): ?>
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
+ <? $data = array("name" => $module_name); ?>
+ <? if ($module_info->locked) $data["disabled"] = 1; ?>
+ <td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td>
+ <td> <?= t($module_info->name) ?> </td>
+ <td> <?= $module_info->version ?> </td>
+ <td> <?= t($module_info->description) ?> </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ <input type="submit" value="<?= t("Update")->for_html_attr() ?>" />
+ </form>
+ </div>
</div>
diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php
new file mode 100644
index 00000000..b394aa19
--- /dev/null
+++ b/modules/gallery/views/admin_sidebar.html.php
@@ -0,0 +1,64 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript">
+ $(document).ready(function(){
+ $(".g-admin-blocks-list").equal_heights();
+ var extra_ht = $(".g-admin-blocks-list li").length * $(".g-admin-blocks-list li:first").height();
+ $(".g-admin-blocks-list").height($(".g-admin-blocks-list").height() + extra_ht);
+ });
+
+ $(function() {
+ $(".g-admin-blocks-list ul").sortable({
+ connectWith: ".g-sortable-blocks",
+ opacity: .7,
+ placeholder: "g-target",
+ update: function(event,ui) {
+ if ($(this).attr("id") == "g-active-blocks") {
+ var active_blocks = "";
+ $("ul#g-active-blocks li").each(function(i) {
+ active_blocks += "&block["+i+"]="+$(this).attr("ref");
+ });
+ $.getJSON($("#g-site-blocks").attr("ref").replace("__ACTIVE__", active_blocks), function(data) {
+ if (data.result == "success") {
+ $("ul#g-available-blocks").html(data.available);
+ $("ul#g-active-blocks").html(data.active);
+ $("#g-action-status").remove();
+ var message = "<ul id=\"g-action-status\" class=\"g-message-block\">";
+ message += "<li class=\"g-success\">" + data.message + "</li>";
+ message += "</ul>";
+ $("#g-block-admin").before(message);
+ $("#g-action-status li").gallery_show_message();
+ }
+ });
+ }
+ }
+ }).disableSelection();
+ });
+</script>
+
+<div id="g-block-admin" class="g-block ui-helper-clearfix">
+ <h1> <?= t("Manage sidebar") ?> </h1>
+ <p>
+ <?= t("Select and drag blocks from the available column to the active column to add to the sidebar; remove by dragging the other way.") ?>
+ </p>
+
+ <div class="g-block-content">
+ <div id="g-site-blocks" ref="<?= url::site("admin/sidebar/update?csrf={$csrf}__ACTIVE__") ?>">
+ <div class="g-admin-blocks-list">
+ <div><h3><?= t("Available blocks") ?></h3></div>
+ <div>
+ <ul id="g-available-blocks" class="g-sortable-blocks">
+ <?= $available ?>
+ </ul>
+ </div>
+ </div>
+ <div class="g-admin-blocks-list">
+ <div><h3><?= t("Active blocks") ?></h3></div>
+ <div>
+ <ul id="g-active-blocks" class="g-sortable-blocks">
+ <?= $active ?>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/modules/gallery/views/admin_sidebar_blocks.html.php b/modules/gallery/views/admin_sidebar_blocks.html.php
new file mode 100644
index 00000000..48aa3f05
--- /dev/null
+++ b/modules/gallery/views/admin_sidebar_blocks.html.php
@@ -0,0 +1,5 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+
+<? foreach ($blocks as $ref => $text): ?>
+<li class="g-draggable" ref="<?= $ref ?>"><?= $text ?></li>
+<? endforeach ?>
diff --git a/modules/gallery/views/admin_theme_options.html.php b/modules/gallery/views/admin_theme_options.html.php
index 724e6438..a4bf1c4e 100644
--- a/modules/gallery/views/admin_theme_options.html.php
+++ b/modules/gallery/views/admin_theme_options.html.php
@@ -1,6 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminThemeOptions">
+<div class="g-block">
<h1> <?= t("Theme Options") ?> </h1>
+ <div class="g-block-content">
<?= $form ?>
+ </div>
</div>
diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php
index 0aac4717..d14e8bd4 100644
--- a/modules/gallery/views/admin_themes.html.php
+++ b/modules/gallery/views/admin_themes.html.php
@@ -7,83 +7,88 @@
}
</script>
-<h1> <?= t("Theme Choice") ?> </h1>
-<p>
- <?= t("Gallery allows you to choose a theme for browsing your Gallery, as well as a special theme for the administration interface. Click a theme to preview and activate it.") ?>
-</p>
+<div class="g-block ui-helper-clearfix">
+ <h1> <?= t("Theme choice") ?> </h1>
+ <p>
+ <?= t("Gallery allows you to choose a theme for browsing your Gallery, as well as a special theme for the administration interface. Click a theme to preview and activate it.") ?>
+ </p>
-<div id="gSiteTheme">
- <h2> <?= t("Gallery theme") ?> </h2>
- <div class="gBlock gSelected">
- <img src="<?= url::file("themes/{$site}/thumbnail.png") ?>"
- alt="<?= html::clean_attribute($themes[$site]->name) ?>" />
- <h3> <?= $themes[$site]->name ?> </h3>
- <p>
- <?= $themes[$site]->description ?>
- </p>
- </div>
+ <div class="g-block-content">
+ <div id="g-site-theme">
+ <h2> <?= t("Gallery theme") ?> </h2>
+ <div class="g-block g-selected ui-helper-clearfix">
+ <img src="<?= url::file("themes/{$site}/thumbnail.png") ?>"
+ alt="<?= html::clean_attribute($themes[$site]->name) ?>" />
+ <h3> <?= $themes[$site]->name ?> </h3>
+ <p>
+ <?= $themes[$site]->description ?>
+ </p>
+ </div>
+
+ <h2> <?= t("Available Gallery themes") ?> </h2>
+ <div class="g-available">
+ <? $count = 0 ?>
+ <? foreach ($themes as $id => $info): ?>
+ <? if (!$info->site) continue ?>
+ <? if ($id == $site) continue ?>
+ <div class="g-block ui-helper-clearfix">
+ <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>">
+ <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>"
+ alt="<?= html::clean_attribute($info->name) ?>" />
+ <h3> <?= $info->name ?> </h3>
+ <p>
+ <?= $info->description ?>
+ </p>
+ </a>
+ </div>
+ <? $count++ ?>
+ <? endforeach ?>
- <h2> <?= t("Available Gallery themes") ?> </h2>
- <div class="gAvailable">
- <? $count = 0 ?>
- <? foreach ($themes as $id => $info): ?>
- <? if (!$info->site) continue ?>
- <? if ($id == $site) continue ?>
- <div class="gBlock">
- <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>">
- <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>"
- alt="<?= html::clean_attribute($info->name) ?>" />
- <h3> <?= $info->name ?> </h3>
+ <? if (!$count): ?>
<p>
- <?= $info->description ?>
+ <?= t("There are no other site themes available.") ?>
</p>
- </a>
+ <? endif ?>
+ </div>
</div>
- <? $count++ ?>
- <? endforeach ?>
- <? if (!$count): ?>
- <p>
- <?= t("There are no other site themes available.") ?>
- </p>
- <? endif ?>
- </div>
-</div>
+ <div id="g-admin-theme">
+ <h2> <?= t("Admin theme") ?> </h2>
+ <div class="g-block g-selected ui-helper-clearfix">
+ <img src="<?= url::file("themes/{$admin}/thumbnail.png") ?>"
+ alt="<?= html::clean_attribute($themes[$admin]->name) ?>" />
+ <h3> <?= $themes[$admin]->name ?> </h3>
+ <p>
+ <?= $themes[$admin]->description ?>
+ </p>
+ </div>
-<div id="gAdminTheme">
- <h2> <?= t("Admin theme") ?> </h2>
- <div class="gBlock gSelected">
- <img src="<?= url::file("themes/{$admin}/thumbnail.png") ?>"
- alt="<?= html::clean_attribute($themes[$admin]->name) ?>" />
- <h3> <?= $themes[$admin]->name ?> </h3>
- <p>
- <?= $themes[$admin]->description ?>
- </p>
- </div>
+ <h2> <?= t("Available admin themes") ?> </h2>
+ <div class="g-available">
+ <? $count = 0 ?>
+ <? foreach ($themes as $id => $info): ?>
+ <? if (!$info->admin) continue ?>
+ <? if ($id == $admin) continue ?>
+ <div class="g-block ui-helper-clearfix">
+ <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>">
+ <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>"
+ alt="<?= html::clean_attribute($info->name) ?>" />
+ <h3> <?= $info->name ?> </h3>
+ <p>
+ <?= $info->description ?>
+ </p>
+ </a>
+ </div>
+ <? $count++ ?>
+ <? endforeach ?>
- <h2> <?= t("Available admin themes") ?> </h2>
- <div class="gAvailable">
- <? $count = 0 ?>
- <? foreach ($themes as $id => $info): ?>
- <? if (!$info->admin) continue ?>
- <? if ($id == $admin) continue ?>
- <div class="gBlock">
- <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>">
- <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>"
- alt="<?= html::clean_attribute($info->name) ?>" />
- <h3> <?= $info->name ?> </h3>
+ <? if (!$count): ?>
<p>
- <?= $info->description ?>
+ <?= t("There are no other admin themes available.") ?>
</p>
- </a>
+ <? endif ?>
+ </div>
</div>
- <? $count++ ?>
- <? endforeach ?>
- <? if (!$count): ?>
- <p>
- <?= t("There are no other admin themes available.") ?>
- </p>
- <? endif ?>
</div>
</div> \ No newline at end of file
diff --git a/modules/gallery/views/form.html.php b/modules/gallery/views/form.html.php
index 730d77cb..abc32164 100644
--- a/modules/gallery/views/form.html.php
+++ b/modules/gallery/views/form.html.php
@@ -44,7 +44,7 @@ if (!function_exists("DrawForm")) {
print $input->render();
} else {
if ($input->error_messages()) {
- print "$prefix<li class=\"gError\">\n";
+ print "$prefix<li class=\"g-error\">\n";
} else {
print "$prefix<li>\n";
}
@@ -58,7 +58,7 @@ if (!function_exists("DrawForm")) {
}
if ($input->error_messages()) {
foreach ($input->error_messages() as $error_message) {
- print "$prefix <p class=\"gError\">\n";
+ print "$prefix <p class=\"g-message g-error\">\n";
print "$prefix $error_message\n";
print "$prefix </p>\n";
}
diff --git a/modules/gallery/views/in_place_edit.html.php b/modules/gallery/views/in_place_edit.html.php
new file mode 100644
index 00000000..03cbdc69
--- /dev/null
+++ b/modules/gallery/views/in_place_edit.html.php
@@ -0,0 +1,16 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?= 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'") ?>
+ </li>
+ <li>
+ <?= form::submit(array("class" => "submit ui-state-default"), t("Save")) ?>
+ </li>
+ <li><a href="#" class="g-cancel"><?= t("Cancel") ?></a></li>
+ </ul>
+<?= form::close() ?>
+<? if (!empty($errors["input"])): ?>
+<div id="g-in-place-edit-message" class="g-error"><?= $errors["input"] ?></div>
+<? endif ?>
+
diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php
index 9361514d..0d8801e5 100644
--- a/modules/gallery/views/kohana_error_page.php
+++ b/modules/gallery/views/kohana_error_page.php
@@ -57,7 +57,7 @@
<title><?= t("Something went wrong!") ?></title>
</head>
<body>
- <? try { $user = user::active(); } catch (Exception $e) { } ?>
+ <? try { $user = identity::active_user(); } catch (Exception $e) { } ?>
<? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?>
<div class="big_box" id="framework_error">
<h1>
@@ -117,6 +117,11 @@
<? endif ?>
</div>
</div>
+ <? else: ?>
+ <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTraceAsString(); ?>
+ <? if (!empty($trace)): ?>
+ <? Kohana::Log("error", print_r($trace, 1)); ?>
+ <? endif ?>
<? endif ?>
</body>
</html>
diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php
index b0f424be..9d14bbb2 100644
--- a/modules/gallery/views/l10n_client.html.php
+++ b/modules/gallery/views/l10n_client.html.php
@@ -2,13 +2,13 @@
<div id="l10n-client" class="hidden">
<div class="labels">
<span id="l10n-client-toggler">
- <a id="gMinimizeL10n">_</a>
- <a id="gCloseL10n" title="<?= t("Stop the translation mode")->for_html_attr() ?>"
+ <a id="g-minimize-l10n">_</a>
+ <a id="g-close-l10n" title="<?= t("Stop the translation mode")->for_html_attr() ?>"
href="<?= html::clean_attribute(url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token())) ?>">X</a>
</span>
- <div class="label strings"><h2><?= t("Page Text") ?>
+ <div class="label strings"><h2><?= t("Page text") ?>
<? if (!Input::instance()->get('show_all_l10n_messages')): ?>
- <a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show All)") ?></a>
+ <a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show all)") ?></a>
<? endif; ?>
</h2></div>
<div class="label source"><h2><?= t("Source") ?></div>
@@ -37,7 +37,7 @@
<p id="source-text-tmp-space" style="display:none"></p>
</div>
<div class="translation">
- <form method="post" action="<?= url::site("l10n_client/save") ?>" id="gL10nClientSaveForm">
+ <form method="post" action="<?= url::site("l10n_client/save") ?>" id="g-l10n-client-save-form">
<?= access::csrf_form_field() ?>
<?= form::hidden("l10n-message-key") ?>
<?= form::textarea("l10n-edit-translation", "", ' rows="5" class="translationField"') ?>
@@ -68,12 +68,12 @@
</div>
<input type="submit" name="l10n-edit-save" value="<?= t("Save translation")->for_html_attr() ?>"/>
<a href="javascript: Gallery.l10nClient.copySourceText()"
- class="gButtonLink ui-state-default ui-corner-all"><?= t("Copy source text") ?></a>
+ class="g-button ui-state-default ui-corner-all"><?= t("Copy source text") ?></a>
</form>
</div>
</div>
<script type="text/javascript">
- var MSG_TRANSLATE_TEXT = <?= t("Translate Text")->for_js() ?>;
+ var MSG_TRANSLATE_TEXT = <?= t("Translate text")->for_js() ?>;
var l10n_client_data = <?= json_encode($string_list) ?>;
var plural_forms = <?= json_encode($plural_forms) ?>;
var toggle_l10n_mode_url = <?= html::js_string(url::site("l10n_client/toggle_l10n_mode")) ?>;
diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php
new file mode 100644
index 00000000..36647f9d
--- /dev/null
+++ b/modules/gallery/views/login_ajax.html.php
@@ -0,0 +1,45 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript">
+ $("#g-login-form").ready(function() {
+ $("#g-password-reset").click(function() {
+ $.ajax({
+ url: "<?= url::site("password/reset") ?>",
+ success: function(data) {
+ $("#g-login").html(data);
+ $("#ui-dialog-title-g-dialog").html(<?= t("Reset password")->for_js() ?>);
+ $(".submit").addClass("g-button ui-state-default ui-corner-all");
+ $(".submit").gallery_hover_init();
+ ajaxify_login_reset_form();
+ }
+ });
+ });
+ });
+
+ 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">
+ <ul>
+ <li id="g-login-form">
+ <?= $form ?>
+ </li>
+ <? if (identity::is_writable()): ?>
+ <li>
+ <a href="#" id="g-password-reset" class="g-right g-text-small"><?= t("Forgot your password?") ?></a>
+ </li>
+ <? endif ?>
+ </ul>
+</div>
diff --git a/modules/gallery/views/login_current_user.html.php b/modules/gallery/views/login_current_user.html.php
new file mode 100644
index 00000000..e3b3688f
--- /dev/null
+++ b/modules/gallery/views/login_current_user.html.php
@@ -0,0 +1,11 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<li>
+ <? $name = $menu->label->for_html() ?>
+ <? if (identity::is_writable()): ?>
+ <?= t("Logged in as %name", array("name" => html::mark_clean(
+ "<a href='$menu->url' title='" . t("Edit your profile")->for_html_attr() .
+ "' id='$menu->id' class='g-dialog-link'>{$name}</a>"))) ?>
+ <? else: ?>
+ <?= t("Logged in as %name", array("name" => $name)) ?>
+ <? endif ?>
+</li>
diff --git a/modules/gallery/views/maintenance.html.php b/modules/gallery/views/maintenance.html.php
index f80b6e7a..6351b6ab 100644
--- a/modules/gallery/views/maintenance.html.php
+++ b/modules/gallery/views/maintenance.html.php
@@ -2,7 +2,7 @@
<html>
<head>
<title>
- <?= t("Gallery - Maintenance Mode") ?>
+ <?= t("Gallery - maintenance mode") ?>
</title>
<style>
body {
@@ -38,12 +38,12 @@
</head>
<body>
<h1>
- <?= t("Gallery - Maintenance Mode") ?>
+ <?= t("Gallery - maintenance mode") ?>
</h1>
<p>
<?= t("This site is currently only accessible by site administrators.") ?>
</p>
- <?= user::get_login_form("login/auth_html") ?>
+ <?= auth::get_login_form("login/auth_html") ?>
</body>
</html>
diff --git a/modules/gallery/views/menu.html.php b/modules/gallery/views/menu.html.php
new file mode 100644
index 00000000..cb49bcdf
--- /dev/null
+++ b/modules/gallery/views/menu.html.php
@@ -0,0 +1,24 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<? if ($menu->elements): // Don't show the menu if it has no choices ?>
+<? if ($menu->is_root): ?>
+<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>">
+ <? foreach ($menu->elements as $element): ?>
+ <?= $element->render() ?>
+ <? endforeach ?>
+</ul>
+
+<? else: ?>
+
+<li title="<?= $menu->label->for_html_attr() ?>">
+ <a href="#">
+ <?= $menu->label->for_html() ?>
+ </a>
+ <ul>
+ <? foreach ($menu->elements as $element): ?>
+ <?= $element->render() ?>
+ <? endforeach ?>
+ </ul>
+</li>
+
+<? endif ?>
+<? endif ?>
diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php
new file mode 100644
index 00000000..00a394bc
--- /dev/null
+++ b/modules/gallery/views/menu_ajax_link.html.php
@@ -0,0 +1,10 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<li>
+ <a id="<?= $menu->css_id ?>"
+ class="g-ajax-link <?= $menu->css_class ?>"
+ href="<?= $menu->url ?>"
+ title="<?= $menu->label->for_html_attr() ?>"
+ ajax_handler="<?= $menu->ajax_handler ?>">
+ <?= $menu->label->for_html() ?>
+ </a>
+</li>
diff --git a/modules/gallery/views/menu_dialog.html.php b/modules/gallery/views/menu_dialog.html.php
new file mode 100644
index 00000000..99b1b013
--- /dev/null
+++ b/modules/gallery/views/menu_dialog.html.php
@@ -0,0 +1,9 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<li>
+ <a id="<?= $menu->css_id ?>"
+ class="g-dialog-link <?= $menu->css_class ?>"
+ href="<?= $menu->url ?>"
+ title="<?= $menu->label->for_html_attr() ?>">
+ <?= $menu->label->for_html() ?>
+ </a>
+</li>
diff --git a/modules/gallery/views/menu_link.html.php b/modules/gallery/views/menu_link.html.php
new file mode 100644
index 00000000..8e4cdb95
--- /dev/null
+++ b/modules/gallery/views/menu_link.html.php
@@ -0,0 +1,9 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<li>
+ <a id="<?= $menu->css_id ?>"
+ class="g-menu-link <?= $menu->css_class ?>"
+ href="<?= $menu->url ?>"
+ title="<?= $menu->label->for_html_attr() ?>">
+ <?= $menu->label->for_html() ?>
+ </a>
+</li>
diff --git a/modules/gallery/views/move_browse.html.php b/modules/gallery/views/move_browse.html.php
index 99728ecc..ce3fc2fd 100644
--- a/modules/gallery/views/move_browse.html.php
+++ b/modules/gallery/views/move_browse.html.php
@@ -3,14 +3,14 @@
var load_tree = function(target_id, locked) {
var load_url = "<?= url::site("move/show_sub_tree/{$source->id}/__TARGETID__") ?>";
var node = $("#node_" + target_id);
- $("#gMove .node a").removeClass("selected");
+ $("#g-move .node a").removeClass("selected");
node.find("a:first").addClass("selected");
if (locked) {
- $("#gMoveButton").attr("disabled", "disabled");
- $("#gMove form input[name=target_id]").attr("value", "");
+ $("#g-move-button").attr("disabled", "disabled");
+ $("#g-move form input[name=target_id]").attr("value", "");
} else {
- $("#gMoveButton").removeAttr("disabled");
- $("#gMove form input[name=target_id]").attr("value", target_id);
+ $("#g-move-button").removeAttr("disabled");
+ $("#g-move form input[name=target_id]").attr("value", target_id);
}
var sub_tree = $("#tree_" + target_id);
if (sub_tree.length) {
@@ -33,7 +33,7 @@
<? t("Move this album to a new album") ?>
<? endif ?>
</h1>
-<div id="gMove">
+<div id="g-move">
<ul id="tree_0">
<li id="node_1" class="node">
<?= $tree ?>
@@ -42,6 +42,6 @@
<form method="post" action="<?= url::site("move/save/$source->id") ?>">
<?= access::csrf_form_field() ?>
<input type="hidden" name="target_id" value="" />
- <input type="submit" id="gMoveButton" value="<?= t("Move")->for_html_attr() ?>" disabled="disabled"/>
+ <input type="submit" id="g-move-button" value="<?= t("Move")->for_html_attr() ?>" disabled="disabled"/>
</form>
</div>
diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php
index e9783eb8..f7af8d93 100644
--- a/modules/gallery/views/movieplayer.html.php
+++ b/modules/gallery/views/movieplayer.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= html::anchor($item->file_url(true), "", $attrs) ?>
-<script>
+<script type="text/javascript">
flowplayer(
"<?= $attrs["id"] ?>",
{
diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php
index 519734d6..0b27336e 100644
--- a/modules/gallery/views/permissions_browse.html.php
+++ b/modules/gallery/views/permissions_browse.html.php
@@ -5,9 +5,9 @@
$.ajax({
url: form_url.replace("__ITEM__", id),
success: function(data) {
- $("#gEditPermissionForm").html(data);
- $(".active").removeClass("active");
- $("#item-" + id).addClass("active");
+ $("#g-edit-permissions-form").html(data);
+ $(".g-active").removeClass("g-active");
+ $("#item-" + id).addClass("g-active");
}
});
}
@@ -19,15 +19,15 @@
url: action_url.replace("__CMD__", cmd).replace("__GROUP__", group_id).
replace("__PERM__", perm_id).replace("__ITEM__", item_id),
success: function(data) {
- $("#gEditPermissionForm").load(form_url.replace("__ITEM__", item_id));
+ $("#g-edit-permissions-form").load(form_url.replace("__ITEM__", item_id));
}
});
}
</script>
-<div id="gPermissions">
+<div id="g-permissions">
<? if (!$htaccess_works): ?>
- <ul id="gMessage">
- <li class="gError">
+ <ul id="g-action-status" class="g-message-block">
+ <li class="g-error">
<?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable <a %mod_rewrite_attrs>mod_rewrite</a> and set <a %apache_attrs><i>AllowOverride FileInfo Options</i></a> to fix this.",
array("mod_rewrite_attrs" => html::mark_clean('href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"'),
"apache_attrs" => html::mark_clean('href="http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride" target="_blank"'))) ?>
@@ -37,26 +37,26 @@
<p><?= t("Edit permissions for album:") ?></p>
- <ul class="gBreadcrumbs">
+ <ul class="g-breadcrumbs">
+ <? $i = 0 ?>
<? foreach ($parents as $parent): ?>
- <li id="item-<?= $parent->id ?>">
+ <li id="item-<?= $parent->id ?>"<? if ($i == 0) print " class=\"g-first\"" ?>>
<? if (access::can("edit", $parent)): ?>
- <a href="javascript:show(<?= $parent->id ?>)">
- <?= html::purify($parent->title) ?>
- </a>
+ <a href="javascript:show(<?= $parent->id ?>)"> <?= html::purify($parent->title) ?> </a>
<? else: ?>
<?= html::purify($parent->title) ?>
<? endif ?>
</li>
+ <? $i++ ?>
<? endforeach ?>
- <li class="active" id="item-<?= $item->id ?>">
+ <li class="g-active" id="item-<?= $item->id ?>">
<a href="javascript:show(<?= $item->id ?>)">
<?= html::purify($item->title) ?>
</a>
</li>
</ul>
- <div id="gEditPermissionForm">
+ <div id="g-edit-permissions-form">
<?= $form ?>
</div>
</div>
diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php
index a0bb35f2..f1714119 100644
--- a/modules/gallery/views/permissions_form.html.php
+++ b/modules/gallery/views/permissions_form.html.php
@@ -1,7 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<fieldset>
<legend> <?= t('Edit Permissions') ?> </legend>
-
<table>
<tr>
<th> </th>
@@ -12,73 +11,75 @@
<? foreach ($permissions as $permission): ?>
<tr>
- <td> <?= t($permission->display_name) ?> </td>
+ <td> <?= t($permission->display_name) ?>
+ </td>
<? foreach ($groups as $group): ?>
<? $intent = access::group_intent($group, $permission->name, $item) ?>
<? $allowed = access::group_can($group, $permission->name, $item) ?>
<? $lock = access::locked_by($group, $permission->name, $item) ?>
<? if ($lock): ?>
- <td class="gDenied">
- <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" title="<?= t('denied and locked through parent album')->for_html_attr() ?>" alt="<?= t('denied icon')->for_html_attr() ?>" />
+ <td class="g-denied">
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>"
+ title="<?= t('denied and locked through parent album')->for_html_attr() ?>"
+ alt="<?= t('denied icon')->for_html_attr() ?>" />
<a href="javascript:show(<?= $lock->id ?>)" title="<?= t('click to go to parent album')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-lock.png') ?>" alt="<?= t('locked icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-lock.png")) ?>" alt="<?= t('locked icon')->for_html_attr() ?>" />
</a>
</td>
<? else: ?>
<? if ($intent === access::INHERIT): ?>
<? if ($allowed): ?>
- <td class="gAllowed">
- <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
- title="<?= t('allowed through parent album, click to allow explicitly')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-success-pale.png') ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" />
+ <td class="g-allowed">
+ <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('allowed through parent album, click to allow explicitly')->for_html_attr() ?>">
+ <img src="<?= url::file(gallery::find_file("images", "ico-success-passive.png")) ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" />
</a>
<a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('click to deny')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-denied-gray.png') ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" />
</a>
</td>
<? else: ?>
- <td class="gDenied">
+ <td class="g-denied">
<a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('click to allow')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-success-gray.png') ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" />
</a>
<a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('denied through parent album, click to deny explicitly')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-denied-pale.png') ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied-passive.png")) ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" />
</a>
</td>
<? endif ?>
<? elseif ($intent === access::DENY): ?>
- <td class="gDenied">
+ <td class="g-denied">
<a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('click to allow')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-success-gray.png') ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" />
</a>
<? if ($item->id == 1): ?>
- <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/>
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/>
<? else: ?>
<a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('denied, click to reset')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" alt="<?= t('denied icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" />
</a>
<? endif ?>
</td>
<? elseif ($intent === access::ALLOW): ?>
- <td class="gAllowed">
+ <td class="g-allowed">
<? if ($item->id == 1): ?>
- <img src="<?= url::file('themes/default/images/ico-success.png') ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" />
<? else: ?>
<a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('allowed, click to reset')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-success.png') ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" />
</a>
<? endif ?>
<a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)"
title="<?= t('click to deny')->for_html_attr() ?>">
- <img src="<?= url::file('themes/default/images/ico-denied-gray.png') ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" />
+ <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" />
</a>
</td>
<? endif ?>
diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index 7f8a96df..10e748b6 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -1,274 +1,134 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.js") ?>"></script>
-<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.queue.js") ?>"></script>
-<script type="text/javascript" src="<?= url::file("lib/jquery.scrollTo.js") ?>"></script>
+<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
+<script type="text/javascript" src="<?= url::file("lib/uploadify/jquery.uploadify.min.js") ?>"></script>
+<script type="text/javascript">
+ $("#g-add-photos-canvas").ready(function () {
+ $("#g-uploadify").uploadify({
+ uploader: "<?= url::file("lib/uploadify/uploadify.swf") ?>",
+ script: "<?= url::site("simple_uploader/add_photo/{$item->id}") ?>",
+ scriptData: <?= json_encode(array(
+ "g3sid" => Session::instance()->id(),
+ "user_agent" => Input::instance()->server("HTTP_USER_AGENT"),
+ "csrf" => $csrf)) ?>,
+ fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
+ fileDesc: <?= t("Photos and movies")->for_js() ?>,
+ cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>",
+ buttonText: <?= t("Select Photos ...")->for_js() ?>,
+ simUploadLimit: 10,
+ //wmode: "transparent",
+ hideButton: false, /* should be true */
+ auto: true,
+ multi: true,
+ onAllComplete: function(filesUploaded, errors, allbytesLoaded, speed) {
+ $("#g-upload-cancel-all")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
+ onClearQueue: function(event) {
+ $("#g-upload-cancel-all")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
+ onComplete: function(event, queueID, fileObj, response, data) {
+ // @todo handle a response of "Error: xxxx" as an error
+ var re = /^error: (.*)$/i;
+ var msg = re.exec(response);
+ if (msg) {
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-error\">" + fileObj.name + " - " + msg[1] + "</li>");
+ } else {
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-success\">" + fileObj.name + " - <?= t("Completed") ?></li>");
+ }
+ return true;
+ },
+
+ onError: function(event, queueID, fileObj, errorObj) {
+ var msg = " - ";
+ if (errorObj.type == "HTTP") {
+ if (errorObj.info == "500") {
+ msg += "Error occurred processing the file";
+ // Server error - check server logs
+ } else if (errorObj.info == "404") {
+ msg += "The upload script was not found.";
+ // Server script not found
+ } else {
+ // Server Error: status: errorObj.info
+ msg += "Error occurred communication with the server, status: " + errorObj.info;
+ }
+ } else if (errorObj.type == "File Size") {
+ var sizelimit = $("#g-uploadify").uploadifySettings(sizeLimit);
+ msg += fileObj.name+' '+errorObj.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB';
+ } else {
+ msg += "Error occurred communication with the server, error " + errorObj.type + ": " + errorObj.info;
+ }
+ $("#g-add-photos-status ul").append(
+ "<li class=\"g-error\">" + fileObj.name + msg + "</li>");
+ $("#g-uploadify" + queueID).remove();
+ //return false;
+ },
+ onSelect: function(event) {
+ if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) {
+ $("#g-upload-cancel-all")
+ .removeClass("ui-state-disabled")
+ .attr("disabled", null);
+ }
+ return true;
+ }
+ });
+
+ // @todo figure out how to actually get the offset or why it comes back 0 0
+ var offset = $("#g-add-photos-button").offset();
+ //$("#g-uploadifyUploader").css({top: "97px", position: "absolute", left: "198px"});
+ //$("#g-add-photos-button").height("40px").width("120px");
+ });
+</script>
-<!-- hack to set the title for the dialog -->
-<form id="gAddPhotosForm" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>">
+<form id="g-add-photos-form" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>">
<fieldset>
<legend> <?= t("Add photos to %album_title", array("album_title" => html::purify($item->title))) ?> </legend>
- </fieldset>
-</form>
-<div id="gAddPhotos">
- <? if (ini_get("suhosin.session.encrypt")): ?>
- <ul id="gMessage">
- <li class="gError">
- <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.",
+ </fieldset>
+ <div id="g-add-photos">
+ <? if (ini_get("suhosin.session.encrypt")): ?>
+ <ul id="g-action-status" class="g-message-block">
+ <li class="g-error">
+ <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.",
array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt",
- "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
- </li>
- </ul>
- <? endif ?>
-
- <p>
- <?= t("Photos will be uploaded to album: ") ?>
- </p>
- <ul class="gBreadcrumbs">
- <? foreach ($item->parents() as $parent): ?>
- <li> <?= html::clean($parent->title) ?> </li>
- <? endforeach ?>
- <li class="active"> <?= html::purify($item->title) ?> </li>
- </ul>
-
- <p>
- <span id="gUploadQueueInfo">
- <?= t("Upload Queue") ?>
- </span>
- <a id="gUploadCancel" title="<?= t("Cancel all the pending uploads")->for_html_attr() ?>" onclick="swfu.cancelQueue();"><?= t("cancel") ?></a>
- </p>
- <div id="gAddPhotosCanvas" style="text-align: center;">
- <div id="gAddPhotosQueue"></div>
- <div id="gEditPhotosQueue"></div>
- <span id="gChooseFilesButtonPlaceholder"></span>
+ "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
+ </li>
+ </ul>
+ <? endif ?>
+
+ <div>
+ <p>
+ <?= t("Photos will be uploaded to album: ") ?>
+ </p>
+ <ul class="g-breadcrumbs">
+ <? foreach ($item->parents() as $i => $parent): ?>
+ <li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::clean($parent->title) ?> </li>
+ <? endforeach ?>
+ <li class="g-active"> <?= html::purify($item->title) ?> </li>
+ </ul>
+ </div>
+
+ <div id="g-add-photos-canvas" style="text-align: center;">
+ <!-- a id="g-add-photos-button" class="ui-corner-all" style="padding-bottom: 1em;" href="#"><?= t("Select Photos...") ?></a -->
+ <span id="g-uploadify"></span>
+ </div>
+ <div id="g-add-photos-status" style="text-align: center;">
+ <ul>
+ </ul>
+ </div>
+
+ <!-- Proxy the done request back to our form, since its been ajaxified -->
+ <button id="g-upload-done" class="ui-state-default ui-corner-all" onclick="$('#g-add-photos-form').submit();return false;">
+ <?= t("Done") ?>
+ </button>
+ <button id="g-upload-cancel-all" class="ui-state-default ui-corner-all ui-state-disabled" onclick="$('#g-uploadify').uploadifyClearQueue();return false;" disabled="disabled">
+ <?= t("Cancel All") ?>
+ </button>
</div>
- <!--
- <button id="gUploadCancel" class="ui-state-default ui-corner-all" type="button"
- onclick="swfu.cancelQueue();"
- disabled="disabled">
- <?= t("Cancel all") ?>
- </button>
- -->
-
- <!-- Proxy the done request back to our form, since its been ajaxified -->
- <button class="ui-state-default ui-corner-all" onclick="$('#gAddPhotosForm').submit()">
- <?= t("Close") ?>
- </button>
-</div>
-
-<style>
- #SWFUpload_0 {
- margin-top: 100px;
- }
- #gAddPhotos .gBreadcrumbs {
- border: 0;
- margin: 0;
- padding-left:10px;
- }
- #gAddPhotosCanvas {
- border: 1px solid #CCCCCC;
- margin: .5em 0 .5em 0;
- width: 469px;
- }
- #gAddPhotos button {
- margin-bottom: .5em;
- float: right;
- }
- #gAddPhotos #gUploadCancel {
- display: none;
- cursor: pointer;
- }
-</style>
-
-<script type="text/javascript">
- var swfu = new SWFUpload({
- flash_url: <?= html::js_string(url::file("lib/swfupload/swfupload.swf")) ?>,
- upload_url: <?= html::js_string(url::site("simple_uploader/add_photo/$item->id")) ?>,
- post_params: <?= json_encode(array(
- "g3sid" => Session::instance()->id(),
- "user_agent" => Input::instance()->server("HTTP_USER_AGENT"),
- "csrf" => $csrf)) ?>,
- file_size_limit: <?= html::js_string(ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB") ?>,
- file_types: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
- file_types_description: <?= t("Photos and Movies")->for_js() ?>,
- file_upload_limit: 1000,
- file_queue_limit: 0,
- custom_settings: { },
- debug: false,
-
- // Button settings
- button_image_url: <?= html::js_string(url::file("themes/default/images/select-photos-backg.png")) ?>,
- button_width: "202",
- button_height: "45",
- button_placeholder_id: "gChooseFilesButtonPlaceholder",
- button_text: <?= json_encode('<span class="swfUploadFont">' . t("Select photos...") . '</span>') ?>,
- button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }",
- button_text_left_padding: 30,
- button_text_top_padding: 10,
-
- // The event handler functions are defined in handlers.js
- file_queued_handler: file_queued,
- file_queue_error_handler: file_queue_error,
- file_dialog_complete_handler: file_dialog_complete,
- upload_start_handler: upload_start,
- upload_progress_handler: upload_progress,
- upload_error_handler: upload_error,
- upload_success_handler: upload_success,
- upload_complete_handler: upload_complete,
- queue_complete_handler: queue_complete
- });
-
- // @todo add support for cancelling individual uploads
- function File_Progress(file) {
- this.box = $("#" + file.id);
- if (!this.box.length) {
- $("#gAddPhotosQueue").append(
- "<div class=\"box\" id=\"" + file.id + "\">" +
- "<div class=\"title\"></div>" +
- "<div class=\"status\"></div>" +
- "<div class=\"progressbar\"></div>" +
- "</div>");
- this.box = $("#" + file.id);
- }
- this.title = this.box.find(".title");
- this.status = this.box.find(".status");
- this.progress_bar = this.box.find(".progressbar");
- this.progress_bar.progressbar();
- this.progress_bar.css("visibility", "hidden");
- }
-
- File_Progress.prototype.set_status = function(status_class, msg) {
- this.box.removeClass("pending error uploading complete").addClass(status_class);
- this.status.html(msg);
- }
-
- function file_queued(file) {
- var fp = new File_Progress(file);
- fp.title.html(file.name);
- fp.set_status("pending", <?= t("Pending...")->for_js() ?>);
- // @todo add cancel button to call this.cancelUpload(file.id)
- }
-
- function file_queue_error(file, error_code, message) {
- if (error_code === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
- alert(<?= t("You have attempted to queue too many files.")->for_js() ?>);
- return;
- }
-
- var fp = new File_Progress(file);
- switch (error_code) {
- case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("<strong>File is too big.</strong> A likely error source is a too low value for <em>upload_max_filesize</em> (%upload_max_filesize) in your <em>php.ini</em>.", array("upload_max_filesize" => ini_get("upload_max_filesize")))->for_js() ?>);
- break;
- case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Cannot upload empty files.")->for_js() ?>);
- break;
- case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Invalid file type.")->for_js() ?>);
- break;
- default:
- if (file !== null) {
- fp.title.html(file.name);
- fp.set_status("error", <?= t("Unknown error")->for_js() ?>);
- }
- break;
- }
- }
-
- function file_dialog_complete(num_files_selected, num_files_queued) {
- if (num_files_selected > 0) {
- $("#gUploadCancel").show();
- $("#gUploadQueueInfo").text(get_completed_status_msg(this.getStats()));
- }
-
- // Auto start the upload
- this.startUpload();
- }
-
- function upload_start(file) {
- // Do all file validation on the server side. Update the UI here because in Linux
- // no uploadProgress events are called (limitation in the Linux Flash VM).
- var fp = new File_Progress(file);
- fp.title.html(file.name);
- fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
- $("#gAddPhotosCanvas").scrollTo(fp.box, 1000);
- return true;
- // @todo add cancel button to call this.cancelUpload(file.id)
- }
-
- function upload_progress(file, bytes_loaded, bytes_total) {
- var percent = Math.ceil((bytes_loaded / bytes_total) * 100);
- var fp = new File_Progress(file);
- fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
- fp.progress_bar.css("visibility", "visible");
- fp.progress_bar.progressbar("value", percent);
- }
-
- function upload_success(file, serverData) {
- var fp = new File_Progress(file);
- fp.progress_bar.progressbar("value", 100);
- fp.set_status("complete", <?= t("Complete.")->for_js() ?>);
- }
-
- function upload_error(file, error_code, message) {
- var fp = new File_Progress(file);
- switch (error_code) {
- case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
- fp.set_status("error", <?= t("Upload error: bad image file")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
- fp.set_status("error", <?= t("Upload failed")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.IO_ERROR:
- fp.set_status("error", <?= t("Server error")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
- fp.set_status("error", <?= t("Security error")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
- fp.set_status("error", <?= t("Upload limit exceeded")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
- fp.set_status("error", <?= t("Failed validation. File skipped")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
- // If there aren't any files left (they were all cancelled) disable the cancel button
- if (this.getStats().files_queued === 0) {
- $("#gUploadCancel").hide();
- }
- fp.set_status("error", <?= t("Cancelled")->for_js() ?>);
- break;
- case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
- fp.set_status("error", <?= t("Stopped")->for_js() ?>);
- break;
- default:
- fp.set_status("error", <?= t("Unknown error: ")->for_js() ?> + error_code);
- break;
- }
- }
-
- function upload_complete(file) {
- var stats = this.getStats();
- $("#gUploadQueueInfo").text(get_completed_status_msg(stats));
- if (stats.files_queued === 0) {
- $("#gUploadCancel").hide();
- }
- }
-
- function get_completed_status_msg(stats) {
- var msg = <?= t("Upload Queue (completed %completed of %total)", array("completed" => "__COMPLETED__", "total" => "__TOTAL__"))->for_js() ?>;
- msg = msg.replace("__COMPLETED__", stats.successful_uploads);
- msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads +
- stats.upload_errors + stats.upload_cancelled + stats.queue_errors);
- return msg;
- }
-
- // This event comes from the Queue Plugin
- function queue_complete(num_files_uploaded) {
- var status_msg = <?= t("Uploaded: __COUNT__")->for_js() ?>;
- $("#gUploadStatus").html(status_msg.replace("__COUNT__", num_files_uploaded));
- }
-</script>
+</form>
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 8a01cd29..5cd1cd77 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<html>
<head>
- <title><?= t("Gallery 3 Upgrader") ?></title>
+ <title><?= t("Gallery 3 upgrader") ?></title>
<link rel="stylesheet" type="text/css" href="<?= url::file("modules/gallery/css/upgrader.css") ?>"
media="screen,print,projection" />
<script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script>
@@ -11,29 +11,54 @@
<img src="<?= url::file("modules/gallery/images/gallery.png") ?>" />
<div id="inner">
<? if ($can_upgrade): ?>
- <? if ($done): ?>
- <div id="confirmation">
- <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a>
- <div>
+ <div id="dialog" style="visibility: hidden">
+ <a id="dialog_close_link" style="display: none" onclick="$('#dialog').fadeOut(); return false;" href="#" class="close">[x]</a>
+ <div id="busy" style="display: none">
+ <h1>
+ <img width="16" height="16" src="<?= url::file("lib/images/loading-small.gif") ?>"/>
+ <?= t("Upgrade in progress!") ?>
+ </h1>
+ <p>
+ <?= t("Please don't refresh or leave the page.") ?>
+ </p>
+ </div>
+ <div id="done" style="display: none">
<h1> <?= t("That's it!") ?> </h1>
<p>
<?= t("Your <a href=\"%url\">Gallery</a> is up to date.",
- array("url" => html::mark_clean(item::root()->url()))) ?>
+ array("url" => html::mark_clean(item::root()->url()))) ?>
</p>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
- $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2));
- $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2));
+ $("#dialog").css("left", Math.round(($(window).width() - $("#dialog").width()) / 2));
+ $("#dialog").css("top", Math.round(($(window).height() - $("#dialog").height()) / 2));
+ $("#upgrade_link").click(function(event) { show_busy() });
+
+ <? if ($done): ?>
+ show_done();
+ <? endif ?>
});
+
+ var show_busy = function() {
+ $("#dialog").css("visibility", "visible");
+ $("#busy").show();
+ $("#upgrade_link").parent().removeClass("button-active");
+ $("#upgrade_link").replaceWith($("#upgrade_link").html())
+ }
+
+ var show_done = function() {
+ $("#dialog").css("visibility", "visible");
+ $("#done").show();
+ $("#dialog_close_link").show();
+ }
</script>
- <? endif ?>
- <p class="gray_on_done">
+ <p class="<?= $done ? "muted" : "" ?>">
<?= t("Welcome to the Gallery upgrader. One click and you're done!") ?>
</p>
<table>
- <tr class="gray_on_done">
+ <tr class="<?= $done ? "muted" : "" ?>">
<th> <?= t("Module name") ?> </th>
<th> <?= t("Installed version") ?> </th>
<th> <?= t("Available version") ?> </th>
@@ -58,17 +83,23 @@
<? endforeach ?>
</table>
- <div class="button gray_on_done">
- <a href="<?= url::site("upgrader/upgrade") ?>">
+ <? if ($done): ?>
+ <div class="button muted">
+ <?= t("Upgrade all") ?>
+ </div>
+ <? else: ?>
+ <div class="button button-active">
+ <a id="upgrade_link" href="<?= url::site("upgrader/upgrade") ?>">
<?= t("Upgrade all") ?>
</a>
</div>
+ <? endif ?>
<? if (@$inactive): ?>
- <p class="gray_on_done">
+ <p class="<?= $done ? "muted" : "" ?>">
<?= t("The following modules are inactive and don't require an upgrade.") ?>
</p>
- <ul class="gray_on_done">
+ <ul class="<?= $done ? "muted" : "" ?>">
<? foreach ($available as $module): ?>
<? if (!$module->active): ?>
<li>
diff --git a/modules/user/views/user_languages_block.html.php b/modules/gallery/views/user_languages_block.html.php
index b5ae674c..89185967 100644
--- a/modules/user/views/user_languages_block.html.php
+++ b/modules/gallery/views/user_languages_block.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<?= form::dropdown("gSelectSessionLocale", $installed_locales, $selected) ?>
+<?= form::dropdown("g-select-session-locale", $installed_locales, $selected) ?>
<script type="text/javascript">
- $("#gSelectSessionLocale").change(function() {
+ $("#g-select-session-locale").change(function() {
var old_locale_preference = <?= html::js_string($selected) ?>;
var locale = $(this).val();
if (old_locale_preference == locale) {
diff --git a/modules/gallery/views/welcome_message.html.php b/modules/gallery/views/welcome_message.html.php
index 5515c3dc..24d01bab 100644
--- a/modules/gallery/views/welcome_message.html.php
+++ b/modules/gallery/views/welcome_message.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gWelcomeMessage">
+<div id="g-welcome-message">
<h1 style="display: none">
<?= t("Welcome to Gallery 3!") ?>
</h1>
@@ -16,13 +16,13 @@
<p>
<a href="<?= url::site("form/edit/users/{$user->id}") ?>"
- title="<?= t("Edit Your Profile")->for_html_attr() ?>"
- id="gAfterInstallChangePasswordLink"
- class="gButtonLink ui-state-default ui-corners-all">
- <?= t("Change Password Now") ?>
+ title="<?= t("Edit your profile")->for_html_attr() ?>"
+ id="g-after-install-change-password-link"
+ class="g-button ui-state-default ui-corners-all">
+ <?= t("Change password now") ?>
</a>
- <script>
- $("#gAfterInstallChangePasswordLink").gallery_dialog();
+ <script type="text/javascript">
+ $("#g-after-install-change-password-link").gallery_dialog();
</script>
</p>
diff --git a/modules/gallery/views/welcome_message_loader.html.php b/modules/gallery/views/welcome_message_loader.html.php
index 2c6bffca..d1ff2f3f 100644
--- a/modules/gallery/views/welcome_message_loader.html.php
+++ b/modules/gallery/views/welcome_message_loader.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<span id="gWelcomeMessageLink"
+<span id="g-welcome-message-link"
title="<?= t("Welcome to Gallery 3")->for_html_attr() ?>"
href="<?= url::site("welcome_message") ?>"/>
<script type="text/javascript">
- $(document).ready(function(){$("#gWelcomeMessageLink").gallery_dialog({immediate: true});});
+ $(document).ready(function(){$("#g-welcome-message-link").gallery_dialog({immediate: true});});
</script>
diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php
index a5dbcc1f..58e0d9c5 100644
--- a/modules/gallery_unit_test/controllers/gallery_unit_test.php
+++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php
@@ -77,14 +77,6 @@ class Gallery_Unit_Test_Controller extends Controller {
}
try {
- // Find all tests, excluding sample tests that come with the unit_test module.
- foreach (glob(MODPATH . "*/tests") as $path) {
- if ($path != MODPATH . "unit_test/tests") {
- $paths[] = $path;
- }
- }
- Kohana::config_set('unit_test.paths', $paths);
-
// Clean out the database
if ($tables = $db->list_tables()) {
foreach ($db->list_tables() as $table) {
@@ -96,6 +88,8 @@ class Gallery_Unit_Test_Controller extends Controller {
@system("rm -rf test/var");
@mkdir('test/var/logs', 0777, true);
+ $active_modules = module::$active;
+
// Reset our caches
module::$modules = array();
module::$active = array();
@@ -105,23 +99,28 @@ class Gallery_Unit_Test_Controller extends Controller {
// Rest the cascading class path
Kohana::config_set("core", Kohana::config_load("core"));
- // Install all modules
+ // Install the active modules
// Force gallery and user to be installed first to resolve dependencies.
gallery_installer::install(true);
module::load_modules();
module::install("user");
module::activate("user");
- $modules = array();
- foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) {
- $module_name = basename(dirname(dirname($file)));
+ $modules = $paths = array();
+ foreach (module::available() as $module_name => $unused) {
if (in_array($module_name, array("gallery", "user"))) {
+ $paths[] = MODPATH . "{$module_name}/tests";
continue;
}
- module::install($module_name);
- module::activate($module_name);
+ if (file_exists($path = MODPATH . "{$module_name}/tests")) {
+ $paths[] = $path;
+ module::install($module_name);
+ module::activate($module_name);
+ }
}
+ Kohana::config_set('unit_test.paths', $paths);
+
// Trigger late-binding install actions (defined in gallery_event::user_login)
graphics::choose_default_toolkit();
diff --git a/modules/image_block/helpers/image_block_theme.php b/modules/image_block/helpers/image_block_block.php
index 78138b23..79bd92ba 100644
--- a/modules/image_block/helpers/image_block_theme.php
+++ b/modules/image_block/helpers/image_block_block.php
@@ -17,34 +17,47 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class image_block_theme_Core {
- static function sidebar_blocks($theme) {
- $block = new Block();
- $block->css_id = "gImageBlock";
- $block->title = t("Random Image");
- $block->content = new View("image_block_block.html");
+class image_block_block_Core {
+ static function get_site_list() {
+ return array("random_image" => t("Random image"));
+ }
- $random = ((float)mt_rand()) / (float)mt_getrandmax();
+ static function get($block_id, $theme) {
+ $block = "";
+ switch ($block_id) {
+ case "random_image":
+ $block = new Block();
+ $block->css_id = "g-image-block";
+ $block->title = t("Random image");
+ $block->content = new View("image_block_block.html");
- $items = ORM::factory("item")
- ->viewable()
- ->where("type !=", "album")
- ->where("rand_key < ", $random)
- ->orderby(array("rand_key" => "DESC"))
- ->find_all(1);
+ $random = ((float)mt_rand()) / (float)mt_getrandmax();
- if ($items->count() == 0) {
- // Try once more. If this fails, just ditch the block altogether
$items = ORM::factory("item")
->viewable()
->where("type !=", "album")
- ->where("rand_key >= ", $random)
+ ->where("rand_key < ", $random)
->orderby(array("rand_key" => "DESC"))
->find_all(1);
- }
- $block->content->item = $items->current();
+ if ($items->count() == 0) {
+ // Try once more. If this fails, just ditch the block altogether
+ $items = ORM::factory("item")
+ ->viewable()
+ ->where("type !=", "album")
+ ->where("rand_key >= ", $random)
+ ->orderby(array("rand_key" => "DESC"))
+ ->find_all(1);
+ }
+
+ if ($items->count() > 0) {
+ $block->content->item = $items->current();
+ } else {
+ $block = "";
+ }
+ break;
+ }
- return $items->count() == 0 ? "" : $block;
+ return $block;
}
}
diff --git a/modules/image_block/helpers/image_block_installer.php b/modules/image_block/helpers/image_block_installer.php
new file mode 100644
index 00000000..04a15619
--- /dev/null
+++ b/modules/image_block/helpers/image_block_installer.php
@@ -0,0 +1,30 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class image_block_installer {
+ static function install() {
+ module::set_version("image_block", 2);
+ }
+
+ static function upgrade($version) {
+ if ($version == 1) {
+ module::set_version("image_block", 2);
+ }
+ }
+}
diff --git a/modules/image_block/views/image_block_block.html.php b/modules/image_block/views/image_block_block.html.php
index c51c1b4a..68d5fa89 100644
--- a/modules/image_block/views/image_block_block.html.php
+++ b/modules/image_block/views/image_block_block.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div class="gImageBlock">
+<div class="g-image-block">
<a href="<?= $item->url() ?>">
- <?= $item->thumb_img(array("class" => "gThumbnail")) ?>
+ <?= $item->thumb_img(array("class" => "g-thumbnail")) ?>
</a>
</div>
diff --git a/modules/rss/helpers/rss_theme.php b/modules/info/helpers/info_block.php
index 3d1b9a29..a86bbec9 100644
--- a/modules/rss/helpers/rss_theme.php
+++ b/modules/info/helpers/info_block.php
@@ -17,24 +17,23 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class rss_theme_Core {
- static function sidebar_blocks($theme) {
- $block = new Block();
- $block->css_id = "gRss";
- $block->title = t("Available RSS Feeds");
- $block->content = new View("rss_block.html");
- $block->content->feeds = array();
- foreach (module::active() as $module) {
- $class_name = "{$module->name}_rss";
- if (method_exists($class_name, "available_feeds")) {
- $block->content->feeds = array_merge(
- $block->content->feeds,
- call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag()));
- }
- }
+class info_block_Core {
+ static function get_site_list() {
+ return array("metadata" => t("Metadata"));
+ }
- if ($block->content->feeds) {
- return $block;
+ static function get($block_id, $theme) {
+ $block = "";
+ switch ($block_id) {
+ case "metadata":
+ if ($theme->item()) {
+ $block = new Block();
+ $block->css_id = "g-metadata";
+ $block->title = $theme->item()->is_album() ? t("Album info") : t("Photo info");
+ $block->content = new View("info_block.html");
+ }
+ break;
}
+ return $block;
}
-}
+} \ No newline at end of file
diff --git a/modules/info/helpers/info_theme.php b/modules/info/helpers/info_theme.php
index 4bf894ad..8b8602a1 100644
--- a/modules/info/helpers/info_theme.php
+++ b/modules/info/helpers/info_theme.php
@@ -18,16 +18,6 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class info_theme_Core {
- static function sidebar_blocks($theme) {
- if ($theme->item()) {
- $block = new Block();
- $block->css_id = "gMetadata";
- $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info");
- $block->content = new View("info_block.html");
- return $block;
- }
- }
-
static function thumb_info($theme, $item) {
$results = "";
if ($item->view_count) {
diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php
index d8f36984..ac177ee7 100644
--- a/modules/info/views/info_block.html.php
+++ b/modules/info/views/info_block.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<ul class="gMetadata">
+<ul class="g-metadata">
<li>
<strong class="caption"><?= t("Title:") ?></strong>
<?= html::purify($item->title) ?>
diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php
index 88d92b16..9a40b0b9 100644
--- a/modules/notification/helpers/notification.php
+++ b/modules/notification/helpers/notification.php
@@ -20,7 +20,7 @@
class notification {
static function get_subscription($item_id, $user=null) {
if (empty($user)) {
- $user = user::active();
+ $user = identity::active_user();
}
return ORM::factory("subscription")
@@ -31,7 +31,7 @@ class notification {
static function is_watching($item, $user=null) {
if (empty($user)) {
- $user = user::active();
+ $user = identity::active_user();
}
return ORM::factory("subscription")
@@ -44,7 +44,7 @@ class notification {
static function add_watch($item, $user=null) {
if ($item->is_album()) {
if (empty($user)) {
- $user = user::active();
+ $user = identity::active_user();
}
$subscription = ORM::factory("subscription");
$subscription->item_id = $item->id;
@@ -56,7 +56,7 @@ class notification {
static function remove_watch($item, $user=null) {
if ($item->is_album()) {
if (empty($user)) {
- $user = user::active();
+ $user = identity::active_user();
}
$subscription = ORM::factory("subscription")
@@ -67,19 +67,25 @@ class notification {
}
static function get_subscribers($item) {
- // @todo don't access the user table directly
- // @todo only return distinct email addresses
- $users = ORM::factory("user")
- ->join("subscriptions", "users.id", "subscriptions.user_id")
- ->join("items", "subscriptions.item_id", "items.id")
- ->where("email IS NOT", null)
- ->where("items.left_ptr <=", $item->left_ptr)
- ->where("items.right_ptr >", $item->right_ptr)
- ->find_all();
+ $subscriber_ids = array();
+ foreach (ORM::factory("subscription")
+ ->select("user_id")
+ ->join("items", "subscriptions.item_id", "items.id")
+ ->where("items.left_ptr <=", $item->left_ptr)
+ ->where("items.right_ptr >", $item->right_ptr)
+ ->find_all()
+ ->as_array() as $subscriber) {
+ $subscriber_ids[] = $subscriber->user_id;
+ }
+
+ if (empty($subscriber_ids)) {
+ return array();
+ }
+ $users = identity::get_user_list($subscriber_ids);
$subscribers = array();
foreach ($users as $user) {
- if (access::user_can($user, "view", $item)) {
+ if (access::user_can($user, "view", $item) && !empty($user->email)) {
$subscribers[$user->email] = 1;
}
}
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php
index c50b04c4..6b2df574 100644
--- a/modules/notification/helpers/notification_event.php
+++ b/modules/notification/helpers/notification_event.php
@@ -52,6 +52,17 @@ class notification_event_Core {
}
}
+ static function user_deleted($user) {
+ ORM::factory("subscriptions")
+ ->where(array("user_id", $user->id))
+ ->delete_all();
+ }
+
+ static function identity_provider_changed($old_provider, $new_provider) {
+ ORM::factory("subscriptions")
+ ->delete_all();
+ }
+
static function comment_created($comment) {
try {
if ($comment->state == "published") {
@@ -95,7 +106,7 @@ class notification_event_Core {
}
static function site_menu($menu, $theme) {
- if (!user::active()->guest) {
+ if (!identity::active_user()->guest) {
$item = $theme->item();
if ($item && $item->is_album() && access::can("view", $item)) {
@@ -107,7 +118,7 @@ class notification_event_Core {
->append(Menu::factory("link")
->id("watch")
->label($label)
- ->css_id("gNotifyLink")
+ ->css_id("g-notify-link")
->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token())));
}
}
diff --git a/modules/notification/views/comment_published.html.php b/modules/notification/views/comment_published.html.php
index a8ca1899..ac36a2c1 100644
--- a/modules/notification/views/comment_published.html.php
+++ b/modules/notification/views/comment_published.html.php
@@ -11,11 +11,11 @@
<td><?= nl2br(html::purify($comment->text)) ?></td>
</tr>
<tr>
- <td><?= t("Author Name:") ?></td>
+ <td><?= t("Author name:") ?></td>
<td><?= html::clean($comment->author_name()) ?></td>
</tr>
<tr>
- <td><?= t("Author Email:") ?></td>
+ <td><?= t("Author email:") ?></td>
<td><?= html::clean($comment->author_email()) ?></td>
</tr>
<tr>
diff --git a/modules/notification/views/item_updated.html.php b/modules/notification/views/item_updated.html.php
index 9c200964..47856cab 100644
--- a/modules/notification/views/item_updated.html.php
+++ b/modules/notification/views/item_updated.html.php
@@ -8,7 +8,7 @@
<table>
<tr>
<? if ($item->original("title") != $item->title): ?>
- <td><?= t("New Title:") ?></td>
+ <td><?= t("New title:") ?></td>
<td><?= html::clean($item->title) ?></td>
<? else: ?>
<td><?= t("Title:") ?></td>
@@ -21,7 +21,7 @@
</tr>
<? if ($item->original("description") != $item->description): ?>
<tr>
- <td><?= t("New Description:") ?></td>
+ <td><?= t("New description:") ?></td>
<td><?= html::clean($item->description) ?></td>
</tr>
<? elseif (!empty($item->description)): ?>
diff --git a/modules/organize/css/organize.css b/modules/organize/css/organize.css
index b1cef33c..41695cae 100644
--- a/modules/organize/css/organize.css
+++ b/modules/organize/css/organize.css
@@ -2,76 +2,73 @@
/*******************************************************************
* Dialog wide styles
*/
-#gOrganize {
+#g-organize {
+ height: 100%;
overflow: hidden;
}
-#gOrganize #bd {
+#g-organize #bd {
height: 100%;
}
-#gOrganize .yui-u {
- width: 75%;
+#g-organize #g-organize-detail {
+ width: auto;
}
-#gOrganize .yui-gf .first {
+#g-organize #g-organize-tree-container {
+ height: 100%;
width: 25%;
}
-#gMessage {
+#g-organize #g-action-status {
margin-bottom: .4em;
width: 75%;
white-space: nowrap;
}
-#gOrganizeDetail {
+#g-organize-detail {
height: 100%;
}
-#gMessage .gInfo {
- font-weight: bold;
- padding-left: 2em;
-}
-
/*******************************************************************
* Album Tree styles
*/
-#gOrganizeTreeContainer {
+#g-organize-tree-container {
height: 100%;
overflow: auto;
margin: 0 !important;
padding: 0 !important;
}
-#gOrganizeAlbumTree .selected {
+#g-organize-album-tree .g-selected {
background-color: #cfdeff;
border-bottom: 1px solid #999;
- margin-right: 0px;
+ margin-right: 0;
}
-#gOrganizeAlbumTree ul li {
+#g-organize-album-tree ul li {
padding-left: 1.2em;
}
-.gOrganizeAlbum span {
+.g-organize-album span {
cursor: pointer;
}
-.gOrganizeAlbumText {
+.g-organize-album-text {
cursor: pointer;
width: auto;
margin: 2px 0px 1px 2px;
display: block;
}
-.gOrganizeAlbumText:hover {
+.g-organize-album-text:hover {
background: #eee;
}
/*******************************************************************
* Album panel styles
*/
-#gOrganizeMicroThumbPanel {
+#g-organize-microthumb-panel {
margin: 0 !important;
padding: 0 !important;
background-color: #cfdeff;
@@ -82,28 +79,27 @@
overflow-y: auto;
}
-#gOrganizeMicroThumbGrid {
+#g-organize-microthumb-grid {
padding: 1em;
}
-.gOrganizeMicroThumbGridCell {
- float: left;
- font-size: 0.8em;
+.g-organize-microthumb-grid-cell {
+ font-size: .8em;
padding: .5em !important;
border-left: 1px hidden #13A;
border-right: 1px hidden #13A;
margin: 4px;
}
-.gOrganizeMicroThumb {
+.g-organize-microthumb {
display: block;
height: 9em;
text-align: center;
width: 9em;
}
-.gOrganizeMicroThumbGridCell.ui-selecting,
-.gOrganizeMicroThumbGridCell.ui-selected {
+.g-organize-microthumb-grid-cell.ui-selecting,
+.g-organize-microthumb-grid-cell.ui-selected {
margin: 2px;
border: 2px solid #13A;
}
@@ -115,15 +111,15 @@
background: #13A;
}
-.gThumbnail {
+.g-thumbnail {
padding: .5em;
}
-#gOrganizeMicroThumbGrid .gAlbum {
+#g-organize-microthumb-grid .g-album {
background-color: #e8e8e8;
}
-.gOrganizeMicroThumbGridCell:hover {
+.g-organize-microthumb-grid-cell:hover {
margin: 2px;
border: 2px solid #13A;
}
@@ -131,18 +127,17 @@
/****************************************************************
* Controls styles
*/
-#gOrganizeControls {
+#g-organize-controls {
padding-left: 8px;
background-color: #13A;
color: #ccc;
width: 100% !important;
}
-#gOrganizeControls select {
+#g-organize-controls select {
display: inline;
}
-#gOrganizeClose {
- float: right;
+#g-organize-close {
margin-right: 12px;
}
diff --git a/modules/organize/helpers/organize_event.php b/modules/organize/helpers/organize_event.php
index d6043116..6aa6da81 100644
--- a/modules/organize/helpers/organize_event.php
+++ b/modules/organize/helpers/organize_event.php
@@ -25,8 +25,8 @@ class organize_event_Core {
$menu->get("options_menu")
->append(Menu::factory("dialog")
->id("organize")
- ->label(t("Organize Album"))
- ->css_id("gOrganizeLink")
+ ->label(t("Organize album"))
+ ->css_id("g-organize-link")
->url(url::site("organize/dialog/{$item->id}")));
}
}
@@ -37,7 +37,7 @@ class organize_event_Core {
->append(Menu::factory("dialog")
->id("organize")
->label(t("Organize album"))
- ->css_id("gOrganizeLink")
+ ->css_id("g-organize-link")
->css_class("ui-icon-folder-open")
->url(url::site("organize/dialog/{$item->id}")));
}
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index cfaff01c..d125e2df 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -4,11 +4,11 @@
handle: ".ui-selected",
distance: 10,
cursorAt: { left: -10, top: -10},
- appendTo: "#gOrganizeMicroThumbPanel",
+ appendTo: "#g-organize-microthumb-panel",
helper: function(event, ui) {
var selected = $(".ui-draggable.ui-selected img");
if (selected.length) {
- var set = $('<div class="gDragHelper"></div>')
+ var set = $('<div class="g-drag-helper"></div>')
.css({
zIndex: 2000,
width: 80,
@@ -37,16 +37,16 @@
},
start: function(event, ui) {
- $("#gOrganizeMicroThumbPanel .ui-selected").hide();
+ $("#g-organize-microthumb-panel .ui-selected").hide();
},
drag: function(event, ui) {
- var top = $("#gOrganizeMicroThumbPanel").offset().top;
- var height = $("#gOrganizeMicroThumbPanel").height();
+ var top = $("#g-organize-microthumb-panel").offset().top;
+ var height = $("#g-organize-microthumb-panel").height();
if (ui.offset.top > height + top - 20) {
- $("#gOrganizeMicroThumbPanel").get(0).scrollTop += 100;
+ $("#g-organize-microthumb-panel").get(0).scrollTop += 100;
} else if (ui.offset.top < top + 20) {
- $("#gOrganizeMicroThumbPanel").get(0).scrollTop = Math.max(0, $("#gOrganizeMicroThumbPanel").get(0).scrollTop - 100);
+ $("#g-organize-microthumb-panel").get(0).scrollTop = Math.max(0, $("#g-organize-microthumb-panel").get(0).scrollTop - 100);
}
}
},
@@ -63,7 +63,7 @@
target_id = $(".currentDropTarget").attr("ref");
} else {
before_or_after = "after";
- target_id = $("#gOrganizeMicroThumbGrid li:last").attr("ref");
+ target_id = $("#g-organize-microthumb-grid li:last").attr("ref");
}
$.organize.do_drop({
url: rearrange_url
@@ -79,9 +79,9 @@
tolerance: "pointer",
greedy: true,
drop: function(event, ui) {
- if ($(event.target).hasClass("gViewOnly")) {
+ if ($(event.target).hasClass("g-view-only")) {
$(".ui-selected").show();
- $(".gOrganizeMicroThumbGridCell").css("borderStyle", "none");
+ $(".g-organize-microthumb-grid-cell").css("borderStyle", "none");
} else {
$.organize.do_drop({
url: move_url.replace("__ALBUM_ID__", $(event.target).attr("ref")),
@@ -92,7 +92,7 @@
},
do_drop: function(options) {
- $("#gOrganizeMicroThumbPanel").selectable("destroy");
+ $("#g-organize-microthumb-panel").selectable("destroy");
var source_ids = [];
$(options.source).each(function(i) {
source_ids.push($(this).attr("ref"));
@@ -110,19 +110,19 @@
_refresh: function(data) {
if (data.tree) {
- $("#gOrganizeAlbumTree").html(data.tree);
+ $("#g-organize-album-tree").html(data.tree);
}
if (data.grid) {
- $("#gOrganizeMicroThumbGrid").html(data.grid);
- $("#gOrganizeSortColumn").attr("value", data.sort_column);
- $("#gOrganizeSortOrder").attr("value", data.sort_order);
+ $("#g-organize-microthumb-grid").html(data.grid);
+ $("#g-organize-sort-column").attr("value", data.sort_column);
+ $("#g-organize-sort-order").attr("value", data.sort_order);
}
$.organize.set_handlers();
},
mouse_move_handler: function(event) {
- if ($(".gDragHelper").length) {
- $(".gOrganizeMicroThumbGridCell").css({borderStyle: "hidden", margin: "4px"});
+ if ($(".g-drag-helper").length) {
+ $(".g-organize-microthumb-grid-cell").css({borderStyle: "hidden", margin: "4px"});
$(".currentDropTarget").removeClass("currentDropTarget");
var borderStyle = event.pageX < $(this).offset().left + $(this).width() / 2 ?
{borderLeftStyle: "solid", marginLeft: "2px"} : {borderRightStyle: "solid", marginRight: "2px"};
@@ -138,39 +138,39 @@
var self = this;
// Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?)
$(".sf-menu li.sfHover ul").css("z-index", 68);
- $("#gDialog").dialog("option", "zIndex", 70);
- $("#gDialog").bind("dialogopen", function(event, ui) {
- $("#gOrganize").height($("#gDialog").innerHeight() - 20);
- $("#gOrganizeMicroThumbPanel").height($("#gDialog").innerHeight() - 90);
- $("#gOrganizeTreeContainer").height($("#gDialog").innerHeight() - 59);
+ $("#g-dialog").dialog("option", "zIndex", 70);
+ $("#g-dialog").bind("dialogopen", function(event, ui) {
+ $("#g-organize").height($("#g-dialog").innerHeight() - 20);
+ $("#g-organize-microthumb-panel").height($("#g-dialog").innerHeight() - 90);
+ $("#g-organize-tree-container").height($("#g-dialog").innerHeight() - 59);
});
- $("#gDialog").bind("dialogclose", function(event, ui) {
+ $("#g-dialog").bind("dialogclose", function(event, ui) {
window.location.reload();
});
- $("#gDialog #gOrganizeClose").click(function(event) {
- $("#gDialog").dialog("close");
+ $("#g-dialog #g-organize-close").click(function(event) {
+ $("#g-dialog").dialog("close");
});
- $("#gOrganizeSortColumn,#gOrganizeSortOrder").change(function(event) {
- $.organize.resort($("#gOrganizeSortColumn").attr("value"), $("#gOrganizeSortOrder").attr("value"));
+ $("#g-organize-sort-column,#g-organize-sort-order").change(function(event) {
+ $.organize.resort($("#g-organize-sort-column").attr("value"), $("#g-organize-sort-order").attr("value"));
});
$.organize.set_handlers();
},
set_handlers: function() {
- $("#gOrganizeMicroThumbPanel")
- .selectable({filter: ".gOrganizeMicroThumbGridCell"})
+ $("#g-organize-microthumb-panel")
+ .selectable({filter: ".g-organize-microthumb-grid-cell"})
.droppable($.organize.content_droppable);
- $(".gOrganizeMicroThumbGridCell")
+ $(".g-organize-microthumb-grid-cell")
.draggable($.organize.micro_thumb_draggable)
.mouseleave($.organize.mouse_leave_handler)
.mousemove($.organize.mouse_move_handler);
- $(".gOrganizeAlbum").droppable($.organize.branch_droppable);
- $(".gOrganizeAlbumText").click($.organize.show_album);
- $("#gOrganizeAlbumTree .ui-icon-plus,#gOrganizeAlbumTree .ui-icon-minus").click($.organize.toggle_branch);
+ $(".g-organize-album").droppable($.organize.branch_droppable);
+ $(".g-organize-album-text").click($.organize.show_album);
+ $("#g-organize-album-tree .ui-icon-plus,#g-organize-album-tree .ui-icon-minus").click($.organize.toggle_branch);
},
toggle_branch: function(event) {
@@ -204,23 +204,23 @@
*/
show_album: function(event) {
event.preventDefault();
- if ($(event.currentTarget).hasClass("selected")) {
+ if ($(event.currentTarget).hasClass("g-selected")) {
return;
}
- var parent = $(event.currentTarget).parents(".gOrganizeBranch");
- if ($(parent).hasClass("gViewOnly")) {
+ var parent = $(event.currentTarget).parents(".g-organize-branch");
+ if ($(parent).hasClass("g-view-only")) {
return;
}
- $("#gOrganizeMicroThumbPanel").selectable("destroy");
+ $("#g-organize-microthumb-panel").selectable("destroy");
var id = $(event.currentTarget).attr("ref");
- $("#gOrganizeAlbumTree .selected").removeClass("selected");
- $(".gOrganizeAlbumText[ref=" + id + "]").addClass("selected");
- var url = $("#gOrganizeMicroThumbPanel").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0);
+ $("#g-organize-album-tree .g-selected").removeClass("g-selected");
+ $(".g-organize-album-text[ref=" + id + "]").addClass("g-selected");
+ var url = $("#g-organize-microthumb-panel").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0);
$.get(url, {},
function(data) {
- $("#gOrganizeMicroThumbGrid").html(data.grid);
- $("#gOrganizeSortColumn").attr("value", data.sort_column);
- $("#gOrganizeSortOrder").attr("value", data.sort_order);
+ $("#g-organize-microthumb-grid").html(data.grid);
+ $("#g-organize-sort-column").attr("value", data.sort_column);
+ $("#g-organize-sort-order").attr("value", data.sort_order);
$.organize.set_handlers();
},
"json");
@@ -231,14 +231,14 @@
*/
resort: function(column, dir) {
var url = sort_order_url
- .replace("__ALBUM_ID__", $("#gOrganizeAlbumTree .selected").attr("ref"))
+ .replace("__ALBUM_ID__", $("#g-organize-album-tree .g-selected").attr("ref"))
.replace("__COL__", column)
.replace("__DIR__", dir);
$.get(url, {},
function(data) {
- $("#gOrganizeMicroThumbGrid").html(data.grid);
- $("#gOrganizeSortColumn").attr("value", data.sort_column);
- $("#gOrganizeSortOrder").attr("value", data.sort_order);
+ $("#g-organize-microthumb-grid").html(data.grid);
+ $("#g-organize-sort-column").attr("value", data.sort_column);
+ $("#g-organize-sort-order").attr("value", data.sort_order);
$.organize.set_handlers();
},
"json");
diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php
index cbc2e4f9..57a0bdc6 100644
--- a/modules/organize/views/organize_dialog.html.php
+++ b/modules/organize/views/organize_dialog.html.php
@@ -5,37 +5,35 @@
var sort_order_url = "<?= url::site("organize/sort_order/__ALBUM_ID__/__COL__/__DIR__?csrf=$csrf") ?>";
var tree_url = "<?= url::site("organize/tree/__ALBUM_ID__") ?>";
</script>
-<div id="gOrganize" class="gDialogPanel">
+<div id="g-organize" class="g-dialog-panel">
<h1 style="display:none"><?= t("Organize %name", array("name" => html::purify($album->title))) ?></h1>
<div id="bd">
- <div class="yui-gf">
- <div class="yui-u first">
+ <div>
+ <div class="g-first g-left">
<h3><?= t("Albums") ?></h3>
</div>
- <div id="gMessage" class="yui-u">
- <div class="gInfo"><?= t("Drag and drop photos to re-order or move between albums") ?></div>
- </div>
+ <div id="g-action-status" class="g-message-block g-info"><?= t("Drag and drop photos to re-order or move between albums") ?></div>
</div>
- <div id="gOrganizeContentPane" class="yui-gf">
- <div id="gOrganizeTreeContainer" class="yui-u first">
- <ul id="gOrganizeAlbumTree">
+ <div id="g-organize-content-pane">
+ <div id="g-organize-tree-container" class="g-first g-left">
+ <h3><?= t("Albums") ?></h3><ul id="g-organize-album-tree">
<?= $album_tree ?>
</ul>
</div>
- <div id="gOrganizeDetail" class="yui-u">
- <div id="gOrganizeMicroThumbPanel"
+ <div id="g-organize-detail">
+ <div id="g-organize-microthumb-panel"
ref="<?= url::site("organize/album/__ITEM_ID__/__OFFSET__") ?>">
- <ul id="gOrganizeMicroThumbGrid">
+ <ul id="g-organize-microthumb-grid">
<?= $micro_thumb_grid ?>
</ul>
</div>
- <div id="gOrganizeControls">
- <a id="gOrganizeClose" href="#" ref="done"
- class="gButtonLink ui-corner-all ui-state-default"><?= t("Close") ?></a>
+ <div id="g-organize-controls">
+ <a id="g-organize-close" href="#" ref="done"
+ class="g-button g-right ui-corner-all ui-state-default"><?= t("Close") ?></a>
<form>
<?= t("Sort order") ?>
- <?= form::dropdown(array("id" => "gOrganizeSortColumn"), album::get_sort_order_options(), $album->sort_column) ?>
- <?= form::dropdown(array("id" => "gOrganizeSortOrder"), array("ASC" => "Ascending", "DESC" => "Descending"), $album->sort_order) ?>
+ <?= form::dropdown(array("id" => "g-organize-sort-column"), album::get_sort_order_options(), $album->sort_column) ?>
+ <?= form::dropdown(array("id" => "g-organize-sort-order"), array("ASC" => "Ascending", "DESC" => "Descending"), $album->sort_order) ?>
</form>
</div>
</div>
@@ -44,5 +42,5 @@
</div>
<script type="text/javascript">
- $("#gOrganize").ready($.organize.init);
+ $("#g-organize").ready($.organize.init);
</script>
diff --git a/modules/organize/views/organize_thumb_grid.html.php b/modules/organize/views/organize_thumb_grid.html.php
index af7136fc..f28176de 100644
--- a/modules/organize/views/organize_thumb_grid.html.php
+++ b/modules/organize/views/organize_thumb_grid.html.php
@@ -1,20 +1,20 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? foreach ($album->children(25, $offset) as $child): ?>
-<li class="gOrganizeMicroThumbGridCell" ref="<?= $child->id ?>">
- <div id="gOrganizeMicroThumb_<?= $child->id ?>"
- class="gOrganizeMicroThumb <?= $child->is_album() ? "gAlbum" : "gPhoto" ?>">
- <?= $child->thumb_img(array("class" => "gThumbnail", "ref" => $child->id), 90, true) ?>
+<li class="g-organize-microthumb-grid-cell g-left" ref="<?= $child->id ?>">
+ <div id="g-organize-microthumb_<?= $child->id ?>"
+ class="g-organize-microthumb <?= $child->is_album() ? "g-album" : "g-photo" ?>">
+ <?= $child->thumb_img(array("class" => "g-thumbnail", "ref" => $child->id), 90, true) ?>
</div>
</li>
<? endforeach ?>
<? if ($album->children_count() > $offset): ?>
-<script>
+<script type="text/javascript">
setTimeout(function() {
$.get("<?= url::site("organize/album/$album->id/" . ($offset + 25)) ?>",
{},
function(data) {
- $("#gOrganizeMicroThumbGrid").append(data.grid);
+ $("#g-organize-microthumb-grid").append(data.grid);
$.organize.set_handlers();
},
"json");
diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php
index e5d91c04..924a1bd6 100644
--- a/modules/organize/views/organize_tree.html.php
+++ b/modules/organize/views/organize_tree.html.php
@@ -1,9 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $album) ? "" : "gViewOnly" ?>"
+<li class="g-organize-album ui-icon-left <?= access::can("edit", $album) ? "" : "g-view-only" ?>"
ref="<?= $album->id ?>">
<span class="ui-icon ui-icon-minus">
</span>
- <span class="gOrganizeAlbumText <?= $selected && $album->id == $selected->id ? "selected" : "" ?>"
+ <span class="g-organize-album-text <?= $selected && $album->id == $selected->id ? "selected" : "" ?>"
ref="<?= $album->id ?>">
<?= html::clean($album->title) ?>
</span>
@@ -12,11 +12,11 @@
<? if ($selected && $child->contains($selected)): ?>
<?= View::factory("organize_tree.html", array("selected" => $selected, "album" => $child)); ?>
<? else: ?>
- <li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $child) ? "" : "gViewOnly" ?>"
+ <li class="g-organize-album ui-icon-left <?= access::can("edit", $child) ? "" : "g-view-only" ?>"
ref="<?= $child->id ?>">
<span class="ui-icon ui-icon-plus">
</span>
- <span class="gOrganizeAlbumText" ref="<?= $child->id ?>">
+ <span class="g-organize-album-text" ref="<?= $child->id ?>">
<?= html::clean($child->title) ?>
</span>
</li>
diff --git a/modules/recaptcha/css/recaptcha.css b/modules/recaptcha/css/recaptcha.css
new file mode 100644
index 00000000..27117a55
--- /dev/null
+++ b/modules/recaptcha/css/recaptcha.css
@@ -0,0 +1,7 @@
+#g-content #g-comments ul li #g-recaptcha {
+ padding: 0;
+}
+
+#g-content #g-comments ul li #g-recaptcha div {
+ padding: 0;
+}
diff --git a/modules/recaptcha/helpers/recaptcha.php b/modules/recaptcha/helpers/recaptcha.php
index bead6156..789bae85 100644
--- a/modules/recaptcha/helpers/recaptcha.php
+++ b/modules/recaptcha/helpers/recaptcha.php
@@ -19,7 +19,7 @@
*/
class recaptcha_Core {
static function get_configure_form() {
- $form = new Forge("admin/recaptcha", "", "post", array("id" => "gConfigureRecaptchaForm"));
+ $form = new Forge("admin/recaptcha", "", "post", array("id" => "g-configure-recaptcha-form"));
$group = $form->group("configure_recaptcha")
->label(t("Configure reCAPTCHA"));
$group->input("public_key")
diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php
index d23a0c74..e7ded3ab 100644
--- a/modules/recaptcha/helpers/recaptcha_event.php
+++ b/modules/recaptcha/helpers/recaptcha_event.php
@@ -20,7 +20,13 @@
class recaptcha_event_Core {
static function comment_add_form($form) {
if (module::get_var("recaptcha", "public_key")) {
- $form->add_comment->recaptcha("recaptcha")->label("")->id("gRecaptcha");
+ $form->add_comment->recaptcha("recaptcha")->label("")->id("g-recaptcha");
+ }
+ }
+
+ static function register_add_form($form) {
+ if (module::get_var("recaptcha", "public_key")) {
+ $form->register_user->recaptcha("recaptcha")->label("")->id("g-recaptcha");
}
}
diff --git a/modules/recaptcha/helpers/recaptcha_theme.php b/modules/recaptcha/helpers/recaptcha_theme.php
new file mode 100644
index 00000000..fd1f563c
--- /dev/null
+++ b/modules/recaptcha/helpers/recaptcha_theme.php
@@ -0,0 +1,28 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class recaptcha_theme_Core {
+ static function head($theme) {
+ $theme->css("recaptcha.css");
+ }
+
+ static function admin_head($theme) {
+ $theme->css("recaptcha.css");
+ }
+} \ No newline at end of file
diff --git a/modules/recaptcha/views/admin_recaptcha.html.php b/modules/recaptcha/views/admin_recaptcha.html.php
index 0a4b1f8f..4f07fef0 100644
--- a/modules/recaptcha/views/admin_recaptcha.html.php
+++ b/modules/recaptcha/views/admin_recaptcha.html.php
@@ -1,33 +1,35 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAdminRecaptcha">
- <h1> <?= t("reCAPTCHA Challenge Filtering") ?> </h1>
+<div class="g-block">
+ <h1> <?= t("reCAPTCHA challenge filtering") ?> </h1>
<p>
<?= t("reCAPTCHA is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows. In order to use it, you need to sign up for a <a href=\"%domain_url\">reCAPTCHA Public/Private Key pair</a>, which is also free. Once registered, the challenge and response strings are evaluated at <a href=\"%recaptcha_url\">recaptcha.net</a> to determine if the form content has been entered by a bot.",
array("domain_url" => $form->get_key_url,
"recaptcha_url" => html::mark_clean("http://recaptcha.net"))) ?>
</p>
- <?= $form ?>
-</div>
+ <div class="g-block-content">
+ <?= $form ?>
-<? if ($public_key && $private_key): ?>
-<div id="gAdminRecaptchaTest" class="gBlock">
- <h2> <?= t("reCAPTCHA Test") ?> </h2>
- <p>
- <?= t("If you see a CAPTCHA form below, then reCAPTCHA is functioning properly.") ?>
- </p>
+ <? if ($public_key && $private_key): ?>
+ <div id="g-admin-recaptcha-test">
+ <h2> <?= t("reCAPTCHA test") ?> </h2>
+ <p>
+ <?= t("If you see a CAPTCHA form below, then reCAPTCHA is functioning properly.") ?>
+ </p>
+
+ <div id="g-recaptcha">
+ <script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
+ <script type="text/javascript">
+ Recaptcha.create("<?= $public_key ?>", "g-recaptcha", {
+ callback: Recaptcha.focus_response_field,
+ lang: "en",
+ custom_translations : { instructions_visual : <?= t("Type words to check:")->for_js() ?>},
+ theme: "white"
+ });
+ </script>
+ </div>
+ </div>
+ <? endif ?>
- <div id="gRecaptcha"/>
- <script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
- <script type="text/javascript">
- Recaptcha.create("<?= $public_key ?>", "gRecaptcha", {
- callback: Recaptcha.focus_response_field,
- lang: "en",
- custom_translations : { instructions_visual : <?= t("Type words to check:")->for_js() ?>},
- theme: "white"
- });
- </script>
</div>
</div>
-<? endif ?>
-
diff --git a/modules/recaptcha/views/form_recaptcha.html.php b/modules/recaptcha/views/form_recaptcha.html.php
index 4ec04c49..20e7359e 100644
--- a/modules/recaptcha/views/form_recaptcha.html.php
+++ b/modules/recaptcha/views/form_recaptcha.html.php
@@ -1,17 +1,17 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gRecaptcha"></div>
+<div id="g-recaptcha"></div>
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
<script type="text/javascript">
setTimeout(function() {
Recaptcha.create(
"<?= $public_key ?>",
- "gRecaptcha",
+ "g-recaptcha",
{
theme: "white",
custom_translations : { instructions_visual : <?= t("Type words to check:")->for_js() ?>},
callback: Recaptcha.focus_response_field
}
);
- }, 0);
+ }, 500);
</script>
diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php
index 015d6032..1ecec9af 100644
--- a/modules/rss/controllers/rss.php
+++ b/modules/rss/controllers/rss.php
@@ -52,12 +52,14 @@ class Rss_Controller extends Controller {
$view->feed = $feed;
$view->pub_date = date("D, d M Y H:i:s T");
- $feed->uri = url::abs_site(Router::$current_uri);
+ $feed->uri = url::abs_site(str_replace("&", "&amp;", url::merge($_GET)));
if ($page > 1) {
- $feed->previous_page_uri = url::abs_site(url::merge(array("page" => $page - 1)));
+ $feed->previous_page_uri =
+ url::abs_site(str_replace("&", "&amp;", url::merge(array("page" => $page - 1))));
}
if ($page < $feed->max_pages) {
- $feed->next_page_uri = url::abs_site(url::merge(array("page" => $page + 1)));
+ $feed->next_page_uri =
+ url::abs_site(str_replace("&", "&amp;", url::merge(array("page" => $page + 1))));
}
rest::http_content_type(rest::RSS);
diff --git a/modules/rss/helpers/rss_block.php b/modules/rss/helpers/rss_block.php
new file mode 100644
index 00000000..8da45e98
--- /dev/null
+++ b/modules/rss/helpers/rss_block.php
@@ -0,0 +1,49 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class rss_block_Core {
+ static function get_site_list() {
+ return array("rss_feeds" => t("Available RSS feeds"));
+ }
+
+ static function get($block_id, $theme) {
+ $block = "";
+ switch ($block_id) {
+ case "rss_feeds":
+ $feeds = array();
+ foreach (module::active() as $module) {
+ $class_name = "{$module->name}_rss";
+ if (method_exists($class_name, "available_feeds")) {
+ $feeds = array_merge($feeds,
+ call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag()));
+ }
+ }
+ if (!empty($feeds)) {
+ $block = new Block();
+ $block->css_id = "g-rss";
+ $block->title = t("Available RSS feeds");
+ $block->content = new View("rss_block.html");
+ $block->content->feeds = $feeds;
+ }
+ break;
+ }
+
+ return $block;
+ }
+}
diff --git a/modules/rss/views/feed.mrss.php b/modules/rss/views/feed.mrss.php
index 3612cbc0..5fce8699 100644
--- a/modules/rss/views/feed.mrss.php
+++ b/modules/rss/views/feed.mrss.php
@@ -26,11 +26,12 @@
<link><?= url::abs_site("{$child->type}s/{$child->id}") ?></link>
<guid isPermaLink="true"><?= url::abs_site("{$child->type}s/{$child->id}") ?></guid>
<pubDate><?= date("D, d M Y H:i:s T", $child->created); ?></pubDate>
+ <description><?= html::purify($child->description) ?></description>
<content:encoded>
<![CDATA[
<span><?= html::purify($child->description) ?></span>
<p>
- <? if ($child->type == "photo" || $child->type == "album"): ?>
+ <? if ($child->type == "photo"): ?>
<img alt="" src="<?= $child->resize_url(true) ?>"
title="<?= html::purify($child->title)->for_html_attr() ?>"
height="<?= $child->resize_height ?>" width="<?= $child->resize_width ?>" /><br />
@@ -45,12 +46,11 @@
]]>
</content:encoded>
<media:thumbnail url="<?= $child->thumb_url(true) ?>"
- fileSize="<?= @filesize($child->thumb_path()) ?>"
height="<?= $child->thumb_height ?>"
width="<?= $child->thumb_width ?>"
/>
<media:group>
- <? if ($child->type == "photo" || $child->type == "album"): ?>
+ <? if ($child->type == "photo"): ?>
<media:content url="<?= $child->resize_url(true) ?>"
fileSize="<?= @filesize($child->resize_path()) ?>"
type="<?= $child->mime_type ?>"
diff --git a/modules/rss/views/rss_block.html.php b/modules/rss/views/rss_block.html.php
index 737731b6..210c72a5 100644
--- a/modules/rss/views/rss_block.html.php
+++ b/modules/rss/views/rss_block.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<ul id="gFeeds">
+<ul id="g-feeds">
<? foreach($feeds as $url => $title): ?>
<li style="clear: both;">
<span class="ui-icon-left">
diff --git a/modules/search/controllers/search.php b/modules/search/controllers/search.php
index 08128ae8..cf9e271f 100644
--- a/modules/search/controllers/search.php
+++ b/modules/search/controllers/search.php
@@ -30,7 +30,12 @@ class Search_Controller extends Controller {
}
list ($count, $result) = search::search($q, $page_size, $offset);
+
+ $max_pages = max(ceil($count / $page_size), 1);
+
$template = new Theme_View("page.html", "search");
+ $template->set_global("page", $page);
+ $template->set_global("max_pages", $max_pages);
$template->set_global("page_size", $page_size);
$template->set_global("children_count", $count);
diff --git a/modules/search/helpers/search.php b/modules/search/helpers/search.php
index 0080b4ce..8c3bd3ab 100644
--- a/modules/search/helpers/search.php
+++ b/modules/search/helpers/search.php
@@ -22,30 +22,25 @@ class search_Core {
$db = Database::instance();
$q = $db->escape_str($q);
- if (!user::active()->admin) {
- foreach (user::group_ids() as $id) {
+ if (!identity::active_user()->admin) {
+ foreach (identity::group_ids_for_active_user() as $id) {
$fields[] = "`view_$id` = TRUE"; // access::ALLOW
}
- $access_sql = "AND (" . join(" AND ", $fields) . ")";
+ $access_sql = "AND (" . join(" OR ", $fields) . ")";
} else {
$access_sql = "";
}
- // Count the total number of rows. We can't do this with our regular query because of the
- // limit statement. It's possible that if we get rid of the limit (but keep the offset) on
- // the 2nd query and combine the two, it might be faster than making 2 separate queries.
- $count_query = "SELECT COUNT(*) AS c " .
- "FROM {items} JOIN {search_records} ON ({items}.`id` = {search_records}.`item_id`) " .
- "WHERE MATCH({search_records}.`data`) AGAINST ('$q' IN BOOLEAN MODE) " .
- $access_sql;
- $count = $db->query($count_query)->current()->c;
-
- $query = "SELECT {items}.*, MATCH({search_records}.`data`) AGAINST ('$q') AS `score` " .
+ $query =
+ "SELECT SQL_CALC_FOUND_ROWS {items}.*, " .
+ " MATCH({search_records}.`data`) AGAINST ('$q') AS `score` " .
"FROM {items} JOIN {search_records} ON ({items}.`id` = {search_records}.`item_id`) " .
"WHERE MATCH({search_records}.`data`) AGAINST ('$q' IN BOOLEAN MODE) " .
$access_sql .
"ORDER BY `score` DESC " .
"LIMIT $limit OFFSET $offset";
+ $data = $db->query($query);
+ $count = $db->query("SELECT FOUND_ROWS() as c")->current()->c;
return array($count, new ORM_Iterator(ORM::factory("item"), $db->query($query)));
}
@@ -57,7 +52,7 @@ class search_Core {
list ($remaining) = search::stats();
if ($remaining) {
site_status::warning(
- t('Your search index needs to be updated. <a href="%url" class="gDialogLink">Fix this now</a>',
+ t('Your search index needs to be updated. <a href="%url" class="g-dialog-link">Fix this now</a>',
array("url" => html::mark_clean(url::site("admin/maintenance/start/search_task::update_index?csrf=__CSRF__")))),
"search_index_out_of_date");
}
diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php
index 91d9eec8..fdf22a9e 100644
--- a/modules/search/views/search.html.php
+++ b/modules/search/views/search.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? // @todo Set hover on AlbumGrid list items ?>
-<form action="<?= url::site("/search") ?>" id="gSearchForm">
+<form action="<?= url::site("/search") ?>" id="g-search-form" class="g-short-form">
<fieldset>
<legend>
<?= t("Search") ?>
@@ -17,17 +17,17 @@
</fieldset>
</form>
-<div id="gSearchResults">
- <h1><?= t("Search Results") ?></h1>
+<div id="g-search-results">
+ <h1><?= t("Search results") ?></h1>
<? if (count($items)): ?>
- <ul id="gAlbumGrid">
+ <ul id="g-album-grid" class="ui-helper-clearfix">
<? foreach ($items as $item): ?>
- <? $item_class = "gPhoto"; ?>
+ <? $item_class = "g-photo"; ?>
<? if ($item->is_album()): ?>
- <? $item_class = "gAlbum"; ?>
+ <? $item_class = "g-album"; ?>
<? endif ?>
- <li class="gItem <?= $item_class ?>">
+ <li class="g-item <?= $item_class ?>">
<a href="<?= $item->url() ?>">
<?= $item->thumb_img() ?>
<p>
@@ -40,7 +40,7 @@
</li>
<? endforeach ?>
</ul>
- <?= $theme->pager() ?>
+ <?= $theme->paginator() ?>
<? else: ?>
<p>
diff --git a/modules/search/views/search_link.html.php b/modules/search/views/search_link.html.php
index 51bb4e14..481d0c82 100644
--- a/modules/search/views/search_link.html.php
+++ b/modules/search/views/search_link.html.php
@@ -1,9 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<form action="<?= url::site("search") ?>" id="gQuickSearchForm">
+<form action="<?= url::site("search") ?>" id="g-quick-search-form" class="g-short-form">
<ul>
<li>
- <label for="gSearch"><?= t("Search the gallery") ?></label>
- <input type="text" name="q" id="gSearch"/>
+ <label for="g-search"><?= t("Search the gallery") ?></label>
+ <input type="text" name="q" id="g-search"/>
</li>
<li>
<input type="submit" value="<?= t("Go")->for_html_attr() ?>" />
diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php
index 38190fee..f32bb834 100644
--- a/modules/server_add/controllers/admin_server_add.php
+++ b/modules/server_add/controllers/admin_server_add.php
@@ -83,9 +83,9 @@ class Admin_Server_Add_Controller extends Admin_Controller {
private function _get_admin_form() {
$form = new Forge("admin/server_add/add_path", "", "post",
- array("id" => "gServerAddAdminForm"));
+ array("id" => "g-server-add-admin-form", "class" => "g-short-form"));
$add_path = $form->group("add_path");
- $add_path->input("path")->label(t("Path"))->rules("required")
+ $add_path->input("path")->label(t("Path"))->rules("required")->id("g-path")
->error_messages("not_readable", t("This directory is not readable by the webserver"))
->error_messages("is_symlink", t("Symbolic links are not allowed"));
$add_path->submit("add")->value(t("Add Path"));
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index 9769cd6f..53a3d091 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -103,7 +103,7 @@ class Server_Add_Controller extends Admin_Controller {
access::verify_csrf();
$task = ORM::factory("task", $task_id);
- if (!$task->loaded || $task->owner_id != user::active()->id) {
+ if (!$task->loaded || $task->owner_id != identity::active_user()->id) {
access::forbidden();
}
@@ -207,7 +207,7 @@ class Server_Add_Controller extends Admin_Controller {
$task->set("mode", "done");
}
- $owner_id = user::active()->id;
+ $owner_id = identity::active_user()->id;
foreach ($entries as $entry) {
if (microtime(true) - $start > 0.5) {
break;
diff --git a/modules/server_add/css/server_add.css b/modules/server_add/css/server_add.css
new file mode 100644
index 00000000..36746ab5
--- /dev/null
+++ b/modules/server_add/css/server_add.css
@@ -0,0 +1,38 @@
+#g-server-add button {
+ margin-bottom: .5em;
+}
+
+#g-server-add-tree {
+ cursor: pointer;
+ padding-left: 4px;
+ width: 95%;
+}
+
+#g-server-add-tree li {
+ padding: 0;
+ float: none;
+}
+
+#g-server-add-tree span.selected {
+ background: #ddd;
+}
+
+#g-server-add-tree {
+ border: 1px solid #ccc;
+ height: 20em;
+ overflow: auto;
+ margin-bottom: .5em;
+ padding: .5em;
+}
+
+#g-server-add ul ul li {
+ padding-left: 1.2em;
+}
+
+#g-server-add-paths li .ui-icon {
+ margin-top: .4em;
+}
+
+#g-server-add-admin-form .textbox {
+ width: 400px;
+}
diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php
index 4db83f74..e1295bd4 100644
--- a/modules/server_add/helpers/server_add_event.php
+++ b/modules/server_add/helpers/server_add_event.php
@@ -30,12 +30,12 @@ class server_add_event_Core {
$item = $theme->item();
$paths = unserialize(module::get_var("server_add", "authorized_paths"));
- if ($item && user::active()->admin && $item->is_album() && !empty($paths) &&
+ if ($item && identity::active_user()->admin && $item->is_album() && !empty($paths) &&
is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path())) {
$menu->get("add_menu")
->append(Menu::factory("dialog")
->id("server_add")
- ->label(t("Server add"))
+ ->label(t("Server Add"))
->url(url::site("server_add/browse/$item->id")));
}
}
diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php
index 2ba2e167..84f28df2 100644
--- a/modules/server_add/helpers/server_add_theme.php
+++ b/modules/server_add/helpers/server_add_theme.php
@@ -19,7 +19,8 @@
*/
class server_add_theme_Core {
static function head($theme) {
- if (user::active()->admin) {
+ if (identity::active_user()->admin) {
+ $theme->css("server_add.css");
$theme->script("server_add.js");
}
}
@@ -27,10 +28,11 @@ class server_add_theme_Core {
static function admin_head($theme) {
$head = array();
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
+ $theme->css("server_add.css");
$theme->css("jquery.autocomplete.css");
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
- $head[] = "<script> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
+ $head[] = "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
$theme->script("jquery.autocomplete.js");
$theme->script("admin.js");
diff --git a/modules/server_add/js/admin.js b/modules/server_add/js/admin.js
index 5440af2a..9d7bd181 100644
--- a/modules/server_add/js/admin.js
+++ b/modules/server_add/js/admin.js
@@ -3,6 +3,6 @@
*
*/
$("document").ready(function() {
- $("#gServerAddAdmin input:text").autocomplete(
+ $("#g-path").autocomplete(
base_url.replace("__ARGS__", "admin/server_add/autocomplete"), {max: 256});
});
diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js
index 50a8c36b..02dda4c0 100644
--- a/modules/server_add/js/server_add.js
+++ b/modules/server_add/js/server_add.js
@@ -2,38 +2,38 @@
$.widget("ui.gallery_server_add", {
_init: function() {
var self = this;
- $("#gServerAddAddButton", this.element).click(function(event) {
+ $("#g-server-add-add-button", this.element).click(function(event) {
event.preventDefault();
- $(".gProgressBar", this.element).
+ $(".g-progress-bar", this.element).
progressbar().
progressbar("value", 0);
- $("#gServerAddProgress", this.element).slideDown("fast", function() { self.start_add(); });
+ $("#g-server-add-progress", this.element).slideDown("fast", function() { self.start_add(); });
});
- $("#gServerAddPauseButton", this.element).click(function(event) {
+ $("#g-server-add-pause-button", this.element).click(function(event) {
self.pause = true;
- $("#gServerAddPauseButton", this.element).hide();
- $("#gServerAddContinueButton", this.element).show();
+ $("#g-server-add-pause-button", this.element).hide();
+ $("#g-server-add-continue-button", this.element).show();
});
- $("#gServerAddContinueButton", this.element).click(function(event) {
+ $("#g-server-add-continue-button", this.element).click(function(event) {
self.pause = false;
- $("#gServerAddPauseButton", this.element).show();
- $("#gServerAddContinueButton", this.element).hide();
+ $("#g-server-add-pause-button", this.element).show();
+ $("#g-server-add-continue-button", this.element).hide();
self.run_add();
});
- $("#gServerAddCloseButton", this.element).click(function(event) {
- $("#gDialog").dialog("close");
+ $("#g-server-add-close-button", this.element).click(function(event) {
+ $("#g-dialog").dialog("close");
window.location.reload();
});
- $("#gServerAddTree span.gDirectory", this.element).dblclick(function(event) {
+ $("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) {
self.open_dir(event);
});
- $("#gServerAddTree span.gFile, #gServerAddTree span.gDirectory", this.element).click(function(event) {
+ $("#g-server-add-tree span.g-file, #g-server-add-tree span.g-directory", this.element).click(function(event) {
self.select_file(event);
});
- $("#gServerAddTree span.gDirectory", this.element).dblclick(function(event) {
+ $("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) {
self.open_dir(event);
});
- $("#gDialog").bind("dialogclose", function(event, ui) {
+ $("#g-dialog").bind("dialogclose", function(event, ui) {
window.location.reload();
});
},
@@ -48,8 +48,8 @@
paths.push($(this).attr("ref"));
});
- $("#gServerAddAddButton", this.element).hide();
- $("#gServerAddPauseButton", this.element).show();
+ $("#g-server-add-add-button", this.element).hide();
+ $("#g-server-add-pause-button", this.element).show();
$.ajax({
url: START_URL,
@@ -58,8 +58,8 @@
data: { "paths[]": paths },
dataType: "json",
success: function(data, textStatus) {
- $("#gStatus").html(data.status);
- $(".gProgressBar", self.element).progressbar("value", data.percent_complete);
+ $("#g-status").html(data.status);
+ $(".g-progress-bar", self.element).progressbar("value", data.percent_complete);
self.taskURL = data.url;
setTimeout(function() { self.run_add(); }, 25);
}
@@ -74,13 +74,13 @@
async: false,
dataType: "json",
success: function(data, textStatus) {
- $("#gStatus").html(data.status);
- $(".gProgressBar", self.element).progressbar("value", data.percent_complete);
+ $("#g-status").html(data.status);
+ $(".g-progress-bar", self.element).progressbar("value", data.percent_complete);
if (data.done) {
- $("#gServerAddProgress", this.element).slideUp();
- $("#gServerAddAddButton", this.element).show();
- $("#gServerAddPauseButton", this.element).hide();
- $("#gServerAddContinueButton", this.element).hide();
+ $("#g-server-add-progress", this.element).slideUp();
+ $("#g-server-add-add-button", this.element).show();
+ $("#g-server-add-pause-button", this.element).hide();
+ $("#g-server-add-continue-button", this.element).hide();
} else {
if (!self.pause) {
setTimeout(function() { self.run_add(); }, 25);
@@ -99,11 +99,11 @@
$.ajax({
url: GET_CHILDREN_URL.replace("__PATH__", path),
success: function(data, textStatus) {
- $("#gServerAddTree", self.element).html(data);
- $("#gServerAddTree span.gDirectory", self.element).dblclick(function(event) {
+ $("#g-server-add-tree", self.element).html(data);
+ $("#g-server-add-tree span.g-directory", self.element).dblclick(function(event) {
self.open_dir(event);
});
- $("#gServerAddTree span.gFile, #gServerAddTree span.gDirectory", this.element).click(function(event) {
+ $("#g-server-add-tree span.g-file, #g-server-add-tree span.g-directory", this.element).click(function(event) {
self.select_file(event);
});
}
@@ -115,10 +115,10 @@
*/
select_file: function (event) {
$(event.target).toggleClass("selected");
- if ($("#gServerAdd span.selected").length) {
- $("#gServerAddAddButton").enable(true).removeClass("ui-state-disabled");
+ if ($("#g-server-add span.selected").length) {
+ $("#g-server-add-add-button").enable(true).removeClass("ui-state-disabled");
} else {
- $("#gServerAddAddButton").enable(false).addClass("ui-state-disabled");
+ $("#g-server-add-add-button").enable(false).addClass("ui-state-disabled");
}
}
});
diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php
index b48a19da..6dbb8637 100644
--- a/modules/server_add/views/admin_server_add.html.php
+++ b/modules/server_add/views/admin_server_add.html.php
@@ -1,25 +1,21 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gServerAddAdmin">
- <h2>
- <?= t("Add From Server Admininstration") ?>
- </h2>
- <div id="gAuthorizedPath">
- <h3><?= t("Authorized Paths") ?></h3>
- <ul id="gMessage"<? if (!empty($paths)): ?> style="display: none;"<? endif ?>>
- <li class="gInfo"><?= t("No Authorized image source paths defined yet") ?></li>
- </ul>
- <ul id="gPathList">
+<div class="g-block">
+ <h1> <?= t("Add from server admininstration") ?> </h1>
+ <div class="g-block-content">
+ <?= $form ?>
+ <h2><?= t("Authorized paths") ?></h2>
+ <ul id="g-server-add-paths">
+ <? if (empty($paths)): ?>
+ <li class="g-module-status g-info"><?= t("No authorized image source paths defined yet") ?></li>
+ <? endif ?>
<? foreach ($paths as $id => $path): ?>
- <li class="ui-icon-left">
- <a href="<?= url::site("admin/server_add/remove_path?path=" . urlencode($path) . "&amp;csrf=$csrf") ?>"
- id="icon_<?= $id?>"
- class="gRemoveDir ui-icon ui-icon-trash">
- X
- </a>
+ <li>
<?= html::clean($path) ?>
+ <a href="<?= url::site("admin/server_add/remove_path?path=" . urlencode($path) . "&amp;csrf=$csrf") ?>"
+ id="icon_<?= $id ?>"
+ class="g-remove-dir g-button"><span class="ui-icon ui-icon-trash"><?= t("delete") ?></span></a>
</li>
<? endforeach ?>
</ul>
</div>
- <?= $form ?>
</div>
diff --git a/modules/server_add/views/server_add_tree.html.php b/modules/server_add/views/server_add_tree.html.php
index 4e5bf601..91354329 100644
--- a/modules/server_add/views/server_add_tree.html.php
+++ b/modules/server_add/views/server_add_tree.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li class="ui-icon-left">
<span class="ui-icon ui-icon-folder-open"></span>
- <span class="gDirectory" ref="">
+ <span class="g-directory" ref="">
<?= t("All") ?>
</span>
<ul>
@@ -9,7 +9,7 @@
<? foreach ($parents as $dir): ?>
<li class="ui-icon-left">
<span class="ui-icon ui-icon-folder-open"></span>
- <span class="gDirectory" ref="<?= html::clean_attribute($dir) ?>">
+ <span class="g-directory" ref="<?= html::clean_attribute($dir) ?>">
<?= html::clean(basename($dir)) ?>
</span>
<ul>
@@ -18,7 +18,7 @@
<? foreach ($files as $file): ?>
<li class="ui-icon-left">
<span class="ui-icon <?= is_dir($file) ? "ui-icon-folder-collapsed" : "ui-icon-document" ?>"></span>
- <span class="<?= is_dir($file) ? "gDirectory" : "gFile" ?>"
+ <span class="<?= is_dir($file) ? "g-directory" : "g-file" ?>"
ref="<?= html::clean_attribute($file) ?>" >
<?= html::clean(basename($file)) ?>
</span>
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 fdb66d1c..824a86a6 100644
--- a/modules/server_add/views/server_add_tree_dialog.html.php
+++ b/modules/server_add/views/server_add_tree_dialog.html.php
@@ -4,50 +4,48 @@
var START_URL = "<?= url::site("server_add/start?item_id={$item->id}&csrf=$csrf") ?>";
</script>
-<div id="gServerAdd">
+<div id="g-server-add">
<h1 style="display: none;"><?= t("Add Photos to '%title'", array("title" => html::purify($item->title))) ?></h1>
- <p id="gDescription"><?= t("Photos will be added to album:") ?></p>
- <ul class="gBreadcrumbs">
+ <p id="g-description"><?= t("Photos will be added to album:") ?></p>
+ <ul class="g-breadcrumbs">
+ <? $i = 0 ?>
<? foreach ($item->parents() as $parent): ?>
- <li>
- <?= html::purify($parent->title) ?>
- </li>
+ <li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::purify($parent->title) ?> </li>
+ <? $i++ ?>
<? endforeach ?>
- <li class="active">
- <?= html::purify($item->title) ?>
- </li>
+ <li class="g-active"> <?= html::purify($item->title) ?> </li>
</ul>
- <ul id="gServerAddTree" class="gCheckboxTree">
+ <ul id="g-server-add-tree" class="g-checkbox-tree">
<?= $tree ?>
</ul>
- <div id="gServerAddProgress" style="display: none">
- <div class="gProgressBar"></div>
- <div id="gStatus"></div>
+ <div id="g-server-add-progress" style="display: none">
+ <div class="g-progress-bar"></div>
+ <div id="g-status"></div>
</div>
<span>
- <button id="gServerAddAddButton" class="ui-state-default ui-state-disabled ui-corner-all"
+ <button id="g-server-add-add-button" class="ui-state-default ui-state-disabled ui-corner-all"
disabled="disabled">
<?= t("Add") ?>
</button>
- <button id="gServerAddPauseButton" class="ui-state-default ui-corner-all" style="display:none">
+ <button id="g-server-add-pause-button" class="ui-state-default ui-corner-all" style="display:none">
<?= t("Pause") ?>
</button>
- <button id="gServerAddContinueButton" class="ui-state-default ui-corner-all" style="display:none">
+ <button id="g-server-add-continue-button" class="ui-state-default ui-corner-all" style="display:none">
<?= t("Continue") ?>
</button>
- <button id="gServerAddCloseButton" class="ui-state-default ui-corner-all">
+ <button id="g-server-add-close-button" class="ui-state-default ui-corner-all">
<?= t("Close") ?>
</button>
</span>
<script type="text/javascript">
- $("#gServerAdd").ready(function() {
- $("#gServerAdd").gallery_server_add();
+ $("#g-server-add").ready(function() {
+ $("#g-server-add").gallery_server_add();
});
</script>
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php
index ce26b189..099f5fdb 100644
--- a/modules/slideshow/helpers/slideshow_event.php
+++ b/modules/slideshow/helpers/slideshow_event.php
@@ -37,9 +37,9 @@ class slideshow_event_Core {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
- ->css_id("gSlideshowLink"));
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
+ ->css_id("g-slideshow-link"));
}
}
@@ -47,18 +47,18 @@ class slideshow_event_Core {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
- ->css_id("gSlideshowLink"));
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
+ ->css_id("g-slideshow-link"));
}
static function tag_menu($menu, $theme) {
$menu->append(Menu::factory("link")
->id("slideshow")
->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})")
- ->css_id("gSlideshowLink"));
+ ->url("javascript:cooliris.embed.show(" .
+ "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})")
+ ->css_id("g-slideshow-link"));
}
private static function _feed_url($theme) {
@@ -66,9 +66,9 @@ class slideshow_event_Core {
if (!$item->is_album()) {
$item = $item->parent();
}
- return rss::url("gallery/album/{$item->id}?page_size=100");
+ return rss::url("gallery/album/{$item->id}?page_size=20");
} else {
- return rss::url("tag/tag/{$theme->tag()->id}?page_size=100");
+ return rss::url("tag/tag/{$theme->tag()->id}?page_size=20");
}
}
}
diff --git a/modules/slideshow/helpers/slideshow_theme.php b/modules/slideshow/helpers/slideshow_theme.php
index 269a93ce..163d2bd8 100644
--- a/modules/slideshow/helpers/slideshow_theme.php
+++ b/modules/slideshow/helpers/slideshow_theme.php
@@ -20,7 +20,7 @@
class slideshow_theme_Core {
static function head($theme) {
$proto = (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] === "off") ? "http" : "https";
- return "<script src=\"$proto://lite.piclens.com/current/piclens_optimized.js\" " .
+ return "<script src=\"$proto://apps.cooliris.com/slideshow/go.js\" " .
"type=\"text/javascript\"></script>";
}
}
diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php
index 63f7957c..67587c2e 100644
--- a/modules/tag/controllers/admin_tags.php
+++ b/modules/tag/controllers/admin_tags.php
@@ -69,7 +69,9 @@ class Admin_Tags_Controller extends Admin_Controller {
public function form_rename($id) {
$tag = ORM::factory("tag", $id);
if ($tag->loaded) {
- print tag::get_rename_form($tag);
+ print InPlaceEdit::factory($tag->name)
+ ->action("admin/tags/rename/$id")
+ ->render();
}
}
@@ -81,25 +83,15 @@ class Admin_Tags_Controller extends Admin_Controller {
kohana::show_404();
}
- // Don't use a form as the form is dynamically created in the js
- $post = new Validation($_POST);
- $post->add_rules("name", "required", "length[1,64]");
- $valid = $post->validate();
- if ($valid) {
- $new_name = $this->input->post("name");
- $new_tag = ORM::factory("tag")->where("name", $new_name)->find();
- if ($new_tag->loaded) {
- $error_msg = t("There is already a tag with that name");
- $valid = false;
- }
- } else {
- $error_msg = $post->errors();
- $error_msg = $error_msg[0];
- }
+ $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 ($valid) {
+ if ($in_place_edit->validate()) {
$old_name = $tag->name;
- $tag->name = $new_name;
+ $tag->name = $in_place_edit->value();
$tag->save();
$message = t("Renamed tag %old_name to %new_name",
@@ -107,16 +99,18 @@ class Admin_Tags_Controller extends Admin_Controller {
message::success($message);
log::success("tags", $message);
- print json_encode(
- array("result" => "success",
- "location" => url::site("admin/tags"),
- "tag_id" => $tag->id,
- "new_tagname" => html::clean($tag->name)));
+ print json_encode(array("result" => "success"));
} else {
- print json_encode(
- array("result" => "error",
- "message" => (string) $error_msg));
+ print json_encode(array("result" => "error", "form" => $in_place_edit->render()));
}
}
+
+ public function check_for_duplicate(Validation $post_data, $field) {
+ $tag_exists = ORM::factory("tag")->where("name", $post_data[$field])->count_all();
+ if ($tag_exists) {
+ $post_data->add_error($field, "in_use");
+ }
+ }
+
}
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 1bd6b3cc..c3b14fcc 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -25,13 +25,18 @@ class Tags_Controller extends REST_Controller {
$page = (int) $this->input->get("page", "1");
$children_count = $tag->items_count();
$offset = ($page-1) * $page_size;
+ $max_pages = max(ceil($children_count / $page_size), 1);
// Make sure that the page references a valid offset
- if ($page < 1 || ($children_count && $page > ceil($children_count / $page_size))) {
- Kohana::show_404();
+ if ($page < 1) {
+ url::redirect($album->abs_url());
+ } else if ($page > $max_pages) {
+ url::redirect($album->abs_url("page=$max_pages"));
}
$template = new Theme_View("page.html", "tag");
+ $template->set_global("page", $page);
+ $template->set_global("max_pages", $max_pages);
$template->set_global("page_size", $page_size);
$template->set_global("tag", $tag);
$template->set_global("children", $tag->items($page_size, $offset));
diff --git a/modules/tag/css/tag.css b/modules/tag/css/tag.css
new file mode 100644
index 00000000..6d6438e3
--- /dev/null
+++ b/modules/tag/css/tag.css
@@ -0,0 +1,96 @@
+/* Tag cloud ~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-tag-cloud ul {
+ font-size: 1.2em;
+ text-align: justify;
+}
+
+#g-tag-cloud ul li {
+ display: inline;
+ line-height: 1.5em;
+ text-align: justify;
+}
+
+#g-tag-cloud ul li a {
+ text-decoration: none;
+}
+
+#g-tag-cloud ul li span {
+ display: none;
+}
+
+#g-tag-cloud ul li.size1 a {
+ color: #9cf;
+ font-size: 80%;
+ font-weight: 100;
+}
+
+#g-tag-cloud ul li.size2 a {
+ color: #69f;
+ font-size: 90%;
+ font-weight: 300;
+}
+
+#g-tag-cloud ul li.size3 a {
+ color: #69c;
+ font-size: 100%;
+ font-weight: 500;
+}
+
+#g-tag-cloud ul li.size4 a {
+ color: #369;
+ font-size: 110%;
+ font-weight: 700;
+}
+
+#g-tag-cloud ul li.size5 a {
+ color: #0e2b52;
+ font-size: 120%;
+ font-weight: 900;
+}
+
+#g-tag-cloud ul li.size6 a {
+ color: #0e2b52;
+ font-size: 130%;
+ font-weight: 900;
+}
+
+#g-tag-cloud ul li.size7 a {
+ color: #0e2b52;
+ font-size: 140%;
+ font-weight: 900;
+}
+
+#g-tag-cloud ul li a:hover {
+ color: #f30;
+ text-decoration: underline;
+}
+
+/* Add tag form ~~~~~~~~~~~~~~~~~~~~ */
+
+#g-sidebar .g-short-form .textbox {
+ width: 11em;
+}
+
+/* Tag admin ~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-tag-admin {
+ table-layout: fixed;
+}
+
+#g-tag-admin td {
+ border: 0;
+ vertical-align: top;
+}
+
+#g-tag-admin ul {
+ margin-bottom: 2em;
+}
+
+#g-tag-admin li {
+ padding: .1em 0 .2em 0;
+}
+
+#g-tag-admin form ul {
+ margin-bottom: 0;
+}
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index be5461a4..feaf40c5 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -73,12 +73,15 @@ class tag_Core {
if ($tags) {
$cloud = new View("tag_cloud.html");
$cloud->max_count = $tags[0]->count;
- usort($tags, array("tag_theme", "sort_by_name"));
+ usort($tags, array("tag", "sort_by_name"));
$cloud->tags = $tags;
return $cloud;
}
}
+ static function sort_by_name($tag1, $tag2) {
+ return strcasecmp($tag1->name, $tag2->name);
+ }
/**
* Return all the tags for a given item.
@@ -98,7 +101,7 @@ class tag_Core {
}
static function get_add_form($item) {
- $form = new Forge("tags", "", "post", array("id" => "gAddTagForm"));
+ $form = new Forge("tags", "", "post", array("id" => "g-add-tag-form", "class" => "g-short-form"));
$label = $item->is_album() ?
t("Add tag to album") :
($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie"));
@@ -110,17 +113,8 @@ class tag_Core {
return $form;
}
- static function get_rename_form($tag) {
- $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "gRenameTagForm"));
- $group = $form->group("rename_tag")->label(t("Rename Tag"));
- $group->input("name")->label(t("Tag name"))->value($tag->name)->rules("required|length[1,64]");
- $group->inputs["name"]->error_messages("in_use", t("There is already a tag with that name"));
- $group->submit("")->value(t("Save"));
- return $form;
- }
-
static function get_delete_form($tag) {
- $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm"));
+ $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "g-delete-tag-form"));
$group = $form->group("delete_tag")
->label(t("Really delete tag %tag_name?", array("tag_name" => $tag->name)));
$group->submit("")->value(t("Delete Tag"));
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
new file mode 100644
index 00000000..20ef18fa
--- /dev/null
+++ b/modules/tag/helpers/tag_block.php
@@ -0,0 +1,45 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class tag_block_Core {
+ static function get_site_list() {
+ return array("tag" => t("Popular tags"));
+ }
+
+ static function get($block_id, $theme) {
+ $block = "";
+ switch ($block_id) {
+ case "tag":
+ $block = new Block();
+ $block->css_id = "g-tag";
+ $block->title = t("Popular tags");
+ $block->content = new View("tag_block.html");
+ $block->content->cloud = tag::cloud(30);
+
+ if ($theme->item() && $theme->page_type() != "tag" && access::can("edit", $theme->item())) {
+ $controller = new Tags_Controller();
+ $block->content->form = tag::get_add_form($theme->item());
+ } else {
+ $block->content->form = "";
+ }
+ break;
+ }
+ return $block;
+ }
+} \ No newline at end of file
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index 1bce9bd8..e966821a 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -21,33 +21,11 @@ class tag_theme_Core {
static function head($theme) {
$theme->css("jquery.autocomplete.css");
$theme->script("jquery.autocomplete.js");
- $theme->script("tag.js");
+ $theme->css("tag.css");
}
static function admin_head($theme) {
- $theme->script("tag.js");
- }
-
- static function sidebar_blocks($theme) {
- // @todo this needs to be data driven
-
- $block = new Block();
- $block->css_id = "gTag";
- $block->title = t("Popular Tags");
- $block->content = new View("tag_block.html");
- $block->content->cloud = tag::cloud(30);
-
- if ($theme->item() && $theme->page_type() != "tag" && access::can("edit", $theme->item())) {
- $controller = new Tags_Controller();
- $block->content->form = tag::get_add_form($theme->item());
- } else {
- $block->content->form = "";
- }
-
- return $block;
- }
-
- static function sort_by_name($tag1, $tag2) {
- return strcasecmp($tag1->name, $tag2->name);
+ $theme->css("tag.css");
+ $theme->script("gallery.in_place_edit.js");
}
} \ No newline at end of file
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
deleted file mode 100644
index 52c695c6..00000000
--- a/modules/tag/js/tag.js
+++ /dev/null
@@ -1,81 +0,0 @@
-$("document").ready(function() {
- ajaxify_tag_form();
-});
-
-function ajaxify_tag_form() {
- $("#gTag form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.result == "success") {
- $.get($("#gTagCloud").attr("title"), function(data, textStatus) {
- $("#gTagCloud").html(data);
- });
- }
- $("#gTag form").resetForm();
- }
- });
-}
-
-function closeEditInPlaceForms() {
- // closes currently open inplace edit forms
- if ($("#gRenameTagForm").length) {
- $("#gEditErrorMessage").remove();
- var li = $("#gRenameTagForm").parent();
- $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert"));
- li.height("");
- $(".gEditable", li).bind("click", editInPlace);
- $(".gDialogLink", li).gallery_dialog();
- }
-}
-
-function str_replace(search_term, replacement, string) {
- var temp = string.split(search_term);
- return temp.join(replacement);
-}
-
-function editInPlace(element) {
- closeEditInPlaceForms();
-
- // create edit form
- var tag_id = $(this).attr('id').substr(5);
- var tag_name = $(this).html();
- var tag_width = $(this).width();
- $(this).parent().data("revert", $(this).parent().html());
- var form = '<form id="gRenameTagForm" method="post" class="ui-helper-clearfix" ';
- form += 'action="' + TAG_RENAME_URL.replace('__ID__', tag_id) + '">';
- form += '<input name="csrf" type="hidden" value="' + csrf_token + '" />';
- form += '<input id="name" name="name" type="text" class="textbox" value="' +
- str_replace('"', "&quot;", tag_name) + '" />';
- form += '<input type="submit" class="submit ui-state-default ui-corner-all" value="' + save_i18n + '" i/>';
- form += '<a href="#">' + cancel_i18n + '</a>';
- form += '</form>';
-
- // add edit form
- $(this).parent().html(form);
- $("#gRenameTagForm #name")
- .width(tag_width+30)
- .focus();
- //$("#gRenameTagForm").parent().height( $("#gRenameTagForm").height() );
- $("#gRenameTagForm a").bind("click", closeEditInPlaceForms);
-
- ajaxify_editInPlaceForm = function() {
- $("#gRenameTagForm").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.result == "success") {
- closeEditInPlaceForms(); // close form
- $("#gTag-" + data.tag_id).text(data.new_tagname); // update tagname
- console.log(data);
- window.location.reload();
- } else if (data.result == "error") {
- $("#gRenameTagForm #name")
- .addClass("gError")
- .focus();
- $("#gTagAdmin").before("<p id=\"gEditErrorMessage\" class=\"gError\">" + data.message + "</p>");
- }
- }
- });
- };
- ajaxify_editInPlaceForm();
-}
-
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php
index d9488e1c..49512daa 100644
--- a/modules/tag/models/tag.php
+++ b/modules/tag/models/tag.php
@@ -102,4 +102,18 @@ class Tag_Model extends ORM {
}
return $result;
}
+
+ /**
+ * Return the server-relative url to this item, eg:
+ * /gallery3/index.php/tags/35
+ *
+ * @param string $query the query string (eg "page=3")
+ */
+ public function url($query=null) {
+ $url = url::site("tags/$this->id");
+ if ($query) {
+ $url .= "?$query";
+ }
+ return $url;
+ }
} \ No newline at end of file
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index 8f3693aa..b637a7f1 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -1,64 +1,59 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script>
- var TAG_RENAME_URL = <?= html::js_string(url::site("admin/tags/rename/__ID__")) ?>;
+<script type="text/javascript">
$("document").ready(function() {
// using JS for adding link titles to avoid running t() for each tag
- $("#gTagAdmin .tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>);
- $("#gTagAdmin .delete-link").attr("title", $(".delete-link:first span").html());
+ $("#g-tag-admin .g-tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>);
+ $("#g-tag-admin .g-delete-link").attr("title", $(".g-delete-link:first span").html());
// In-place editing for tag admin
- $(".gEditable").bind("click", editInPlace);
+ $(".g-editable").gallery_in_place_edit({
+ form_url: <?= html::js_string(url::site("admin/tags/form_rename/__ID__")) ?>
+ });
});
- // make some values available within tag.js
- var csrf_token = "<?= $csrf ?>";
- var save_i18n = <?= html::js_string(t("save")->for_html_attr()) ?>;
- var cancel_i18n = <?= html::js_string(t("cancel")->for_html_attr()) ?>;
</script>
-<div class="gBlock">
- <h2>
- <?= t("Tag Admin") ?>
- </h2>
- <? $tags_per_column = $tags->count()/5 ?>
- <? $column_tag_count = 0 ?>
+<? $tags_per_column = $tags->count()/5 ?>
+<? $column_tag_count = 0 ?>
- <table id="gTagAdmin" class="gBlockContent">
- <caption class="understate">
- <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
- </caption>
- <tr>
- <td>
+<div class="g-block">
+ <h1> <?= t("Tag Admin") ?> </h1>
+
+ <div class="g-block-content">
+ <table id="g-tag-admin">
+ <caption>
+ <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
+ </caption>
+ <tr>
+ <td>
<? foreach ($tags as $i => $tag): ?>
<? $current_letter = strtoupper(mb_substr($tag->name, 0, 1)) ?>
<? if ($i == 0): /* first letter */ ?>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
<? elseif ($last_letter != $current_letter): /* new letter */ ?>
+ </ul>
<? if ($column_tag_count > $tags_per_column): /* new column */ ?>
- </td>
- <td>
<? $column_tag_count = 0 ?>
+ </td>
+ <td>
<? endif ?>
-
- </ul>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
<? endif ?>
-
- <li>
- <span id="gTag-<?= $tag->id ?>" class="gEditable tag-name"><?= html::clean($tag->name) ?></span>
- <span class="understate">(<?= $tag->count ?>)</span>
- <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
- class="gDialogLink delete-link gButtonLink">
- <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
- </li>
-
+ <li>
+ <span class="g-editable g-tag-name" rel="<?= $tag->id ?>"><?= html::clean($tag->name) ?></span>
+ <span class="g-understate">(<?= $tag->count ?>)</span>
+ <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
+ class="g-dialog-link g-delete-link g-button">
+ <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
+ </li>
<? $column_tag_count++ ?>
<? $last_letter = $current_letter ?>
- <? endforeach /* $tags */ ?>
- </ul>
- </td>
- </tr>
- </table>
+ <? endforeach ?>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php
index 59a4ef88..00b57360 100644
--- a/modules/tag/views/tag_block.html.php
+++ b/modules/tag/views/tag_block.html.php
@@ -1,17 +1,29 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script>
- $("#gAddTagForm").ready(function() {
- var url = $("#gTagCloud").attr("title") + "/autocomplete";
- $("#gAddTagForm input:text").autocomplete(
+<script type="text/javascript">
+ $("#g-add-tag-form").ready(function() {
+ var url = $("#g-tag-cloud").attr("ref") + "/autocomplete";
+ $("#g-add-tag-form input:text").autocomplete(
url, {
max: 30,
multiple: true,
- multipleSeparator: ',',
- cacheLength: 1}
+ multipleSeparator: ',',
+ cacheLength: 1
+ }
);
+ $("#g-add-tag-form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.result == "success") {
+ $.get($("#g-tag-cloud").attr("ref"), function(data, textStatus) {
+ $("#g-tag-cloud").html(data);
+ });
+ }
+ $("#g-add-tag-form").resetForm();
+ }
+ });
});
</script>
-<div id="gTagCloud" title="<?= url::site("tags") ?>">
+<div id="g-tag-cloud" ref="<?= url::site("tags") ?>">
<?= $cloud ?>
</div>
<?= $form ?> \ No newline at end of file
diff --git a/modules/tag/views/tag_cloud.html.php b/modules/tag/views/tag_cloud.html.php
index d6a0b5f8..de12bb49 100644
--- a/modules/tag/views/tag_cloud.html.php
+++ b/modules/tag/views/tag_cloud.html.php
@@ -3,7 +3,7 @@
<? foreach ($tags as $tag): ?>
<li class="size<?=(int)(($tag->count / $max_count) * 7) ?>">
<span><?= $tag->count ?> photos are tagged with </span>
- <a href="<?= url::site("tags/$tag->id") ?>"><?= html::clean($tag->name) ?></a>
+ <a href="<?= $tag->url() ?>"><?= html::clean($tag->name) ?></a>
</li>
<? endforeach ?>
</ul>
diff --git a/modules/user/config/identity.php b/modules/user/config/identity.php
new file mode 100644
index 00000000..f9f013aa
--- /dev/null
+++ b/modules/user/config/identity.php
@@ -0,0 +1,37 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+/*
+ * @package Identity
+ *
+ * User settings, defined as arrays, or "groups". If no group name is
+ * used when loading the cache library, the group named "default" will be used.
+ *
+ * Each group can be used independently, and multiple groups can be used at once.
+ *
+ * Group Options:
+ * driver - User backend driver. Gallery comes with Gallery user driver.
+ * allow_updates - Flag to indicate that the back end allows updates.
+ * params - Driver parameters, specific to each driver.
+ */
+$config["user"] = array (
+ "driver" => "gallery",
+ "allow_updates" => true,
+ "params" => array(),
+);
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index 0b748955..cc2d881e 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -21,19 +21,22 @@ class Admin_Users_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->content = new View("admin_users.html");
- $view->content->users = ORM::factory("user")->orderby("name")->find_all();
- $view->content->groups = ORM::factory("group")->orderby("name")->find_all();
+ $view->content->users = ORM::factory("user")
+ ->orderby("name", "ASC")
+ ->find_all();
+ $view->content->groups = ORM::factory("group")
+ ->orderby("name", "ASC")
+ ->find_all();
print $view;
}
public function add_user() {
access::verify_csrf();
- $form = user::get_add_form_admin();
+ $form = $this->_get_user_add_form_admin();
$valid = $form->validate();
$name = $form->add_user->inputs["name"]->value;
- $user = ORM::factory("user")->where("name", $name)->find();
- if ($user->loaded) {
+ if ($user = user::lookup_by_name($name)) {
$form->add_user->inputs["name"]->add_error("in_use", 1);
$valid = false;
}
@@ -60,22 +63,24 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function add_user_form() {
- print user::get_add_form_admin();
+ $v = new View("user_form.html");
+ $v->form = $this->_get_user_add_form_admin();
+ print $v;
}
public function delete_user($id) {
access::verify_csrf();
- if ($id == user::active()->id || $id == user::guest()->id) {
+ if ($id == identity::active_user()->id || $id == user::guest()->id) {
access::forbidden();
}
- $user = ORM::factory("user", $id);
- if (!$user->loaded) {
+ $user = user::lookup($id);
+ if (empty($user)) {
kohana::show_404();
}
- $form = user::get_delete_form_admin($user);
+ $form = $this->_get_user_delete_form_admin($user);
if($form->validate()) {
$name = $user->name;
$user->delete();
@@ -91,31 +96,28 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function delete_user_form($id) {
- $user = ORM::factory("user", $id);
- if (!$user->loaded) {
+ $user = user::lookup($id);
+ if (empty($user)) {
kohana::show_404();
}
- print user::get_delete_form_admin($user);
+ print $this->_get_user_delete_form_admin($user);
}
public function edit_user($id) {
access::verify_csrf();
- $user = ORM::factory("user", $id);
- if (!$user->loaded) {
+ $user = user::lookup($id);
+ if (empty($user)) {
kohana::show_404();
}
- $form = user::get_edit_form_admin($user);
+ $form = $this->_get_user_edit_form_admin($user);
$valid = $form->validate();
if ($valid) {
$new_name = $form->edit_user->inputs["name"]->value;
+ $temp_user = user::lookup_by_name($new_name);
if ($new_name != $user->name &&
- ORM::factory("user")
- ->where("name", $new_name)
- ->where("id !=", $user->id)
- ->find()
- ->loaded) {
+ ($temp_user && $temp_user->id != $user->id)) {
$form->edit_user->inputs["name"]->add_error("in_use", 1);
$valid = false;
} else {
@@ -136,7 +138,7 @@ class Admin_Users_Controller extends Admin_Controller {
}
// An admin can change the admin status for any user but themselves
- if ($user->id != user::active()->id) {
+ if ($user->id != identity::active_user()->id) {
$user->admin = $form->edit_user->admin->checked;
}
$user->save();
@@ -151,50 +153,51 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function edit_user_form($id) {
- $user = ORM::factory("user", $id);
- if (!$user->loaded) {
+ $user = user::lookup($id);
+ if (empty($user)) {
kohana::show_404();
}
- $form = user::get_edit_form_admin($user);
+ $v = new View("user_form.html");
+ $v->form = $this->_get_user_edit_form_admin($user);
// Don't allow the user to control their own admin bit, else you can lock yourself out
- if ($user->id == user::active()->id) {
- $form->edit_user->admin->disabled(1);
+ if ($user->id == identity::active_user()->id) {
+ $v->form->edit_user->admin->disabled(1);
}
- print $form;
+ print $v;
}
public function add_user_to_group($user_id, $group_id) {
access::verify_csrf();
- $group = ORM::factory("group", $group_id);
- $user = ORM::factory("user", $user_id);
+ $group = group::lookup($group_id);
+ $user = user::lookup($user_id);
$group->add($user);
$group->save();
}
public function remove_user_from_group($user_id, $group_id) {
access::verify_csrf();
- $group = ORM::factory("group", $group_id);
- $user = ORM::factory("user", $user_id);
+ $group = group::lookup($group_id);
+ $user = user::lookup($user_id);
$group->remove($user);
$group->save();
}
public function group($group_id) {
$view = new View("admin_users_group.html");
- $view->group = ORM::factory("group", $group_id);
+ $view->group = group::lookup($group_id);
print $view;
}
public function add_group() {
access::verify_csrf();
- $form = group::get_add_form_admin();
+ $form = $this->_get_group_add_form_admin();
$valid = $form->validate();
if ($valid) {
$new_name = $form->add_group->inputs["name"]->value;
- $group = ORM::factory("group")->where("name", $new_name)->find();
- if ($group->loaded) {
+ $group = group::lookup_by_name($new_name);
+ if (!empty($group)) {
$form->add_group->inputs["name"]->add_error("in_use", 1);
$valid = false;
}
@@ -213,18 +216,18 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function add_group_form() {
- print group::get_add_form_admin();
+ print $this->_get_group_add_form_admin();
}
public function delete_group($id) {
access::verify_csrf();
- $group = ORM::factory("group", $id);
- if (!$group->loaded) {
+ $group = group::lookup($id);
+ if (empty($group)) {
kohana::show_404();
}
- $form = group::get_delete_form_admin($group);
+ $form = $this->_get_group_delete_form_admin($group);
if ($form->validate()) {
$name = $group->name;
$group->delete();
@@ -240,27 +243,28 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function delete_group_form($id) {
- $group = ORM::factory("group", $id);
- if (!$group->loaded) {
+ $group = group::lookup($id);
+ if (empty($group)) {
kohana::show_404();
}
- print group::get_delete_form_admin($group);
+
+ print $this->_get_group_delete_form_admin($group);
}
public function edit_group($id) {
access::verify_csrf();
- $group = ORM::factory("group", $id);
- if (!$group->loaded) {
- kohana::show_404();
+ $group = group::lookup($id);
+ if (empty($group)) {
+ kohana::show_404();
}
- $form = group::get_edit_form_admin($group);
+ $form = $this->_get_group_edit_form_admin($group);
$valid = $form->validate();
if ($valid) {
$new_name = $form->edit_group->inputs["name"]->value;
- $group = ORM::factory("group")->where("name", $new_name)->find();
+ $group = group::lookup_by_name($name);
if ($group->loaded) {
$form->edit_group->inputs["name"]->add_error("in_use", 1);
$valid = false;
@@ -282,12 +286,118 @@ class Admin_Users_Controller extends Admin_Controller {
}
public function edit_group_form($id) {
- $group = ORM::factory("group", $id);
- if (!$group->loaded) {
+ $group = group::lookup($id);
+ if (empty($group)) {
kohana::show_404();
}
- print group::get_edit_form_admin($group);
+ print $this->_get_group_edit_form_admin($group);
+ }
+
+ /* User Form Definitions */
+ static function _get_user_edit_form_admin($user) {
+ $form = new Forge(
+ "admin/users/edit_user/$user->id", "", "post", array("id" => "g-edit-user-form"));
+ $group = $form->group("edit_user")->label(t("Edit user"));
+ $group->input("name")->label(t("Username"))->id("g-username")->value($user->name);
+ $group->inputs["name"]->error_messages(
+ "in_use", t("There is already a user with that username"));
+ $group->input("full_name")->label(t("Full name"))->id("g-fullname")->value($user->full_name);
+ self::_add_locale_dropdown($group, $user);
+ $group->password("password")->label(t("Password"))->id("g-password");
+ $group->password("password2")->label(t("Confirm password"))->id("g-password2")
+ ->matches($group->password);
+ $group->input("email")->label(t("Email"))->id("g-email")->value($user->email);
+ $group->input("url")->label(t("URL"))->id("g-url")->value($user->url);
+ $group->checkbox("admin")->label(t("Admin"))->id("g-admin")->checked($user->admin);
+ $form->add_rules_from($user);
+ $minimum_length = module::get_var("user", "mininum_password_length", 5);
+ $form->edit_user->password
+ ->rules($minimum_length ? "length[$minimum_length, 40]" : "length[40]");
+
+ module::event("user_edit_form_admin", $user, $form);
+ $group->submit("")->value(t("Modify User"));
+ return $form;
+ }
+
+ static function _get_user_add_form_admin() {
+ $form = new Forge("admin/users/add_user", "", "post", array("id" => "g-add-user-form"));
+ $group = $form->group("add_user")->label(t("Add user"));
+ $group->input("name")->label(t("Username"))->id("g-username")
+ ->error_messages("in_use", t("There is already a user with that username"));
+ $group->input("full_name")->label(t("Full name"))->id("g-fullname");
+ $group->password("password")->label(t("Password"))->id("g-password");
+ $group->password("password2")->label(t("Confirm password"))->id("g-password2")
+ ->matches($group->password);
+ $group->input("email")->label(t("Email"))->id("g-email");
+ $group->input("url")->label(t("URL"))->id("g-url");
+ self::_add_locale_dropdown($group);
+ $group->checkbox("admin")->label(t("Admin"))->id("g-admin");
+ $form->add_rules_from(ORM::factory("user"));
+
+ $minimum_length = module::get_var("user", "mininum_password_length", 5);
+ $form->add_user->password
+ ->rules($minimum_length ? "required|length[$minimum_length, 40]" : "length[40]");
+
+ module::event("user_add_form_admin", $user, $form);
+ $group->submit("")->value(t("Add User"));
+ return $form;
+ }
+
+ private function _add_locale_dropdown(&$form, $user=null) {
+ $locales = locales::installed();
+ foreach ($locales as $locale => $display_name) {
+ $locales[$locale] = SafeString::of_safe_html($display_name);
+ }
+ if (count($locales) > 1) {
+ // Put "none" at the first position in the array
+ $locales = array_merge(array("" => t("« none »")), $locales);
+ $selected_locale = ($user && $user->locale) ? $user->locale : "";
+ $form->dropdown("locale")
+ ->label(t("Language Preference"))
+ ->options($locales)
+ ->selected($selected_locale);
+ }
+ }
+
+ private function _get_user_delete_form_admin($user) {
+ $form = new Forge("admin/users/delete_user/$user->id", "", "post",
+ array("id" => "g-delete-user-form"));
+ $group = $form->group("delete_user")->label(
+ t("Are you sure you want to delete user %name?", array("name" => $user->name)));
+ $group->submit("")->value(t("Delete user %name", array("name" => $user->name)));
+ return $form;
}
+ /* Group Form Definitions */
+ private function _get_group_edit_form_admin($group) {
+ $form = new Forge("admin/users/edit_group/$group->id", "", "post", array("id" => "g-edit-group-form"));
+ $form_group = $form->group("edit_group")->label(t("Edit group"));
+ $form_group->input("name")->label(t("Name"))->id("g-name")->value($group->name);
+ $form_group->inputs["name"]->error_messages(
+ "in_use", t("There is already a group with that name"));
+ $form_group->submit("")->value(t("Save"));
+ $form->add_rules_from($group);
+ return $form;
+ }
+
+ private function _get_group_add_form_admin() {
+ $form = new Forge("admin/users/add_group", "", "post", array("id" => "g-add-group-form"));
+ $form_group = $form->group("add_group")->label(t("Add group"));
+ $form_group->input("name")->label(t("Name"))->id("g-name");
+ $form_group->inputs["name"]->error_messages(
+ "in_use", t("There is already a group with that name"));
+ $form_group->submit("")->value(t("Add group"));
+ $form->add_rules_from(ORM::factory("group"));
+ return $form;
+ }
+
+ private function _get_group_delete_form_admin($group) {
+ $form = new Forge("admin/users/delete_group/$group->id", "", "post",
+ array("id" => "g-delete-group-form"));
+ $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("")->value(t("Delete"));
+ return $form;
+ }
}
diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php
index 92608dcd..5f36b554 100644
--- a/modules/user/controllers/password.php
+++ b/modules/user/controllers/password.php
@@ -32,10 +32,8 @@ class Password_Controller extends Controller {
if (request::method() == "post") {
$this->_change_password();
} else {
- $user = ORM::factory("user")
- ->where("hash", Input::instance()->get("key"))
- ->find();
- if ($user->loaded) {
+ $user = user::lookup_by_hash(Input::instance()->get("key"));
+ if (!empty($user)) {
print $this->_new_password_form($user->hash);
} else {
throw new Exception("@todo FORBIDDEN", 503);
@@ -48,7 +46,7 @@ class Password_Controller extends Controller {
$valid = $form->validate();
if ($valid) {
- $user = ORM::factory("user")->where("name", $form->reset->inputs["name"]->value)->find();
+ $user = user::lookup_by_name($form->reset->inputs["name"]->value);
if (!$user->loaded || empty($user->email)) {
$form->reset->inputs["name"]->add_error("no_email", 1);
$valid = false;
@@ -85,9 +83,9 @@ class Password_Controller extends Controller {
}
private function _reset_form() {
- $form = new Forge(url::current(true), "", "post", array("id" => "gResetForm"));
+ $form = new Forge(url::current(true), "", "post", array("id" => "g-reset-form"));
$group = $form->group("reset")->label(t("Reset Password"));
- $group->input("name")->label(t("Username"))->id("gName")->class(null)->rules("required");
+ $group->input("name")->label(t("Username"))->id("g-name")->class(null)->rules("required");
$group->inputs["name"]->error_messages("no_email", t("No email, unable to reset password"));
$group->submit("")->value(t("Reset"));
@@ -97,36 +95,35 @@ class Password_Controller extends Controller {
private function _new_password_form($hash=null) {
$template = new Theme_View("page.html", "reset");
- $form = new Forge("password/do_reset", "", "post", array("id" => "gChangePasswordForm"));
+ $form = new Forge("password/do_reset", "", "post", array("id" => "g-change-password-form"));
$group = $form->group("reset")->label(t("Change Password"));
$hidden = $group->hidden("hash");
if (!empty($hash)) {
$hidden->value($hash);
}
- $group->password("password")->label(t("Password"))->id("gPassword")
- ->rules("required|length[1,40]");
- $group->password("password2")->label(t("Confirm Password"))->id("gPassword2")
+ $minimum_length = module::get_var("user", "mininum_password_length", 5);
+ $input_password = $group->password("password")->label(t("Password"))->id("g-password")
+ ->rules($minimum_length ? "required|length[$minimum_length, 40]" : "length[40]");
+ $group->password("password2")->label(t("Confirm Password"))->id("g-password2")
->matches($group->password);
$group->inputs["password2"]->error_messages(
"mistyped", t("The password and the confirm password must match"));
$group->submit("")->value(t("Update"));
- $template->content = $form;
+ $template->content = new View("user_form.html");
+ $template->content->form = $form;
return $template;
}
private function _change_password() {
$view = $this->_new_password_form();
- if ($view->content->validate()) {
- $user = ORM::factory("user")
- ->where("hash", $view->content->reset->hash->value)
- ->find();
-
- if (!$user->loaded) {
+ if ($view->content->form->validate()) {
+ $user = user::lookup_by_hash(Input::instance()->post("hash"));
+ if (empty($user)) {
throw new Exception("@todo FORBIDDEN", 503);
}
- $user->password = $view->content->reset->password->value;
+ $user->password = $view->content->form->reset->password->value;
$user->hash = null;
$user->save();
message::success(t("Password reset successfully"));
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index 4ad704f0..ca218393 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -17,15 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Users_Controller extends REST_Controller {
- protected $resource_type = "user";
+class Users_Controller extends Controller {
+ public function update($id) {
+ $user = user::lookup($id);
- public function _update($user) {
- if ($user->guest || $user->id != user::active()->id) {
+ if ($user->guest || $user->id != identity::active_user()->id) {
access::forbidden();
}
- $form = user::get_edit_form($user);
+ $form = $this->_get_edit_form($user);
$valid = $form->validate();
if ($valid) {
$user->full_name = $form->edit_user->full_name->value;
@@ -57,11 +57,52 @@ class Users_Controller extends REST_Controller {
}
}
- public function _form_edit($user) {
- if ($user->guest || $user->id != user::active()->id) {
+ public function form_edit($id) {
+ $user = user::lookup($id);
+ if ($user->guest || $user->id != identity::active_user()->id) {
access::forbidden();
}
- print user::get_edit_form($user);
+ $v = new View("user_form.html");
+ $v->form = $this->_get_edit_form($user);
+ print $v;
+ }
+
+ private function _get_edit_form($user) {
+ $form = new Forge("users/update/$user->id", "", "post", array("id" => "g-edit-user-form"));
+ $group = $form->group("edit_user")->label(t("Edit User: %name", array("name" => $user->name)));
+ $group->input("full_name")->label(t("Full Name"))->id("g-fullname")->value($user->full_name);
+ self::_add_locale_dropdown($group, $user);
+ $group->password("password")->label(t("Password"))->id("g-password");
+ $group->password("password2")->label(t("Confirm Password"))->id("g-password2")
+ ->matches($group->password);
+ $group->input("email")->label(t("Email"))->id("g-email")->value($user->email);
+ $group->input("url")->label(t("URL"))->id("g-url")->value($user->url);
+ $form->add_rules_from($user);
+
+ $minimum_length = module::get_var("user", "mininum_password_length", 5);
+ $form->edit_user->password
+ ->rules($minimum_length ? "length[$minimum_length, 40]" : "length[40]");
+
+ module::event("user_edit_form", $user, $form);
+ $group->submit("")->value(t("Save"));
+ return $form;
+ }
+
+ /** @todo combine with Admin_Users_Controller::_add_locale_dropdown */
+ private function _add_locale_dropdown(&$form, $user=null) {
+ $locales = locales::installed();
+ foreach ($locales as $locale => $display_name) {
+ $locales[$locale] = SafeString::of_safe_html($display_name);
+ }
+ if (count($locales) > 1) {
+ // Put "none" at the first position in the array
+ $locales = array_merge(array("" => t("« none »")), $locales);
+ $selected_locale = ($user && $user->locale) ? $user->locale : "";
+ $form->dropdown("locale")
+ ->label(t("Language Preference"))
+ ->options($locales)
+ ->selected($selected_locale);
+ }
}
}
diff --git a/modules/user/css/user.css b/modules/user/css/user.css
new file mode 100644
index 00000000..084eac31
--- /dev/null
+++ b/modules/user/css/user.css
@@ -0,0 +1,119 @@
+/* User- and group-related form width ~~~~ */
+
+#g-login-form,
+#g-add-user-form
+#g-edit-user-form,
+#g-delete-user-form,
+#g-user-admin {
+ width: 270px;
+}
+
+/* User/group admin ~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-user-admin {
+ width: auto;
+}
+
+#g-group-admin {
+}
+
+#g-user-admin-list .g-admin {
+ color: #55f;
+ font-weight: bold;
+}
+
+.g-group {
+ display: block;
+ border: 1px solid #999;
+ margin: 0 1em 1em 0;
+ padding: 0;
+ width: 200px;
+}
+
+.g-group h4 {
+ background-color: #eee;
+ border-bottom: 1px dashed #ccc;
+ padding: .5em 0 .5em .5em;
+}
+
+.g-group .g-button {
+ padding: 0;
+}
+
+.g-group .g-member-list,
+.g-group div {
+ height: 180px;
+ margin: 1px;
+ overflow: auto;
+}
+
+.g-group p {
+ margin-top: 1em;
+ padding: .5em;
+ text-align: center;
+}
+
+.g-group .g-user {
+ padding: .2em 0 0 .5em;
+}
+
+.g-group .g-user .g-button {
+ vertical-align: middle;
+}
+
+.g-default-group h4,
+.g-default-group .g-user {
+ color: #999;
+}
+
+.g-group.ui-droppable {
+ padding: 0 !important;
+}
+
+/* Password strength meter ~~~~~~~~~~~~~~~ */
+
+.g-password-strength0 {
+ background: url(../images/progressImg1.png) no-repeat 0 0;
+ width: 138px;
+ height: 7px;
+}
+
+.g-password-strength10 {
+ background-position:0 -7px;
+}
+
+.g-password-strength20 {
+ background-position:0 -14px;
+}
+
+.g-password-strength30 {
+ background-position:0 -21px;
+}
+
+.g-password-strength40 {
+ background-position:0 -28px;
+}
+
+.g-password-strength50 {
+ background-position:0 -35px;
+}
+
+.g-password-strength60 {
+ background-position:0 -42px;
+}
+
+.g-password-strength70 {
+ background-position:0 -49px;
+}
+
+.g-password-strength80 {
+ background-position:0 -56px;
+}
+
+.g-password-strength90 {
+ background-position:0 -63px;
+}
+
+.g-password-strength100 {
+ background-position:0 -70px;
+}
diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php
index 04e6efd6..3aaf1b11 100644
--- a/modules/user/helpers/group.php
+++ b/modules/user/helpers/group.php
@@ -28,7 +28,7 @@ class group_Core {
* Create a new group.
*
* @param string $name
- * @return Group_Model
+ * @return Group_Definition the group object
*/
static function create($name) {
$group = ORM::factory("group")->where("name", $name)->find();
@@ -38,14 +38,13 @@ class group_Core {
$group->name = $name;
$group->save();
-
return $group;
}
/**
* The group of all possible visitors. This includes the guest user.
*
- * @return Group_Model
+ * @return Group_Definition the group object
*/
static function everybody() {
return model_cache::get("group", 1);
@@ -54,54 +53,47 @@ class group_Core {
/**
* The group of all logged-in visitors. This does not include guest users.
*
- * @return Group_Model
+ * @return Group_Definition the group object
*/
static function registered_users() {
return model_cache::get("group", 2);
}
/**
+ * Look up a group by id.
+ * @param integer $id the user id
+ * @return Group_Definition the group object, or null if the id was invalid.
+ */
+ static function lookup($id) {
+ return self::_lookup_by_field("id", $id);
+ }
+
+ /**
* Look up a group by name.
* @param integer $id the group name
- * @return Group_Model the group object, or null if the name was invalid.
+ * @return Group_Definition the group object, or null if the name was invalid.
*/
static function lookup_by_name($name) {
- $group = model_cache::get("group", $name, "name");
- if ($group->loaded) {
- return $group;
- }
- return null;
+ return self::_lookup_by_field("name", $name);
}
- static function get_edit_form_admin($group) {
- $form = new Forge("admin/users/edit_group/$group->id", "", "post", array("id" => "gEditGroupForm"));
- $form_group = $form->group("edit_group")->label(t("Edit Group"));
- $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("")->value(t("Save"));
- $form->add_rules_from($group);
- return $form;
- }
-
- static function get_add_form_admin() {
- $form = new Forge("admin/users/add_group", "", "post", array("id" => "gAddGroupForm"));
- $form_group = $form->group("add_group")->label(t("Add Group"));
- $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("")->value(t("Add Group"));
- $group = ORM::factory("group");
- $form->add_rules_from($group);
- return $form;
- }
-
- static function get_delete_form_admin($group) {
- $form = new Forge("admin/users/delete_group/$group->id", "", "post",
- array("id" => "gDeleteGroupForm"));
- $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("")->value(t("Delete"));
- return $form;
+ /**
+ * Search the groups by the field and value.
+ * @param string $field_name column to look up the user by
+ * @param string $value value to match
+ * @return Group_Definition the group object, or null if the name was invalid.
+ */
+ private static function _lookup_by_field($field_name, $value) {
+ try {
+ $user = model_cache::get("group", $value, $field_name);
+ if ($user->loaded) {
+ return $user;
+ }
+ } catch (Exception $e) {
+ if (strpos($e->getMessage(), "MISSING_MODEL") === false) {
+ throw $e;
+ }
+ }
+ return null;
}
}
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index b9162b92..f9f16da5 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -24,153 +24,6 @@
* Note: by design, this class does not do any permission checking.
*/
class user_Core {
- static function get_edit_form($user) {
- $form = new Forge("users/$user->id?_method=put", "", "post", array("id" => "gEditUserForm"));
- $group = $form->group("edit_user")->label(t("Edit User: %name", array("name" => $user->name)));
- $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name);
- self::_add_locale_dropdown($group, $user);
- $group->password("password")->label(t("Password"))->id("gPassword");
- $group->password("password2")->label(t("Confirm Password"))->id("gPassword2")
- ->matches($group->password);
- $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
- $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
- $form->add_rules_from($user);
-
- module::event("user_edit_form", $user, $form);
- $group->submit("")->value(t("Save"));
- return $form;
- }
-
- static function get_edit_form_admin($user) {
- $form = new Forge(
- "admin/users/edit_user/$user->id", "", "post", array("id" => "gEditUserForm"));
- $group = $form->group("edit_user")->label(t("Edit User"));
- $group->input("name")->label(t("Username"))->id("gUsername")->value($user->name);
- $group->inputs["name"]->error_messages(
- "in_use", t("There is already a user with that username"));
- $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name);
- self::_add_locale_dropdown($group, $user);
- $group->password("password")->label(t("Password"))->id("gPassword");
- $group->password("password2")->label(t("Confirm Password"))->id("gPassword2")
- ->matches($group->password);
- $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
- $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url);
- $group->checkbox("admin")->label(t("Admin"))->id("gAdmin")->checked($user->admin);
- $form->add_rules_from($user);
- $form->edit_user->password->rules("-required");
-
- module::event("user_edit_form_admin", $user, $form);
- $group->submit("")->value(t("Modify User"));
- return $form;
- }
-
- static function get_add_form_admin() {
- $form = new Forge("admin/users/add_user", "", "post", array("id" => "gAddUserForm"));
- $group = $form->group("add_user")->label(t("Add User"));
- $group->input("name")->label(t("Username"))->id("gUsername")
- ->error_messages("in_use", t("There is already a user with that username"));
- $group->input("full_name")->label(t("Full Name"))->id("gFullName");
- $group->password("password")->label(t("Password"))->id("gPassword");
- $group->password("password2")->label(t("Confirm Password"))->id("gPassword2")
- ->matches($group->password);
- $group->input("email")->label(t("Email"))->id("gEmail");
- $group->input("url")->label(t("URL"))->id("gUrl");
- self::_add_locale_dropdown($group);
- $group->checkbox("admin")->label(t("Admin"))->id("gAdmin");
- $user = ORM::factory("user");
- $form->add_rules_from($user);
-
- module::event("user_add_form_admin", $user, $form);
- $group->submit("")->value(t("Add User"));
- return $form;
- }
-
- private static function _add_locale_dropdown(&$form, $user=null) {
- $locales = locales::installed();
- foreach ($locales as $locale => $display_name) {
- $locales[$locale] = SafeString::of_safe_html($display_name);
- }
- if (count($locales) > 1) {
- // Put "none" at the first position in the array
- $locales = array_merge(array("" => t("« none »")), $locales);
- $selected_locale = ($user && $user->locale) ? $user->locale : "";
- $form->dropdown("locale")
- ->label(t("Language Preference"))
- ->options($locales)
- ->selected($selected_locale);
- }
- }
-
- static function get_delete_form_admin($user) {
- $form = new Forge("admin/users/delete_user/$user->id", "", "post",
- array("id" => "gDeleteUserForm"));
- $group = $form->group("delete_user")->label(
- t("Are you sure you want to delete user %name?", array("name" => $user->name)));
- $group->submit("")->value(t("Delete user %name", array("name" => $user->name)));
- return $form;
- }
-
- static function get_login_form($url) {
- $form = new Forge($url, "", "post", array("id" => "gLoginForm"));
- $group = $form->group("login")->label(t("Login"));
- $group->input("name")->label(t("Username"))->id("gUsername")->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("")->value(t("Login"));
- return $form;
- }
-
- /**
- * Make sure that we have a session and group_ids cached in the session.
- */
- static function load_user() {
- $session = Session::instance();
- if (!($user = $session->get("user"))) {
- $session->set("user", $user = user::guest());
- }
-
- // The installer cannot set a user into the session, so it just sets an id which we should
- // upconvert into a user.
- if ($user === 2) {
- $user = model_cache::get("user", 2);
- user::login($user);
- $session->set("user", $user);
- }
-
- if (!$session->get("group_ids")) {
- $ids = array();
- foreach ($user->groups as $group) {
- $ids[] = $group->id;
- }
- $session->set("group_ids", $ids);
- }
- }
-
- /**
- * Return the array of group ids this user belongs to
- *
- * @return array
- */
- static function group_ids() {
- return Session::instance()->get("group_ids", array(1));
- }
-
- /**
- * Return the active user. If there's no active user, return the guest user.
- *
- * @return User_Model
- */
- static function active() {
- // @todo (maybe) cache this object so we're not always doing session lookups.
- $user = Session::instance()->get("user", null);
- if (!isset($user)) {
- // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary
- // work.
- $user = user::guest();
- }
- return $user;
- }
-
/**
* Return the guest user.
*
@@ -183,18 +36,6 @@ class user_Core {
}
/**
- * Change the active user.
- *
- * @return User_Model
- */
- static function set_active($user) {
- $session = Session::instance();
- $session->set("user", $user);
- $session->delete("group_ids");
- self::load_user();
- }
-
- /**
* Create a new user.
*
* @param string $name
@@ -267,91 +108,69 @@ class user_Core {
}
/**
- * Log in as a given user.
- * @param object $user the user object.
- */
- static function login($user) {
- $user->login_count += 1;
- $user->last_login = time();
- $user->save();
-
- user::set_active($user);
- module::event("user_login", $user);
- }
-
- /**
- * Log out the active user and destroy the session.
- * @param object $user the user object.
- */
- static function logout() {
- $user = user::active();
- if (!$user->guest) {
- try {
- Session::instance()->destroy();
- } catch (Exception $e) {
- Kohana::log("error", $e);
- }
- module::event("user_logout", $user);
- }
- }
-
- /**
* Look up a user by id.
* @param integer $id the user id
* @return User_Model the user object, or null if the id was invalid.
*/
static function lookup($id) {
- $user = model_cache::get("user", $id);
- if ($user->loaded) {
- return $user;
- }
- return null;
+ return self::_lookup_user_by_field("id", $id);
}
/**
* Look up a user by name.
- * @param integer $id the user name
+ * @param integer $name the user name
* @return User_Model the user object, or null if the name was invalid.
*/
static function lookup_by_name($name) {
- $user = model_cache::get("user", $name, "name");
- if ($user->loaded) {
- return $user;
- }
- return null;
+ return self::_lookup_user_by_field("name", $name);
}
/**
- * Create a hashed password using md5 plus salt.
- * @param string $password plaintext password
- * @param string $salt (optional) salt or hash containing salt (randomly generated if omitted)
- * @return string hashed password
+ * Look up a user by hash.
+ * @param integer $hash the user hash value
+ * @return User_Model the user object, or null if the name was invalid.
*/
- private static function _md5Salt($password, $salt="") {
- if (empty($salt)) {
- for ($i = 0; $i < 4; $i++) {
- $char = mt_rand(48, 109);
- $char += ($char > 90) ? 13 : ($char > 57) ? 7 : 0;
- $salt .= chr($char);
+ static function lookup_by_hash($hash) {
+ return self::_lookup_user_by_field("hash", $hash);
+ }
+
+ /**
+ * List the users
+ * @param mixed filters (@see Database.php
+ * @return array the user list.
+ */
+ static function get_user_list($filter=array()) {
+ $user = ORM::factory("user");
+
+ foreach($filter as $method => $args) {
+ switch ($method) {
+ case "in":
+ $user->in($args[0], $args[1]);
+ break;
+ default:
+ $user->$method($args);
}
- } else {
- $salt = substr($salt, 0, 4);
}
- return $salt . md5($salt . $password);
+ return $user->find_all();
}
- static function cookie_locale() {
- $cookie_data = Input::instance()->cookie("g_locale");
- $locale = null;
- if ($cookie_data) {
- if (preg_match("/^([a-z]{2,3}(?:_[A-Z]{2})?)$/", trim($cookie_data), $matches)) {
- $requested_locale = $matches[1];
- $installed_locales = locales::installed();
- if (isset($installed_locales[$requested_locale])) {
- $locale = $requested_locale;
- }
+ /**
+ * Look up a user by field value.
+ * @param string search field
+ * @param string search value
+ * @return User_Core the user object, or null if the name was invalid.
+ */
+ private static function _lookup_user_by_field($field_name, $value) {
+ try {
+ $user = model_cache::get("user", $value, $field_name);
+ if ($user->loaded) {
+ return $user;
+ }
+ } catch (Exception $e) {
+ if (strpos($e->getMessage(), "MISSING_MODEL") === false) {
+ throw $e;
}
}
- return $locale;
+ return null;
}
} \ No newline at end of file
diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php
index ede4e515..cf91812e 100644
--- a/modules/user/helpers/user_event.php
+++ b/modules/user/helpers/user_event.php
@@ -17,37 +17,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class user_event_Core {
- /**
- * Initialization.
- */
- static function gallery_ready() {
- user::load_user();
- self::set_request_locale();
- }
+class user_event_Core {
static function admin_menu($menu, $theme) {
- $menu->add_after("appearance_menu",
- Menu::factory("link")
+ $menu->add_after("appearance_menu", Menu::factory("link")
->id("users_groups")
->label(t("Users/Groups"))
->url(url::site("admin/users")));
- }
- static function set_request_locale() {
- // 1. Check the session specific preference (cookie)
- $locale = user::cookie_locale();
- // 2. Check the user's preference
- if (!$locale) {
- $locale = user::active()->locale;
- }
- // 3. Check the browser's / OS' preference
- if (!$locale) {
- $locale = locales::locale_from_http_request();
- }
- // If we have any preference, override the site's default locale
- if ($locale) {
- I18n::instance()->locale($locale);
- }
+ return $menu;
}
}
diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php
index 8ef4f13d..0cba502f 100644
--- a/modules/user/helpers/user_installer.php
+++ b/modules/user/helpers/user_installer.php
@@ -70,9 +70,18 @@ class user_installer {
$admin->admin = true;
$admin->save();
- // Let the admin own everything
- $db->update("items", array("owner_id" => $admin->id), array("owner_id" => "IS NULL"));
- module::set_version("user", 1);
+ $current_provider = module::get_var("gallery", "identity_provider");
+ if (empty($current_provider)) {
+ // If there is no provider defined then we are doing an initial install
+ // so we need to set the provider and make the administrator own everything
+ // If the installer is called and there is an identity provider, then we
+ // are switching identity providers and and the event handlers will do the
+ // right things
+ module::set_var("gallery", "identity_provider", "user");
+
+ // Let the admin own everything
+ $db->query("update {items} set owner_id = {$admin->id}");
+ }
$root = ORM::factory("item", 1);
access::allow($everybody, "view", $root);
@@ -80,6 +89,18 @@ class user_installer {
access::allow($registered, "view", $root);
access::allow($registered, "view_full", $root);
+
+ module::set_var("user", "mininum_password_length", 5);
+
+ module::set_version("user", 2);
+ }
+
+ static function upgrade($version) {
+ if ($version == 1) {
+ module::set_var("user", "mininum_password_length", 5);
+
+ module::set_version("user", $version = 2);
+ }
}
static function uninstall() {
@@ -92,11 +113,6 @@ class user_installer {
$group->delete();
}
- try {
- Session::instance()->destroy();
- } catch (Exception $e) {
- // We don't care if there was a problem destroying the session.
- }
$db = Database::instance();
$db->query("DROP TABLE IF EXISTS {users};");
$db->query("DROP TABLE IF EXISTS {groups};");
diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php
index 098d87fd..31e2e8c0 100644
--- a/modules/user/helpers/user_theme.php
+++ b/modules/user/helpers/user_theme.php
@@ -19,35 +19,12 @@
*/
class user_theme_Core {
static function head($theme) {
- if (count(locales::installed())) {
- // Needed by the languages block
- $theme->script("jquery.cookie.js");
- }
- return "";
+ $theme->css("user.css");
+ $theme->script("password_strength.js");
}
- static function header_top($theme) {
- if ($theme->page_type != "login") {
- $view = new View("login.html");
- $view->user = user::active();
- return $view->render();
- }
+ static function admin_head($theme) {
+ $theme->css("user.css");
+ $theme->script("password_strength.js");
}
-
- static function sidebar_blocks($theme) {
- $locales = locales::installed();
- foreach ($locales as $locale => $display_name) {
- $locales[$locale] = SafeString::of_safe_html($display_name);
- }
- if (count($locales) > 1) {
- $block = new Block();
- $block->css_id = "gUserLanguageBlock";
- $block->title = t("Language Preference");
- $block->content = new View("user_languages_block.html");
- $block->content->installed_locales =
- array_merge(array("" => t("« none »")), $locales);
- $block->content->selected = (string) user::cookie_locale();
- return $block;
- }
- }
-}
+} \ No newline at end of file
diff --git a/modules/user/images/progressImg1.png b/modules/user/images/progressImg1.png
new file mode 100644
index 00000000..a9093647
--- /dev/null
+++ b/modules/user/images/progressImg1.png
Binary files differ
diff --git a/modules/user/js/password_strength.js b/modules/user/js/password_strength.js
new file mode 100644
index 00000000..2442b8de
--- /dev/null
+++ b/modules/user/js/password_strength.js
@@ -0,0 +1,39 @@
+(function($) {
+ // Based on the Password Strength Indictor By Benjamin Sterling
+ // http://benjaminsterling.com/password-strength-indicator-and-generator/
+ $.widget("ui.user_password_strength", {
+ _init: function() {
+ var self = this;
+ $(this.element).keyup(function() {
+ var strength = self.calculateStrength (this.value);
+ var index = Math.min(Math.floor( strength / 10 ), 10);
+ $("#g-password-gauge")
+ .removeAttr('class')
+ .addClass( "g-password-strength0" )
+ .addClass( self.options.classes[ index ] );
+ }).after("<div id='g-password-gauge' class='g-password-strength0'></div>");
+ },
+
+ calculateStrength: function(value) {
+ // Factor in the length of the password
+ var strength = Math.min(5, value.length) * 10 - 20;
+ // Factor in the number of numbers
+ strength += Math.min(3, value.length - value.replace(/[0-9]/g,"").length) * 10;
+ // Factor in the number of non word characters
+ strength += Math.min(3, value.length - value.replace(/\W/g,"").length) * 15;
+ // Factor in the number of Upper case letters
+ strength += Math.min(3, value.length - value.replace(/[A-Z]/g,"").length) * 10;
+
+ // Normalizxe between 0 and 100
+ return Math.max(0, Math.min(100, strength));
+ }
+ });
+ $.extend($.ui.user_password_strength, {
+ defaults: {
+ classes : ['g-password-strength10', 'g-password-strength20', 'g-password-strength30',
+ 'g-password-strength40', 'g-password-strength50', 'g-password-strength60',
+ 'g-password-strength70',' g-password-strength80',' g-password-strength90',
+ 'g-password-strength100']
+ }
+ });
+ })(jQuery);
diff --git a/modules/user/libraries/drivers/IdentityProvider/Gallery.php b/modules/user/libraries/drivers/IdentityProvider/Gallery.php
new file mode 100644
index 00000000..f02c53a2
--- /dev/null
+++ b/modules/user/libraries/drivers/IdentityProvider/Gallery.php
@@ -0,0 +1,161 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+/*
+ * Based on the Cache_Sqlite_Driver developed by the Kohana Team
+ */
+class IdentityProvider_Gallery_Driver implements IdentityProvider_Driver {
+ /**
+ * @see IdentityProvider_Driver::guest.
+ */
+ public function guest() {
+ return user::guest();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::guest.
+ */
+ public function admin_user() {
+ return self::lookup_user(2);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_user.
+ */
+ public function create_user($name, $full_name, $password) {
+ return user::create($name, $full_name, $password);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::is_correct_password.
+ */
+ public function is_correct_password($user, $password) {
+ $valid = $user->password;
+
+ // Try phpass first, since that's what we generate.
+ if (strlen($valid) == 34) {
+ require_once(MODPATH . "user/lib/PasswordHash.php");
+ $hashGenerator = new PasswordHash(10, true);
+ return $hashGenerator->CheckPassword($password, $valid);
+ }
+
+ $salt = substr($valid, 0, 4);
+ // Support both old (G1 thru 1.4.0; G2 thru alpha-4) and new password schemes:
+ $guess = (strlen($valid) == 32) ? md5($password) : ($salt . md5($salt . $password));
+ if (!strcmp($guess, $valid)) {
+ return true;
+ }
+
+ // Passwords with <&"> created by G2 prior to 2.1 were hashed with entities
+ $sanitizedPassword = html::specialchars($password, false);
+ $guess = (strlen($valid) == 32) ? md5($sanitizedPassword)
+ : ($salt . md5($salt . $sanitizedPassword));
+ if (!strcmp($guess, $valid)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user.
+ */
+ public function lookup_user($id) {
+ return user::lookup($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_user_by_name.
+ */
+ public function lookup_user_by_name($name) {
+ return user::lookup_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::create_group.
+ */
+ public function create_group($name) {
+ return group::create($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::everybody.
+ */
+ public function everybody() {
+ return group::everybody();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::registered_users.
+ */
+ public function registered_users() {
+ return group::registered_users();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group.
+ */
+ public function lookup_group($id) {
+ return group::lookup($id);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::lookup_group_by_name.
+ */
+ public function lookup_group_by_name($name) {
+ return group::lookup_by_name($name);
+ }
+
+ /**
+ * @see IdentityProvider_Driver::get_user_list.
+ */
+ public function get_user_list($ids) {
+ return ORM::factory("user")
+ ->in("id", $ids)
+ ->find_all()
+ ->as_array();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::groups.
+ */
+ public function groups() {
+ return ORM::factory("group")->find_all();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::add_user_to_group.
+ */
+ static function add_user_to_group($user, $group_id) {
+ $group = self::lookup_group($group_id);
+
+ $group->add($user);
+ $group->save();
+ }
+
+ /**
+ * @see IdentityProvider_Driver::remove_user_to_group.
+ */
+ static function remove_user_from_group($user, $group_id) {
+ $group = self::lookup_group_by_name($group_id);
+ $group->remove($user);
+ $group->save();
+ }
+} // End Identity Gallery Driver
+
diff --git a/modules/user/models/group.php b/modules/user/models/group.php
index 8af78012..4432fc69 100644
--- a/modules/user/models/group.php
+++ b/modules/user/models/group.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Group_Model extends ORM {
+class Group_Model extends ORM implements Group_Definition {
protected $has_and_belongs_to_many = array("users");
var $rules = array(
diff --git a/modules/user/models/user.php b/modules/user/models/user.php
index 55562f34..184ce70a 100644
--- a/modules/user/models/user.php
+++ b/modules/user/models/user.php
@@ -17,11 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class User_Model extends ORM {
+class User_Model extends ORM implements User_Definition {
protected $has_and_belongs_to_many = array("groups");
var $rules = array(
- "name" => "length[1,32]",
+ "name" => "required|length[1,32]",
"full_name" => "length[0,255]",
"email" => "valid_email|length[1,255]",
"password" => "length[1,40]",
@@ -82,4 +82,4 @@ class User_Model extends ORM {
public function display_name() {
return empty($this->full_name) ? $this->name : $this->full_name;
}
-} \ No newline at end of file
+}
diff --git a/modules/user/module.info b/modules/user/module.info
index 8a9af407..7178f108 100644
--- a/modules/user/module.info
+++ b/modules/user/module.info
@@ -1,3 +1,6 @@
name = "Users and Groups"
-description = "Provides user and group management"
-version = 1
+description = "Gallery 3 user and group management"
+version = 2
+
+; Don't show this module on the module administration screen
+no_module_admin = 1
diff --git a/modules/user/tests/No_Direct_ORM_Access_Test.php b/modules/user/tests/No_Direct_ORM_Access_Test.php
new file mode 100644
index 00000000..440321fa
--- /dev/null
+++ b/modules/user/tests/No_Direct_ORM_Access_Test.php
@@ -0,0 +1,77 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+require_once(MODPATH . "gallery/tests/Gallery_Filters.php");
+
+class No_Direct_ORM_Access_Test extends Unit_Test_Case {
+ public function no_access_to_users_table_test() {
+ $dir = new UserModuleFilterIterator(
+ new PhpCodeFilterIterator(
+ new GalleryCodeFilterIterator(
+ new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator(DOCROOT)))));
+ $errors = array();
+ foreach ($dir as $file) {
+ //if (basename(dirname($file)) == "helpers") {
+ $file_as_string = file_get_contents($file);
+ if (preg_match("/ORM::factory\\(\"user\"/", $file_as_string)) {
+ foreach (split("\n", $file_as_string) as $l => $line) {
+ if (preg_match('/ORM::factory\\(\"user\"/', $line)) {
+ $errors[] = "$file($l) => $line";
+ }
+ }
+ }
+ $file_as_string = null;
+ }
+ if ($errors) {
+ $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors));
+ }
+ }
+
+ public function no_access_to_groups_table_test() {
+ $dir = new UserModuleFilterIterator(
+ new PhpCodeFilterIterator(
+ new GalleryCodeFilterIterator(
+ new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator(DOCROOT)))));
+ $errors = array();
+ foreach ($dir as $file) {
+ $file_as_string = file_get_contents($file);
+ if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) {
+ foreach (split("\n", $file_as_string) as $l => $line) {
+ if (preg_match('/ORM::factory\\(\"group\"/', $line)) {
+ $errors[] = "$file($l) => $line";
+ }
+ }
+ }
+ $file_as_string = null;
+ }
+ if ($errors) {
+ $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors));
+ }
+ }
+
+}
+
+class UserModuleFilterIterator extends FilterIterator {
+ public function accept() {
+ $path_name = $this->getInnerIterator()->getPathName();
+ return strpos($path_name, "/modules/user") === false;
+ }
+}
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index c065e4b1..45d04916 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -2,15 +2,15 @@
<script type="text/javascript">
var add_user_to_group_url = "<?= url::site("admin/users/add_user_to_group/__USERID__/__GROUPID__?csrf=$csrf") ?>";
$(document).ready(function(){
- $("#gUserAdminList .core-info").draggable({
+ $("#g-user-admin-list .g-core-info").draggable({
helper: "clone"
});
- $("#gGroupAdmin .gGroup").droppable({
- accept: ".core-info",
- hoverClass: "gSelected",
+ $("#g-group-admin .g-group").droppable({
+ accept: ".g-core-info",
+ hoverClass: "g-selected",
drop: function(ev, ui) {
- var user_id = $(ui.draggable).attr("id").replace("user-", "");
- var group_id = $(this).attr("id").replace("group-", "");
+ var user_id = $(ui.draggable).attr("id").replace("g-user-", "");
+ var group_id = $(this).attr("id").replace("g-group-", "");
$.get(add_user_to_group_url.replace("__USERID__", user_id).replace("__GROUPID__", group_id),
{},
function() {
@@ -18,8 +18,8 @@
});
}
});
- $("#group-1").droppable("destroy");
- $("#group-2").droppable("destroy");
+ $("#g-group-1").droppable("destroy");
+ $("#g-group-2").droppable("destroy");
});
var reload_group = function(group_id) {
@@ -27,8 +27,8 @@
$.get(reload_group_url.replace("__GROUPID__", group_id),
{},
function(data) {
- $("#group-" + group_id).html(data);
- $("#group-" + group_id + " .gDialogLink").gallery_dialog();
+ $("#g-group-" + group_id).html(data);
+ $("#g-group-" + group_id + " .g-dialog-link").gallery_dialog();
});
}
@@ -41,88 +41,93 @@
});
}
</script>
-<div class="gBlock">
- <a href="<?= url::site("admin/users/add_user_form") ?>"
- class="gDialogLink gButtonLink right ui-icon-left ui-state-default ui-corner-all"
- title="<?= t("Create a new user")->for_html_attr() ?>">
- <span class="ui-icon ui-icon-circle-plus"></span>
- <?= t("Add a new user") ?>
- </a>
- <h2>
- <?= t("User Admin") ?>
- </h2>
+<div class="g-block">
+ <h1> <?= t("Users and groups") ?> </h1>
- <div class="gBlockContent">
- <table id="gUserAdminList">
- <tr>
- <th><?= t("Username") ?></th>
- <th><?= t("Full name") ?></th>
- <th><?= t("Email") ?></th>
- <th><?= t("Last login") ?></th>
- <th><?= t("Actions") ?></th>
- </tr>
+ <div class="g-block-content">
- <? 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->url("images/avatar.jpg", true)) ?>"
- title="<?= t("Drag user onto group below to add as a new member")->for_html_attr() ?>"
- alt="<?= html::clean_attribute($user->name) ?>"
- width="20"
- height="20" />
- <?= html::clean($user->name) ?>
- </td>
- <td>
- <?= html::clean($user->full_name) ?>
- </td>
- <td>
- <?= html::clean($user->email) ?>
- </td>
- <td>
- <?= ($user->last_login == 0) ? "" : gallery::date($user->last_login) ?>
- </td>
- <td class="gActions">
- <a href="<?= url::site("admin/users/edit_user_form/$user->id") ?>"
- open_text="<?= t("close") ?>"
- class="gPanelLink gButtonLink ui-state-default ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-pencil"></span><span class="gButtonText"><?= t("edit") ?></span></a>
- <? if (user::active()->id != $user->id && !$user->guest): ?>
- <a href="<?= url::site("admin/users/delete_user_form/$user->id") ?>"
- class="gDialogLink gButtonLink ui-state-default ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-trash"></span><?= t("delete") ?></a>
- <? else: ?>
- <span title="<?= t("This user cannot be deleted")->for_html_attr() ?>"
- class="gButtonLink ui-state-disabled ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-trash"></span><?= t("delete") ?></span>
- <? endif ?>
- </td>
- </tr>
- <? endforeach ?>
- </table>
- </div>
-</div>
+ <div id="g-user-admin" class="g-block">
+ <a href="<?= url::site("admin/users/add_user_form") ?>"
+ class="g-dialog-link g-button g-right ui-icon-left ui-state-default ui-corner-all"
+ title="<?= t("Create a new user")->for_html_attr() ?>">
+ <span class="ui-icon ui-icon-circle-plus"></span>
+ <?= t("Add a new user") ?>
+ </a>
+
+ <h2> <?= t("Users") ?> </h2>
+
+ <div class="g-block-content">
+ <table id="g-user-admin-list">
+ <tr>
+ <th><?= t("Username") ?></th>
+ <th><?= t("Full name") ?></th>
+ <th><?= t("Email") ?></th>
+ <th><?= t("Last login") ?></th>
+ <th><?= t("Actions") ?></th>
+ </tr>
+
+ <? foreach ($users as $i => $user): ?>
+ <tr id="g-user-<?= $user->id ?>" class="<?= text::alternate("g-odd", "g-even") ?> g-user <?= $user->admin ? "g-admin" : "" ?>">
+ <td id="g-user-<?= $user->id ?>" class="g-core-info g-draggable">
+ <img src="<?= $user->avatar_url(20, $theme->url("images/avatar.jpg", true)) ?>"
+ title="<?= t("Drag user onto a group to add as a new member")->for_html_attr() ?>"
+ alt="<?= html::clean_attribute($user->name) ?>"
+ width="20"
+ height="20" />
+ <?= html::clean($user->name) ?>
+ </td>
+ <td>
+ <?= html::clean($user->full_name) ?>
+ </td>
+ <td>
+ <?= html::clean($user->email) ?>
+ </td>
+ <td>
+ <?= ($user->last_login == 0) ? "" : gallery::date($user->last_login) ?>
+ </td>
+ <td>
+ <a href="<?= url::site("admin/users/edit_user_form/$user->id") ?>"
+ open_text="<?= t("Close") ?>"
+ class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-pencil"></span><span class="g-button-text"><?= t("Edit") ?></span></a>
+ <? if (identity::active_user()->id != $user->id && !$user->guest): ?>
+ <a href="<?= url::site("admin/users/delete_user_form/$user->id") ?>"
+ class="g-dialog-link g-button ui-state-default ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-trash"></span><?= t("Delete") ?></a>
+ <? else: ?>
+ <span title="<?= t("This user cannot be deleted")->for_html_attr() ?>"
+ class="g-button ui-state-disabled ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-trash"></span><?= t("Delete") ?></span>
+ <? endif ?>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+ </div>
+ </div>
+
+ <div id="g-group-admin" class="g-block g-right ui-helper-clearfix">
+ <a href="<?= url::site("admin/users/add_group_form") ?>"
+ class="g-dialog-link g-button g-right ui-icon-left ui-state-default ui-corner-all"
+ title="<?= t("Create a new group")->for_html_attr() ?>">
+ <span class="ui-icon ui-icon-circle-plus"></span>
+ <?= t("Add a new group") ?>
+ </a>
-<div id="gGroupAdmin" class="gBlock">
- <a href="<?= url::site("admin/users/add_group_form") ?>"
- class="gDialogLink gButtonLink right ui-icon-left ui-state-default ui-corner-all"
- title="<?= t("Create a new group")->for_html_attr() ?>">
- <span class="ui-icon ui-icon-circle-plus"></span>
- <?= t("Add a new group") ?>
- </a>
+ <h2> <?= t("Groups") ?> </h2>
- <h2>
- <?= t("Group Admin") ?>
- </h2>
+ <div class="g-block-content">
+ <ul>
+ <? foreach ($groups as $i => $group): ?>
+ <li id="g-group-<?= $group->id ?>" class="g-group g-left <?= ($group->special ? "g-default-group" : "") ?>" />
+ <? $v = new View("admin_users_group.html"); $v->group = $group; ?>
+ <?= $v ?>
+ </li>
+ <? endforeach ?>
+ </ul>
+ </div>
+ </div>
- <div class="gBlockContent">
- <ul>
- <? foreach ($groups as $i => $group): ?>
- <li id="group-<?= $group->id ?>" class="gGroup <?= ($group->special ? "gDefaultGroup" : "") ?>" />
- <? $v = new View("admin_users_group.html"); $v->group = $group; ?>
- <?= $v ?>
- </li>
- <? endforeach ?>
- </ul>
</div>
</div>
diff --git a/modules/user/views/admin_users_group.html.php b/modules/user/views/admin_users_group.html.php
index 476e0817..b7e573b3 100644
--- a/modules/user/views/admin_users_group.html.php
+++ b/modules/user/views/admin_users_group.html.php
@@ -4,26 +4,26 @@
<? if (!$group->special): ?>
<a href="<?= url::site("admin/users/delete_group_form/$group->id") ?>"
title="<?= t("Delete the %name group", array("name" => $group->name))->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-trash"><?= t("delete") ?></span></a>
+ class="g-dialog-link g-button g-right">
+ <span class="ui-icon ui-icon-trash"><?= t("Delete") ?></span></a>
<? else: ?>
<a title="<?= t("This default group cannot be deleted")->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-state-disabled ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-trash"><?= t("delete") ?></span></a>
+ class="g-button g-right ui-state-disabled ui-icon-left">
+ <span class="ui-icon ui-icon-trash"><?= t("Delete") ?></span></a>
<? endif ?>
</h4>
<? if ($group->users->count() > 0): ?>
-<ul>
+<ul class="g-member-list">
<? foreach ($group->users as $i => $user): ?>
- <li class="gUser">
+ <li class="g-user">
<?= html::clean($user->name) ?>
<? if (!$group->special): ?>
<a href="javascript:remove_user(<?= $user->id ?>, <?= $group->id ?>)"
- class="gButtonLink ui-state-default ui-corner-all ui-icon-left"
+ class="g-button g-right ui-state-default ui-corner-all ui-icon-left"
title="<?= t("Remove %user from %group group",
array("user" => $user->name, "group" => $group->name))->for_html_attr() ?>">
- <span class="ui-icon ui-icon-closethick"><?= t("remove") ?></span>
+ <span class="ui-icon ui-icon-closethick"><?= t("Remove") ?></span>
</a>
<? endif ?>
</li>
@@ -31,8 +31,8 @@
</ul>
<? else: ?>
<div>
- <p>
- <?= t("Drag &amp; drop users from the User Admin above into this group box to add group members.") ?>
+ <p class="ui-state-disabled">
+ <?= t("Drag &amp; drop users from the \"Users\" list onto this group to add group members.") ?>
</p>
</div>
<? endif ?>
diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php
deleted file mode 100644
index bb670d51..00000000
--- a/modules/user/views/login.html.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<ul id="gLoginMenu">
- <? if ($user->guest): ?>
- <li class="first">
- <a href="<?= url::site("login/ajax") ?>"
- title="<?= t("Login to Gallery")->for_html_attr() ?>"
- id="gLoginLink"><?= t("Login") ?></a>
- </li>
- <? else: ?>
- <li class="first">
- <?= t('Logged in as %name', array('name' => html::mark_clean(
- '<a href="' . url::site("form/edit/users/{$user->id}") .
- '" title="' . t("Edit Your Profile")->for_html_attr() .
- '" id="gUserProfileLink" class="gDialogLink">' .
- html::clean($user->display_name()) . '</a>'))) ?>
- </li>
- <li>
- <a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(url::current(true))) ?>"
- id="gLogoutLink"><?= t("Logout") ?></a>
- </li>
- <? endif ?>
-</ul>
diff --git a/modules/user/views/login_ajax.html.php b/modules/user/views/login_ajax.html.php
deleted file mode 100644
index 56bc1cbd..00000000
--- a/modules/user/views/login_ajax.html.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<script type="text/javascript">
- $("#gLoginForm").ready(function() {
- $("#gForgotPasswordLink").click(function() {
- $.ajax({
- url: "<?= url::site("password/reset") ?>",
- success: function(data) {
- $("div#gLoginView").html(data);
- $("#ui-dialog-title-gDialog").html(<?= t("Reset Password")->for_js() ?>);
- ajaxify_login_reset_form();
- }
- });
- });
- });
-
- function ajaxify_login_reset_form() {
- $("#gLoginView form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.form) {
- $("#gLoginView form").replaceWith(data.form);
- ajaxify_login_reset_form();
- }
- if (data.result == "success") {
- $("#gDialog").dialog("close");
- window.location.reload();
- }
-
- }
- });
- };
-</script>
-<div id="gLoginView">
- <ul>
- <li>
- <div id="gLoginViewForm">
- <?= $form ?>
- </div>
- </li>
- <li>
- <a href="#" id="gForgotPasswordLink"><?= t("Forgot Your Password?") ?></a>
- </li>
- </ul>
-</div>
diff --git a/modules/user/views/reset_password.html.php b/modules/user/views/reset_password.html.php
index 92ca4917..3afca881 100644
--- a/modules/user/views/reset_password.html.php
+++ b/modules/user/views/reset_password.html.php
@@ -1,10 +1,10 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<html>
<head>
- <title><?= t("Password Reset Request") ?> </title>
+ <title><?= t("Password reset request") ?> </title>
</head>
<body>
- <h2><?= t("Password Reset Request") ?> </h2>
+ <h2><?= t("Password reset request") ?> </h2>
<p>
<?= t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
</p>
diff --git a/modules/user/views/user_form.html.php b/modules/user/views/user_form.html.php
new file mode 100644
index 00000000..039ae8a5
--- /dev/null
+++ b/modules/user/views/user_form.html.php
@@ -0,0 +1,7 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript">
+ $("form").ready(function(){
+ $('input[name="password"]').user_password_strength();
+ });
+</script>
+<?= $form ?>
diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php
index 423196ac..2a1d5f60 100644
--- a/modules/watermark/controllers/admin_watermarks.php
+++ b/modules/watermark/controllers/admin_watermarks.php
@@ -138,7 +138,7 @@ class Admin_Watermarks_Controller extends Admin_Controller {
if ($name = module::get_var("watermark", "name")) {
foreach (array("thumb", "resize") as $target) {
graphics::add_rule(
- "watermark", $target, "composite",
+ "watermark", $target, "gallery_graphics::composite",
array("file" => VARPATH . "modules/watermark/$name",
"width" => module::get_var("watermark", "width"),
"height" => module::get_var("watermark", "height"),
diff --git a/modules/watermark/helpers/watermark.php b/modules/watermark/helpers/watermark.php
index 170ee64c..60d5cb5d 100644
--- a/modules/watermark/helpers/watermark.php
+++ b/modules/watermark/helpers/watermark.php
@@ -23,7 +23,7 @@ class watermark_Core {
$range[$i] = "$i%";
}
- $form = new Forge("admin/watermarks/add", "", "post", array("id" => "gAddWatermarkForm"));
+ $form = new Forge("admin/watermarks/add", "", "post", array("id" => "g-add-watermark-form"));
$group = $form->group("add_watermark")->label(t("Upload Watermark"));
$group->upload("file")->label(t("Watermark"))->rules("allow[jpg,png,gif]|size[1MB]|required");
$group->dropdown("position")->label(t("Watermark Position"))
@@ -41,7 +41,7 @@ class watermark_Core {
$range[$i] = "$i%";
}
- $form = new Forge("admin/watermarks/edit", "", "post", array("id" => "gEditWatermarkForm"));
+ $form = new Forge("admin/watermarks/edit", "", "post", array("id" => "g-edit-watermark-form"));
$group = $form->group("edit_watermark")->label(t("Edit Watermark"));
$group->dropdown("position")->label(t("Watermark Position"))
->options(self::positions())
@@ -54,7 +54,7 @@ class watermark_Core {
}
static function get_delete_form() {
- $form = new Forge("admin/watermarks/delete", "", "post", array("id" => "gDeleteWatermarkForm"));
+ $form = new Forge("admin/watermarks/delete", "", "post", array("id" => "g-delete-watermark-form"));
$group = $form->group("delete_watermark")->label(t("Really delete Watermark?"));
$group->submit("")->value(t("Delete"));
return $form;
diff --git a/modules/watermark/module.info b/modules/watermark/module.info
index abd4a3cf..41a871bd 100644
--- a/modules/watermark/module.info
+++ b/modules/watermark/module.info
@@ -1,3 +1,3 @@
name = "Watermarks"
description = "Allows users to watermark their photos"
-version = 1
+version = 2
diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php
index ac69d21d..fc634b82 100644
--- a/modules/watermark/views/admin_watermarks.html.php
+++ b/modules/watermark/views/admin_watermarks.html.php
@@ -1,37 +1,39 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="#gWatermarks">
+<div class="g-block">
<h1> <?= t("Watermarks") ?> </h1>
<p>
<?= t("You can have one watermark for your Gallery. This watermark will be applied to all thumbnails and resized images, but it will not be applied to your full size images. To make sure that your guests can only see watermarked images, you should restrict access to your full size images.") ?>
</p>
- <? if (empty($name)): ?>
- <a href="<?= url::site("admin/watermarks/form_add") ?>"
- title="<?= t("Upload a watermark")->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-document-b"></span><?= t("Upload a watermark") ?></a>
- <? else: ?>
- <h2> <?= t("Active Watermark") ?> </h2>
- <p>
- <?= t("Note that changing this watermark will require you to rebuild all of your thumbnails and resized images.") ?>
- </p>
- <div>
- <div class="image">
- <img width="<?= $width ?>" height="<?= $height ?>" src="<?= $url ?>"/>
- <p>
- <?= t("Position: %position", array("position" => watermark::position($position))) ?>
- </p>
- <p>
- <?= t("Transparency: %transparency%", array("transparency" => module::get_var("watermark", "transparency"))) ?>
- </p>
- </div>
- <div class="controls">
- <a href="<?= url::site("admin/watermarks/form_edit") ?>"
- title="<?= t("Edit Watermark")->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-pencil"></span><?= t("edit") ?></a>
- <a href="<?= url::site("admin/watermarks/form_delete") ?>"
- title="<?= t("Delete Watermark")->for_html_attr() ?>"
- class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-trash"></span><?= t("delete") ?></a>
+ <div class="g-block-content">
+ <? if (empty($name)): ?>
+ <a href="<?= url::site("admin/watermarks/form_add") ?>"
+ title="<?= t("Upload a watermark")->for_html_attr() ?>"
+ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-document-b"></span><?= t("Upload a watermark") ?></a>
+ <? else: ?>
+ <h2> <?= t("Active watermark") ?> </h2>
+ <p>
+ <?= t("Note that changing this watermark will require you to rebuild all of your thumbnails and resized images.") ?>
+ </p>
+ <div>
+ <div class="g-photo">
+ <img width="<?= $width ?>" height="<?= $height ?>" src="<?= $url ?>" />
+ <p>
+ <?= t("Position: %position", array("position" => watermark::position($position))) ?>
+ </p>
+ <p>
+ <?= t("Transparency: %transparency%", array("transparency" => module::get_var("watermark", "transparency"))) ?>
+ </p>
+ </div>
+ <div class="controls">
+ <a href="<?= url::site("admin/watermarks/form_edit") ?>"
+ title="<?= t("Edit watermark")->for_html_attr() ?>"
+ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-pencil"></span><?= t("edit") ?></a>
+ <a href="<?= url::site("admin/watermarks/form_delete") ?>"
+ title="<?= t("Delete watermark")->for_html_attr() ?>"
+ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-trash"></span><?= t("delete") ?></a>
+ </div>
</div>
+ <? endif ?>
</div>
- <? endif ?>
</div>
diff --git a/robots.txt b/robots.txt
new file mode 100644
index 00000000..bc7b5ac9
--- /dev/null
+++ b/robots.txt
@@ -0,0 +1,13 @@
+User-agent: *
+Disallow: /application/
+Disallow: /installer/
+Disallow: /lib/
+Disallow: /modules/
+Disallow: /system/
+Disallow: /themes/
+Disallow: /var/logs/
+Disallow: /var/modules/
+Disallow: /var/resizes/
+Disallow: /var/thumbs/
+Disallow: /var/tmp/
+Disallow: /var/uploads/
diff --git a/system/core/Kohana.php b/system/core/Kohana.php
index c934b12b..8027975d 100644
--- a/system/core/Kohana.php
+++ b/system/core/Kohana.php
@@ -325,6 +325,14 @@ final class Kohana {
// Add SYSPATH as the last path
self::$include_paths[] = SYSPATH;
+
+ // Local fix for Kohana Ticket:2276
+ self::$internal_cache['find_file_paths'] = array();
+ if ( ! isset(self::$write_cache['find_file_paths']))
+ {
+ // Write cache at shutdown
+ self::$write_cache['find_file_paths'] = TRUE;
+ }
}
return self::$include_paths;
diff --git a/system/libraries/Database.php b/system/libraries/Database.php
index 2039371c..4cd29c58 100644
--- a/system/libraries/Database.php
+++ b/system/libraries/Database.php
@@ -1031,8 +1031,12 @@ class Database_Core {
$table = $this->from[0];
}
+ else
+ {
+ $table = $this->config['table_prefix'].$table;
+ }
- $sql = $this->driver->merge($this->config['table_prefix'].$table, array_keys($this->set), array_values($this->set));
+ $sql = $this->driver->merge($table, array_keys($this->set), array_values($this->set));
$this->reset_write();
return $this->query($sql);
@@ -1068,8 +1072,12 @@ class Database_Core {
$table = $this->from[0];
}
+ else
+ {
+ $table = $this->config['table_prefix'].$table;
+ }
- $sql = $this->driver->update($this->config['table_prefix'].$table, $this->set, $this->where);
+ $sql = $this->driver->update($table, $this->set, $this->where);
$this->reset_write();
return $this->query($sql);
diff --git a/themes/admin_default/css/fix-ie.css b/themes/admin_default/css/fix-ie.css
deleted file mode 100644
index 6bc2334c..00000000
--- a/themes/admin_default/css/fix-ie.css
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Fix display in IE 6 and 7
- */
-
-#gHeader,
-#gGroupAdmin,
-#gDeveloperTools,
-.gAvailable .gBlock {
- zoom: 1;
-}
-
-.gUnavailable {
- filter: alpha(opacity=40);
-}
-
-.gUnavailable:hover {
- filter: alpha(opacity=100);
-}
diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css
deleted file mode 100644
index de6d436e..00000000
--- a/themes/admin_default/css/screen.css
+++ /dev/null
@@ -1,1170 +0,0 @@
-/**
- * Gallery 3 Default Theme Screen Styles
- *
- * @requires YUI reset, font, grids CSS
- *
- * Sheet organization:
- * 1) Basic HTML elements
- * 2) Reusable classes
- * 3) Reusable content blocks
- * 4) Page layout containers
- * 5) Content blocks in specific layout containers
- * 6) Navigation and menus
- * 7) Browser hacks
- * 8) jQuery and jQuery UI
- * 9) Right-to-left language styles
- */
-
-/** *******************************************************************
- * 1) Basic HTML elements
- **********************************************************************/
-
-body, html {
- background-color: #ccc;
- font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
-}
-
-p {
- margin-bottom: 1em;
-}
-
-em {
- font-style: oblique;
-}
-
-h1, h2, h3, h4, h5, strong, th {
- font-weight: bold;
-}
-
-h1 {
- font-size: 1.7em;
-}
-
-#gSearchResults h1 {
- margin-bottom: 1em;
-}
-
-#gProgress h1 {
- font-size: 1.1em;
-}
-
-h2 {
- font-size: 1.4em;
-}
-
-#gSidebar .gBlock h2 {
- font-size: 1.2em;
-}
-
-#gSidebar .gBlock li {
- margin-bottom: .6em;
-}
-
-h3 {
- font-size: 1.2em;
-}
-
-/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-a,
-.gMenu a,
-#gDialog a,
-.gButtonLink,
-.gButtonLink:hover,
-.gButtonLink:active,
-a.ui-state-hover,
-input.ui-state-hover,
-button.ui-state-hover {
- color: #5382BF !important;
- text-decoration: none;
- -moz-outline-style: none;
-}
-
-a:hover,
-#gDialog a:hover {
- text-decoration: underline;
-}
-
-.gMenu a:hover {
- text-decoration: none;
-}
-
-#gDialog .gCancel {
- clear: none;
- float: left;
- margin: .3em 1em;
-}
-
-#gForgotPasswordLink {
- float: right;
- font-size: .9em;
-}
-
-#gDialog .gCancel {
- float: left;
-}
-
-/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-table {
- width: 100%;
-}
-
-#gContent table {
- margin: 1em 0 3em 0;
-}
-
-caption,
-th {
- text-align: left;
-}
-
-th,
-td {
- border: none;
- border-bottom: 1px solid #ccc;
- padding: .5em;
- vertical-align: top;
-}
-
-#gAdminMaintenance td {
- vertical-align: middle;
-}
-
-/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-fieldset {
- border: 1px solid #ccc;
- padding-bottom: .8em;
-}
-
-#gHeader fieldset,
-#gSidebar fieldset,
-.gShortForm fieldset {
- border: none;
-}
-
-legend {
- font-weight: bold;
- margin-left: 1em;
-}
-
-#gHeader legend,
-#gSidebar legend,
-#gContent #gSearchForm legend,
-input[type="hidden"],
-.gShortForm label {
- display: none;
-}
-
-label {
- cursor: help;
-}
-
-input[type="text"],
-input[type="password"] {
- width: 50%;
-}
-
-input[type="text"],
-input[type="password"],
-textarea {
- border: 1px solid #e8e8e8;
- border-top-color: #ccc;
- border-left-color: #ccc;
- color: #333;
-}
-
-textarea {
- width: 100%;
- height: 12em;
-}
-
-input:focus,
-textarea:focus,
-option:focus {
- background-color: #ffc;
- color: #000;
-}
-
-/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-form li {
- margin: 0 !important;
- padding: .3em 1.5em .3em 1em;
-}
-
-form ul ul {
- clear: both;
-}
-
-form ul ul li {
- float: left;
-}
-
-input,
-select,
-textarea {
- display: block;
- clear: both;
- padding: .2em;
-}
-
-input[type="submit"],
-input[type="reset"] {
- display: inline;
- clear: none;
- float: left;
-}
-
-/* Form validation ~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gValidationRule {
- font-size: 80%;
- margin-top: .5em;
-}
-
-form.gError input[type="text"],
-li.gError input[type="text"],
-form.gError input[type="password"],
-li.gError input[type="password"],
-form.gError input[type="checkbox"],
-li.gError input[type="checkbox"],
-form.gError input[type="radio"],
-li.gError input[type="radio"],
-form.gError textarea,
-li.gError textarea,
-form.gError select,
-li.gError select {
- border: 2px solid red;
-}
-
-/** *******************************************************************
- * 2) Reusable generic classes
- *********************************************************************/
-
-.inactive, .understate {
- color: #ccc;
- font-weight: normal;
-}
-
-.left {
- float: left;
- margin: 1em 1em 1em 0;
-}
-
-.right {
- float: right;
- margin: 1em 0 1em 1em;
-}
-
-.txtright {
- text-align: right;
-}
-
-/** *******************************************************************
- * 3) Reusable content blocks
- *********************************************************************/
-
-.gBlock {
- background-color: #fff;
- border: 1px solid #ccc;
- clear: both;
- margin-bottom: 2.5em;
- padding: 1em;
-}
-
-#gSidebar .gBlockContent {
- padding: 0;
-}
-
-.gBlock h2 {
- background-color: #e8e8e8;
- padding: .3em .8em;
-}
-
-.gBlockContent {
- margin-top: 1em;
-}
-
-.gSelected img,
-.gAvailable .gBlock img {
- float: left;
- margin: 0 1em 1em 0;
-}
-
-.rtl .gSelected img,
-.rtl .gAvailable .gBlock img {
- float: right;
-}
-
-.gSelected {
- background: #e8e8e8;
-}
-
-.gAvailable .gInstalledToolkit:hover {
- cursor: pointer;
- background: #eee;
-}
-
-.gAvailable .gButtonLink {
- width: 96%;
-}
-
-.gSelected .gButtonLink {
- display: none;
-}
-
-.gUnavailable {
- border-color: #999;
- opacity: 0.4;
-}
-
-.gOddRow {
- background-color: #eee;
-}
-
-.gEvenRow {
- background-color: #fff;
-}
-
-/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gMessage {
- width: 100%;
-}
-
-#gSiteStatus li,
-#gMessage li,
-.gModuleStatus {
- border: 1px solid #ccc;
- margin-bottom: .4em;
-}
-
-#gSiteStatus li {
- margin-bottom: 0;
- border: none;
- border-bottom: 1px solid #ccc;
-}
-
-.gModuleStatus {
- clear: both;
- margin-bottom: 1em;
-}
-
-.gError,
-.gInfo,
-.gSuccess,
-.gWarning {
- padding: .4em .5em .4em 30px;
-}
-
-.gError, tr.gError td.gError {
- background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%;
-}
-
-.gInfo {
- background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%;
-}
-
-.gSuccess {
- background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%;
-}
-
-.gWarning, tr.gWarning td.gWarning {
- background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%;
-}
-
-.gPager .gInfo,
-tr.gError,
-tr.gInfo,
-tr.gSuccess,
-tr.gWarning {
- background: none;
-}
-
-.gInfo td.gInfo {
- background-color: transparent;
-}
-
-.gSuccess td.gSuccess {
- background-color: transparent;
-}
-
-.gError td {
- background-color: #f6cbca;
-}
-
-.gWarning td {
- background-color: #fcf9ce;
-}
-
-/* Inline layout (forms, lists) ~~~~~~~~~~ */
-
-.gShortForm li {
- float: left;
- padding: .4em 0;
-}
-
-.gShortForm input[type="text"] {
- color: #666;
- padding: .3em .6em;
- width: 11em;
-}
-
-/*** ******************************************************************
- * 4) Page layout containers
- *********************************************************************/
-
-/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gView {
- background-color: #fff;
- border: 1px solid #ccc;
- border-bottom: none;
- min-width: 974px !important;
-}
-
-/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */
-
-#gHeader {
- background-color: #e8e8e8;
- border-bottom: 1px solid #ccc;
- font-size: .8em;
- margin-bottom: 20px;
- padding: 0 20px;
- position: relative;
-}
-
-#gContent {
- font-size: 1.1em;
- padding-left: 20px;
- width: 96%;
-}
-
-#gSidebar {
- background-color: #fff;
- font-size: .9em;
- padding: 0 20px;
- width: 220px;
-}
-
-#gFooter {
- background-color: #e8e8e8;
- border-top: 1px solid #ccc;
- font-size: .8em;
- margin-top: 20px;
- padding: 10px 20px;
-}
-
-/** *******************************************************************
- * 5) Content blocks in specific layout containers
- *********************************************************************/
-
-/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gHeader #gLogo {
- background: transparent url('../../../lib/images/logo.png') no-repeat 0 .5em;
- color: #A5A5A5 !important;
- display: block;
- height: 55px;
- padding-top: 5px;
- width: 105px;
-}
-
-#gHeader #gLogo:hover {
- color: #f60 !important;
- text-decoration: none;
-}
-
-#gHeader #gQuickSearchForm {
- clear: right;
- float: right;
- margin: 1em 0;
-}
-
-#gHeader #gQuickSearchForm input[type='text'] {
- width: 17em;
-}
-
-#gContent .gBlock h2 {
- background-color: transparent;
- padding-left: 0;
-}
-
-#gSidebar .gBlockContent {
- padding-left: 1em;
-}
-
-/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gHeader #gLoginMenu li,
-#gFooter #gCredits li {
- display: inline;
-}
-
-#gHeader #gLoginMenu li {
- padding-left: 1.2em;
-}
-
-#gFooter #gCredits li {
- padding-right: 1.2em;
-}
-
-#gContent #gSearchResults {
- margin-top: 1em;
- padding-top: 1em;
-}
-
-.gBlock .ui-dialog-titlebar {
- margin: -1em -1em 0;
-}
-
-#gSidebar .gBlock h2 {
- background: none;
-}
-
-#gPhotoStream {
- background-color: #e8e8e8;
-}
-
-#gPhotoStream .gBlockContent ul {
- border-right: 1px solid #e8e8e8;
- height: 135px;
- overflow: auto;
- overflow: -moz-scrollbars-horizontal; /* for FF */
- overflow-x: scroll; /* scroll horizontal */
- overflow-y: hidden; /* Hide vertical*/
-}
-
-#gContent #gPhotoStream .gItem {
- background-color: #fff;
- border: 1px solid #e8e8e8;
- border-right-color: #ccc;
- border-bottom-color: #ccc;
- float: left;
- height: 90px;
- overflow: hidden;
- text-align: center;
- width: 90px;
-}
-
-.rtl #gContent #gPhotoStream .gItem {
- float: right;
-}
-
-#gSiteStatus {
- margin-bottom: 0;
-}
-
-#gContent .gItem {
- background-color: #fff;
- border: 1px solid #e8e8e8;
- border-right-color: #ccc;
- border-bottom-color: #ccc;
- height: 90px;
- padding: 14px 8px;
- text-align: center;
- width: 90px;
-}
-
-#gAdminCommentsMenu {
- margin: 1em 0;
-}
-
-#gAdminCommentsMenu a {
- margin: 0;
- padding: .2em .6em;
-}
-
-#gAdminGraphics .gAvailable .gBlock {
- clear: none;
- float: left;
- height: 17em;
- margin-right: 1em;
- width: 30%;
-}
-
-.rtl #gAdminGraphics .gAvailable .gBlock {
- float: right;
- margin-left: 1em;
- margin-right: 0em;
-}
-
-#gSiteTheme,
-#gAdminTheme {
- float: left;
- width: 48%;
-}
-
-.rtl #gSiteTheme,
-.rtl #gAdminTheme {
- float: right;
-}
-
-#gSiteTheme {
- margin-right: 1em;
-}
-
-#gUserAdminList {
- margin-bottom: 1em;
-}
-#gUserAdminList td {
- vertical-align: bottom;
-}
-
-#gUserAdminList .gDraggable:hover {
- border: 1px dashed black;
-}
-
-#gUserAdminList .admin {
- color: #55f;
- font-weight: bold;
-}
-
-.gActions a,
-.gActions span {
- margin-right: 3em;
-}
-
-li.gGroup {
- float: left;
- display: block;
- width: 200px;
- border: 1px solid gray;
- padding: 0;
- margin: 0 1em 1em 0;
-}
-
-.rtl li.gGroup {
- float: right;
-}
-
-li.gGroup h4 {
- background-color: #eee;
- border-bottom: 1px dashed #ccc;
- padding: .5em 0 .5em .5em;
-}
-li.gGroup .gButtonLink {
- padding: 0;
-}
-li.gGroup ul, li.gGroup div {
- height: 180px;
- margin: 1px;
- overflow: auto;
- padding-top: .2em;
-}
-li.gGroup div p {
- color: gray;
- text-align: center;
- padding: 2em .5em 0 .5em
-}
-li.gGroup .gUser {
- padding: .2em 0 0 .5em;
-}
-li.gGroup .gUser .gButtonLink {
- vertical-align: middle;
-}
-
-li.gDefaultGroup h4, li.gDefaultGroup .gUser {
- color: gray;
-}
-
-#gAdminAdvancedSettings tr.setting:hover {
- background: #ffc;
-}
-
-/** *******************************************************************
- * 5) Navigation and menus
- *********************************************************************/
-
-#gSiteAdminMenu,
-#gTagCloud ul {
- font-size: 1.2em;
-}
-
-/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gHeader #gLoginMenu {
- color: #999;
- float: right;
- margin: 0;
- padding: 5px 0;
-}
-
-.rtl #gHeader #gLoginMenu {
- text-align: left;
-}
-
-/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gSiteAdminMenu {
- bottom: 0;
- display: none;
- font-size: 1.2em;
- left: 140px;
- position: absolute;
-}
-
-#gSiteAdminMenu ul {
- margin-bottom: 0;
-}
-
-/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gPager {
- clear: both;
- margin: 0;
- padding: 5px 0 !important;
- width: 100%;
-}
-
-.gPager li {
- float: left;
- margin: 0;
- width: 30%;
-}
-
-.gPager .gInfo {
- text-align: center;
- width: 40%;
-}
-
-/** *******************************************************************
- * 6) Browser hacks
- *********************************************************************/
-
-#gSiteAdminMenu:after,
-#gHeader:after,
-#gAdminCommentsMenu:after,
-#gGroupAdmin:after,
-.gSelected:after,
-.gAvailable .gBlock:after,
-#gModuleCreateForm ul li ul:after,
-#gDeveloperTools:after,
-#gPhotoStream:after,
-#gViewMenu:after {
- clear: both;
- content: ".";
- display: block;
- height: 0;
- visibility: hidden;
-}
-
-/** *******************************************************************
- * 7) jQuery and jQuery UI
- *********************************************************************/
-
-/* Superfish menu overrides ~~~~~~~~~~~~~~ */
-
-.sf-menu li li, .sf-menu li li ul li {
- background-color: #bdd2ff;
-}
-
-.sf-menu li:hover {
- background-color: #dfe9ff;
-}
-
-/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */
-
-.gLoadingLarge {
- background: #e8e8e8 url('../../../lib/images/loading-large.gif') no-repeat center center;
- font-size: 0;
-}
-
-.gDialogLoadingLarge {
- background: url('../../../lib/images/loading-large.gif') no-repeat center center !important;
- font-size: 0;
-}
-
-.gLoadingSmall {
- background: #e8e8e8 url('../../../lib/images/loading-small.gif') no-repeat center center;
- font-size: 0;
-}
-
-.gDraggable {
- cursor: move;
-}
-
-.gDropTarget {
- background-color: #cfdeff;
- border: 1px dotted #999;
- height: 100px;
- margin: 1em 0;
-}
-
-/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gPanel {
- display: none;
- padding: 1em;
-}
-
-#gPanel legend {
- display: none;
-}
-
-#gPanel fieldset {
- border: none;
-}
-
-.ui-draggable {
- cursor: move;
-}
-
-.gButtonSetVertical a {
- width: 8em !important;
-}
-
-#gAdminDashboard .ui-dialog-titlebar,
-#gAdminDashboardSidebar .ui-dialog-titlebar {
- padding: .2em .4em;
-}
-
-.ui-widget-overlay {
- background: #000;
- opacity: .7;
-}
-
-#gDialog {
- text-align: left;
-}
-
-#gDialog li {
- padding-left: 0;
-}
-
-#gDialog form input[type="text"],
-#gDialog form input[type="password"] {
- width: 100%;
-}
-
-#gDialog #gLoginForm,
-#gDialog #gAddUserForm,
-#gDialog #gAddGroupForm {
- margin: 0 auto;
- width: 270px;
-}
-
-#gDialog fieldset {
- border: none;
-}
-
-#gDialog legend {
- display: none;
-}
-
-/* jQuery UI ThemeRoller buttons */
-
-.gButtonLink {
- display: inline-block;
- margin: 0 4px 0 0;
- padding: .2em .4em;
- outline: 0;
-}
-
-.gButtonSet {
- padding-left: 1px;
-}
-
-.gButtonSet li {
- float: left;
-}
-
-.gButtonSet .gButtonLink {
- margin: 0;
-}
-
-.ui-icon-left .ui-icon {
- float: left;
- margin-right: .2em;
-}
-
-.ui-icon-right .ui-icon {
- float: right;
- margin-left: .2em;
-}
-
-.ui-icon-rotate-ccw {
- background-position: -192px -64px;
-}
-
-.ui-icon-rotate-cw {
- background-position: -208px -64px;
-}
-
-/*************** STUFF THAT NEEDS A HOME ****************/
-
-#gMove ul {
- padding-left: 1em;
-}
-
-#gMove .selected {
- background: #999;
-}
-
-.gProgressBar {
- height: 1em;
- width: 100%;
- margin-top: .5em;
- display: inline-block;
-}
-
-#gAddPhotos p {
- margin: 0;
- padding: 0;
-}
-
-#gAddPhotosCanvas {
- height: 325px;
- width: 450px;
- overflow: auto;
-}
-
-#gAddPhotosQueue .progressbar {
- height: 4px;
-}
-
-#gAddPhotosQueue .title {
- font-size: 1.25em;
-}
-
-#gAddPhotosQueue .status {
- font-size: .75em;
-}
-
-#gAddPhotosQueue .box {
- margin-bottom: 8px;
- padding: 4px;
-}
-
-#gAddPhotosQueue .pending {
- background-color: #e8e8e8;
- border: 1px solid #d7d7d7;
-}
-
-#gAddPhotosQueue .error {
- background-color: #fcc;
- border: 1px solid #ebb;
-}
-
-#gAddPhotosQueue .uploading {
- background-color: #ff9;
- border: 1px solid #ee8;
-}
-
-#gAddPhotosQueue .complete {
- background-color: #cfc;
- border: 1px solid #beb;
-}
-
-#gAdminG2ImportNotes {
- padding-bottom: 20px;
-}
-
-#gAdminG2ImportDetails {
- padding-top: 20px;
-}
-
-#gAdminG2ImportDetails .gWarning {
- margin-top: 4px;
-}
-
-#gAdminG2ImportDetails .gInfo {
- padding: 2px;
- border: 1px solid #999;
- margin-bottom: 10px;
-}
-
-#gAdminG2ImportNotes p,
-#gAdminG2ImportDetails .gInfo p {
- padding: 0;
- margin: 0;
-}
-
-#gAdminG2ImportNotes ul li,
-#gAdminG2Import .gInfo ul li {
- padding-left: 0;
- margin-left: 20px;
- list-style-type: disc;
-}
-
-#gTagAdmin {
- table-layout: fixed;
-}
-
-#gTagAdmin td {
- border: 0;
-}
-
-#gTagAdmin ul {
- padding-bottom: .3em;
-}
-
-#gTagAdmin li {
- padding: .1em 0 .2em .3em;
-}
-
-#gTagAdmin .gColumn {
- float: left;
- width: 200px;
-}
-
-.rtl #gTagAdmin .gColumn {
- float: right;
-}
-
-.gEditable {
- padding: .1em .3em .2em .3em;
-}
-
-.gEditable:hover {
- background-color: #ffc;
- cursor: text;
-}
-
-#gRenameTagForm input {
- padding: 0 .2em 0 .2em;
- clear: none;
- float: left;
- margin: 0 .2em 0 0;
-}
-
-.rtl #gRenameTagForm input {
- float: right;
-}
-
-#gRenameTagForm input[type="text"].gError {
- border: 2px solid red;
- background: none;
-}
-
-#gRenameTagForm input[type="submit"] {
- height: 25px;
-}
-
-#gRenameTagForm a, #gRenameTagForm span {
- display: block;
- float: left;
- padding: .2em .2em 0 .1em;
-}
-
-.rtl #gRenameTagForm a, #gRenameTagForm span {
- float: right;
-}
-
-#gTaskLogDialog h1 {
- font-size: 1.1em;
-}
-
-.gTaskLog {
- border: 1pt solid;
- font-size: .9em;
- height: 400px;
- margin: .5em 0;
- overflow: auto;
- padding: .5em
-}
-
-#gServerAddAdmin {
- margin:auto;
- text-align: left;
-}
-
-.rtl #gServerAddAdmin {
- text-align: right;
-}
-
-#gServerAddAdmin form fieldset {
- border: medium none;
-}
-
-#gServerAddAdmin legend {
- display: none;
-}
-
-#gServerAddAdmin .gWarning {
- background-color: #FFFF99;
-}
-
-#gAuthorizedPath {
- margin: 0 !important;
- padding: 0.3em 1.5em 0.3em 1em;
-}
-
-#gServerAdd Admin #path {
- width: 80%;
-}
-
-.gRemoveDir:hover {
- cursor: pointer;
-}
-
-#gLanguagesForm table {
- width: 400px;
- float: left;
- margin: 0 3em 1em 0;
-}
-
-#gLanguagesForm .installed {
- background-color: #EEEEEE;
-}
-
-#gLanguagesForm .default {
- background-color: #C5DBEC;
- font-weight: bold;
-}
-
-#gLanguagesForm input {
- clear: both;
-}
-
-#gTranslations {
- padding: 2em 0 0 0;
- clear: both;
-}
-
-#gTranslations .gButtonLink {
- padding: .5em;
-}
-
-.gDocLink {
- float: right;
-}
-
-/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */
-
-.rtl {
- direction: rtl;
-}
-
-.rtl caption,
-.rtl th,
-.rtl #gDialog {
- text-align: right;
-}
-
-.rtl .txtright {
- text-align: left;
-}
-
-.rtl #gHeader #gQuickSearchForm,
-.rtl #gForgotPasswordLink,
-.rtl #gHeader #gLoginMenu,
-.rtl .ui-icon-right .ui-icon {
- clear: left;
- float: left;
-}
-
-.rtl #gDialog .gCancel,
-.rtl form ul ul li,
-.rtl input[type="submit"],
-.rtl input[type="reset"],
-.rtl .gShortForm li,
-.rtl #gContent #gAlbumGrid .gItem,
-.rtl #gSiteAdminMenu,
-.rtl .gPager li,
-.rtl .gButtonSet li,
-.rtl .ui-icon-left .ui-icon {
- float: right;
-}
diff --git a/themes/admin_default/images/avatar.jpg b/themes/admin_default/images/avatar.jpg
deleted file mode 100644
index 2e76b12b..00000000
--- a/themes/admin_default/images/avatar.jpg
+++ /dev/null
Binary files differ
diff --git a/themes/admin_default/images/ico-view-hybrid.png b/themes/admin_default/images/ico-view-hybrid.png
deleted file mode 100644
index ee902e55..00000000
--- a/themes/admin_default/images/ico-view-hybrid.png
+++ /dev/null
Binary files differ
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js
deleted file mode 100644
index 1e09fd9f..00000000
--- a/themes/admin_default/js/ui.init.js
+++ /dev/null
@@ -1,59 +0,0 @@
-$(document).ready(function(){
- // Initialize Superfish menus
- $("#gSiteAdminMenu ul.gMenu").addClass("sf-menu");
- $("ul.gMenu").addClass("sf-menu");
- $("ul.sf-menu").superfish({
- delay: 500,
- animation: {
- opacity: "show",
- height: "show"
- },
- pathClass: "current",
- speed: "fast"
- });
- $("#gSiteAdminMenu").css("display", "block");
-
- // Initialize status message effects
- $("#gMessage li").gallery_show_message();
-
- // Initialize modal dialogs
- $(".gDialogLink").gallery_dialog();
-
- // Initialize ajax links
- $(".gDialogLink").gallery_ajax();
-
- // Initialize panels
- $(".gPanelLink").gallery_panel();
-
- if ($("#gPhotoStream").length) {
- // Vertically align thumbs in photostream
- $(".gItem").gallery_valign();
- }
-
- // Apply jQuery UI button css to submit inputs
- $("input[type=submit]:not(.gShortForm input)").addClass("ui-state-default ui-corner-all");
-
- // Round view menu buttons
- if ($("#gAdminCommentsMenu").length) {
- $("#gAdminCommentsMenu ul").removeClass("gMenu").removeClass("sf-menu");
- $("#gAdminCommentsMenu").addClass("gButtonSet");
- $("#gAdminCommentsMenu a").addClass("gButtonLink ui-state-default");
- $("#gAdminCommentsMenu ul li:first a").addClass("ui-corner-left");
- $("#gAdminCommentsMenu ul li:last a").addClass("ui-corner-right");
- }
-
- // Round corners
- $(".gSelected").addClass("ui-corner-all");
- $(".gAvailable .gBlock").addClass("ui-corner-all");
- $(".gUnavailable").addClass("ui-corner-all");
-
- // Add hover state for buttons
- $(".ui-state-default").hover(
- function() {
- $(this).addClass("ui-state-hover");
- },
- function() {
- $(this).removeClass("ui-state-hover");
- }
- );
-});
diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php
deleted file mode 100644
index 5034ec19..00000000
--- a/themes/admin_default/views/pager.html.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? // See http://docs.kohanaphp.com/libraries/pagination ?>
-<ul class="gPager">
- <? /* @todo This message isn't easily localizable */
- $from_to_msg = t2("Item %from_number of %count",
- "Items %from_number - %to_number of %count",
- $total_items,
- array("from_number" => $current_first_item,
- "to_number" => $current_last_item,
- "count" => $total_items)) ?>
- <li>
- <? if ($first_page): ?>
- <a href="<?= str_replace('{page}', 1, $url) ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-first"></span><?= t("first") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-seek-first"></span><?= t("first") ?></a>
- <? endif ?>
- <? if ($previous_page): ?>
- <a href="<?= str_replace('{page}', $previous_page, $url) ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-prev"></span><?= t("previous") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-seek-prev"></span><?= t("previous") ?></a>
- <? endif ?>
- </li>
- <li class="gInfo"><?= $from_to_msg ?></li>
- <li class="txtright">
- <? if ($next_page): ?>
- <a href="<?= str_replace('{page}', $next_page, $url) ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-next"></span><?= t("next") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-state-disabled ui-icon-right ui-corner-all">
- <span class="ui-icon ui-icon-seek-next"></span><?= t("next") ?></a>
- <? endif ?>
- <? if ($last_page): ?>
- <a href="<?= str_replace('{page}', $last_page, $url) ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-end"></span><?= t("last") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-state-disabled ui-icon-right ui-corner-all">
- <span class="ui-icon ui-icon-seek-end"></span><?= t("last") ?></a>
- <? endif ?>
- </li>
-</ul>
diff --git a/themes/admin_wind/css/fix-ie.css b/themes/admin_wind/css/fix-ie.css
new file mode 100644
index 00000000..5475cb79
--- /dev/null
+++ b/themes/admin_wind/css/fix-ie.css
@@ -0,0 +1,18 @@
+/**
+ * Fix display in IE 6 and 7
+ */
+
+.g-unavailable {
+ filter: alpha(opacity=40);
+}
+
+.g-unavailable:hover {
+ filter: alpha(opacity=100);
+}
+
+tr.g-error td,
+tr.g-info td,
+tr.g-success td,
+tr.g-warning td {
+ background: none !important;
+}
diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css
new file mode 100644
index 00000000..73ec8ac5
--- /dev/null
+++ b/themes/admin_wind/css/screen.css
@@ -0,0 +1,480 @@
+/**
+ * Gallery 3 Admin Wind Theme Screen Styles
+ *
+ * @requires YUI reset, font, grids CSS
+ *
+ * Sheet organization:
+ * 1) Basic HTML elements
+ * 2) Reusable content blocks
+ * 3) Page layout containers
+ * 4) Content blocks in specific layout containers
+ * 5) Navigation and menus
+ * 6) jQuery and jQuery UI
+ * 7) Right-to-left language styles
+ *
+ * @todo Review g-buttonset-vertical
+ */
+
+/** *******************************************************************
+ * 1) Basic HTML elements
+ **********************************************************************/
+
+body, html {
+ background-color: #ccc;
+ font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
+}
+
+p {
+ margin-bottom: 1em;
+}
+
+em {
+ font-style: oblique;
+}
+
+h1, h2, h3, h4, h5, strong, th {
+ font-weight: bold;
+}
+
+h1 {
+ font-size: 1.7em;
+}
+
+#g-dialog h1 {
+ font-size: 1.1em;
+}
+
+h2 {
+ font-size: 1.4em;
+}
+
+#g-sidebar .g-block h2 {
+ font-size: 1.2em;
+}
+
+#g-sidebar .g-block li {
+ margin-bottom: .6em;
+}
+
+h3 {
+ font-size: 1.2em;
+}
+
+/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+a,
+.g-menu a,
+#g-dialog a,
+.g-button,
+.g-button:hover,
+.g-button:active,
+a.ui-state-hover,
+input.ui-state-hover,
+button.ui-state-hover {
+ color: #5382BF !important;
+ text-decoration: none;
+ -moz-outline-style: none;
+}
+
+a:hover,
+#g-dialog a:hover {
+ text-decoration: underline;
+}
+
+.g-menu a:hover {
+ text-decoration: none;
+}
+
+/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+fieldset {
+ margin-bottom: 1em;
+}
+
+#g-content form ul li {
+ padding: .4em 0;
+}
+
+#g-dialog form {
+ width: 270px;
+}
+
+#g-dialog fieldset {
+ margin-bottom: 0;
+}
+
+/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+table {
+ width: 100%;
+}
+
+#g-content table {
+ margin: .6em 0 2em 0;
+}
+
+caption,
+th {
+ text-align: left;
+}
+
+th,
+td {
+ border: none;
+ border-bottom: 1px solid #ccc;
+ padding: .5em;
+ vertical-align: middle;
+}
+
+th {
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+/** *******************************************************************
+ * 2) Reusable content blocks
+ *********************************************************************/
+
+.g-block,
+#g-content #g-admin-dashboard .g-block {
+ background-color: #fff;
+ border: 1px solid #ccc;
+ padding: 1em;
+}
+
+.g-block h2 {
+ background-color: #e8e8e8;
+ padding: .3em .8em;
+}
+
+.g-block-content {
+ margin-top: 1em;
+}
+
+#g-content .g-block {
+ border: none;
+ padding: 0;
+}
+
+#g-sidebar .g-block-content {
+ padding: 0;
+}
+
+#g-content .g-selected,
+#g-content .g-available .g-block {
+ border: 1px solid #ccc;
+ padding: .8em;
+}
+
+.g-selected img,
+.g-available .g-block img {
+ float: left;
+ margin: 0 1em 1em 0;
+}
+
+.g-selected {
+ background: #e8e8e8;
+}
+
+.g-available .g-installed-toolkit:hover {
+ cursor: pointer;
+ background: #eee;
+}
+
+.g-available .g-button {
+ width: 96%;
+}
+
+.g-selected .g-button {
+ display: none;
+}
+
+.g-unavailable {
+ border-color: #999;
+ opacity: 0.4;
+}
+
+.g-info td {
+ background-color: transparent;
+ background-image: none;
+}
+
+.g-success td {
+ background-color: transparent;
+ background-image: none;
+}
+
+.g-error td {
+ background-color: #f6cbca;
+ background-image: none;
+}
+
+.g-warning td {
+ background-color: #fcf9ce;
+ background-image: none;
+}
+
+.g-module-status.g-info,
+#g-log-entries .g-info,
+.g-module-status.g-success,
+#g-log-entries .g-success {
+ background-color: #fff;
+}
+
+/*** ******************************************************************
+ * 3) Page layout containers
+ *********************************************************************/
+
+/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-header #g-login-menu {
+ margin-top: 1em;
+}
+
+/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-view {
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-bottom: none;
+ min-width: 974px !important;
+}
+
+/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-header {
+ background-color: #e8e8e8;
+ border-bottom: 1px solid #ccc;
+ font-size: .8em;
+ margin-bottom: 20px;
+ padding: 0 20px;
+ position: relative;
+}
+
+#g-content {
+ font-size: 1.1em;
+ padding: 0 2em;
+ width: 96%;
+}
+
+#g-sidebar {
+ background-color: #fff;
+ font-size: .9em;
+ padding: 0 20px;
+ width: 220px;
+}
+
+#g-footer {
+ background-color: #e8e8e8;
+ border-top: 1px solid #ccc;
+ font-size: .8em;
+ margin-top: 20px;
+ padding: 10px 20px;
+}
+
+/** *******************************************************************
+ * 4) Content blocks in specific layout containers
+ *********************************************************************/
+
+/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-header #g-logo {
+ background: transparent url('../../../lib/images/logo.png') no-repeat 0 .5em;
+ color: #A5A5A5 !important;
+ display: block;
+ height: 65px;
+ padding-top: 5px;
+ width: 105px;
+}
+
+#g-header #g-logo:hover {
+ color: #f60 !important;
+ text-decoration: none;
+}
+
+#g-content .g-block h2 {
+ background-color: transparent;
+ padding-left: 0;
+}
+
+#g-sidebar .g-block-content {
+ padding-left: 1em;
+}
+
+.g-block .ui-dialog-titlebar {
+ margin: -1em -1em 0;
+}
+
+#g-sidebar .g-block h2 {
+ background: none;
+}
+
+/* Photo stream ~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-photo-stream {
+ background-color: #e8e8e8;
+}
+
+#g-photo-stream .g-block-content ul {
+ border-right: 1px solid #e8e8e8;
+ height: 135px;
+ overflow: auto;
+ overflow: -moz-scrollbars-horizontal; /* for FF */
+ overflow-x: scroll; /* scroll horizontal */
+ overflow-y: hidden; /* Hide vertical*/
+}
+
+#g-content #g-photo-stream .g-item {
+ background-color: #fff;
+ border: 1px solid #e8e8e8;
+ border-right-color: #ccc;
+ border-bottom-color: #ccc;
+ float: left;
+ height: 90px;
+ overflow: hidden;
+ text-align: center;
+ width: 90px;
+}
+
+#g-content .g-item {
+ background-color: #fff;
+ border: 1px solid #e8e8e8;
+ border-right-color: #ccc;
+ border-bottom-color: #ccc;
+ height: 90px;
+ padding: 14px 8px;
+ text-align: center;
+ width: 90px;
+}
+
+/* Graphics settings ~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-admin-graphics .g-available .g-block {
+ clear: none;
+ float: left;
+ margin-right: 1em;
+ width: 30%;
+}
+
+/* Appearance settings ~~~~~~~~~~~~~~~~~~~ */
+
+#g-site-theme,
+#g-admin-theme {
+ float: left;
+ width: 48%;
+}
+
+#g-site-theme {
+ margin-right: 1em;
+}
+
+/* Block admin ~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-admin-blocks-list {
+ float: left;
+ margin: 0 2em 2em 0;
+ width: 30%;
+}
+
+.g-admin-blocks-list div:last-child {
+ border: .1em solid;
+ height: 100%;
+}
+
+.g-admin-blocks-list ul {
+ height: 98%;
+ margin: .1em .1em;
+ padding: .1em;
+}
+
+.g-admin-blocks-list ul li.g-draggable {
+ background-color: #e8e8e8;
+ margin: .5em;
+ padding: .3em .8em;
+}
+
+/* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */
+#g-in-place-edit-message {
+ background-color: #FFF;
+}
+
+/** *******************************************************************
+ * 5) Navigation and menus
+ *********************************************************************/
+
+/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-site-admin-menu {
+ bottom: 0;
+ font-size: 1.2em;
+ left: 140px;
+ position: absolute;
+}
+
+#g-site-admin-menu ul {
+ margin-bottom: 0;
+}
+
+/** *******************************************************************
+ * 6) jQuery and jQuery UI
+ *********************************************************************/
+
+/* Superfish menu overrides ~~~~~~~~~~~~~~ */
+
+.sf-menu li li,
+.sf-menu li li ul li {
+ background-color: #bdd2ff;
+}
+
+.sf-menu li:hover {
+ background-color: #dfe9ff;
+}
+
+/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-admin-dashboard .ui-state-highlight,
+#g-sidebar .ui-state-highlight {
+ height: 2em;
+ margin-bottom: 1em;
+}
+
+.g-buttonset-vertical a {
+ width: 8em !important;
+}
+
+#g-admin-dashboard .ui-dialog-titlebar,
+#g-admin-dashboard-sidebar .ui-dialog-titlebar {
+ padding: .2em .4em;
+}
+
+/** *******************************************************************
+ * 7) Right to left styles
+ *********************************************************************/
+
+.rtl #g-content #g-album-grid .g-item,
+.rtl #g-site-theme,
+.rtl #g-admin-theme,
+.rtl .g-selected img,
+.rtl .g-available .g-block img,
+.rtl #g-content #g-photo-stream .g-item,
+.rtl li.g-group,
+.rtl #g-server-add-admin {
+ float: right;
+}
+
+.rtl #g-admin-graphics .g-available .g-block {
+ float: right;
+ margin-left: 1em;
+ margin-right: 0em;
+}
+
+.rtl #g-site-admin-menu {
+ left: auto;
+ right: 150px;
+}
+
+.rtl #g-header #g-login-menu li {
+ margin-left: 0;
+ padding-left: 0;
+ padding-right: 1.2em;
+}
diff --git a/themes/default/images/avatar.jpg b/themes/admin_wind/images/avatar.jpg
index acad9314..acad9314 100644
--- a/themes/default/images/avatar.jpg
+++ b/themes/admin_wind/images/avatar.jpg
Binary files differ
diff --git a/themes/admin_wind/js/ui.init.js b/themes/admin_wind/js/ui.init.js
new file mode 100644
index 00000000..e0210ce5
--- /dev/null
+++ b/themes/admin_wind/js/ui.init.js
@@ -0,0 +1,60 @@
+/**
+ * Initialize jQuery UI and Gallery Plugins
+ * @todo Move ui-corner-all assignments to theme admin views
+ */
+
+$(document).ready(function(){
+
+ // Initialize Superfish menus
+ $("#g-site-admin-menu .g-menu").hide().addClass("sf-menu");
+ $("#g-site-admin-menu .g-menu").superfish({
+ delay: 500,
+ animation: {
+ opacity: "show",
+ height: "show"
+ },
+ pathClass: "g-selected",
+ speed: "fast"
+ }).show();
+
+ // Initialize status message effects
+ $("#g-action-status li").gallery_show_message();
+
+ // Initialize modal dialogs
+ $(".g-dialog-link").gallery_dialog();
+
+ // Initialize short forms
+ $(".g-short-form").gallery_short_form();
+
+ // Initialize ajax links
+ $(".g-ajax-link").gallery_ajax();
+
+ // Initialize panels
+ $(".g-panel-link").gallery_panel();
+
+ if ($("#g-photo-stream").length) {
+ // Vertically align thumbs in photostream
+ $(".g-item").gallery_valign();
+ }
+
+ // Apply jQuery UI button css to submit inputs
+ $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all");
+
+ // Round view menu buttons
+ if ($("#g-admin-comments-menu").length) {
+ $("#g-admin-comments-menu ul").removeClass("g-menu");
+ $("#g-admin-comments-menu").addClass("g-buttonset");
+ $("#g-admin-comments-menu a").addClass("g-button ui-state-default");
+ $("#g-admin-comments-menu ul li:first a").addClass("ui-corner-left");
+ $("#g-admin-comments-menu ul li:last a").addClass("ui-corner-right");
+ }
+
+ // Round corners
+ $(".g-selected").addClass("ui-corner-all");
+ $(".g-available .g-block").addClass("ui-corner-all");
+ $(".g-unavailable").addClass("ui-corner-all");
+
+ // Initialize button hover effect
+ $.fn.gallery_hover_init();
+
+});
diff --git a/themes/admin_default/theme.info b/themes/admin_wind/theme.info
index b3d9741d..4034b64a 100644
--- a/themes/admin_default/theme.info
+++ b/themes/admin_wind/theme.info
@@ -1,4 +1,4 @@
-name = "Gallery Default"
+name = "Gallery Wind"
description = "A crisp Site Administration theme with soft colors and drop down menus."
version = 1
author = "Gallery Team"
diff --git a/themes/admin_default/thumbnail.png b/themes/admin_wind/thumbnail.png
index b07a4cc2..b07a4cc2 100644
--- a/themes/admin_default/thumbnail.png
+++ b/themes/admin_wind/thumbnail.png
Binary files differ
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_wind/views/admin.html.php
index ef15ed25..25ba1c97 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_wind/views/admin.html.php
@@ -4,12 +4,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title><?= t("Admin Dashboard") ?></title>
+ <title><?= t("Admin dashboard") ?></title>
<link rel="shortcut icon" href="<?= url::file("lib/images/favicon.ico") ?>" type="image/x-icon" />
<?= $theme->css("yui/reset-fonts-grids.css") ?>
<?= $theme->css("themeroller/ui.base.css") ?>
<?= $theme->css("superfish/css/superfish.css") ?>
+ <?= $theme->css("gallery.common.css") ?>
<?= $theme->css("screen.css") ?>
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("fix-ie.css") ?>"
@@ -22,7 +23,7 @@
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
- var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
+ var MSG_CANCEL = <?= t("Cancel")->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
@@ -35,21 +36,31 @@
<body <?= $theme->body_attributes() ?>>
<?= $theme->admin_page_top() ?>
<? if ($sidebar): ?>
- <div id="doc3" class="yui-t5 gView">
+ <div id="doc3" class="yui-t5 g-view">
<? else: ?>
- <div id="doc3" class="yui-t7 gView">
+ <div id="doc3" class="yui-t7 g-view">
<? endif; ?>
<?= $theme->site_status() ?>
- <div id="gHeader">
+ <div id="g-header" class="ui-helper-clearfix">
<?= $theme->admin_header_top() ?>
- <ul id="gLoginMenu">
- <li class="first"><?= html::anchor(item::root()->abs_url(), "&larr; ".t("Back to the Gallery")) ?></li>
- <li id="gLogoutLink"><a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(item::root()->url())) ?>"><?= t("Logout") ?></a></li>
+ <ul id="g-login-menu" class="g-inline g-right">
+ <li class="g-first">
+ <? if (identity::is_writable()): ?>
+ <?= t('Logged in as %name', array('name' => html::mark_clean(
+ '<a href="' . url::site("form/edit/users/{$user->id}") .
+ '" title="' . t("Edit your profile")->for_html_attr() .
+ '" id="g-user-profile-link" class="g-dialog-link">' .
+ html::clean($user->display_name()) . '</a>'))) ?>
+ <? else: ?>
+ <?= t('Logged in as %name', array('name' => html::clean($user->display_name()))) ?>
+ <? endif ?>
+ </li>
+ <li id="g-logout-link"><a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(item::root()->url())) ?>"><?= t("Logout") ?></a></li>
</ul>
- <a id="gLogo" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery")->for_html_attr() ?>">
+ <a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery")->for_html_attr() ?>">
&larr; <?= t("back to the ...") ?>
</a>
- <div id="gSiteAdminMenu" style="display: none;">
+ <div id="g-site-admin-menu" class="ui-helper-clearfix">
<?= $theme->admin_menu() ?>
</div>
<?= $theme->admin_header_bottom() ?>
@@ -57,19 +68,19 @@
<div id="bd">
<div id="yui-main">
<div class="yui-b">
- <div id="gContent" class="yui-g">
+ <div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
<? if ($sidebar): ?>
- <div id="gSidebar" class="yui-b">
+ <div id="g-sidebar" class="yui-b">
<?= $sidebar ?>
</div>
<? endif ?>
</div>
- <div id="gFooter">
+ <div id="g-footer" class="g-inline ui-helper-clearfix">
<?= $theme->admin_footer() ?>
<div>
<?= $theme->admin_credits() ?>
diff --git a/themes/admin_default/views/block.html.php b/themes/admin_wind/views/block.html.php
index 6cbea76e..d1d2d088 100644
--- a/themes/admin_default/views/block.html.php
+++ b/themes/admin_wind/views/block.html.php
@@ -2,9 +2,9 @@
<? if ($anchor): ?>
<a name="<?= $anchor ?>"></a>
<? endif ?>
-<div block_id="<?= $id ?>" id="<?= $css_id ?>" class="gBlock ui-widget">
+<div block_id="<?= $id ?>" id="<?= $css_id ?>" class="g-block ui-widget">
<div class="ui-dialog-titlebar ui-widget-header ui-helper-clearfix ui-icon-right">
- <? if ($css_id != "gBlockAdder"): ?>
+ <? if ($css_id != "g-block-adder"): ?>
<a href="<?= url::site("admin/dashboard/remove_block/$id?csrf=$csrf") ?>"
class="ui-dialog-titlebar-close ui-corner-all">
<span class="ui-icon ui-icon-closethick">remove</span>
@@ -12,7 +12,7 @@
<? endif ?>
<?= $title ?>
</div>
- <div class="gBlockContent">
+ <div class="g-block-content">
<?= $content ?>
</div>
</div>
diff --git a/themes/admin_wind/views/pager.html.php b/themes/admin_wind/views/pager.html.php
new file mode 100644
index 00000000..7870ef3f
--- /dev/null
+++ b/themes/admin_wind/views/pager.html.php
@@ -0,0 +1,44 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<? // See http://docs.kohanaphp.com/libraries/pagination ?>
+<ul class="g-pager">
+ <? /* @todo This message isn't easily localizable */
+ $from_to_msg = t2("Item %from_number of %count",
+ "Items %from_number - %to_number of %count",
+ $total_items,
+ array("from_number" => $current_first_item,
+ "to_number" => $current_last_item,
+ "count" => $total_items)) ?>
+ <li>
+ <? if ($first_page): ?>
+ <a href="<?= str_replace('{page}', 1, $url) ?>" class="g-button ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a>
+ <? else: ?>
+ <a class="g-button ui-icon-left ui-state-disabled ui-corner-all">
+ <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a>
+ <? endif ?>
+ <? if ($previous_page): ?>
+ <a href="<?= str_replace('{page}', $previous_page, $url) ?>" class="g-button ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a>
+ <? else: ?>
+ <a class="g-button ui-icon-left ui-state-disabled ui-corner-all">
+ <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a>
+ <? endif ?>
+ </li>
+ <li class="g-info"><?= $from_to_msg ?></li>
+ <li class="g-text-right">
+ <? if ($next_page): ?>
+ <a href="<?= str_replace('{page}', $next_page, $url) ?>" class="g-button ui-icon-right ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a>
+ <? else: ?>
+ <a class="g-button ui-state-disabled ui-icon-right ui-corner-all">
+ <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a>
+ <? endif ?>
+ <? if ($last_page): ?>
+ <a href="<?= str_replace('{page}', $last_page, $url) ?>" class="g-button ui-icon-right ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a>
+ <? else: ?>
+ <a class="g-button ui-state-disabled ui-icon-right ui-corner-all">
+ <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a>
+ <? endif ?>
+ </li>
+</ul>
diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css
deleted file mode 100644
index 64ecf775..00000000
--- a/themes/default/css/screen.css
+++ /dev/null
@@ -1,1128 +0,0 @@
-/**
- * Gallery 3 Default Theme Screen Styles
- *
- * @requires YUI reset, font, grids CSS
- *
- * Sheet organization:
- * 1) Basic HTML elements
- * 2) Reusable classes
- * 3) Reusable content blocks
- * 4) Page layout containers
- * 5) Content blocks in specific layout containers
- * 6) Navigation and menus
- * 7) Browser hacks
- * 8) jQuery and jQuery UI
- * 9) Right-to-left language styles
- */
-
-/** *******************************************************************
- * 1) Basic HTML elements
- **********************************************************************/
-
-body, html {
- background-color: #ccc;
- font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
-}
-
-p {
- margin-bottom: 1em;
-}
-
-em {
- font-style: oblique;
-}
-
-h1, h2, h3, h4, h5, strong, th {
- font-weight: bold;
-}
-
-h1 {
- font-size: 1.7em;
-}
-
-#gSearchResults h1 {
- margin-bottom: 1em;
-}
-
-#gProgress h1 {
- font-size: 1.1em;
-}
-
-h2 {
- font-size: 1.4em;
-}
-
-#gSidebar .gBlock h2 {
- font-size: 1.2em;
-}
-
-#gSidebar .gBlock li {
- margin-bottom: .6em;
-}
-
-h3 {
- font-size: 1.2em;
-}
-
-/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-a,
-.gMenu a,
-#gDialog a,
-.gButtonLink,
-.gButtonLink:hover,
-.gButtonLink:active,
-a.ui-state-hover,
-input.ui-state-hover,
-button.ui-state-hover {
- color: #5382bf !important;
- cursor: pointer !important;
- text-decoration: none;
- -moz-outline-style: none;
-}
-
-a:hover,
-#gDialog a:hover {
- text-decoration: underline;
-}
-
-.gMenu a:hover {
- text-decoration: none;
-}
-
-#gDialog .gCancel {
- clear: none;
- float: left;
- margin: .3em 1em;
-}
-
-#gForgotPasswordLink {
- float: right;
- font-size: .9em;
-}
-
-#gDialog .gCancel {
- float: left;
-}
-
-#gDialog #gMessage li {
- width: 400px;
- white-space: normal;
- padding-left: 32px;
-}
-
-/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-table {
- width: 100%;
-}
-
-#gContent table {
- margin: 1em 0;
-}
-
-caption,
-th {
- text-align: left;
-}
-
-th,
-td {
- border: none;
- border-bottom: 1px solid #ccc;
- padding: .5em;
- vertical-align: top;
-}
-
-/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-fieldset {
- border: 1px solid #ccc;
- padding-bottom: .8em;
-}
-
-#gBanner fieldset,
-#gSidebar fieldset,
-.gShortForm fieldset {
- border: none;
-}
-
-legend {
- font-weight: bold;
- margin-left: 1em;
-}
-
-#gBanner legend,
-#gSidebar legend,
-#gContent #gSearchForm legend,
-input[type="hidden"],
-.gShortForm label {
- display: none;
-}
-
-label {
- cursor: help;
-}
-
-input[type="text"],
-input[type="password"] {
- width: 50%;
-}
-
-input[type="text"],
-input[type="password"],
-textarea {
- border: 1px solid #e8e8e8;
- border-top-color: #ccc;
- border-left-color: #ccc;
- color: #333;
-}
-
-textarea {
- width: 100%;
- height: 12em;
-}
-
-input:focus,
-textarea:focus,
-option:focus {
- background-color: #ffc;
- color: #000;
-}
-
-/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-form li {
- margin: 0 !important;
- padding: .3em 1.5em .3em 1em;
-}
-
-form ul ul {
- clear: both;
-}
-
-form ul ul li {
- float: left;
-}
-
-input,
-select,
-textarea {
- display: block;
- clear: both;
- padding: .2em;
-}
-
-input[type="submit"],
-input[type="reset"] {
- display: inline;
- clear: none;
- float: left;
-}
-
-/* Form validation ~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gValidationRule {
- font-size: 80%;
- margin-top: .5em;
-}
-
-form.gError input[type="text"],
-li.gError input[type="text"],
-form.gError input[type="password"],
-li.gError input[type="password"],
-form.gError input[type="checkbox"],
-li.gError input[type="checkbox"],
-form.gError input[type="radio"],
-li.gError input[type="radio"],
-form.gError textarea,
-li.gError textarea,
-form.gError select,
-li.gError select {
- border: 2px solid red;
-}
-
-/** *******************************************************************
- * 2) Reusable generic classes
- *********************************************************************/
-
-.inactive, .understate {
- color: #ccc;
- font-weight: normal;
-}
-
-.left {
- float: left;
- margin: 1em 1em 1em 0;
-}
-
-.right {
- float: right;
- margin: 1em 0 1em 1em;
-}
-
-.txtright {
- text-align: right;
-}
-
-/** *******************************************************************
- * 3) Reusable content blocks
- *********************************************************************/
-
-.gBlock {
- clear: both;
- margin-bottom: 2.5em;
-}
-
-.gBlock h2 {
- background-color: #e8e8e8;
- padding: .3em .8em;
-}
-
-.gBlockContent {
- margin-top: 1em;
-}
-
-/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gMessage {
- width: 100%;
-}
-
-#gSiteStatus li,
-#gMessage li,
-.gModuleStatus {
- border: 1px solid #ccc;
- margin-bottom: .4em;
-}
-
-#gSiteStatus li {
- margin-bottom: 0;
- border: none;
- border-bottom: 1px solid #ccc;
-}
-
-.gModuleStatus {
- clear: both;
- margin-bottom: 1em;
-}
-
-.gError,
-.gInfo,
-.gSuccess,
-.gWarning {
- background-position: .4em 50%;
- background-repeat: no-repeat;
- padding: .4em .5em .4em 30px;
-}
-
-.gError {
- background-color: #f6cbca;
- background-image: url('../images/ico-error.png');
-}
-
-.gInfo {
- background-color: #e8e8e8;
- background-image: url('../images/ico-info.png');
-}
-
-.gSuccess {
- background-color: #d9efc2;
- background-image: url('../images/ico-success.png');
-}
-
-.gWarning {
- background-color: #fcf9ce;
- background-image: url('../images/ico-warning.png');
-}
-
-form .gError,
-.gPager .gInfo {
- background-color: #fff !important;
-}
-
-.gPager .gInfo {
- background-image: none !important;
- padding: 0 !important;
-}
-
-/* Inline layout (forms, lists) ~~~~~~~~~~ */
-
-.gShortForm li {
- float: left;
- padding: .4em 0;
-}
-
-.gShortForm input[type="text"] {
- color: #666;
- padding: .3em .6em;
- width: 11em;
-}
-
-/*** ******************************************************************
- * 4) Page layout containers
- *********************************************************************/
-
-/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gView {
- background-color: #fff;
- border: 1px solid #ccc;
- border-bottom: none;
-}
-
-/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */
-
-#gHeader {
- margin-bottom: 1em;
-}
-
-#gBanner {
- background-color: #e8e8e8;
- border-bottom: 1px solid #ccc;
- font-size: .8em;
- min-height: 5em;
- padding: 1em 20px;
- position: relative;
-}
-
-#gContent {
- font-size: 1.2em;
- padding-left: 20px;
- position: relative;
- width: 696px;
-}
-
-#gSidebar {
- font-size: .9em;
- padding: 0 20px;
- width: 220px;
-}
-
-#gFooter {
- background-color: #e8e8e8;
- border-top: 1px solid #ccc;
- font-size: .8em;
- margin-top: 20px;
- padding: 10px 20px;
-}
-
-/** *******************************************************************
- * 5) Content blocks in specific layout containers
- *********************************************************************/
-
-/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gBanner #gLogo img {
- margin: 0;
-}
-
-#gBanner #gQuickSearchForm {
- clear: right;
- float: right;
- margin-top: 1em;
-}
-
-#gBanner #gQuickSearchForm input[type='text'] {
- width: 17em;
-}
-
-#gContent .gBlock h2 {
- background-color: transparent;
- padding-left: 0;
-}
-
-#gSidebar .gBlockContent {
- padding-left: 1em;
-}
-
-/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gContent #gAlbumGrid {
- margin: 1em 0;
- position: relative;
- z-index: 1;
-}
-
-#gContent #gAlbumGrid .gItem {
- background-color: #fff;
- border: 1px solid #fff;
- float: left;
- font-size: .7em;
- height: 220px;
- overflow: hidden;
- padding: .6em 8px;
- position: relative;
- text-align: center;
- width: 213px;
- z-index: 1;
-}
-
-#gContent #gAlbumGrid .gItem h2 {
- margin: 5px 0;
-}
-
-#gContent .gPhoto h2,
-#gContent .gItem .gMetadata {
- display: none;
-}
-
-#gContent #gAlbumGrid .gAlbum {
- background-color: #e8e8e8;
-}
-
-#gContent #gAlbumGrid .gAlbum h2 span {
- background: transparent url('../images/ico-album.png') no-repeat top left;
- display: inline-block;
- height: 16px;
- margin-right: 5px;
- width: 16px;
-}
-
-#gContent #gAlbumGrid .gHoverItem {
- background-color: #fff;
- border: 1px solid #000;
-}
-
-#gContent .gHoverItem h2,
-#gContent .gHoverItem .gMetadata {
- display: block;
-}
-
-/* Individual photo content ~~~~~~~~~~~~~~ */
-
-#gContent #gItem {
- position: relative;
- width: 99%;
-}
-
-#gContent #gPhoto {
- position: relative;
-}
-
-#gContent #gItem .gFullSizeLink img {
- display: block;
- margin: 1em auto !important;
-}
-
-#gContent #gComments {
- margin-top: 2em;
- position: relative;
-}
-
-#gContent #gComments ul li {
- margin: 1em 0;
-}
-
-#gContent #gComments .gAuthor {
- border-bottom: 1px solid #ccc;
- color: #999;
- height: 32px;
- line-height: 32px;
-}
-
-#gContent #gComments ul li div {
- padding: 0 8px 8px 43px;
-}
-
-#gContent #gComments ul li #gRecaptcha {
- padding: 0;
-}
-
-#gContent #gComments ul li #gRecaptcha div {
- padding: 0;
-}
-
-#gContent #gComments .gAvatar {
- height: 32px;
- margin-right: .4em;
- width: 32px;
-}
-
-#gAddCommentButton {
- position: absolute;
- right: 0;
- top: 2px;
-}
-
-#gContent #gAddCommentForm {
- margin-top: 2em;
-}
-
-/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gBanner #gLoginMenu li,
-#gFooter #gCredits li {
- display: inline;
-}
-
-#gBanner #gLoginMenu li {
- padding-left: 1.2em;
-}
-
-#gFooter #gCredits li {
- padding-right: 1.2em;
-}
-
-#gContent #gSearchResults {
- margin-top: 1em;
- padding-top: 1em;
-}
-
-/** *******************************************************************
- * 5) Navigation and menus
- *********************************************************************/
-
-#gSiteMenu,
-#gTagCloud ul {
- font-size: 1.2em;
-}
-
-/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gBanner #gLoginMenu {
- color: #999;
- float: right;
-}
-
-/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gSiteMenu {
- bottom: 0;
- display: none;
- left: 140px;
- position: absolute;
-}
-
-#gSiteMenu ul {
- margin-bottom: 0 !important;
-}
-
-/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gContextMenu {
- position: absolute;
- bottom: 0;
- left: 0;
-}
-
-.gItem .gContextMenu {
- display: none;
- margin-top: 2em;
- width: 100%;
-}
-
-#gItem .gContextMenu {
- font-size: .7em;
-}
-
-#gItem .gContextMenu ul {
- display: none;
-}
-
-.gContextMenu li {
- border-left: none;
- border-right: none;
- border-bottom: none;
-}
-
-.gContextMenu li a {
- display: block;
- line-height: 1.6em;
-}
-
-.gHoverItem .gContextMenu {
- display: block;
-}
-
-.gHoverItem .gContextMenu li {
- text-align: left;
-}
-
-.gHoverItem .gContextMenu a:hover {
- text-decoration: none;
-}
-
-/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gViewMenu {
- margin-bottom: 1em;
-}
-
-#gViewMenu a {
- background-repeat: no-repeat;
- background-position: 50% 50%;
- height: 28px !important;
- width: 43px !important;
-}
-
-#gViewMenu #gHybridLink {
- background-image: url('../images/ico-view-hybrid.png');
-}
-
-#gViewMenu #gSlideshowLink {
- background-image: url('../images/ico-view-slideshow.png');
-}
-
-#gViewMenu .gFullSizeLink {
- background-image: url('../images/ico-view-fullsize.png');
-}
-
-#gViewMenu #gCommentsLink {
- background-image: url('../images/ico-view-comments.png');
-}
-
-#gViewMenu #gDigibugLink {
- background-image: url('../images/ico-print.png');
-}
-
-/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gBreadcrumbs {
- padding: 0 20px;
-}
-
-.gBreadcrumbs li {
- background: transparent url('../images/ico-separator.gif') no-repeat scroll left center;
- float: left;
- padding: 10px 6px 10px 16px !important;
-}
-
-.gBreadcrumbs li.root {
- background: transparent;
-}
-
-.gBreadcrumbs li a,
-.gBreadcrumbs li span {
- display: block;
-}
-
-.gBreadcrumbs li.active,
-.gBreadcrumbs li.active span {
- font-weight: bold;
-}
-
-#gDialog ul.gBreadcrumbs {
- clear: both;
- margin-left: 0;
- padding-left: 0;
-}
-
-#gDialog .gBreadcrumbs li {
- font-size: .9em;
-}
-
-/* Tags and cloud ~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gTagCloud ul {
- text-align: justify;
-}
-
-#gTagCloud ul li {
- display: inline;
- line-height: 1.5em;
- text-align: justify;
-}
-
-#gTagCloud ul li a {
- text-decoration: none;
-}
-
-#gTagCloud ul li span {
- display: none;
-}
-
-#gTagCloud ul li.size1 a {
- color: #9cf;
- font-size: 80%;
- font-weight: 100;
-}
-
-#gTagCloud ul li.size2 a {
- color: #69f;
- font-size: 90%;
- font-weight: 300;
-}
-
-#gTagCloud ul li.size3 a {
- color: #69c;
- font-size: 100%;
- font-weight: 500;
-}
-
-#gTagCloud ul li.size4 a {
- color: #369;
- font-size: 110%;
- font-weight: 700;
-}
-
-#gTagCloud ul li.size5 a {
- color: #0e2b52;
- font-size: 120%;
- font-weight: 900;
-}
-
-#gTagCloud ul li.size6 a {
- color: #0e2b52;
- font-size: 130%;
- font-weight: 900;
-}
-
-#gTagCloud ul li.size7 a {
- color: #0e2b52;
- font-size: 140%;
- font-weight: 900;
-}
-
-#gTagCloud ul li a:hover {
- color: #f30;
- text-decoration: underline;
-}
-
-#gWelcomeMessage p {
- padding-bottom: 1em;
-}
-
-/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-.gPager {
- clear: both;
- margin: 0;
- padding: 5px 0 !important;
- width: 100%;
-}
-
-.gPager li {
- float: left;
- margin: 0;
- width: 30%;
-}
-
-.gPager .gInfo {
- text-align: center;
- width: 40%;
-}
-
-/** *******************************************************************
- * 6) Browser hacks
- *********************************************************************/
-
-#gHeader:after,
-#gAlbumGrid:after,
-.gPager:after,
-#gViewMenu:after {
- clear: both;
- content: ".";
- display: block;
- height: 0;
- visibility: hidden;
-}
-
-/** *******************************************************************
- * 7) jQuery and jQuery UI
- *********************************************************************/
-
-/* Superfish menu overrides ~~~~~~~~~~~~~~ */
-
-.sf-menu li li, .sf-menu li li ul li {
- background-color: #bdd2ff;
-}
-
-.sf-menu li:hover {
- background-color: #dfe9ff;
-}
-
-/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */
-
-.gLoadingLarge {
- background: #e8e8e8 url('../../../lib/images/loading-large.gif') no-repeat center center;
- font-size: 0;
-}
-
-.gDialogLoadingLarge {
- background: url('../../../lib/images/loading-large.gif') no-repeat center center !important;
- font-size: 0;
-}
-
-.gLoadingSmall {
- background: #e8e8e8 url('../../../lib/images/loading-small.gif') no-repeat center center;
- font-size: 0;
-}
-
-.gDraggable {
- cursor: move;
-}
-
-.gDropTarget {
- background-color: #cfdeff;
- border: 1px dotted #999;
- height: 100px;
- margin: 1em 0;
-}
-
-/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */
-
-.ui-widget-overlay {
- background: #000;
- opacity: .7;
-}
-
-#gDialog {
- text-align: left;
-}
-
-#gDialog li {
- padding-left: 0;
-}
-
-#gDialog form input[type="text"],
-#gDialog form input[type="password"] {
- width: 100%;
-}
-
-#gDialog #gLoginForm,
-#gDialog #gAddUserForm,
-#gDialog #gAddGroupForm {
- margin: 0 auto;
- width: 270px;
-}
-
-#gDialog fieldset {
- border: none;
-}
-
-#gDialog legend {
- display: none;
-}
-
-#gDialog p {
- margin: 0;
-}
-
-/* jQuery UI ThemeRoller buttons */
-
-.gButtonLink {
- display: inline-block;
- margin: 0 4px 0 0;
- padding: .2em .4em;
- outline: 0;
-}
-
-.gButtonSet {
- padding-left: 1px;
-}
-
-.gButtonSet li {
- float: left;
-}
-
-.gButtonSet .gButtonLink {
- margin: 0;
-}
-
-.ui-icon-left .ui-icon {
- float: left;
- margin-right: .2em;
-}
-
-.ui-icon-right .ui-icon {
- float: right;
- margin-left: .2em;
-}
-
-.ui-icon-rotate-ccw {
- background-position: -192px -64px;
-}
-
-.ui-icon-rotate-cw {
- background-position: -208px -64px;
-}
-
-/* STUFF THAT NEEDS A HOME */
-
-#gMove ul {
- padding-left: 1em;
-}
-
-#gMove .selected {
- background: #999;
-}
-
-/* Server Add */
-
-#gServerAdd button {
- margin-bottom: .5em;
-}
-
-#gServerAddTree {
- cursor: pointer;
- padding-left: 4px;
- width: 95%;
-}
-
-#gServerAddTree li {
- padding: 0;
- float: none;
-}
-
-#gServerAddTree span.selected {
- background: #ddd;
-}
-
-#gServerAddTree {
- border: 1px solid #ccc;
- height: 20em;
- overflow: auto;
- margin-bottom: .5em;
- padding: .5em;
-}
-
-#gServerAdd ul ul li {
- padding-left: 1.2em;
-}
-
-/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#gEditPermissionForm {
- clear: both;
-}
-#gEditPermissionForm fieldset {
- border: 1px solid #cccccc;
- padding: 0;
-}
-
-#gPermissions .gDenied,
-#gPermissions .gAllowed {
- text-align: center;
- vertical-align: middle;
-}
-#gPermissions .gDenied {
- background-color: #fcc;
-}
-#gPermissions .gAllowed {
- background-color: #cfc;
-}
-
-/*************** STUFF THAT NEEDS A HOME ****************/
-
-.gProgressBar {
- height: 1em;
- width: 100%;
- margin-top: .5em;
- display: inline-block;
-}
-
-#gAddPhotos span {
- clear: both;
- display: block;
-}
-
-#gAddPhotosCanvas {
- height: 325px;
- width: 450px;
- overflow: auto;
-}
-
-#gAddPhotosQueue .progressbar {
- height: 4px;
-}
-
-#gAddPhotosQueue .title {
- font-size: 1.25em;
-}
-
-#gAddPhotosQueue .status {
- font-size: .75em;
-}
-
-#gAddPhotosQueue .box {
- margin-bottom: 8px;
- padding: 4px;
-}
-
-#gAddPhotosQueue .pending {
- background-color: #e8e8e8;
- border: 1px solid #d7d7d7;
-}
-
-#gAddPhotosQueue .error {
- background-color: #fcc;
- border: 1px solid #ebb;
-}
-
-#gAddPhotosQueue .uploading {
- background-color: #ff9;
- border: 1px solid #ee8;
-}
-
-#gAddPhotosQueue .complete {
- background-color: #cfc;
- border: 1px solid #beb;
-}
-
-#gAdminG2ImportNotes {
- padding-bottom: 20px;
-}
-
-#gAdminG2ImportDetails {
- padding-top: 20px;
-}
-
-#gAdminG2ImportDetails .gWarning {
- margin-top: 4px;
-}
-
-#gAdminG2ImportDetails .gInfo {
- padding: 2px;
- border: 1px solid #999;
- margin-bottom: 10px;
-}
-
-#gAdminG2ImportNotes p,
-#gAdminG2ImportDetails .gInfo p {
- padding: 0;
- margin: 0;
-}
-
-#gAdminG2ImportNotes ul li,
-#gAdminG2Import .gInfo ul li {
- padding-left: 0;
- margin-left: 20px;
- list-style-type: disc;
-}
-
-/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */
-
-.rtl {
- direction: rtl;
-}
-
-.rtl caption,
-.rtl th,
-.rtl #gDialog {
- text-align: right;
-}
-
-.rtl #gHeader #gQuickSearchForm,
-.rtl #gForgotPasswordLink,
-.rtl #gHeader #gLoginMenu,
-.rtl .ui-icon-right .ui-icon {
- clear: left;
- float: left;
-}
-
-.rtl #gDialog .gCancel,
-.rtl form ul ul li,
-.rtl input[type="submit"],
-.rtl input[type="reset"],
-.rtl .gShortForm li,
-.rtl #gHeader #gLogo img,
-.rtl #gContent #gAlbumGrid .gItem,
-.rtl #gSiteMenu,
-.rtl .gBreadcrumbs li,
-.rtl .gPager li,
-.rtl .gButtonSet li,
-.rtl .ui-icon-left .ui-icon {
- float: right;
-}
-
diff --git a/themes/default/images/ico-album.png b/themes/default/images/ico-album.png
deleted file mode 100644
index affa1b84..00000000
--- a/themes/default/images/ico-album.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-error.png b/themes/default/images/ico-error.png
deleted file mode 100644
index c37bd062..00000000
--- a/themes/default/images/ico-error.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-info.png b/themes/default/images/ico-info.png
deleted file mode 100644
index 12cd1aef..00000000
--- a/themes/default/images/ico-info.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-print.png b/themes/default/images/ico-print.png
deleted file mode 100644
index b82a8e1e..00000000
--- a/themes/default/images/ico-print.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-separator.gif b/themes/default/images/ico-separator.gif
deleted file mode 100644
index 3de2d0d3..00000000
--- a/themes/default/images/ico-separator.gif
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-success.png b/themes/default/images/ico-success.png
deleted file mode 100644
index a9925a06..00000000
--- a/themes/default/images/ico-success.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-view-comments.png b/themes/default/images/ico-view-comments.png
deleted file mode 100644
index e5d3630f..00000000
--- a/themes/default/images/ico-view-comments.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-view-fullsize.png b/themes/default/images/ico-view-fullsize.png
deleted file mode 100644
index 0be23e9b..00000000
--- a/themes/default/images/ico-view-fullsize.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-view-hybrid.png b/themes/default/images/ico-view-hybrid.png
deleted file mode 100644
index ee902e55..00000000
--- a/themes/default/images/ico-view-hybrid.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-view-slideshow.png b/themes/default/images/ico-view-slideshow.png
deleted file mode 100644
index 82f61f63..00000000
--- a/themes/default/images/ico-view-slideshow.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-warning.png b/themes/default/images/ico-warning.png
deleted file mode 100644
index 628cf2da..00000000
--- a/themes/default/images/ico-warning.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js
deleted file mode 100644
index e645eb71..00000000
--- a/themes/default/js/ui.init.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Initialize jQuery UI and Gallery Plugin elements
- */
-
-var short_forms = new Array(
- "#gQuickSearchForm",
- "#gAddTagForm",
- "#gSearchForm"
-);
-
-$(document).ready(function() {
-
- // Initialize Superfish menus
- $("ul.gMenu").addClass("sf-menu");
- $('ul.sf-menu').superfish({
- delay: 500,
- animation: {
- opacity:'show',
- height:'show'
- },
- speed: 'fast'
- });
- $("#gSiteMenu").css("display", "block");
-
- // Initialize status message effects
- $("#gMessage li").gallery_show_message();
-
- // Initialize dialogs
- $("#gLoginLink").addClass("gDialogLink");
- $(".gDialogLink").gallery_dialog();
-
- // Initialize view menu
- if ($("#gViewMenu").length) {
- $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu");
- $("#gViewMenu a").addClass("ui-icon");
- }
-
- // Initialize short forms
- for (var i in short_forms) {
- short_form_init(short_forms[i]);
- $(short_forms[i]).addClass("gShortForm");
- }
- $(".gShortForm input[type=text]").addClass("ui-corner-left");
- $(".gShortForm input[type=submit]").addClass("ui-state-default ui-corner-right");
-
- // Apply jQuery UI button css to submit inputs
- $("input[type=submit]:not(.gShortForm input)").addClass("ui-state-default ui-corner-all");
-
- // Apply styles and icon classes to gContextMenu
- if ($(".gContextMenu").length) {
- $(".gContextMenu li").addClass("ui-state-default");
- $(".gContextMenu a").addClass("gButtonLink ui-icon-left");
- $(".gContextMenu a").prepend("<span class=\"ui-icon\"></span>");
- $(".gContextMenu a span").each(function() {
- var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString();
- $(this).addClass(iconClass);
- });
- }
-
- // Album view only
- if ($("#gAlbumGrid").length) {
- // Vertical align thumbnails/metadata in album grid
- $(".gItem").gallery_valign();
-
- // Initialize context menus
- $(".gItem").hover(
- function(){
- // Insert invisible placeholder to hold the item's position in the grid
- var placeHolder = $(this).clone();
- $(placeHolder).attr("id", "gPlaceHolder");
- $(placeHolder).css("visibility", "hidden");
- $(this).after($(placeHolder));
- // Style and position the item
- $(this).addClass("gHoverItem");
- var position = $(this).position();
- $(this).css("position", "absolute");
- $(this).css("top", position.top);
- $(this).css("left", position.left);
- $(this).css("z-index", "1000");
- // Initialize the contextual menu
- $(this).gallery_context_menu();
- // Set height based on height of descendents
- var title = $(this).find("h2");
- var meta = $(this).find(".gMetadata");
- var context_label = $(this).find(".gContextMenu li:first");
- var item_ht = $(this).height();
- var title_ht = $(title).gallery_height();
- var meta_ht = $(meta).gallery_height();
- var context_label_ht = $(context_label).gallery_height();
- $(this).height(item_ht + title_ht + meta_ht + context_label_ht);
- },
- function() {
- // Reset item height, position, and z-index
- if ($(this).next().height()) {
- var sib_height = $(this).next().height();
- } else {
- var sib_height = $(this).prev().height();
- }
- if ($.browser.msie && $.browser.version >= 8) {
- sib_height = sib_height + 1;
- }
- $(this).css("height", sib_height);
- $(this).css("position", "relative");
- $(this).css("top", null);
- $(this).css("left", null);
- $(this).css("z-index", 1);
- // Remove the placeholder and hover class from the item
- $("#gPlaceHolder").remove();
- $(this).removeClass("gHoverItem");
- }
- );
- }
-
- // Photo/Item item view
- if ($("#gItem").length) {
- // Ensure the resized image fits within its container
- $("#gItem").gallery_fit_photo();
-
- // Initialize context menus
- var resize = $("#gItem").gallery_get_photo();
- $(resize).hover(function(){
- $(this).gallery_context_menu();
- });
-
- // Add scroll effect for links to named anchors
- $.localScroll({
- queue: true,
- duration: 1000,
- hash: true
- });
- }
-
- // Initialize button hover effect
- $.fn.gallery_hover_init();
-
-});
diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php
deleted file mode 100644
index 910814dd..00000000
--- a/themes/default/views/movie.html.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gItem">
- <?= $theme->photo_top() ?>
-
- <ul class="gPager">
- <li>
- <? if ($previous_item): ?>
- <a href="<?= $previous_item->url() ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
- <? endif; ?>
- </li>
- <li class="gInfo"><?= t("%position of %total", array("position" => $position, "total" => $sibling_count)) ?></li>
- <li class="txtright">
- <? if ($next_item): ?>
- <a href="<?= $next_item->url() ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-right ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
- <? endif ?>
- </li>
- </ul>
-
-
- <?= $item->movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?>
-
- <div id="gInfo">
- <h1><?= html::purify($item->title) ?></h1>
- <div><?= nl2br(html::purify($item->description)) ?></div>
- </div>
-
- <?= $theme->photo_bottom() ?>
- <?= $theme->context_menu($item, "#gMovieId-{$item->id}") ?>
-</div>
diff --git a/themes/default/views/pager.html.php b/themes/default/views/pager.html.php
deleted file mode 100644
index 7cdc9bb0..00000000
--- a/themes/default/views/pager.html.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? // See http://docs.kohanaphp.com/libraries/pagination ?>
-<ul class="gPager">
- <? /* @todo This message isn't easily localizable */
- $from_to_msg = t2("Photo %from_number of %count",
- "Photos %from_number - %to_number of %count",
- $total_items,
- array("from_number" => $current_first_item,
- "to_number" => $current_last_item,
- "count" => $total_items)) ?>
- <li>
- <? if ($first_page): ?>
- <a href="<?= str_replace('{page}', 1, $url) ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-first"></span><?= t("first") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-seek-first"></span><?= t("first") ?></a>
- <? endif ?>
- <? if ($previous_page): ?>
- <a href="<?= str_replace('{page}', $previous_page, $url) ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-prev"></span><?= t("previous") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-seek-prev"></span><?= t("previous") ?></a>
- <? endif ?>
- </li>
- <li class="gInfo"><?= $from_to_msg ?></li>
- <li class="txtright">
- <? if ($next_page): ?>
- <a href="<?= str_replace('{page}', $next_page, $url) ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-next"></span><?= t("next") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-state-disabled ui-icon-right ui-corner-all">
- <span class="ui-icon ui-icon-seek-next"></span><?= t("next") ?></a>
- <? endif ?>
- <? if ($last_page): ?>
- <a href="<?= str_replace('{page}', $last_page, $url) ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-seek-end"></span><?= t("last") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-state-disabled ui-icon-right ui-corner-all">
- <span class="ui-icon ui-icon-seek-end"></span><?= t("last") ?></a>
- <? endif ?>
- </li>
-</ul>
diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php
deleted file mode 100644
index b0096043..00000000
--- a/themes/default/views/photo.html.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-
-<? if (access::can("view_full", $theme->item())): ?>
-<!-- Use javascript to show the full size as an overlay on the current page -->
-<script>
- $(document).ready(function() {
- $(".gFullSizeLink").click(function() {
- $.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>");
- return false;
- });
- });
-</script>
-<? endif ?>
-
-<div id="gItem">
- <?= $theme->photo_top() ?>
-
- <ul class="gPager">
- <li>
- <? if ($previous_item): ?>
- <a href="<?= $previous_item->url() ?>" class="gButtonLink ui-icon-left ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-left ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
- <? endif; ?>
- </li>
- <li class="gInfo"><?= t("%position of %total", array("position" => $position, "total" => $sibling_count)) ?></li>
- <li class="txtright">
- <? if ($next_item): ?>
- <a href="<?= $next_item->url() ?>" class="gButtonLink ui-icon-right ui-state-default ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
- <? else: ?>
- <a class="gButtonLink ui-icon-right ui-state-disabled ui-corner-all">
- <span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
- <? endif ?>
- </li>
- </ul>
-
- <div id="gPhoto">
- <?= $theme->resize_top($item) ?>
- <? if (access::can("view_full", $item)): ?>
- <a href="<?= $item->file_url() ?>" class="gFullSizeLink" title="<?= t("View full size")->for_html_attr() ?>">
- <? endif ?>
- <?= $item->resize_img(array("id" => "gPhotoId-{$item->id}", "class" => "gResize")) ?>
- <? if (access::can("view_full", $item)): ?>
- </a>
- <? endif ?>
- <?= $theme->resize_bottom($item) ?>
- <?= $theme->context_menu($item, "#gPhotoId-{$item->id}") ?>
- </div>
-
- <div id="gInfo">
- <h1><?= html::purify($item->title) ?></h1>
- <div><?= nl2br(html::purify($item->description)) ?></div>
- </div>
-
- <?= $theme->photo_bottom() ?>
-</div>
diff --git a/themes/default/views/sidebar.html.php b/themes/default/views/sidebar.html.php
deleted file mode 100644
index 04379eb6..00000000
--- a/themes/default/views/sidebar.html.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<?= $theme->sidebar_top() ?>
-<div class="gToolbar">
- <div id="gViewMenu" class="gButtonSet">
- <? if ($page_type == "album"):?>
- <?= $theme->album_menu() ?>
- <? elseif ($page_type == "photo") : ?>
- <?= $theme->photo_menu() ?>
- <? elseif ($page_type == "movie") : ?>
- <?= $theme->movie_menu() ?>
- <? elseif ($page_type == "tag") : ?>
- <?= $theme->tag_menu() ?>
- <? endif ?>
- </div>
-</div>
-
-<?= $theme->sidebar_blocks() ?>
-<?= $theme->sidebar_bottom() ?>
diff --git a/themes/default/css/fix-ie.css b/themes/wind/css/fix-ie.css
index eee88c15..fcebeea8 100644
--- a/themes/default/css/fix-ie.css
+++ b/themes/wind/css/fix-ie.css
@@ -2,15 +2,7 @@
* Fix display in IE 6, 7
*/
-#gBanner,
-.gBreadcrumbs,
-#gAlbumGrid,
-#gPager,
-#gViewMenu {
- zoom: 1;
-}
-
-#gBanner {
+#g-banner {
z-index: 2;
}
@@ -19,19 +11,19 @@ input.submit {
display: inline !important;
}
-#gAddTagForm input.textbox {
+#g-add-tag-form input.textbox {
width: 110px;
}
-#gDialog a.gCancel {
+#g-dialog .g-cancel {
display: inline-block !important;
float: none !important;
}
-.gPager .txtright {
+.g-pager .g-text-right {
width: 29%;
}
-.gPager .ui-icon-right {
+.g-pager .ui-icon-right {
width: 60px;
}
diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css
new file mode 100644
index 00000000..e46ba8e6
--- /dev/null
+++ b/themes/wind/css/screen.css
@@ -0,0 +1,445 @@
+/**
+ * Gallery 3 Wind Theme Screen Styles
+ *
+ * @requires YUI reset, font, grids CSS
+ *
+ * Sheet organization:
+ * 1) Font sizes, base HTML elements
+ * 2) Reusable content blocks
+ * 3) Page layout containers
+ * 4) Content blocks in specific layout containers
+ * 5) Navigation and menus
+ * 6) jQuery and jQuery UI
+ * 7) Right-to-left language styles
+ */
+
+/** *******************************************************************
+ * 1) Font sizes, base HTML elements
+ **********************************************************************/
+
+body, html {
+ background-color: #ccc;
+ font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
+}
+
+p {
+ margin-bottom: 1em;
+}
+
+em {
+ font-style: oblique;
+}
+
+h1, h2, h3, h4, h5, strong, th {
+ font-weight: bold;
+}
+
+h1 {
+ font-size: 1.7em;
+}
+
+#g-dialog h1 {
+ font-size: 1.1em;
+}
+
+h2 {
+ font-size: 1.4em;
+}
+
+#g-sidebar .g-block h2 {
+ font-size: 1.2em;
+}
+
+#g-sidebar .g-block li {
+ margin-bottom: .6em;
+}
+
+#g-content,
+#g-site-menu,
+h3 {
+ font-size: 1.2em;
+}
+
+#g-sidebar,
+.g-breadcrumbs {
+ font-size: .9em;
+}
+
+#g-banner,
+#g-footer,
+.g-message {
+ font-size: .8em;
+}
+
+#g-album-grid .g-item,
+#g-item #g-photo,
+#g-item #g-movie {
+ font-size: .7em;
+}
+
+/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+a,
+.g-menu a,
+#g-dialog a,
+.g-button,
+.g-button:hover,
+.g-button:active,
+a.ui-state-hover,
+input.ui-state-hover,
+button.ui-state-hover {
+ color: #5382bf !important;
+ cursor: pointer !important;
+ text-decoration: none;
+ -moz-outline-style: none;
+}
+
+a:hover,
+#g-dialog a:hover {
+ text-decoration: underline;
+}
+
+.g-menu a:hover {
+ text-decoration: none;
+}
+
+#g-dialog #g-action-status li {
+ width: 400px;
+ white-space: normal;
+ padding-left: 32px;
+}
+
+/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+table {
+ width: 100%;
+}
+
+#g-content table {
+ margin: 1em 0;
+}
+
+caption,
+th {
+ text-align: left;
+}
+
+th,
+td {
+ border: none;
+ border-bottom: 1px solid #ccc;
+ padding: .5em;
+}
+
+td {
+ vertical-align: top;
+}
+
+/** *******************************************************************
+ * 2) Reusable content blocks
+ *********************************************************************/
+
+.g-block h2 {
+ background-color: #e8e8e8;
+ padding: .3em .8em;
+}
+
+.g-block-content {
+ margin-top: 1em;
+}
+
+/*** ******************************************************************
+ * 3) Page layout containers
+ *********************************************************************/
+
+/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-view {
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-bottom: none;
+}
+
+/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-header {
+ margin-bottom: 1em;
+}
+
+#g-banner {
+ background-color: #e8e8e8;
+ border-bottom: 1px solid #ccc;
+ min-height: 5em;
+ padding: 1em 20px;
+ position: relative;
+}
+
+#g-content {
+ padding-left: 20px;
+ position: relative;
+ width: 696px;
+}
+
+#g-sidebar {
+ padding: 0 20px;
+ width: 220px;
+}
+
+#g-footer {
+ background-color: #e8e8e8;
+ border-top: 1px solid #ccc;
+ margin-top: 20px;
+ padding: 10px 20px;
+}
+
+/** *******************************************************************
+ * 4) Content blocks in specific layout containers
+ *********************************************************************/
+
+/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-banner #g-quick-search-form {
+ clear: right;
+ float: right;
+ margin-top: 1em;
+}
+
+#g-banner #g-quick-search-form input[type='text'] {
+ width: 17em;
+}
+
+#g-content .g-block h2 {
+ background-color: transparent;
+ padding-left: 0;
+}
+
+#g-sidebar .g-block-content {
+ padding-left: 1em;
+}
+
+/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-content #g-album-grid {
+ margin: 1em 0;
+ position: relative;
+ z-index: 1;
+}
+
+#g-content #g-album-grid .g-item {
+ background-color: #fff;
+ border: 1px solid #fff;
+ float: left;
+ padding: .6em 8px;
+ position: relative;
+ text-align: center;
+ width: 213px;
+ z-index: 1;
+}
+
+#g-content #g-album-grid .g-item h2 {
+ margin: 5px 0;
+}
+
+#g-content .g-photo h2,
+#g-content .g-item .g-metadata {
+ display: none;
+ margin-bottom: .6em;
+}
+
+#g-content #g-album-grid .g-album {
+ background-color: #e8e8e8;
+}
+
+#g-content #g-album-grid .g-album h2 span {
+ background: transparent url('../images/ico-album.png') no-repeat top left;
+ display: inline-block;
+ height: 16px;
+ margin-right: 5px;
+ width: 16px;
+}
+
+#g-content #g-album-grid .g-hover-item {
+ border: 1px solid #000;
+ position: absolute !important;
+ z-index: 1000 !important;
+}
+
+#g-content .g-hover-item h2,
+#g-content .g-hover-item .g-metadata {
+ display: block;
+}
+
+#g-content #g-album-grid #g-place-holder {
+ position: relative;
+ visibility: hidden;
+ z-index: 1;
+}
+
+/* Individual photo content ~~~~~~~~~~~~~~ */
+
+#g-item {
+ position: relative;
+ width: 100%;
+}
+
+#g-item #g-photo,
+#g-item #g-movie {
+ padding: 2.2em 0;
+ position: relative;
+}
+
+#g-item img.g-resize,
+#g-item a.g-movie object {
+ display: block;
+ margin: 0 auto;
+}
+
+/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-footer #g-credits li {
+ padding-right: 1.2em;
+}
+
+#g-content #g-search-results {
+ margin-top: 1em;
+ padding-top: 1em;
+}
+
+/* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */
+#g-in-place-edit-message {
+ background-color: #FFF;
+}
+
+/** *******************************************************************
+ * 5) Navigation and menus
+ *********************************************************************/
+
+/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-banner #g-login-menu {
+ color: #999;
+ float: right;
+}
+
+#g-banner #g-login-menu li {
+ padding-left: 1.2em;
+}
+
+/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-site-menu {
+ bottom: 0;
+ left: 140px;
+ position: absolute;
+}
+
+#g-site-menu ul {
+ margin-bottom: 0 !important;
+}
+
+/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-context-menu {
+ background-color: #fff;
+ bottom: 0;
+ left: 0;
+ position: absolute;
+}
+
+.g-item .g-context-menu {
+ display: none;
+ margin-top: 2em;
+ width: 100%;
+}
+
+#g-item .g-context-menu ul {
+ display: none;
+}
+
+.g-context-menu li {
+ border-left: none;
+ border-right: none;
+ border-bottom: none;
+}
+
+.g-context-menu li a {
+ display: block;
+ line-height: 1.6em;
+}
+
+.g-hover-item .g-context-menu {
+ display: block;
+}
+
+.g-hover-item .g-context-menu li {
+ text-align: left;
+}
+
+.g-hover-item .g-context-menu a:hover {
+ text-decoration: none;
+}
+
+/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#g-view-menu {
+ margin-bottom: 1em;
+}
+
+#g-view-menu a {
+ background-repeat: no-repeat;
+ background-position: 50% 50%;
+ height: 28px !important;
+ width: 43px !important;
+}
+
+#g-view-menu #g-slideshow-link {
+ background-image: url('../images/ico-view-slideshow.png');
+}
+
+#g-view-menu .g-fullsize-link {
+ background-image: url('../images/ico-view-fullsize.png');
+}
+
+#g-view-menu #g-comments-link {
+ background-image: url('../images/ico-view-comments.png');
+}
+
+#g-view-menu #g-print-digibug-link {
+ background-image: url('../images/ico-print.png');
+}
+
+/** *******************************************************************
+ * 6) jQuery and jQuery UI
+ *********************************************************************/
+
+/* Superfish menu overrides ~~~~~~~~~~~~~~ */
+
+.sf-menu li li,
+.sf-menu li li ul li {
+ background-color: #bdd2ff;
+}
+
+.sf-menu li:hover {
+ background-color: #dfe9ff;
+}
+
+/** *******************************************************************
+ * 7) Right to left language styles
+ *********************************************************************/
+
+.rtl #g-header #g-login-menu,
+.rtl #g-header #g-quick-search-form {
+ clear: left;
+ float: left;
+}
+
+.rtl #g-header #g-login-menu li {
+ margin-left: 0;
+ padding-left: 0;
+ padding-right: 1.2em;
+}
+
+.rtl #g-site-menu {
+ left: auto;
+ right: 150px;
+}
diff --git a/themes/wind/images/avatar.jpg b/themes/wind/images/avatar.jpg
new file mode 100644
index 00000000..acad9314
--- /dev/null
+++ b/themes/wind/images/avatar.jpg
Binary files differ
diff --git a/themes/admin_default/images/ico-album.png b/themes/wind/images/ico-album.png
index affa1b84..affa1b84 100644
--- a/themes/admin_default/images/ico-album.png
+++ b/themes/wind/images/ico-album.png
Binary files differ
diff --git a/themes/default/images/ico-help.png b/themes/wind/images/ico-help.png
index 5c870176..5c870176 100644
--- a/themes/default/images/ico-help.png
+++ b/themes/wind/images/ico-help.png
Binary files differ
diff --git a/themes/admin_default/images/ico-print.png b/themes/wind/images/ico-print.png
index b82a8e1e..b82a8e1e 100644
--- a/themes/admin_default/images/ico-print.png
+++ b/themes/wind/images/ico-print.png
Binary files differ
diff --git a/themes/admin_default/images/ico-view-comments.png b/themes/wind/images/ico-view-comments.png
index e5d3630f..e5d3630f 100644
--- a/themes/admin_default/images/ico-view-comments.png
+++ b/themes/wind/images/ico-view-comments.png
Binary files differ
diff --git a/themes/admin_default/images/ico-view-fullsize.png b/themes/wind/images/ico-view-fullsize.png
index 0be23e9b..0be23e9b 100644
--- a/themes/admin_default/images/ico-view-fullsize.png
+++ b/themes/wind/images/ico-view-fullsize.png
Binary files differ
diff --git a/themes/admin_default/images/ico-view-slideshow.png b/themes/wind/images/ico-view-slideshow.png
index 82f61f63..82f61f63 100644
--- a/themes/admin_default/images/ico-view-slideshow.png
+++ b/themes/wind/images/ico-view-slideshow.png
Binary files differ
diff --git a/themes/default/images/select-photos-backg.png b/themes/wind/images/select-photos-backg.png
index 81c2d616..81c2d616 100644
--- a/themes/default/images/select-photos-backg.png
+++ b/themes/wind/images/select-photos-backg.png
Binary files differ
diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js
new file mode 100644
index 00000000..be03b6a8
--- /dev/null
+++ b/themes/wind/js/ui.init.js
@@ -0,0 +1,111 @@
+/**
+ * Initialize jQuery UI and Gallery Plugins
+ */
+
+$(document).ready(function() {
+
+ // Initialize Superfish menus (hidden, then shown to address IE issue)
+ $("#g-site-menu .g-menu").hide().addClass("sf-menu");
+ $("#g-site-menu .g-menu").superfish({
+ delay: 500,
+ animation: {
+ opacity:'show',
+ height:'show'
+ },
+ pathClass: "g-selected",
+ speed: 'fast'
+ }).show();
+
+ // Initialize status message effects
+ $("#g-action-status li").gallery_show_message();
+
+ // Initialize dialogs
+ $(".g-dialog-link").gallery_dialog();
+
+ // Initialize short forms
+ $(".g-short-form").gallery_short_form();
+
+ // Apply jQuery UI icon, hover, and rounded corner styles
+ $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all");
+ if ($("#g-view-menu").length) {
+ $("#g-view-menu ul").removeClass("g-menu").removeClass("sf-menu");
+ $("#g-view-menu a").addClass("ui-icon");
+ }
+
+ // Apply jQuery UI icon and hover styles to context menus
+ if ($(".g-context-menu").length) {
+ $(".g-context-menu li").addClass("ui-state-default");
+ $(".g-context-menu a").addClass("g-button ui-icon-left");
+ $(".g-context-menu a").prepend("<span class=\"ui-icon\"></span>");
+ $(".g-context-menu a span").each(function() {
+ var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString();
+ $(this).addClass(iconClass);
+ });
+ }
+
+ // Album view only
+ if ($("#g-album-grid").length) {
+ // Set equal height for album items and vertically align thumbnails/metadata
+ $('.g-item').equal_heights().gallery_valign();
+
+ // Initialize thumbnail hover effect
+ $(".g-item").hover(
+ function() {
+ // Insert a placeholder to hold the item's position in the grid
+ var placeHolder = $(this).clone().attr("id", "g-place-holder");
+ $(this).after($(placeHolder));
+ // Style and position the hover item
+ var position = $(this).position();
+ $(this).css("top", position.top).css("left", position.left);
+ $(this).addClass("g-hover-item");
+ // Initialize the contextual menu
+ $(this).gallery_context_menu();
+ // Set the hover item's height
+ $(this).height("auto");
+ var context_menu = $(this).find(".g-context-menu");
+ var adj_height = $(this).height() + context_menu.height();
+ $(this).height(adj_height);
+ },
+ function() {
+ // Reset item height and position
+ if ($(this).next().height()) {
+ var sib_height = $(this).next().height();
+ } else {
+ var sib_height = $(this).prev().height();
+ }
+ if ($.browser.msie && $.browser.version >= 8) {
+ sib_height = sib_height + 1;
+ }
+ $(this).css("height", sib_height);
+ $(this).css("position", "relative");
+ $(this).css("top", 0).css("left", 0);
+ // Remove the placeholder and hover class from the item
+ $(this).removeClass("g-hover-item");
+ $("#g-place-holder").remove();
+ }
+ );
+ }
+
+ // Photo/Item item view
+ if ($("#g-photo").length) {
+ // Ensure the resized image fits within its container
+ $("#g-photo").gallery_fit_photo();
+
+ // Initialize context menus
+ var resize = $("#g-photo").gallery_get_photo();
+ $(resize).hover(function(){
+ $(this).gallery_context_menu();
+ });
+
+ // Add scroll effect for links to named anchors
+ $.localScroll({
+ queue: true,
+ duration: 1000,
+ hash: true
+ });
+ }
+
+ // Initialize button hover effect
+ $.fn.gallery_hover_init();
+
+});
diff --git a/themes/default/theme.info b/themes/wind/theme.info
index 5f19d0d7..17ea7c20 100644
--- a/themes/default/theme.info
+++ b/themes/wind/theme.info
@@ -1,4 +1,4 @@
-name = "Gallery Default"
+name = "Gallery Wind"
description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience."
version = 1
author = "Gallery Team"
diff --git a/themes/default/thumbnail.png b/themes/wind/thumbnail.png
index c0594db2..c0594db2 100644
--- a/themes/default/thumbnail.png
+++ b/themes/wind/thumbnail.png
Binary files differ
diff --git a/themes/default/views/album.html.php b/themes/wind/views/album.html.php
index 01f7be50..2c2b54eb 100644
--- a/themes/default/views/album.html.php
+++ b/themes/wind/views/album.html.php
@@ -1,27 +1,27 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? // @todo Set hover on AlbumGrid list items for guest users ?>
-<div id="gInfo">
+<div id="g-info">
<?= $theme->album_top() ?>
<h1><?= html::purify($item->title) ?></h1>
- <div class="gDescription"><?= nl2br(html::purify($item->description)) ?></div>
+ <div class="g-description"><?= nl2br(html::purify($item->description)) ?></div>
</div>
-<ul id="gAlbumGrid">
+<ul id="g-album-grid" class="ui-helper-clearfix">
<? if (count($children)): ?>
<? foreach ($children as $i => $child): ?>
- <? $item_class = "gPhoto"; ?>
+ <? $item_class = "g-photo"; ?>
<? if ($child->is_album()): ?>
- <? $item_class = "gAlbum"; ?>
+ <? $item_class = "g-album"; ?>
<? endif ?>
- <li id="gItemId-<?= $child->id ?>" class="gItem <?= $item_class ?>">
+ <li id="g-item-id-<?= $child->id ?>" class="g-item <?= $item_class ?>">
<?= $theme->thumb_top($child) ?>
<a href="<?= $child->url() ?>">
- <?= $child->thumb_img(array("class" => "gThumbnail")) ?>
+ <?= $child->thumb_img(array("class" => "g-thumbnail")) ?>
</a>
<?= $theme->thumb_bottom($child) ?>
- <?= $theme->context_menu($child, "#gItemId-{$child->id} .gThumbnail") ?>
+ <?= $theme->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?>
<h2><span></span><a href="<?= $child->url() ?>"><?= html::purify($child->title) ?></a></h2>
- <ul class="gMetadata">
+ <ul class="g-metadata">
<?= $theme->thumb_info($child) ?>
</ul>
</li>
@@ -30,7 +30,7 @@
<? if ($user->admin || access::can("add", $item)): ?>
<? $addurl = url::file("index.php/simple_uploader/app/$item->id") ?>
<li><?= t("There aren't any photos here yet! <a %attrs>Add some</a>.",
- array("attrs" => html::mark_clean("href=\"$addurl\" class=\"gDialogLink\""))) ?></li>
+ array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?></li>
<? else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
@@ -38,4 +38,4 @@
</ul>
<?= $theme->album_bottom() ?>
-<?= $theme->pager() ?>
+<?= $theme->paginator() ?>
diff --git a/themes/default/views/block.html.php b/themes/wind/views/block.html.php
index e8cff833..699d7c22 100644
--- a/themes/default/views/block.html.php
+++ b/themes/wind/views/block.html.php
@@ -2,9 +2,9 @@
<? if ($anchor): ?>
<a name="<?= $anchor ?>"></a>
<? endif ?>
-<div id="<?= $css_id ?>" class="gBlock">
+<div id="<?= $css_id ?>" class="g-block">
<h2><?= $title ?></h2>
- <div class="gBlockContent">
+ <div class="g-block-content">
<?= $content ?>
</div>
</div>
diff --git a/themes/default/views/dynamic.html.php b/themes/wind/views/dynamic.html.php
index 9ed9d69b..a8a4d362 100644
--- a/themes/default/views/dynamic.html.php
+++ b/themes/wind/views/dynamic.html.php
@@ -1,24 +1,24 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<div id="gAlbumHeader">
- <div id="gAlbumHeaderButtons">
+<div id="g-album-header">
+ <div id="g-album-header-buttons">
<?= $theme->dynamic_top() ?>
</div>
<h1><?= html::clean($title) ?></h1>
</div>
-<ul id="gAlbumGrid">
+<ul id="g-album-grid" class="ui-helper-clearfix">
<? foreach ($children as $i => $child): ?>
- <li class="gItem <?= $child->is_album() ? "gAlbum" : "" ?>">
+ <li class="g-item <?= $child->is_album() ? "g-album" : "" ?>">
<?= $theme->thumb_top($child) ?>
<a href="<?= $child->url() ?>">
- <img id="gPhotoId-<?= $child->id ?>" class="gThumbnail"
+ <img id="g-photo-id-<?= $child->id ?>" class="g-thumbnail"
alt="photo" src="<?= $child->thumb_url() ?>"
width="<?= $child->thumb_width ?>"
height="<?= $child->thumb_height ?>" />
</a>
<h2><?= html::purify($child->title) ?></h2>
<?= $theme->thumb_bottom($child) ?>
- <ul class="gMetadata">
+ <ul class="g-metadata">
<?= $theme->thumb_info($child) ?>
</ul>
</li>
@@ -26,4 +26,4 @@
</ul>
<?= $theme->dynamic_bottom() ?>
-<?= $theme->pager() ?>
+<?= $theme->paginator() ?>
diff --git a/themes/wind/views/movie.html.php b/themes/wind/views/movie.html.php
new file mode 100644
index 00000000..27c293ce
--- /dev/null
+++ b/themes/wind/views/movie.html.php
@@ -0,0 +1,18 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<div id="g-item">
+ <?= $theme->photo_top() ?>
+
+ <?= $theme->paginator() ?>
+
+ <div id="g-movie" class="ui-helper-clearfix">
+ <?= $item->movie_img(array("class" => "g-movie", "id" => "g-movie-id-{$item->id}")) ?>
+ <?= $theme->context_menu($item, "#g-movie-id-{$item->id}") ?>
+ </div>
+
+ <div id="g-info">
+ <h1><?= html::purify($item->title) ?></h1>
+ <div><?= nl2br(html::purify($item->description)) ?></div>
+ </div>
+
+ <?= $theme->photo_bottom() ?>
+</div>
diff --git a/themes/wind/views/no_sidebar.html.php b/themes/wind/views/no_sidebar.html.php
new file mode 100644
index 00000000..378bd971
--- /dev/null
+++ b/themes/wind/views/no_sidebar.html.php
@@ -0,0 +1,6 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<ul class="g-message-block">
+ <li class="g-warning"><?= t("No active sidebar blocks.<br/>
+ <a href=\"%url\">Add blocks</a>",
+ array("url" => html::mark_clean(url::site("admin/sidebar")))) ?></li>
+</ul>
diff --git a/themes/default/views/page.html.php b/themes/wind/views/page.html.php
index 19d8cc00..f41dcd27 100644
--- a/themes/default/views/page.html.php
+++ b/themes/wind/views/page.html.php
@@ -27,6 +27,7 @@
<?= $theme->css("yui/reset-fonts-grids.css") ?>
<?= $theme->css("superfish/css/superfish.css") ?>
<?= $theme->css("themeroller/ui.base.css") ?>
+ <?= $theme->css("gallery.common.css") ?>
<?= $theme->css("screen.css") ?>
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
@@ -37,7 +38,7 @@
<? $new_width = $thumb_proportion * 213 ?>
<? $new_height = $thumb_proportion * 240 ?>
<style type="text/css">
- #gContent #gAlbumGrid .gItem {
+ #g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;
/* <?= $thumb_proportion ?> */
@@ -55,7 +56,6 @@
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
- <?= $theme->script("gallery.form.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<?= $theme->script("ui.init.js") ?>
@@ -73,28 +73,30 @@
<body <?= $theme->body_attributes() ?>>
<?= $theme->page_top() ?>
- <div id="doc4" class="yui-t5 gView">
+ <div id="doc4" class="yui-t5 g-view">
<?= $theme->site_status() ?>
- <div id="gHeader">
- <div id="gBanner">
- <?= $theme->header_top() ?>
+ <div id="g-header" class="ui-helper-clearfix">
+ <div id="g-banner">
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<?= $header_text ?>
<? else: ?>
- <a id="gLogo" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
+ <a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<img width="107" height="48" alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= url::file("lib/images/logo.png") ?>" />
</a>
<? endif ?>
- <div id="gSiteMenu">
+ <?= $theme->user_menu() ?>
+ <?= $theme->header_top() ?>
+ <div id="g-site-menu">
<?= $theme->site_menu() ?>
</div>
<?= $theme->header_bottom() ?>
</div>
<? if (!empty($parents)): ?>
- <ul class="gBreadcrumbs">
+ <ul class="g-breadcrumbs">
+ <? $i = 0 ?>
<? foreach ($parents as $parent): ?>
- <li>
+ <li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
@@ -104,34 +106,35 @@
<?= html::purify($parent->title) ?>
</a>
</li>
+ <? $i++ ?>
<? endforeach ?>
- <li class="active"><?= html::purify($theme->item()->title) ?></li>
+ <li class="g-active"><?= html::purify($theme->item()->title) ?></li>
</ul>
<? endif ?>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
- <div id="gContent" class="yui-g">
+ <div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
- <div id="gSidebar" class="yui-b">
+ <div id="g-sidebar" class="yui-b">
<? if ($theme->page_type != "login"): ?>
<?= new View("sidebar.html") ?>
<? endif ?>
</div>
</div>
- <div id="gFooter">
+ <div id="g-footer" class="ui-helper-clearfix">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
<? endif ?>
<? if (module::get_var("gallery", "show_credits")): ?>
- <ul id="gCredits">
+ <ul id="g-credits" class="g-inline">
<?= $theme->credits() ?>
</ul>
<? endif ?>
diff --git a/themes/wind/views/paginator.html.php b/themes/wind/views/paginator.html.php
new file mode 100644
index 00000000..5d300cf4
--- /dev/null
+++ b/themes/wind/views/paginator.html.php
@@ -0,0 +1,86 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?
+// This is a generic paginator for album, photo and movie pages. Depending on the page type,
+// there are different sets of variables available. With this data, you can make a paginator
+// that lets you say "You're viewing photo 5 of 35", or "You're viewing photos 10 - 18 of 37"
+// for album views.
+//
+// Available variables for all page types:
+// $page_type - "album", "movie", "photo" or "tag"
+// $previous_page_url - the url to the previous page, if there is one
+// $next_page_url - the url to the next page, if there is one
+// $total - the total number of photos in this album
+//
+// Available for the "album" and "tag" page types:
+// $page - what page number we're on
+// $max_pages - the maximum page number
+// $page_size - the page size
+// $first_page_url - the url to the first page, or null if we're on the first page
+// $last_page_url - the url to the last page, or null if we're on the last page
+// $first_visible_position - the position number of the first visible photo on this page
+// $last_visible_position - the position number of the last visible photo on this page
+//
+// Available for "photo" and "movie" page types:
+// $position - the position number of this photo
+//
+?>
+
+<ul class="g-pager ui-helper-clearfix">
+ <li class="g-first">
+ <? if ($page_type == "album" || $page_type == "tag"): ?>
+ <? if (isset($first_page_url)): ?>
+ <a href="<?= $first_page_url ?>" class="g-button ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a>
+ <? else: ?>
+ <a class="g-button ui-icon-left ui-state-disabled ui-corner-all">
+ <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a>
+ <? endif ?>
+ <? endif ?>
+
+ <? if (isset($previous_page_url)): ?>
+ <a href="<?= $previous_page_url ?>" class="g-button ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a>
+ <? else: ?>
+ <a class="g-button ui-icon-left ui-state-disabled ui-corner-all">
+ <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a>
+ <? endif ?>
+ </li>
+
+ <li class="g-info">
+ <? if ($total): ?>
+ <? if ($page_type == "album" || $page_type == "tag"): ?>
+ <?= /* @todo This message isn't easily localizable */
+ t2("Photo %from_number of %count",
+ "Photos %from_number - %to_number of %count",
+ $total,
+ array("from_number" => $first_visible_position,
+ "to_number" => $last_visible_position,
+ "count" => $total)) ?>
+ <? else: ?>
+ <?= t("%position of %total", array("position" => $position, "total" => $total)) ?>
+ <? endif ?>
+ <? else: ?>
+ <?= t("No photos") ?>
+ <? endif ?>
+ </li>
+
+ <li class="g-text-right">
+ <? if (isset($next_page_url)): ?>
+ <a href="<?= $next_page_url ?>" class="g-button ui-icon-right ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a>
+ <? else: ?>
+ <a class="g-button ui-state-disabled ui-icon-right ui-corner-all">
+ <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a>
+ <? endif ?>
+
+ <? if ($page_type == "album" || $page_type == "tag"): ?>
+ <? if (isset($last_page_url)): ?>
+ <a href="<?= $last_page_url ?>" class="g-button ui-icon-right ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a>
+ <? else: ?>
+ <a class="g-button ui-state-disabled ui-icon-right ui-corner-all">
+ <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a>
+ <? endif ?>
+ <? endif ?>
+ </li>
+</ul>
diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php
new file mode 100644
index 00000000..e0fae3f1
--- /dev/null
+++ b/themes/wind/views/photo.html.php
@@ -0,0 +1,39 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+
+<? if (access::can("view_full", $theme->item())): ?>
+<!-- Use javascript to show the full size as an overlay on the current page -->
+<script type="text/javascript">
+ $(document).ready(function() {
+ $(".g-fullsize-link").click(function() {
+ $.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>");
+ return false;
+ });
+ });
+</script>
+<? endif ?>
+
+<div id="g-item">
+ <?= $theme->photo_top() ?>
+
+ <?= $theme->paginator() ?>
+
+ <div id="g-photo">
+ <?= $theme->resize_top($item) ?>
+ <? if (access::can("view_full", $item)): ?>
+ <a href="<?= $item->file_url() ?>" class="g-fullsize-link" title="<?= t("View full size")->for_html_attr() ?>">
+ <? endif ?>
+ <?= $item->resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize")) ?>
+ <? if (access::can("view_full", $item)): ?>
+ </a>
+ <? endif ?>
+ <?= $theme->resize_bottom($item) ?>
+ <?= $theme->context_menu($item, "#g-photo-id-{$item->id}") ?>
+ </div>
+
+ <div id="g-info">
+ <h1><?= html::purify($item->title) ?></h1>
+ <div><?= nl2br(html::purify($item->description)) ?></div>
+ </div>
+
+ <?= $theme->photo_bottom() ?>
+</div>
diff --git a/themes/wind/views/sidebar.html.php b/themes/wind/views/sidebar.html.php
new file mode 100644
index 00000000..cd50fc01
--- /dev/null
+++ b/themes/wind/views/sidebar.html.php
@@ -0,0 +1,16 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?= $theme->sidebar_top() ?>
+<div id="g-view-menu" class="g-buttonset ui-helper-clearfix">
+ <? if ($page_type == "album"):?>
+ <?= $theme->album_menu() ?>
+ <? elseif ($page_type == "photo") : ?>
+ <?= $theme->photo_menu() ?>
+ <? elseif ($page_type == "movie") : ?>
+ <?= $theme->movie_menu() ?>
+ <? elseif ($page_type == "tag") : ?>
+ <?= $theme->tag_menu() ?>
+ <? endif ?>
+</div>
+
+<?= $theme->sidebar_blocks() ?>
+<?= $theme->sidebar_bottom() ?>