';
$divoption = '
';
$closediv = '
';
if($upfolder){
echo $divoption;
$newparams = array_merge($params, array('curdir' => $parentdir));
echo $this->CreateLink($id, 'browsefiles', $returnid, $theadmintheme->DisplayImage("icons/filetypes/upfolder.gif").'
'.$this->Lang('parentdir'), $newparams);
echo $closediv;
}
foreach($folders as $filename){
echo $divoption;
$newparams = array_merge($params, array('curdir' => $curdir.'/'.$filename, 'parentdir' => $curdir));
echo $this->CreateLink($id, 'browsefiles', $returnid, '
'.$filename, $newparams);
echo $closediv;
}
foreach($files as $filename){
echo $divoption;
$newparams = array_merge($params, array('filename'=>$filename, 'filepath' => $curdir.'/'.$filename));
echo $this->CreateLink($id, 'assignfile', $returnid, imagemode_buildlinkcontent($baseurl, $filename, $dir), $newparams).'
';
$imginf = getimagesize($dir.DIRECTORY_SEPARATOR.$filename);
if($imginf && isset($imginf[1])) echo '('.$imginf[0].'x'.$imginf[1].') ';
$newparams = array_merge($params, array('deletefile'=>$filename));
echo $this->CreateLink($id, 'browsefiles', $returnid, $theadmintheme->DisplayImage("icons/system/delete.gif"),$newparams);
echo $closediv;
}
echo '
';
echo $this->CreateFormStart($id, 'addfiles', $returnid, 'post', 'multipart/form-data');
echo '';
if($addfiles){
echo '
';
}
echo '
'.$this->Lang('postmaxsize').ini_get('post_max_size').'
';
if(isset($params["size"])) echo '
('.$this->Lang('browsefilesresize').')
';
echo '
';
if($addfiles) echo '
'.$this->Lang("addfileinput").'
';
echo '
'.$this->CreateInputSubmit($id,'submit',lang('send')).'
';
echo $hidden;
echo '
';
echo $this->CreateFormEnd();
}else{
// list mode (no thumbnails) - uses a template
$instantsearch = $this->GetPreference("display_instantsearch",false);
$instantsort = $this->GetPreference("display_instantsort",false);
$this->smarty->assign("browsetitle",$this->Lang('browsefilestitle'));
$this->smarty->assign("uploadtitle",lang('uploadfile'));
$this->smarty->assign("showingdir",$this->Lang('showingdir').' : '.$dir);
$this->smarty->assign("formstart",$this->CreateFormStart($id, 'addfiles', $returnid, 'post', 'multipart/form-data'));
$this->smarty->assign("formend",$hidden.$this->CreateFormEnd());
$this->smarty->assign("resizenotice",isset($params["size"])?$this->Lang('browsefilesresize'):false);
$this->smarty->assign("postmaxsize",$this->Lang('postmaxsize').ini_get('post_max_size'));
$this->smarty->assign("submit",$this->CreateInputSubmit($id,'submit',lang('send')));
$this->smarty->assign("instantsearch", $instantsearch?$this->Lang("searchthistable")." ".$this->CreateInputText($id, "searchfiletable", "", 10, 64, ' onkeyup="ctlmm_search(this.value,\'filelist_table\');"'):false);
$this->smarty->assign("ziptitle", $this->Lang("uploadzipfile"));
$this->smarty->assign("zipnotice", $this->Lang("zipfilenotice"));
$this->smarty->assign("zipinput", $this->CreateFileUploadInput($id,'uploadzipfile'));
$this->smarty->assign("zipsubmit", $this->CreateInputSubmit($id,'submitzipfile',lang('send')));
if($addfiles){
$this->smarty->assign("fileinput",'