summaryrefslogtreecommitdiff
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
parentd87c5d7963747aca41969af44eefaf2a6c3a305f (diff)
* calendar image path, with asset publication
-rw-r--r--app/php/model/Calendar.php21
-rw-r--r--resources/images/calendars/.gitignore1
2 files changed, 22 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;
+ }
+ }
+
}
?>
diff --git a/resources/images/calendars/.gitignore b/resources/images/calendars/.gitignore
new file mode 100644
index 0000000..72e8ffc
--- /dev/null
+++ b/resources/images/calendars/.gitignore
@@ -0,0 +1 @@
+*