'background' => 'none',
'gallery_view' => 'GalleryLightbox'
);
+
+/* Style for specifying mobile specific views. Ansel looks for this
+ * style when rendering on a mobile device.
+ */
+$styles['ansel_mobile'] = array(
+ 'name' => 'ansel_mobile',
+ 'title' => _("Mobile View"),
+ 'thumbstyle' => 'SquareThumb',
+ 'background' => 'none',
+ 'width' => 75,
+ 'height' => 75,
+);
\ No newline at end of file
foreach ($images as $img) {
$i = new StdClass();
$i->id = $img;
- $i->url = Ansel::getImageUrl($img, 'mini', false, Ansel::getStyleDefinition('ansel_mobile'))->toString();
+ $i->url = Ansel::getImageUrl($img, 'thumb', false, Ansel::getStyleDefinition('ansel_mobile'))->toString();
$json->imgs[] = $i;
}
}
{
parent::__construct($params);
$this->title = _("Square Thumbnails");
+ if (empty($this->_params['width'])) {
+ $this->_params['width'] = $this->_style->width;
+ }
+ if (empty($this->_params['height'])) {
+ $this->_params['height'] = $this->_style->height;
+ }
}
/**
* to display on the gallery view.
* e.g. Array('Geotag' => array(),
* 'Tags' => array('view' => 'gallery'))
+ * 'width' - Optional width of generated thumbnails.
+ * 'height' - Option height of generated thumbnails.
* 'image_widgets' - @TODO: not yet implemented.
* </pre>
*
public function getHash($view)
{
if ($view != 'screen' && $view != 'mini' && $view != 'full') {
- $view = md5($this->thumbstyle . '.' . $this->background);
+ $view = md5($this->thumbstyle . '.' . $this->background . (!empty($this->width) ? $this->width : '') . (!empty($this->height) ? $this->height : ''));
}
return $view;
return $class;
}
- return $this->_properties[$property];
+ return !empty($this->_properties[$property]) ? $this->_properties[$property] : null;
}
public function __isset($property)