From f212f6a794c4aff96446b99e4824a9e2c8cfb259 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Thu, 14 Feb 2013 23:42:20 +0100 Subject: #2003 - Add admin/movies screen. Added admin/movies screen analogous to the admin/graphics screen so the user can: - see how FFmpeg is configured (path and version, similar to toolkits in admin/graphics) - get some instructions on how to install FFmpeg if not found - change the movie_allow_uploads setting - ask Gallery to rebuild their movie thumbs Specifics: - admin_movies, admin_movies.html (new) - new Movies admin screen - ffmpeg.png (new) - logo for admin screen - movie::get_ffmpeg_version (new) - return version number and date of FFmpeg - form_uploadify.html - change admin message if movie uploads are disabled - gallery_event::admin_menu - added Movies link to Settings - xss_data.txt - updated golden file for unit tests --- modules/gallery/views/admin_movies.html.php | 44 +++++++++++++++++++++++++++ modules/gallery/views/form_uploadify.html.php | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 modules/gallery/views/admin_movies.html.php (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_movies.html.php b/modules/gallery/views/admin_movies.html.php new file mode 100644 index 00000000..e7810711 --- /dev/null +++ b/modules/gallery/views/admin_movies.html.php @@ -0,0 +1,44 @@ + +
+

+

+ + +

+

+ + static build of FFmpeg from one of the links here.", array("url" => "http://ffmpeg.org/download.html")) ?> + +

+

+ +

+

+ We can help!", + array("url" => "http://codex.galleryproject.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?> +

+ +
+

+
+ " alt="" /> +

+
+ FFmpeg website for more information.", array("url" => "http://ffmpeg.org")) ?> +

+
+ + +

$ffmpeg_version, "dir" => $ffmpeg_dir)) ?>

+ +

$ffmpeg_dir)) ?>

+ + +

+ +
+
+
+ + +
diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index 4426514a..c13e3418 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -131,7 +131,7 @@ admin && !$movies_allowed): ?>

- ffmpeg on your system. Movie uploading disabled. Help!", array("help_url" => "http://codex.galleryproject.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?> + Help!", array("help_url" => url::site("admin/movies"))) ?>

-- cgit v1.2.3 From 8b0088fd8d1774f4bdf5ae345ab5ad2da1eaedaf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 13:23:05 -0500 Subject: Change gallery/bin -> gallery3/bin in the comment since I suspect most people don't change the name of the directory. Follow-on to 1d7f5e3ab117a6cce8f2a1d3de5e311b74dbee81 for #1935 --- modules/gallery/views/admin_movies.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_movies.html.php b/modules/gallery/views/admin_movies.html.php index e7810711..242a4349 100644 --- a/modules/gallery/views/admin_movies.html.php +++ b/modules/gallery/views/admin_movies.html.php @@ -8,7 +8,7 @@

static build of FFmpeg from one of the links here.", array("url" => "http://ffmpeg.org/download.html")) ?> - +

-- cgit v1.2.3 From 94aadf03dadbfa01ba1744df60c97b6f3094ae88 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Wed, 20 Feb 2013 17:30:27 +0100 Subject: #2008 - Add warnings if some active modules are obsolete. - added module::get_obsolete_modules_message function - put message on admin/dashboard - put message on admin/modules - put message on upgrader - updated unit test golden file xss_data --- modules/gallery/controllers/admin_dashboard.php | 1 + modules/gallery/controllers/admin_modules.php | 1 + modules/gallery/controllers/upgrader.php | 1 + modules/gallery/helpers/module.php | 30 +++++++++++++++++++ modules/gallery/tests/xss_data.txt | 39 +++++++++++++------------ modules/gallery/views/admin_dashboard.html.php | 7 +++++ modules/gallery/views/admin_modules.html.php | 6 ++++ modules/gallery/views/upgrader.html.php | 9 ++++++ 8 files changed, 76 insertions(+), 18 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php index 6bd36b07..53172109 100644 --- a/modules/gallery/controllers/admin_dashboard.php +++ b/modules/gallery/controllers/admin_dashboard.php @@ -26,6 +26,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { $view->sidebar = "

