}
/**
- * Return a hash key for the given view and style.
- *
- * @param string $view The view (thumb, prettythumb etc...)
- * @param Ansel_Style $style The style object.
- *
- * @return string A md5 hash suitable for use as a key.
- */
- static public function getViewHash($view, $style)
- {
- if ($view != 'screen' && $view != 'thumb' && $view != 'mini' &&
- $view != 'full') {
-
- $view = md5($style->thumbstyle . '.' . $style->background);
- }
-
- return $view;
- }
-
- /**
* Get a date parts array containing only enough date parts for the depth
* we are at. If an empty array is passed, attempt to get the parts from
* url parametrs. Any missing date parts must be set to 0.
}
/**
- * Return a hash key for the given view and style.
- *
- * @param string $view The view (thumb, etc...)
- * @param Ansel_Style $style The style.
- *
- * @return string A md5 hash suitable for use as a key.
- */
- public function getViewHash($view, $style = null)
- {
- if (empty($style)) {
- $style = $this->getStyle();
- }
-
- return Ansel::getViewHash($view, $style);
- }
-
- /**
* Checks to see if a user has a given permission.
*
* @param string $userid The userid of the user.
$style = $gallery->getStyle();
}
- if ($view == 'thumb' && $style->thumbstyle == 'Thumb') {
- return $view;
- }
-
- $view = md5($style->thumbstyle . '.' . $style->background);
-
- return $view;
+ return $style->getHash($view);
}
/**
// Make sure that the style hash is recorded, ignoring non-styled thumbs
if ($style->thumbstyle != 'Thumb') {
- $GLOBALS['injector']->getInstance('Ansel_Storage')->ensureHash($gallery->getViewHash('thumb'));
+ $GLOBALS['injector']->getInstance('Ansel_Storage')->ensureHash($gallery->getStyle()->getHash('thumb'));
}
// Clear the OtherGalleries widget cache