summaryrefslogtreecommitdiff
path: root/app/php/model/Calendar.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-06 11:31:34 +0200
committeremkael <emkael@tlen.pl>2016-04-06 11:31:34 +0200
commite8c7ef440c0961118992dc24cc96c77fd1532d01 (patch)
treef1d3d3a2de72a76d39949074c9b66c1f88dc91aa /app/php/model/Calendar.php
parentd87c5d7963747aca41969af44eefaf2a6c3a305f (diff)
* calendar image path, with asset publication
Diffstat (limited to 'app/php/model/Calendar.php')
-rw-r--r--app/php/model/Calendar.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/php/model/Calendar.php b/app/php/model/Calendar.php
index ab0b2e8..23a0818 100644
--- a/app/php/model/Calendar.php
+++ b/app/php/model/Calendar.php
@@ -42,6 +42,27 @@ class Calendar extends ActiveRecord {
return parent::finder($className);
}
+ const CUSTOM_IMAGE_PATH = '../../resources/images/calendars/';
+
+ public function getCustomImageUrl() {
+ if ($this->CustomImage) {
+ if (!preg_match('#^//#', $this->CustomImage)) {
+ return Prado::getApplication()->getAssetManager()->publishFilePath(
+ implode(
+ DIRECTORY_SEPARATOR,
+ [
+ Prado::getApplication()->getBasePath(),
+ self::CUSTOM_IMAGE_PATH,
+ $this->CustomImage
+ ]
+ ),
+ TRUE
+ );
+ }
+ return $this->CustomImage;
+ }
+ }
+
}
?>