parentField = $parentField; $this->updateMethod = $updateMethod; parent::__construct($name); } function ParentField() { return $this->form->FormName() . '_' . $this->parentField; } function FieldHolder() { Requirements::javascript(CMS_DIR . '/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', (int) $_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 .= ''; } else { $result = '

' . _t('ThumbnailStripField.NOIMAGESFOUND', 'No images found in') . ' ' . $folder->Title . '

'; } return $result; } function getflash() { $folder = DataObject::get_by_id("Folder", $_GET['folderID']); if( !$folder ) return _t('ThumbnailStripField.NOTAFOLDER'); $folderList = $folder->getDescendantIDList("Folder"); array_unshift($folderList, $folder->ID); $width = Image::$strip_thumbnail_width - 10; $height = Image::$strip_thumbnail_height - 10; $flashObjects = DataObject::get("File", "ParentID IN (" . implode(', ', $folderList) . ") AND Filename LIKE '%.swf'"); $result = ''; if($flashObjects) { $result .= ''; } return $result; } } ?>