mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-31 08:49:16 -04:00
Move the thumb_proportion method into Theme_View and set it by default
if the page type is album. Leave a todo if we ever set up a theme default API
This commit is contained in:
@@ -47,6 +47,9 @@ class Theme_View_Core extends View {
|
||||
$this->set_global("theme", $this);
|
||||
$this->set_global("user", user::active());
|
||||
$this->set_global("page_type", $page_type);
|
||||
if ($page_type == "album") {
|
||||
$this->set_global("thumb_proportion", $this->thumb_proportion());
|
||||
}
|
||||
|
||||
$maintenance_mode = Kohana::config("core.maintenance_mode", false, false);
|
||||
if ($maintenance_mode) {
|
||||
@@ -54,6 +57,16 @@ class Theme_View_Core extends View {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Proportion of the current thumb_size's to default
|
||||
* @return int
|
||||
*/
|
||||
public function thumb_proportion() {
|
||||
// @TODO change the 200 to a theme supplied value when and if we come up with an
|
||||
// API to allow the theme to set defaults.
|
||||
return module::get_var("core", "thumb_size", 200) / 200;
|
||||
}
|
||||
|
||||
public function url($path, $absolute_url=false) {
|
||||
$arg = "themes/{$this->theme_name}/$path";
|
||||
return $absolute_url ? url::abs_file($arg) : url::file($arg);
|
||||
|
||||
Reference in New Issue
Block a user