parentField = $parentField;
$this->updateMethod = $updateMethod;
parent::__construct($name);
}
function ParentField() {
return $this->form->FormName() . '_' . $this->parentField;
}
function FieldHolder() {
Requirements::javascript('cms/javascript/ThumbnailStripField.js');
return $this->renderWith('ThumbnailStripField');
}
function Images() {
//return DataObject::get("Image", "Paretn);
}
function UpdateMethod() {
return $this->updateMethod;
}
/**
* Populate the Thumbnail strip field, by looking for a folder,
* and the descendants of this folder.
*/
function getimages() {
$result = '';
$folder = DataObject::get_by_id("Folder", $_GET['folderID']);
if( !$folder )
return _t('ThumbnailStripField.NOTAFOLDER','This is not a folder');
$folderList = $folder->getDescendantIDList("Folder");
array_unshift($folderList, $folder->ID);
$images = DataObject::get("Image", "ParentID IN (" . implode(', ', $folderList) . ")","Title");
if($images) {
$result .= '
';
foreach($images as $image) {
$thumbnail = $image->getFormattedImage('StripThumbnail');
// Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to
// set width & height properties on the tag inserted into the CMS. Resampling is done after save
$width = $image->Width;
$height = $image->Height;
if($width > 600) {
$height *= (600/$width);
$width = 600;
}
if($height > 600) {
$width *= (600/$height);
$height = 600;
}
$result .=
'
';
foreach($flashObjects as $flashObject) {
// doesn't work well because we can't stop/mute flash-files, AND IE does not bubble javascript-events
// over a flash-object grml
// $result .= <<
//
//
//HTML;
$result .= <<
$flashObject->Name
HTML;
}
$result .= '