summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
committerJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
commitbafd684eb694ed0bd86b46ff7cd36382c1cebc34 (patch)
treec3bb1e013d563263002d052eb41032076a36a5f9 /files
parent220132ca237f5077f5145bf327e8528a652ad559 (diff)
downloadnextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.tar.gz
nextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.zip
Renaming classes :-)
Diffstat (limited to 'files')
-rw-r--r--files/admin.php10
-rw-r--r--files/ajax/autocomplete.php8
-rw-r--r--files/ajax/delete.php4
-rw-r--r--files/ajax/download.php6
-rw-r--r--files/ajax/list.php10
-rw-r--r--files/ajax/move.php4
-rw-r--r--files/ajax/newfolder.php4
-rw-r--r--files/ajax/rename.php4
-rw-r--r--files/ajax/upload.php6
-rw-r--r--files/appinfo/app.php8
-rw-r--r--files/download.php14
-rw-r--r--files/index.php30
-rw-r--r--files/settings.php12
-rw-r--r--files/templates/admin.php2
14 files changed, 61 insertions, 61 deletions
diff --git a/files/admin.php b/files/admin.php
index c0a41335f5e..0b8639f38ca 100644
--- a/files/admin.php
+++ b/files/admin.php
@@ -27,22 +27,22 @@ require_once('../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
$htaccessWorking=(getenv('htaccessWorking')=='true');
if(isset($_POST['maxUploadSize'])){
$maxUploadFilesize=$_POST['maxUploadSize'];
- OC_FILES::setUploadLimit(OC_HELPER::computerFileSize($maxUploadFilesize));
+ OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize));
}else{
$maxUploadFilesize = ini_get('upload_max_filesize').'B';
}
-OC_APP::setActiveNavigationEntry( "files_administration" );
+OC_App::setActiveNavigationEntry( "files_administration" );
// return template
-$tmpl = new OC_TEMPLATE( "files", "admin", "admin" );
+$tmpl = new OC_Template( "files", "admin", "admin" );
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->printPage();
diff --git a/files/ajax/autocomplete.php b/files/ajax/autocomplete.php
index 2c2f665fd6c..183ee86c788 100644
--- a/files/ajax/autocomplete.php
+++ b/files/ajax/autocomplete.php
@@ -9,7 +9,7 @@ require_once('../../lib/base.php');
// header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -40,8 +40,8 @@ $query=strtolower($query);
$files=array();
-if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){
- $dh = OC_FILESYSTEM::opendir($base);
+if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)){
+ $dh = OC_Filesystem::opendir($base);
if($dh){
if(substr($base,-1,1)!='/'){
$base=$base.'/';
@@ -50,7 +50,7 @@ if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){
if ($file != "." && $file != ".."){
if(substr(strtolower($file),0,$queryLen)==$query){
$item=$base.$file;
- if((!$dirOnly or OC_FILESYSTEM::is_dir($item))){
+ if((!$dirOnly or OC_Filesystem::is_dir($item))){
$files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item);
}
}
diff --git a/files/ajax/delete.php b/files/ajax/delete.php
index 79caf4d0bb2..782db215dfc 100644
--- a/files/ajax/delete.php
+++ b/files/ajax/delete.php
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -21,7 +21,7 @@ $filesWithError = '';
$status = 'success';
//Now delete
foreach($files as $file) {
- if( !OC_FILES::delete( $dir, $file )){
+ if( !OC_Files::delete( $dir, $file )){
$filesWithError .= $file . "\n";
$status = 'error';
}
diff --git a/files/ajax/download.php b/files/ajax/download.php
index 0b2f894a11b..2bbf1df4eca 100644
--- a/files/ajax/download.php
+++ b/files/ajax/download.php
@@ -25,13 +25,13 @@
require_once('../../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
$files = $_GET["files"];
$dir = $_GET["dir"];
-OC_FILES::get($dir,$files);
+OC_Files::get($dir,$files);
?>
diff --git a/files/ajax/list.php b/files/ajax/list.php
index 26462eb5ab9..547bc91fb05 100644
--- a/files/ajax/list.php
+++ b/files/ajax/list.php
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -28,7 +28,7 @@ if($doBreadcrumb){
}
}
- $breadcrumbNav = new OC_TEMPLATE( "files", "part.breadcrumb", "" );
+ $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$data['breadcrumb'] = $breadcrumbNav->fetchPage();
@@ -36,12 +36,12 @@ if($doBreadcrumb){
// make filelist
$files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
- $i["date"] = OC_UTIL::formatDate($i["mtime"] );
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
+ $i["date"] = OC_Util::formatDate($i["mtime"] );
$files[] = $i;
}
-$list = new OC_TEMPLATE( "files", "part.list", "" );
+$list = new OC_Template( "files", "part.list", "" );
$list->assign( "files", $files );
$data = array('files' => $list->fetchPage());
diff --git a/files/ajax/move.php b/files/ajax/move.php
index b1ba641c5b1..4224cbce6d0 100644
--- a/files/ajax/move.php
+++ b/files/ajax/move.php
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -18,7 +18,7 @@ $file = $_GET["file"];
$target = $_GET["target"];
-if(OC_FILES::move($dir,$file,$target,$file)){
+if(OC_Files::move($dir,$file,$target,$file)){
echo json_encode( array( "status" => 'success', "data" => array( "dir" => $dir, "files" => $file )));
}else{
echo json_encode( array( "status" => 'error', "data" => array( "message" => "Could move $file" )));
diff --git a/files/ajax/newfolder.php b/files/ajax/newfolder.php
index 988e7f04012..610418583bd 100644
--- a/files/ajax/newfolder.php
+++ b/files/ajax/newfolder.php
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -21,7 +21,7 @@ if($foldername == '') {
exit();
}
error_log('try to create ' . $foldername . ' in ' . $dir);
-if(OC_FILES::newFile($dir, $foldername, 'dir')) {
+if(OC_Files::newFile($dir, $foldername, 'dir')) {
echo json_encode( array( "status" => "success", "data" => array()));
exit();
}
diff --git a/files/ajax/rename.php b/files/ajax/rename.php
index 7554aa0dd62..516077f6fda 100644
--- a/files/ajax/rename.php
+++ b/files/ajax/rename.php
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -18,7 +18,7 @@ $file = $_GET["file"];
$newname = $_GET["newname"];
// Delete
-if( OC_FILES::move( $dir, $file, $dir, $newname )) {
+if( OC_Files::move( $dir, $file, $dir, $newname )) {
echo json_encode( array( "status" => "success", "data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
}
else{
diff --git a/files/ajax/upload.php b/files/ajax/upload.php
index f47f9b3d282..5dcd2f2b6af 100644
--- a/files/ajax/upload.php
+++ b/files/ajax/upload.php
@@ -9,7 +9,7 @@ require_once('../../lib/base.php');
header( "Content-Type: text/plain" );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@@ -24,8 +24,8 @@ if(strpos($dir,'..') === false){
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
$target='/' . stripslashes($dir) . $files['name'][$i];
- if(OC_FILESYSTEM::fromUploadedFile($files['tmp_name'][$i],$target)){
- $result[]=array( "status" => "success", 'mime'=>OC_FILESYSTEM::getMimeType($target),'size'=>OC_FILESYSTEM::filesize($target),'name'=>$files['name'][$i]);
+ if(OC_Filesystem::fromUploadedFile($files['tmp_name'][$i],$target)){
+ $result[]=array( "status" => "success", 'mime'=>OC_Filesystem::getMimeType($target),'size'=>OC_Filesystem::filesize($target),'name'=>$files['name'][$i]);
}
}
echo json_encode($result);
diff --git a/files/appinfo/app.php b/files/appinfo/app.php
index 06ca16e82d4..0f95b19f592 100644
--- a/files/appinfo/app.php
+++ b/files/appinfo/app.php
@@ -1,12 +1,12 @@
<?php
-OC_APP::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
+OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
-OC_APP::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "home.png" ), "name" => "Files" ));
-OC_APP::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_HELPER::imagePath( "files", "folder.png" )));
+OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => "Files" ));
+OC_App::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )));
// To add navigation sub entries use
-// OC_APP::addNavigationSubEntry( "files_index", array( ... ));
+// OC_App::addNavigationSubEntry( "files_index", array( ... ));
?>
diff --git a/files/download.php b/files/download.php
index ab3dee51348..cc52b930f72 100644
--- a/files/download.php
+++ b/files/download.php
@@ -25,30 +25,30 @@
require_once('../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
$filename = $_GET["file"];
-if(!OC_FILESYSTEM::file_exists($filename)){
+if(!OC_Filesystem::file_exists($filename)){
header("HTTP/1.0 404 Not Found");
- $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+ $tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->assign('file',$filename);
$tmpl->printPage();
exit;
}
-$ftype=OC_FILESYSTEM::getMimeType( $filename );
+$ftype=OC_Filesystem::getMimeType( $filename );
header('Content-Type:'.$ftype);
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
-header('Content-Length: '.OC_FILESYSTEM::filesize($filename));
+header('Content-Length: '.OC_Filesystem::filesize($filename));
ob_end_clean();
-OC_FILESYSTEM::readfile( $filename );
+OC_Filesystem::readfile( $filename );
?>
diff --git a/files/index.php b/files/index.php
index 4f40e70393b..821879b0346 100644
--- a/files/index.php
+++ b/files/index.php
@@ -26,26 +26,26 @@
require_once('../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( '', 'index.php' ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
exit();
}
// Load the files we need
-OC_UTIL::addStyle( "files", "files" );
-OC_UTIL::addScript( "files", "files" );
-OC_UTIL::addScript( 'files', 'filelist' );
-OC_UTIL::addScript( 'files', 'fileactions' );
+OC_Util::addStyle( "files", "files" );
+OC_Util::addScript( "files", "files" );
+OC_Util::addScript( 'files', 'filelist' );
+OC_Util::addScript( 'files', 'fileactions' );
if(!isset($_SESSION['timezone'])){
- OC_UTIL::addScript( 'files', 'timezone' );
+ OC_Util::addScript( 'files', 'timezone' );
}
-OC_APP::setActiveNavigationEntry( "files_index" );
+OC_App::setActiveNavigationEntry( "files_index" );
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
- $i["date"] = OC_UTIL::formatDate($i["mtime"] );
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
+ $i["date"] = OC_Util::formatDate($i["mtime"] );
if($i['type']=='file'){
$i['extention']=substr($i['name'],strrpos($i['name'],'.'));
$i['basename']=substr($i['name'],0,strrpos($i['name'],'.'));
@@ -67,19 +67,19 @@ foreach( explode( "/", $dir ) as $i ){
}
// make breadcrumb und filelist markup
-$list = new OC_TEMPLATE( "files", "part.list", "" );
+$list = new OC_Template( "files", "part.list", "" );
$list->assign( "files", $files );
-$breadcrumbNav = new OC_TEMPLATE( "files", "part.breadcrumb", "" );
+$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
-$maxUploadFilesize = OC_HELPER::computerFileSize(ini_get('upload_max_filesize'));
+$maxUploadFilesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$tmpl = new OC_TEMPLATE( "files", "index", "user" );
+$tmpl = new OC_Template( "files", "index", "user" );
$tmpl->assign( "fileList", $list->fetchPage() );
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
$tmpl->assign( 'dir', $dir);
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign( 'uploadMaxHumanFilesize', OC_HELPER::humanFileSize($maxUploadFilesize));
+$tmpl->assign( 'uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
$tmpl->printPage();
?>
diff --git a/files/settings.php b/files/settings.php
index 447a38b1815..1f2e9d9868c 100644
--- a/files/settings.php
+++ b/files/settings.php
@@ -26,20 +26,20 @@
require_once('../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
// Load the files we need
-OC_UTIL::addStyle( "files", "files" );
-OC_UTIL::addScript( "files", "files" );
+OC_Util::addStyle( "files", "files" );
+OC_Util::addScript( "files", "files" );
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
$i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
$files[] = $i;
}
@@ -55,7 +55,7 @@ foreach( explode( "/", $dir ) as $i ){
}
// return template
-$tmpl = new OC_TEMPLATE( "files", "index", "user" );
+$tmpl = new OC_Template( "files", "index", "user" );
$tmpl->assign( 'files', $files );
$tmpl->assign( "breadcrumb", $breadcrumb );
$tmpl->printPage();
diff --git a/files/templates/admin.php b/files/templates/admin.php
index 40880d34911..e0cf2608301 100644
--- a/files/templates/admin.php
+++ b/files/templates/admin.php
@@ -1,4 +1,4 @@
-<?php OC_UTIL::addScript('files','admin'); ?>
+<?php OC_Util::addScript('files','admin'); ?>
<form name="filesForm" action='#' method='post'>
<?php if($_['htaccessWorking']):?>