Author: Jonathan.Wage
Date: 2010-02-02 21:54:23 +0100 (Tue, 02 Feb 2010)
New Revision: 27448
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/config/app.yml
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetObject.class.php
Log:
[1.4][sfSympalPlugin][1.0] Improving flexibility and configurability of asset
rendering
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/config/app.yml
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/config/app.yml
2010-02-02 20:51:35 UTC (rev 27447)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/config/app.yml
2010-02-02 20:54:23 UTC (rev 27448)
@@ -9,6 +9,8 @@
thumbnails_max_width: 64
thumbnails_max_height: 64
thumbnails_method: fit
+ default_render_options:
+ embed: true
file_types: # define file_types is usefull for
displaying icons in browser
document: # type of file (also used as
default icon name)
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetObject.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetObject.class.php
2010-02-02 20:51:35 UTC (rev 27447)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetObject.class.php
2010-02-02 20:54:23 UTC (rev 27448)
@@ -195,8 +195,15 @@
public function render($options = array())
{
- if (isset($options['linked_thumbnail']))
+ $options = array_merge(sfSympalConfig::get('assets',
'default_render_options', array()));
+ $options =
sfApplicationConfiguration::getActive()->getEventDispatcher()->filter(new
sfEvent($this, 'sympal.assets.filter_render_options'),
$options)->getReturnValue();
+ if (isset($options['renderer']) && $options['renderer'])
{
+ $renderer = new $options['renderer']($this, $options);
+ return $renderer->render();
+ }
+ else if (isset($options['linked_thumbnail']))
+ {
return link_to($this->getThumbnailImage($options), $this->getUrl(),
$options);
}
else if (isset($options['url']))
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.