diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/g2_import/views/admin_g2_import.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/libraries/Admin_View.php | 34 | ||||
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 2 | ||||
-rw-r--r-- | modules/gallery/tests/xss_data.txt | 10 | ||||
-rw-r--r-- | modules/gallery_unit_test/controllers/gallery_unit_test.php | 11 | ||||
-rw-r--r-- | modules/server_add/js/server_add.js | 2 | ||||
-rw-r--r-- | modules/server_add/views/admin_server_add.html.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag_theme.php | 4 |
8 files changed, 47 insertions, 20 deletions
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index fd9487e4..adde83ce 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -1,6 +1,4 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<?= $theme->css("jquery.autocomplete.css") ?> -<?= $theme->script("jquery.autocomplete.js") ?> <script type="text/javascript"> $("document").ready(function() { $("form input[name=embed_path]").gallery_autocomplete( diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 62645d18..ba348d7a 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -93,7 +93,28 @@ class Admin_View_Core extends Gallery_View { case "body_attributes": case "html_attributes": $blocks = array(); + if (method_exists("gallery_theme", $function)) { + switch (count($args)) { + case 0: + $blocks[] = gallery_theme::$function($this); + break; + case 1: + $blocks[] = gallery_theme::$function($this, $args[0]); + break; + case 2: + $blocks[] = gallery_theme::$function($this, $args[0], $args[1]); + break; + default: + $blocks[] = call_user_func_array( + array("gallery_theme", $function), + array_merge(array($this), $args)); + } + } + foreach (module::active() as $module) { + if ($module->name == "gallery") { + continue; + } $helper_class = "{$module->name}_theme"; if (class_exists($helper_class) && method_exists($helper_class, $function)) { $blocks[] = call_user_func_array( @@ -102,15 +123,22 @@ class Admin_View_Core extends Gallery_View { } } + $helper_class = theme::$admin_theme_name . "_theme"; + if (class_exists($helper_class) && method_exists($helper_class, $function)) { + $blocks[] = call_user_func_array( + array($helper_class, $function), + array_merge(array($this), $args)); + } + if (Session::instance()->get("debug")) { - if ($function != "admin_head") { + if ($function != "admin_head" && $function != "body_attributes") { array_unshift( - $blocks, "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function\">" . + $blocks, + "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function g-clear-fix\">" . "<div class=\"title\">$function</div>"); $blocks[] = "</div>"; } } - return implode("\n", $blocks); default: diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index da1e8ce8..fbc58258 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -103,7 +103,7 @@ class Theme_View_Core extends Gallery_View { public function siblings($limit=null, $offset=null) { return call_user_func_array( $this->siblings_callback[0], - array_merge($this->siblings_callback[1], array($offset, $limit))); + array_merge($this->siblings_callback[1], array($limit, $offset))); } public function tag() { diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 7e77a70b..5daaa371 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -41,8 +41,8 @@ modules/comment/views/user_profile_comments.html.php 10 DIRTY_JS $comme modules/comment/views/user_profile_comments.html.php 11 DIRTY $comment->item()->thumb_img(array(),50) 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 7 DIRTY_JS url::site("__ARGS__") -modules/g2_import/views/admin_g2_import.html.php 49 DIRTY $form +modules/g2_import/views/admin_g2_import.html.php 5 DIRTY_JS url::site("__ARGS__") +modules/g2_import/views/admin_g2_import.html.php 47 DIRTY $form modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even") 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 8 DIRTY_JS user_profile::url($entry->user->id) @@ -350,9 +350,9 @@ modules/search/views/search.html.php 45 DIRTY $item- modules/search/views/search.html.php 47 DIRTY_ATTR $item_class modules/search/views/search.html.php 57 DIRTY $theme->paginator() modules/search/views/search_link.html.php 15 DIRTY_ATTR $album_id -modules/server_add/views/admin_server_add.html.php 8 DIRTY_JS url::site("__ARGS__") -modules/server_add/views/admin_server_add.html.php 16 DIRTY $form -modules/server_add/views/admin_server_add.html.php 27 DIRTY_ATTR $id +modules/server_add/views/admin_server_add.html.php 6 DIRTY_JS url::site("__ARGS__") +modules/server_add/views/admin_server_add.html.php 14 DIRTY $form +modules/server_add/views/admin_server_add.html.php 25 DIRTY_ATTR $id 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)?"g-directory":"g-file" modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__") diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 3275d741..6b2bf479 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -145,9 +145,14 @@ class Gallery_Unit_Test_Controller extends Controller { print $e->getTraceAsString() . "\n"; } - $failed = 0; - foreach ($unit_test->stats as $class => $stats) { - $failed += ($stats["failed"] + $stats["errors"]); + if (!isset($unit_test)) { + // If an exception is thrown, it's possible that $unit_test was never set. + $failed = 1; + } else { + $failed = 0; + foreach ($unit_test->stats as $class => $stats) { + $failed += ($stats["failed"] + $stats["errors"]); + } } if (PHP_SAPI == 'cli') { exit($failed); diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index 02dda4c0..a2499896 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -33,7 +33,7 @@ $("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) { self.open_dir(event); }); - $("#g-dialog").bind("dialogclose", function(event, ui) { + $("#g-dialog").on("dialogclose", function(event, ui) { window.location.reload(); }); }, diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php index 5ad142f3..f7e596b4 100644 --- a/modules/server_add/views/admin_server_add.html.php +++ b/modules/server_add/views/admin_server_add.html.php @@ -1,7 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <?= $theme->css("server_add.css") ?> -<?= $theme->css("jquery.autocomplete.css") ?> -<?= $theme->script("jquery.autocomplete.js") ?> <script type="text/javascript"> $("document").ready(function() { $("#g-path").gallery_autocomplete( diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index 81d1352f..143af6c1 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -19,9 +19,7 @@ */ class tag_theme_Core { static function head($theme) { - return $theme->css("jquery.autocomplete.css") - . $theme->script("jquery.autocomplete.js") - . $theme->css("tag.css"); + return $theme->css("tag.css"); } static function admin_head($theme) { |