Feature #16323 » 6039_v3.patch

Administrator Admin, 2008-02-28 00:32

View differences:

t3lib/class.t3lib_refindex.php (working copy)
564 564
					$realFile = $dest.'/'.trim($file);
565 565
#					if (@is_file($realFile))	{		// Now, the refernece index should NOT look if files exist - just faithfully include them if they are in the records!
566 566
						$newValueFiles[] = array(
567
							'filename' => $file,
567
							'filename' => basename($file),
568 568
							'ID' => md5($realFile),
569 569
							'ID_absFile' => $realFile
570 570
						);	// the order should be preserved here because.. (?)
......
974 974
	 * @return	string		Input folder prefixed with PATH_site. No checking for existence is done. Output must be a folder without trailing slash.
975 975
	 */
976 976
	function destPathFromUploadFolder($folder)	{
977
		if (!$folder) {
978
			return substr(PATH_site, 0, -1);
979
		}
977 980
		return PATH_site.$folder;
978 981
	}
979 982

  
t3lib/class.t3lib_tceforms.php (working copy)
2032 2032

  
2033 2033
				if(!$disabled && !(isset($config['disable_controls']) && t3lib_div::inList($config['disable_controls'], 'upload'))) {
2034 2034
						// Adding the upload field:
2035
					if ($this->edit_docModuleUpload)	$item.='<input type="file" name="'.$PA['itemFormElName_file'].'"'.$this->formWidth().' size="60" />';
2035
					if ($this->edit_docModuleUpload && $config['uploadfolder']) {
2036
						$item.='<input type="file" name="'.$PA['itemFormElName_file'].'"'.$this->formWidth().' size="60" />';
2037
					}
2036 2038
				}
2037 2039
			break;
2038 2040
			case 'db':	// If the element is of the internal type "db":
......
3310 3312
					while(list(,$pp)=each($itemArray))	{
3311 3313
						$pParts = explode('|',$pp);
3312 3314
						$uidList[]=$pUid=$pTitle = $pParts[0];
3313
						$opt[]='<option value="'.htmlspecialchars(rawurldecode($pParts[0])).'">'.htmlspecialchars(rawurldecode($pParts[0])).'</option>';
3315
						$opt[]='<option value="'.htmlspecialchars(rawurldecode($pParts[0])).'">'.htmlspecialchars(basename(rawurldecode($pParts[0]))).'</option>';
3314 3316
					}
3315 3317
				break;
3316 3318
				default:
t3lib/class.t3lib_tcemain.php (working copy)
1696 1696
				}
1697 1697
				$valueArray = $dbAnalysis->countItems();
1698 1698
			}
1699
		//store path relative to site root (if uploadfolder is not set)
1700
		} else {
1701
			if (count($valueArray)){
1702
				foreach($valueArray as &$theFile){
1703
					if (t3lib_div::isFirstPartOfStr($theFile,PATH_site))	{
1704
						$theFile = substr($theFile,strlen(PATH_site));
1705
					}
1706
				}
1707
			}
1699 1708
		}
1700 1709

  
1701 1710
		return $valueArray;
(3-3/15)