" . block_manager::get_html("dashboard_sidebar") . "
"; + $view->content->obsolete_modules_message = module::get_obsolete_modules_message(); print $view; } diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php index d13ec1c6..177a925d 100644 --- a/modules/gallery/controllers/admin_modules.php +++ b/modules/gallery/controllers/admin_modules.php @@ -26,6 +26,7 @@ class Admin_Modules_Controller extends Admin_Controller { $view->page_title = t("Modules"); $view->content = new View("admin_modules.html"); $view->content->available = module::available(); + $view->content->obsolete_modules_message = module::get_obsolete_modules_message(); print $view; } diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index d3c6e2ec..6b3a9ef6 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -46,6 +46,7 @@ class Upgrader_Controller extends Controller { $view->available = module::available(); $view->failed = $failed ? explode(",", $failed) : array(); $view->done = $available_upgrades == 0; + $view->obsolete_modules_message = module::get_obsolete_modules_message(); print $view; } diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index df258e87..d7429121 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -541,4 +541,34 @@ class module_Core { static function get_version($module_name) { return module::get($module_name)->version; } + + /** + * Check if obsolete modules are active and, if so, return a warning message. + * If none are found, return null. + */ + static function get_obsolete_modules_message() { + // This is the obsolete modules list. Any active module that's on the list + // with version number at or below the one given will be considered obsolete. + // It is hard-coded here, and may be updated with future releases of Gallery. + $obsolete_modules = array("videos" => 4, "noffmpeg" => 1, "videodimensions" => 1, + "digibug" => 2); + + $modules_found = array(); + foreach ($obsolete_modules as $module => $version) { + if (module::is_active($module) && (module::get_version($module) <= $version)) { + $modules_found[] = $module; + } + } + + if ($modules_found) { + // Need this to be on one super-long line or else the localization scanner may not work. + // (ref: http://sourceforge.net/apps/trac/gallery/ticket/1321) + return t("Recent upgrades to Gallery have made the following modules obsolete: %modules. We recommend that you deactivate the module(s). For more information, please see the documentation page.", + array("modules" => implode(", ", $modules_found), + "url_mod" => url::site("admin/modules"), + "url_doc" => "http://codex.galleryproject.org/Gallery3:User_guide:Obsolete_modules")); + } + + return null; + } } diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 457c157f..0028ac87 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -56,7 +56,8 @@ modules/gallery/views/admin_block_photo_stream.html.php 5 DIRTY_JS $photo modules/gallery/views/admin_block_photo_stream.html.php 6 DIRTY photo::img_dimensions($photo->width,$photo->height,72) 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_dashboard.html.php 37 DIRTY $obsolete_modules_message +modules/gallery/views/admin_dashboard.html.php 42 DIRTY $blocks modules/gallery/views/admin_graphics.html.php 25 DIRTY newView("admin_graphics_none.html") modules/gallery/views/admin_graphics.html.php 27 DIRTY newView("admin_graphics_$active.html",array("tk"=>$tk->$active,"is_active"=>true)) modules/gallery/views/admin_graphics.html.php 34 DIRTY newView("admin_graphics_$id.html",array("tk"=>$tk->$id,"is_active"=>false)) @@ -96,15 +97,16 @@ modules/gallery/views/admin_maintenance.html.php 181 DIRTY $task- 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 75 DIRTY $task->name -modules/gallery/views/admin_modules.html.php 51 DIRTY access::csrf_form_field() -modules/gallery/views/admin_modules.html.php 61 DIRTY_ATTR text::alternate("g-odd","g-even") -modules/gallery/views/admin_modules.html.php 64 DIRTY form::checkbox($data,'1',module::is_active($module_name)) -modules/gallery/views/admin_modules.html.php 66 DIRTY $module_info->version -modules/gallery/views/admin_modules.html.php 74 DIRTY_JS $module_info->author_url -modules/gallery/views/admin_modules.html.php 81 DIRTY_ATTR $module_info->author_name -modules/gallery/views/admin_modules.html.php 85 DIRTY $module_info->author_name -modules/gallery/views/admin_modules.html.php 93 DIRTY_JS $module_info->info_url -modules/gallery/views/admin_modules.html.php 106 DIRTY_JS $module_info->discuss_url +modules/gallery/views/admin_modules.html.php 51 DIRTY $obsolete_modules_message +modules/gallery/views/admin_modules.html.php 57 DIRTY access::csrf_form_field() +modules/gallery/views/admin_modules.html.php 67 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_modules.html.php 70 DIRTY form::checkbox($data,'1',module::is_active($module_name)) +modules/gallery/views/admin_modules.html.php 72 DIRTY $module_info->version +modules/gallery/views/admin_modules.html.php 80 DIRTY_JS $module_info->author_url +modules/gallery/views/admin_modules.html.php 87 DIRTY_ATTR $module_info->author_name +modules/gallery/views/admin_modules.html.php 91 DIRTY $module_info->author_name +modules/gallery/views/admin_modules.html.php 99 DIRTY_JS $module_info->info_url +modules/gallery/views/admin_modules.html.php 112 DIRTY_JS $module_info->discuss_url modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY_ATTR $css_class modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY $message modules/gallery/views/admin_modules_confirm.html.php 16 DIRTY access::csrf_form_field() @@ -264,14 +266,15 @@ modules/gallery/views/quick_delete_confirm.html.php 11 DIRTY $form modules/gallery/views/reauthenticate.html.php 9 DIRTY $form modules/gallery/views/upgrade_checker_block.html.php 19 DIRTY $new_version modules/gallery/views/upgrader.html.php 76 DIRTY_ATTR $done?"muted":"" -modules/gallery/views/upgrader.html.php 94 DIRTY_ATTR $done?"muted":"" -modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable" -modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR in_array($id,$failed)?"failed":"" -modules/gallery/views/upgrader.html.php 103 DIRTY_ATTR $id -modules/gallery/views/upgrader.html.php 107 DIRTY $module->version -modules/gallery/views/upgrader.html.php 110 DIRTY $module->code_version -modules/gallery/views/upgrader.html.php 120 DIRTY_ATTR $done?"muted":"" -modules/gallery/views/upgrader.html.php 123 DIRTY_ATTR $done?"muted":"" +modules/gallery/views/upgrader.html.php 97 DIRTY $obsolete_modules_message +modules/gallery/views/upgrader.html.php 103 DIRTY_ATTR $done?"muted":"" +modules/gallery/views/upgrader.html.php 111 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable" +modules/gallery/views/upgrader.html.php 111 DIRTY_ATTR in_array($id,$failed)?"failed":"" +modules/gallery/views/upgrader.html.php 112 DIRTY_ATTR $id +modules/gallery/views/upgrader.html.php 116 DIRTY $module->version +modules/gallery/views/upgrader.html.php 119 DIRTY $module->code_version +modules/gallery/views/upgrader.html.php 129 DIRTY_ATTR $done?"muted":"" +modules/gallery/views/upgrader.html.php 132 DIRTY_ATTR $done?"muted":"" modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected) modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true)) modules/gallery/views/user_profile.html.php 43 DIRTY $info->view diff --git a/modules/gallery/views/admin_dashboard.html.php b/modules/gallery/views/admin_dashboard.html.php index f391547e..cf90ef28 100644 --- a/modules/gallery/views/admin_dashboard.html.php +++ b/modules/gallery/views/admin_dashboard.html.php @@ -31,6 +31,13 @@ }); }); +
+ +

