Skip to content

Commit

Permalink
Merge pull request unclecheese#18 from jonom/master
Browse files Browse the repository at this point in the history
Made so if UploadFolder is set Import interface loads that folder
  • Loading branch information
unclecheese committed Nov 18, 2011
2 parents df1609a + 14423d3 commit 33e01b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion code/UploadifyField.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,10 @@ public function FolderDropdown($id = null) {
* @return DropdownField
*/
public function ImportDropdown() {
$UploadFolder = $this->getUploadFolder();
$id = ($UploadFolder!="Uploads") ? Folder::findOrMake($UploadFolder)->ID : null;
$class = (class_exists("SimpleTreeDropdownField")) ? "SimpleTreeDropdownField" : "DropdownField";
$d = new $class("ImportFolderID_{$this->id()}", _t('Uploadify.CHOOSEIMPORTFOLDER','Choose a folder'), "Folder", null, "Filename");
$d = new $class("ImportFolderID_{$this->id()}", _t('Uploadify.CHOOSEIMPORTFOLDER','Choose a folder'), "Folder", $id, "Filename");
$d->setEmptyString('-- ' . _t('Uploadify.PLEASESELECT','Select a folder') . ' --');
$d->addExtraClass("{'url' : '".$this->Link('importlist')."' }");
return $d;
Expand Down
2 changes: 1 addition & 1 deletion javascript/uploadify_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ $(function() {
});
}
});
});
}).change();

$('.import_dropdown button').live("click", function() {
url = $(this).metadata().url;
Expand Down

0 comments on commit 33e01b3

Please sign in to comment.