From d45a73777935c86fc5131955831833d7465b5e9d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Jan 2013 01:22:01 -0500 Subject: Update copyright to 2013. Fixes #1953. --- modules/info/helpers/info_block.php | 2 +- modules/info/helpers/info_installer.php | 2 +- modules/info/helpers/info_theme.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/info/helpers') diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index d62c900d..4079fe55 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -1,7 +1,7 @@ Date: Thu, 24 Jan 2013 12:03:05 +0100 Subject: #1960 - Add unit test to look for extra spaces at end of line - Added no_extra_spaces_at_end_of_line_test to File_Structure_Test. - Updated Gallery_Filters to exclude testing code that isn't ours. - Removed existing extra spaces. New test now passes. --- modules/gallery/helpers/gallery_installer.php | 6 +++--- modules/gallery/helpers/movie.php | 6 +++--- modules/gallery/tests/File_Structure_Test.php | 18 +++++++++++++++++- modules/gallery/tests/Gallery_Filters.php | 4 ++++ modules/gallery/views/movieplayer.html.php | 2 +- modules/info/helpers/info_block.php | 2 +- modules/organize/views/organize_frame.html.php | 6 +++--- themes/admin_wind/css/fix-ie.css | 2 +- 8 files changed, 33 insertions(+), 13 deletions(-) (limited to 'modules/info/helpers') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 91c785f6..fe651a4e 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -718,14 +718,14 @@ class gallery_installer { if ($version == 50) { // In v51, we added a lock_timeout variable so that administrators could edit the time out - // from 1 second to a higher variable if their system runs concurrent parallel uploads for + // from 1 second to a higher variable if their system runs concurrent parallel uploads for // instance. module::set_var("gallery", "lock_timeout", 1); module::set_version("gallery", $version = 51); } if ($version == 51) { - // In v52, we added functions to the legal_file helper that map photo and movie file + // In v52, we added functions to the legal_file helper that map photo and movie file // extensions to their mime types (and allow extension of the list by other modules). During // this process, we correctly mapped m4v files to video/x-m4v, correcting a previous error // where they were mapped to video/mp4. This corrects the existing items. @@ -736,7 +736,7 @@ class gallery_installer { ->execute(); module::set_version("gallery", $version = 52); } - + if ($version == 52) { // In v53, we added the ability to change the default time used when extracting frames from // movies. Previously we hard-coded this at 3 seconds, so we use that as the default. diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index fb3fab80..7e6a2e55 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -82,7 +82,7 @@ class movie_Core { // extract frame at start_time, unless movie is too short $start_time_arg = ($duration >= $start_time + 0.1) ? "-ss " . movie::seconds_to_hhmmssdd($start_time) : ""; - + $input_args = isset($movie_options["input_args"]) ? $movie_options["input_args"] : ""; $output_args = isset($movie_options["output_args"]) ? $movie_options["output_args"] : ""; @@ -164,7 +164,7 @@ class movie_Core { * Return the time/duration formatted in hh:mm:ss.dd from a number of seconds. * Useful for inputs to ffmpeg. * - * Note that this is similar to date("H:i:s", mktime(0,0,$seconds,0,0,0,0)), but unlike this + * Note that this is similar to date("H:i:s", mktime(0,0,$seconds,0,0,0,0)), but unlike this * approach avoids potential issues with time zone and DST mismatch and/or using deprecated * features (the last argument of mkdate above, which disables DST, is deprecated as of PHP 5.3). */ @@ -172,7 +172,7 @@ class movie_Core { return sprintf("%02d:%02d:%05.2f", floor($seconds / 3600), floor(($seconds % 3600) / 60), floor(100 * $seconds % 6000) / 100); } - + /** * Return the number of seconds from a time/duration formatted in hh:mm:ss.dd. * Useful for outputs from ffmpeg. diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 7ad865e0..ce75ea13 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -285,7 +285,7 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { } public function all_public_functions_in_test_files_end_in_test() { - // Who tests the tests? :-) + // Who tests the tests? :-) (ref: http://www.xkcd.com/1163) $dir = new PhpCodeFilterIterator( new GalleryCodeFilterIterator( new RecursiveIteratorIterator( @@ -315,4 +315,20 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { } } } + + public function no_extra_spaces_at_end_of_line_test() { + $dir = new GalleryCodeFilterIterator( + new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + $errors = ""; + foreach ($dir as $file) { + if (preg_match("/\.(php|css|html|js)$/", $file)) { + foreach (file($file) as $line_num => $line) { + if ((substr($line, -2) == " \n") || (substr($line, -1) == " ")) { + $errors .= "$file at line " . ($line_num + 1) . "\n"; + } + } + } + } + $this->assert_true(empty($errors), "Extra spaces at end of line found at:\n$errors"); + } } diff --git a/modules/gallery/tests/Gallery_Filters.php b/modules/gallery/tests/Gallery_Filters.php index 83dbd53f..6c2a6aa3 100644 --- a/modules/gallery/tests/Gallery_Filters.php +++ b/modules/gallery/tests/Gallery_Filters.php @@ -47,6 +47,10 @@ class GalleryCodeFilterIterator extends FilterIterator { strpos($path_name, SYSPATH) !== false || strpos($path_name, MODPATH . "gallery/libraries/HTMLPurifier") !== false || strpos($path_name, MODPATH . "gallery/vendor/joomla") !== false || + strpos($path_name, MODPATH . "organize/vendor/ext") !== false || + strpos($path_name, DOCROOT . "lib") !== false || + strpos($path_name, DOCROOT . "themes/admin_wind/css/themeroller") !== false || + strpos($path_name, DOCROOT . "themes/wind/css/themeroller") !== false || substr($path_name, -1, 1) == "~"); } } diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php index 25cb9f58..edb5184c 100644 --- a/modules/gallery/views/movieplayer.html.php +++ b/modules/gallery/views/movieplayer.html.php @@ -18,7 +18,7 @@ $("#" + id).css({width: width, height: height}); }; // setup flowplayer - flowplayer(id, + flowplayer(id, $.extend(true, { "src": "", "wmode": "transparent", diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index 4079fe55..62aa0746 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -29,7 +29,7 @@ class info_block_Core { if ($theme->item()) { $block = new Block(); $block->css_id = "g-metadata"; - $block->title = $theme->item()->is_album() ? t("Album info") : + $block->title = $theme->item()->is_album() ? t("Album info") : ($theme->item()->is_movie() ? t("Movie info") : t("Photo info")); $block->content = new View("info_block.html"); if ($theme->item->title && module::get_var("info", "show_title")) { diff --git a/modules/organize/views/organize_frame.html.php b/modules/organize/views/organize_frame.html.php index c33b7607..b1d92675 100644 --- a/modules/organize/views/organize_frame.html.php +++ b/modules/organize/views/organize_frame.html.php @@ -365,7 +365,7 @@ } } }); - + var tag_button = new Ext.Button({ flex: 2, text: for_js() ?>, @@ -425,11 +425,11 @@ sort_column_combobox, sort_order_combobox ] - }, + }, { xtype: "spacer", - flex: 3 + flex: 3 }, tag_textfield, tag_button, diff --git a/themes/admin_wind/css/fix-ie.css b/themes/admin_wind/css/fix-ie.css index 5475cb79..4546f9fa 100644 --- a/themes/admin_wind/css/fix-ie.css +++ b/themes/admin_wind/css/fix-ie.css @@ -15,4 +15,4 @@ tr.g-info td, tr.g-success td, tr.g-warning td { background: none !important; -} +} -- cgit v1.2.3 From 93963422505ecc790af62ae0503f301145debac3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 31 Jan 2013 19:55:53 -0500 Subject: Drop the requirement to have the install() function set the module version. It's redundant. Fixes #1985. --- modules/comment/helpers/comment_installer.php | 1 - modules/digibug/helpers/digibug_installer.php | 1 - modules/exif/helpers/exif_installer.php | 1 - modules/g2_import/helpers/g2_import_installer.php | 1 - modules/gallery/helpers/gallery_installer.php | 2 -- modules/gallery/helpers/module.php | 3 +-- modules/image_block/helpers/image_block_installer.php | 1 - modules/info/helpers/info_installer.php | 1 - modules/notification/helpers/notification_installer.php | 2 -- modules/rest/helpers/rest_installer.php | 1 - modules/search/helpers/search_installer.php | 1 - modules/server_add/helpers/server_add_installer.php | 1 - modules/slideshow/helpers/slideshow_installer.php | 1 - modules/tag/helpers/tag_installer.php | 1 - modules/user/helpers/user_installer.php | 1 - modules/watermark/helpers/watermark_installer.php | 1 - 16 files changed, 1 insertion(+), 19 deletions(-) (limited to 'modules/info/helpers') diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index 6dbd31cf..136f96ef 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -49,7 +49,6 @@ class comment_installer { module::set_var("comment", "spam_caught", 0); module::set_var("comment", "access_permissions", "everybody"); module::set_var("comment", "rss_visible", "all"); - module::set_version("comment", 7); } static function upgrade($version) { diff --git a/modules/digibug/helpers/digibug_installer.php b/modules/digibug/helpers/digibug_installer.php index b2e529d7..be88b5ec 100644 --- a/modules/digibug/helpers/digibug_installer.php +++ b/modules/digibug/helpers/digibug_installer.php @@ -30,7 +30,6 @@ class digibug_installer { module::set_var("digibug", "company_id", "3153"); module::set_var("digibug", "event_id", "8491"); - module::set_version("digibug", 2); } static function upgrade($version) { diff --git a/modules/exif/helpers/exif_installer.php b/modules/exif/helpers/exif_installer.php index f4c2aa3b..75d0f835 100644 --- a/modules/exif/helpers/exif_installer.php +++ b/modules/exif/helpers/exif_installer.php @@ -29,7 +29,6 @@ class exif_installer { PRIMARY KEY (`id`), KEY(`item_id`)) DEFAULT CHARSET=utf8;"); - module::set_version("exif", 1); } static function activate() { diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php index b0c14425..c7569819 100644 --- a/modules/g2_import/helpers/g2_import_installer.php +++ b/modules/g2_import/helpers/g2_import_installer.php @@ -31,7 +31,6 @@ class g2_import_installer { KEY `g2_id` (`g2_id`)) DEFAULT CHARSET=utf8;"); - module::set_version("g2_import", 2); mkdir(VARPATH . "modules/g2_import"); } diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index d4c4de14..7f10cdee 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -315,8 +315,6 @@ class gallery_installer { module::set_var("gallery", "timezone", null); module::set_var("gallery", "lock_timeout", 1); module::set_var("gallery", "movie_extract_frame_time", 3); - - module::set_version("gallery", 55); } static function upgrade($version) { diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index f4ab5571..df258e87 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -175,9 +175,8 @@ class module_Core { $installer_class = "{$module_name}_installer"; if (method_exists($installer_class, "install")) { call_user_func_array(array($installer_class, "install"), array()); - } else { - module::set_version($module_name, module::available()->$module_name->code_version); } + module::set_version($module_name, module::available()->$module_name->code_version); // Set the weight of the new module, which controls the order in which the modules are // loaded. By default, new modules are installed at the end of the priority list. Since the diff --git a/modules/image_block/helpers/image_block_installer.php b/modules/image_block/helpers/image_block_installer.php index 8558fe51..b177b971 100644 --- a/modules/image_block/helpers/image_block_installer.php +++ b/modules/image_block/helpers/image_block_installer.php @@ -21,7 +21,6 @@ class image_block_installer { static function install() { module::set_var("image_block", "image_count", "1"); - module::set_version("image_block", $version = 3); } static function upgrade($version) { diff --git a/modules/info/helpers/info_installer.php b/modules/info/helpers/info_installer.php index 560af15c..43c216dc 100644 --- a/modules/info/helpers/info_installer.php +++ b/modules/info/helpers/info_installer.php @@ -25,7 +25,6 @@ class info_installer { module::set_var("info", "show_owner", 1); module::set_var("info", "show_name", 1); module::set_var("info", "show_captured", 1); - module::set_version("info", 2); } static function upgrade($version) { diff --git a/modules/notification/helpers/notification_installer.php b/modules/notification/helpers/notification_installer.php index 58435641..f6b05c18 100644 --- a/modules/notification/helpers/notification_installer.php +++ b/modules/notification/helpers/notification_installer.php @@ -36,8 +36,6 @@ class notification_installer { `text` text, PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;"); - - module::set_version("notification", 2); } static function upgrade($version) { diff --git a/modules/rest/helpers/rest_installer.php b/modules/rest/helpers/rest_installer.php index df7484fe..96f8acfa 100644 --- a/modules/rest/helpers/rest_installer.php +++ b/modules/rest/helpers/rest_installer.php @@ -29,7 +29,6 @@ class rest_installer { UNIQUE KEY(`user_id`)) DEFAULT CHARSET=utf8;"); module::set_var("rest", "allow_guest_access", false); - module::set_version("rest", 3); } static function upgrade($version) { diff --git a/modules/search/helpers/search_installer.php b/modules/search/helpers/search_installer.php index 78dbce38..c9e8f26c 100644 --- a/modules/search/helpers/search_installer.php +++ b/modules/search/helpers/search_installer.php @@ -30,7 +30,6 @@ class search_installer { FULLTEXT INDEX (`data`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;"); - module::set_version("search", 1); } static function activate() { diff --git a/modules/server_add/helpers/server_add_installer.php b/modules/server_add/helpers/server_add_installer.php index e843fc79..b62bbcfa 100644 --- a/modules/server_add/helpers/server_add_installer.php +++ b/modules/server_add/helpers/server_add_installer.php @@ -30,7 +30,6 @@ class server_add_installer { `task_id` int(9) NOT NULL, PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;"); - module::set_version("server_add", 4); server_add::check_config(); } diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php index d283487d..22bd9534 100644 --- a/modules/slideshow/helpers/slideshow_installer.php +++ b/modules/slideshow/helpers/slideshow_installer.php @@ -20,7 +20,6 @@ class slideshow_installer { static function install() { module::set_var("slideshow", "max_scale", 0); - module::set_version("slideshow", 2); } static function upgrade($version) { diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php index f80a9de3..1fd18f3e 100644 --- a/modules/tag/helpers/tag_installer.php +++ b/modules/tag/helpers/tag_installer.php @@ -37,7 +37,6 @@ class tag_installer { KEY(`item_id`, `id`)) DEFAULT CHARSET=utf8;"); module::set_var("tag", "tag_cloud_size", 30); - module::set_version("tag", 3); } static function upgrade($version) { diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index e28af69a..67f6a3d5 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -138,6 +138,5 @@ class user_installer { access::allow($registered, "view_full", $root); module::set_var("user", "minimum_password_length", 5); - module::set_version("user", 4); } } \ No newline at end of file diff --git a/modules/watermark/helpers/watermark_installer.php b/modules/watermark/helpers/watermark_installer.php index 5df780a1..13338912 100644 --- a/modules/watermark/helpers/watermark_installer.php +++ b/modules/watermark/helpers/watermark_installer.php @@ -33,7 +33,6 @@ class watermark_installer { DEFAULT CHARSET=utf8;"); @mkdir(VARPATH . "modules/watermark"); - module::set_version("watermark", 2); } static function uninstall() { -- cgit v1.2.3