renamed extention to extension, also now only showing lowercase
This commit is contained in:
parent
d32799e4bf
commit
7ddd043427
|
@ -30,8 +30,8 @@ class OC_Archive_TAR extends OC_Archive{
|
||||||
*/
|
*/
|
||||||
static public function getTarType($file){
|
static public function getTarType($file){
|
||||||
if(strpos($file,'.')){
|
if(strpos($file,'.')){
|
||||||
$extention=substr($file,strrpos($file,'.'));
|
$extension=substr($file,strrpos($file,'.'));
|
||||||
switch($extention){
|
switch($extension){
|
||||||
case 'gz':
|
case 'gz':
|
||||||
case 'tgz':
|
case 'tgz':
|
||||||
return self::GZIP;
|
return self::GZIP;
|
||||||
|
|
|
@ -41,8 +41,8 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
|
||||||
if(self::isEncrypted($path)){
|
if(self::isEncrypted($path)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$extention=substr($path,strrpos($path,'.')+1);
|
$extension=substr($path,strrpos($path,'.')+1);
|
||||||
if(array_search($extention,self::$blackList)===false){
|
if(array_search($extension,self::$blackList)===false){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ if ($source !== false) {
|
||||||
if ($i['type'] == 'file') {
|
if ($i['type'] == 'file') {
|
||||||
$fileinfo = pathinfo($i['name']);
|
$fileinfo = pathinfo($i['name']);
|
||||||
$i['basename'] = $fileinfo['filename'];
|
$i['basename'] = $fileinfo['filename'];
|
||||||
$i['extention'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
|
$i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
|
||||||
}
|
}
|
||||||
$i['directory'] = substr($i['directory'], $rootLength);
|
$i['directory'] = substr($i['directory'], $rootLength);
|
||||||
if ($i['directory'] == "/") {
|
if ($i['directory'] == "/") {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
function musicTypeFromFile(file){
|
function musicTypeFromFile(file){
|
||||||
var extention=file.substr(file.indexOf('.')+1).toLowerCase();
|
var extension=file.substr(file.indexOf('.')+1).toLowerCase();
|
||||||
if(extention=='ogg'){
|
if(extension=='ogg'){
|
||||||
return 'oga';
|
return 'oga';
|
||||||
}
|
}
|
||||||
//TODO check for more specific cases
|
//TODO check for more specific cases
|
||||||
return extention;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
function playAudio(filename){
|
function playAudio(filename){
|
||||||
|
|
|
@ -48,10 +48,10 @@ function getUrlVars(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function musicTypeFromFile(file){
|
function musicTypeFromFile(file){
|
||||||
var extention=file.split('.').pop().toLowerCase();
|
var extension=file.split('.').pop().toLowerCase();
|
||||||
if(extention=='ogg'){
|
if(extension=='ogg'){
|
||||||
return 'oga';
|
return 'oga';
|
||||||
}
|
}
|
||||||
//TODO check for more specific cases
|
//TODO check for more specific cases
|
||||||
return extention;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ class OC_MEDIA_SCANNER{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quick check if a song is a music file by checking the extention, not as good as a proper mimetype check but way faster
|
* quick check if a song is a music file by checking the extension, not as good as a proper mimetype check but way faster
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -69,10 +69,10 @@ OC={
|
||||||
* @param file the name of the image file
|
* @param file the name of the image file
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* if no extention is given for the image, it will automatically decide between .png and .svg based on what the browser supports
|
* if no extension is given for the image, it will automatically decide between .png and .svg based on what the browser supports
|
||||||
*/
|
*/
|
||||||
imagePath:function(app,file){
|
imagePath:function(app,file){
|
||||||
if(file.indexOf('.')==-1){//if no extention is given, use png or svg depending on browser support
|
if(file.indexOf('.')==-1){//if no extension is given, use png or svg depending on browser support
|
||||||
file+=(SVGSupport())?'.svg':'.png';
|
file+=(SVGSupport())?'.svg':'.png';
|
||||||
}
|
}
|
||||||
return OC.filePath(app,'img',file);
|
return OC.filePath(app,'img',file);
|
||||||
|
|
|
@ -40,9 +40,9 @@ tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; h
|
||||||
tbody tr { background-color:#fff; }
|
tbody tr { background-color:#fff; }
|
||||||
tbody tr.selected { background-color:#eee; }
|
tbody tr.selected { background-color:#eee; }
|
||||||
tbody a { color:#000; }
|
tbody a { color:#000; }
|
||||||
span.extention, td.date { color:#999; }
|
span.extension, td.date { color:#999; }
|
||||||
span.extention { opacity:0; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; }
|
span.extension { text-transform:lowercase; opacity:0; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; }
|
||||||
tr:hover span.extention { opacity:1; }
|
tr:hover span.extension { opacity:1; }
|
||||||
div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; }
|
div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; }
|
||||||
div.crumb:first-child { padding-left:1em; }
|
div.crumb:first-child { padding-left:1em; }
|
||||||
div.crumb.last { font-weight:bold; }
|
div.crumb.last { font-weight:bold; }
|
||||||
|
|
|
@ -51,10 +51,10 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
|
||||||
$fileinfo=pathinfo($i['name']);
|
$fileinfo=pathinfo($i['name']);
|
||||||
$i['basename']=$fileinfo['filename'];
|
$i['basename']=$fileinfo['filename'];
|
||||||
if (!empty($fileinfo['extension'])) {
|
if (!empty($fileinfo['extension'])) {
|
||||||
$i['extention']='.' . $fileinfo['extension'];
|
$i['extension']='.' . $fileinfo['extension'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$i['extention']='';
|
$i['extension']='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($i['directory']=='/'){
|
if($i['directory']=='/'){
|
||||||
|
|
|
@ -7,15 +7,15 @@ FileList={
|
||||||
var html='<tr data-type="file" data-size="'+size+'">';
|
var html='<tr data-type="file" data-size="'+size+'">';
|
||||||
if(name.indexOf('.')!=-1){
|
if(name.indexOf('.')!=-1){
|
||||||
var basename=name.substr(0,name.lastIndexOf('.'));
|
var basename=name.substr(0,name.lastIndexOf('.'));
|
||||||
var extention=name.substr(name.lastIndexOf('.'));
|
var extension=name.substr(name.lastIndexOf('.'));
|
||||||
}else{
|
}else{
|
||||||
var basename=name;
|
var basename=name;
|
||||||
var extention=false;
|
var extension=false;
|
||||||
}
|
}
|
||||||
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
|
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
|
||||||
html+='<a class="name" href="download.php?file='+$('#dir').val()+'/'+name+'"><span class="nametext">'+basename
|
html+='<a class="name" href="download.php?file='+$('#dir').val()+'/'+name+'"><span class="nametext">'+basename
|
||||||
if(extention){
|
if(extension){
|
||||||
html+='<span class="extention">'+extention+'</span>';
|
html+='<span class="extension">'+extension+'</span>';
|
||||||
}
|
}
|
||||||
html+='</span></a></td>';
|
html+='</span></a></td>';
|
||||||
if(size!='Pending'){
|
if(size!='Pending'){
|
||||||
|
@ -147,7 +147,7 @@ FileList={
|
||||||
span.text(basename);
|
span.text(basename);
|
||||||
td.children('a.name').append(span);
|
td.children('a.name').append(span);
|
||||||
if(newname.indexOf('.')>0){
|
if(newname.indexOf('.')>0){
|
||||||
span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||||
}
|
}
|
||||||
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){
|
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){
|
||||||
tr.data('renaming',false);
|
tr.data('renaming',false);
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<?php if($file['type'] == 'dir'):?>
|
<?php if($file['type'] == 'dir'):?>
|
||||||
<?php echo htmlspecialchars($file['name']);?>
|
<?php echo htmlspecialchars($file['name']);?>
|
||||||
<?php else:?>
|
<?php else:?>
|
||||||
<?php echo htmlspecialchars($file['basename']);?><span class='extention'><?php echo $file['extention'];?></span>
|
<?php echo htmlspecialchars($file['basename']);?><span class='extension'><?php echo $file['extension'];?></span>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -100,11 +100,11 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
|
||||||
}
|
}
|
||||||
$head=fread($source,8192);//8kb should suffice to determine a mimetype
|
$head=fread($source,8192);//8kb should suffice to determine a mimetype
|
||||||
if($pos=strrpos($path,'.')){
|
if($pos=strrpos($path,'.')){
|
||||||
$extention=substr($path,$pos);
|
$extension=substr($path,$pos);
|
||||||
}else{
|
}else{
|
||||||
$extention='';
|
$extension='';
|
||||||
}
|
}
|
||||||
$tmpFile=OC_Helper::tmpFile($extention);
|
$tmpFile=OC_Helper::tmpFile($extension);
|
||||||
file_put_contents($tmpFile,$head);
|
file_put_contents($tmpFile,$head);
|
||||||
$mime=OC_Helper::getMimeType($tmpFile);
|
$mime=OC_Helper::getMimeType($tmpFile);
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
|
@ -129,11 +129,11 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($pos=strrpos($path,'.')){
|
if($pos=strrpos($path,'.')){
|
||||||
$extention=substr($path,$pos);
|
$extension=substr($path,$pos);
|
||||||
}else{
|
}else{
|
||||||
$extention='';
|
$extension='';
|
||||||
}
|
}
|
||||||
$tmpFile=OC_Helper::tmpFile($extention);
|
$tmpFile=OC_Helper::tmpFile($extension);
|
||||||
$target=fopen($tmpFile,'w');
|
$target=fopen($tmpFile,'w');
|
||||||
$count=OC_Helper::streamCopy($source,$target);
|
$count=OC_Helper::streamCopy($source,$target);
|
||||||
return $tmpFile;
|
return $tmpFile;
|
||||||
|
|
|
@ -310,9 +310,9 @@ class OC_Helper {
|
||||||
$mimeType='application/octet-stream';
|
$mimeType='application/octet-stream';
|
||||||
if ($mimeType=='application/octet-stream') {
|
if ($mimeType=='application/octet-stream') {
|
||||||
self::$mimetypes = include('mimetypes.fixlist.php');
|
self::$mimetypes = include('mimetypes.fixlist.php');
|
||||||
$extention=strtolower(strrchr(basename($path), "."));
|
$extension=strtolower(strrchr(basename($path), "."));
|
||||||
$extention=substr($extention,1);//remove leading .
|
$extension=substr($extension,1);//remove leading .
|
||||||
$mimeType=(isset(self::$mimetypes[$extention]))?self::$mimetypes[$extention]:'application/octet-stream';
|
$mimeType=(isset(self::$mimetypes[$extension]))?self::$mimetypes[$extension]:'application/octet-stream';
|
||||||
|
|
||||||
}
|
}
|
||||||
if (@is_dir($path)) {
|
if (@is_dir($path)) {
|
||||||
|
@ -346,9 +346,9 @@ class OC_Helper {
|
||||||
if(!self::$mimetypes || self::$mimetypes != include('mimetypes.list.php')){
|
if(!self::$mimetypes || self::$mimetypes != include('mimetypes.list.php')){
|
||||||
self::$mimetypes=include('mimetypes.list.php');
|
self::$mimetypes=include('mimetypes.list.php');
|
||||||
}
|
}
|
||||||
$extention=strtolower(strrchr(basename($path), "."));
|
$extension=strtolower(strrchr(basename($path), "."));
|
||||||
$extention=substr($extention,1);//remove leading .
|
$extension=substr($extension,1);//remove leading .
|
||||||
$mimeType=(isset(self::$mimetypes[$extention]))?self::$mimetypes[$extention]:'application/octet-stream';
|
$mimeType=(isset(self::$mimetypes[$extension]))?self::$mimetypes[$extension]:'application/octet-stream';
|
||||||
}
|
}
|
||||||
return $mimeType;
|
return $mimeType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* list of mimetypes by extention
|
* list of mimetypes by extension
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -161,7 +161,7 @@ class OC_Template{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the formfactor extention for current formfactor
|
* @brief Returns the formfactor extension for current formfactor
|
||||||
*/
|
*/
|
||||||
protected function getFormFactorExtension()
|
protected function getFormFactorExtension()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue