summaryrefslogtreecommitdiff
path: root/protected/extensions/SimpleImage/CSimpleImage.php
diff options
context:
space:
mode:
authorTristan Zur <tzur@ccwn.org>2012-05-18 11:31:14 +0200
committerTristan Zur <tzur@ccwn.org>2012-05-18 11:31:14 +0200
commitbb5de528c46a6acc56c9e856caae5f9999319d62 (patch)
treef9c1772868663342b242a2eaa8fa71baafc2eefc /protected/extensions/SimpleImage/CSimpleImage.php
parent3cb7fbfceae978d2b87ae976bf4536c3461bb868 (diff)
- Dateiupload in eigene Klasse ausgelagert -> Upload wird immer gleich
durchgeführt. - Extension SimpleImage hinzugefügt -> Bildgrößen werden nun auf eine konfigurierbare Maximalbreite und Maximalhöhe verkleinert
Diffstat (limited to '')
-rw-r--r--protected/extensions/SimpleImage/CSimpleImage.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/protected/extensions/SimpleImage/CSimpleImage.php b/protected/extensions/SimpleImage/CSimpleImage.php
new file mode 100644
index 0000000..754344b
--- /dev/null
+++ b/protected/extensions/SimpleImage/CSimpleImage.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Application component to load SimpleImage instance.
+ * The original component was developed by Khanh Nam.
+ * @link http://www.yiiframework.com/extension/simpleimage/
+ * @author tzur
+ *
+ */
+class CSimpleImage extends CApplicationComponent{
+ /**
+ * Initializes the SimpleImage component.
+ * Imports the SimpleImage class to be used by this component.
+ * @see CApplicationComponent::init()
+ */
+ public function init() {
+ parent::init();
+ $dir = dirname(__FILE__);
+ $alias = md5($dir);
+ Yii::setPathOfAlias($alias, $dir);
+ Yii::import($alias.'.SimpleImage');
+ }
+
+ /**
+ * Loads the image and creates a SimpleImage instance.
+ * @param string $filename
+ * @return SimpleImage
+ */
+ public function load($filename){
+ return new SimpleImage($filename);
+ }
+}
+?>