+ +

+ +
diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 5a7f7b6c..96576ae4 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -46,6 +46,12 @@ adding more modules! Each module provides new cool features.", array("url" => "http://codex.galleryproject.org/Category:Gallery_3:Modules")) ?>

+ +

+ +

+ +
"> diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index edfaf720..4c611f7e 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -90,6 +90,15 @@
+ +
+

+ + +

+
+ + "> -- cgit v1.2.3 From b52a533a0f1b145f675a920a18b367d3767731d7 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 23 Feb 2013 21:49:29 +0100 Subject: #2014 - Clean up gallery.ajax.js. - prepend "data-" in front of non-standard attr to be more standards compliant. - fix formatting. --- lib/gallery.ajax.js | 4 ++-- modules/gallery/views/menu_ajax_link.html.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/gallery/views') diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js index f27f3969..08f1fede 100644 --- a/lib/gallery.ajax.js +++ b/lib/gallery.ajax.js @@ -2,10 +2,10 @@ $.widget("ui.gallery_ajax", { _init: function() { this.element.click(function(event) { - eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler")); + eval("var ajax_handler = " + $(event.currentTarget).attr("data-ajax-handler")); $.get($(event.currentTarget).attr("href"), function(data) { ajax_handler(data); - }); + }); event.preventDefault(); return false; }); diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php index 06cd6f92..66df84c9 100644 --- a/modules/gallery/views/menu_ajax_link.html.php +++ b/modules/gallery/views/menu_ajax_link.html.php @@ -4,7 +4,7 @@ class="g-ajax-link css_class ?>" href="url ?>" title="label->for_html_attr() ?>" - ajax_handler="ajax_handler ?>"> + data-ajax-handler="ajax_handler ?>"> label->for_html() ?> -- cgit v1.2.3 From 62335da79177414094cc143c41901a7c0605b5d1 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 26 Feb 2013 13:07:00 +0100 Subject: Follow-on from autocomplete updates. (9345dde83e1f092a9309c45282dc21e3fd408875, d632ef3e50252d388c272cacd29e8cc6e4949cec) - gallery module: added loading-small.gif (so all themes have it by default) - gallery module: added css for .ui-autocomplete-loading (copied from .g-loading-small in wind, but without !important so other themes can override it) - gallery module: updated upgrader.html.php to use new image (removes theme dependence) - wind theme: removed outdated css for .ac_loading (not used in v3.0.5, either) - server_add module: removed multiple argument from autocomplete (doesn't work well with it) --- modules/gallery/css/gallery.css | 4 ++++ modules/gallery/images/loading-small.gif | Bin 0 -> 673 bytes modules/gallery/views/upgrader.html.php | 2 +- modules/server_add/views/admin_server_add.html.php | 2 +- themes/wind/css/screen.css | 6 ------ 5 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 modules/gallery/images/loading-small.gif (limited to 'modules/gallery/views') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 73b8ab4e..323c2e83 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -164,6 +164,10 @@ text-align: left; } +.ui-autocomplete-loading { + background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center; +} + /** ******************************************************************* * 2) Admin **********************************************************************/ diff --git a/modules/gallery/images/loading-small.gif b/modules/gallery/images/loading-small.gif new file mode 100644 index 00000000..d0bce154 Binary files /dev/null and b/modules/gallery/images/loading-small.gif differ diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 4c611f7e..2e485c08 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -17,7 +17,7 @@