/** * Returns the folder selection dropdown to the template * * @param int $id The ID of the folder that is selected * @return DropdownField */ public function FolderDropdown($id = null) { if (!$id) { $id = $this->CurrentUploadFolder()->ID; } $group = new FieldGroup($d = new SimpleTreeDropdownField("UploadFolderID_{$this->id()}", '', "Folder", $id, "Filename"), new LiteralField("slash{$this->id()}", " / "), new TextField("NewFolder_{$this->id()}", ""), $a = new FormAction("ok_{$this->id()}", _t('Uploadify.CHANGEFOLDERACTION', 'Change'))); $a->useButtonTag = true; $a->addExtraClass("{'url' : '" . $this->Link('newfolder') . "' }"); $d->setValue($id); return $group; }