diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2011-03-27 11:25:27 -0700 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2011-03-27 11:25:27 -0700 | 
| commit | 65825c572a0db24036c855de01714c613a979550 (patch) | |
| tree | 5b47f305074f4f7c065d8726dc3581bcddb1b5a0 /modules/gallery/helpers | |
| parent | c791ae96d5bb28f39b26a0e556e10e636f97436c (diff) | |
| parent | 12e81d081d412a052860f04902b28da4a460c3fa (diff) | |
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
| -rw-r--r-- | modules/gallery/helpers/gallery_event.php | 6 | ||||
| -rw-r--r-- | modules/gallery/helpers/gallery_graphics.php | 21 | ||||
| -rw-r--r-- | modules/gallery/helpers/graphics.php | 2 | ||||
| -rw-r--r-- | modules/gallery/helpers/upgrade_checker.php | 3 | 
4 files changed, 19 insertions, 13 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 07817187..fbdb4ad5 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -539,9 +539,9 @@ class gallery_event_Core {      $v = new View("user_profile_info.html");      $fields = array("name" => t("Name"), "locale" => t("Language Preference"), -                    "email" => t("Email"), "full_name" => t("Full name"), "url" => "Web site"); +                    "email" => t("Email"), "full_name" => t("Full name"), "url" => t("Web site"));      if (!$data->user->guest) { -      $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site"); +      $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => t("Web site"));      }      $v->user_profile_data = array();      foreach ($fields as $field => $label) { @@ -549,6 +549,8 @@ class gallery_event_Core {          $value = $data->user->$field;          if ($field == "locale") {            $value = locales::display_name($value); +        } elseif ($field == "url") { +          $value = html::mark_clean(html::anchor($data->user->$field));          }          $v->user_profile_data[(string) $label] = $value;        } diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index e63b9336..716bad18 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -24,18 +24,19 @@ class gallery_graphics_Core {     * @param string     $input_file     * @param string     $output_file     * @param array      $options +   * @param Item_Model $item (optional)     */ -  static function rotate($input_file, $output_file, $options) { +  static function rotate($input_file, $output_file, $options, $item=null) {      graphics::init_toolkit(); -    module::event("graphics_rotate", $input_file, $output_file, $options); +    module::event("graphics_rotate", $input_file, $output_file, $options, $item);      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); +    module::event("graphics_rotate_completed", $input_file, $output_file, $options, $item);    }    /** @@ -45,11 +46,12 @@ class gallery_graphics_Core {     * @param string     $input_file     * @param string     $output_file     * @param array      $options +   * @param Item_Model $item (optional)     */ -  static function resize($input_file, $output_file, $options) { +  static function resize($input_file, $output_file, $options, $item=null) {      graphics::init_toolkit(); -    module::event("graphics_resize", $input_file, $output_file, $options); +    module::event("graphics_resize", $input_file, $output_file, $options, $item);      if (@filesize($input_file) == 0) {        throw new Exception("@todo EMPTY_INPUT_FILE"); @@ -69,7 +71,7 @@ class gallery_graphics_Core {        $image->save($output_file);      } -    module::event("graphics_resize_completed", $input_file, $output_file, $options); +    module::event("graphics_resize_completed", $input_file, $output_file, $options, $item);    }    /** @@ -86,12 +88,13 @@ class gallery_graphics_Core {     * @param string     $input_file     * @param string     $output_file     * @param array      $options +   * @param Item_Model $item (optional)     */ -  static function composite($input_file, $output_file, $options) { +  static function composite($input_file, $output_file, $options, $item=null) {      try {        graphics::init_toolkit(); -      module::event("graphics_composite", $input_file, $output_file, $options); +      module::event("graphics_composite", $input_file, $output_file, $options, $item);        list ($width, $height) = getimagesize($input_file);        list ($w_width, $w_height) = getimagesize($options["file"]); @@ -121,7 +124,7 @@ class gallery_graphics_Core {          ->quality(module::get_var("gallery", "image_quality"))          ->save($output_file); -      module::event("graphics_composite_completed", $input_file, $output_file, $options); +      module::event("graphics_composite_completed", $input_file, $output_file, $options, $item);      } catch (ErrorException $e) {        Kohana_Log::add("error", $e->get_message());      } diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 72c563b7..04501132 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -169,7 +169,7 @@ class graphics_Core {          }          foreach (self::_get_rules($target) as $rule) { -          $args = array($working_file, $output_file, unserialize($rule->args)); +          $args = array($working_file, $output_file, unserialize($rule->args), $item);            call_user_func_array($rule->operation, $args);            $working_file = $output_file;          } diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index ff65608b..c11a9319 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -42,7 +42,8 @@ class upgrade_checker_Core {    static function should_auto_check() {      if (upgrade_checker::auto_check_enabled() && random::int(1, 100) == 1) {        $version_info = upgrade_checker::version_info(); -      return (!$version_info || (time() - $version_info->timestamp) > AUTO_CHECK_INTERVAL); +      return (!$version_info || +              (time() - $version_info->timestamp) > upgrade_checker::AUTO_CHECK_INTERVAL);      }      return false;    }  | 
