Merge branch 'master' into sharing. Integrate with changes in master, rename classes

Conflicts:
	lib/base.php
This commit is contained in:
Michael Gapczynski 2011-07-30 19:40:19 -04:00
commit 11d1627513
193 changed files with 3607 additions and 2760 deletions

28
.tx/config Normal file
View File

@ -0,0 +1,28 @@
[main]
host = https://www.transifex.net
[owncloud.admin]
file_filter = l10n/<lang>/admin.po
source_file = l10n/templates/admin.pot
source_lang = en
[owncloud.core]
file_filter = l10n/<lang>/core.po
source_file = l10n/templates/core.pot
source_lang = en
[owncloud.help]
file_filter = l10n/<lang>/help.po
source_file = l10n/templates/help.pot
source_lang = en
[owncloud.log]
file_filter = l10n/<lang>/log.po
source_file = l10n/templates/log.pot
source_lang = en
[owncloud.settings]
file_filter = l10n/<lang>/settings.po
source_file = l10n/templates/settings.pot
source_lang = en

View File

@ -72,7 +72,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
function createDatabase($name, $options = array())
{
global $SERVERROOT;
$datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
$datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;

View File

@ -348,7 +348,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
function connect()
{
global $SERVERROOT;
$datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
$datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$database_file = $this->_getDatabaseFile($this->database_name);
if (is_resource($this->connection)) {
//if (count(array_diff($this->connected_dsn, $this->dsn)) == 0

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -16,7 +16,7 @@ $username = $_POST["username"];
$password = $_POST["password"];
// Return Success story
if( OC_USER::setPassword( $username, $password )){
if( OC_User::setPassword( $username, $password )){
echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
}
else{

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -15,13 +15,13 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
$groupname = $_POST["groupname"];
// Does the group exist?
if( in_array( $groupname, OC_GROUP::getGroups())){
if( in_array( $groupname, OC_Group::getGroups())){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Group already exists" )));
exit();
}
// Return Success story
if( OC_GROUP::createGroup( $groupname )){
if( OC_Group::createGroup( $groupname )){
echo json_encode( array( "status" => "success", "data" => array( "groupname" => $groupname )));
}
else{

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -20,17 +20,17 @@ $username = $_POST["username"];
$password = $_POST["password"];
// Does the group exist?
if( in_array( $username, OC_USER::getUsers())){
if( in_array( $username, OC_User::getUsers())){
echo json_encode( array( "status" => "error", "data" => array( "message" => "User already exists" )));
exit();
}
// Return Success story
if( OC_USER::createUser( $username, $password )){
if( OC_User::createUser( $username, $password )){
foreach( $groups as $i ){
OC_GROUP::addToGroup( $username, $i );
OC_Group::addToGroup( $username, $i );
}
echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "groups" => implode( ", ", OC_GROUP::getUserGroups( $username )))));
echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "groups" => implode( ", ", OC_Group::getUserGroups( $username )))));
}
else{
echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to add user" )));

View File

@ -4,6 +4,6 @@
require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
OC_APP::disable($_POST['appid']);
OC_App::disable($_POST['appid']);
?>

View File

@ -4,6 +4,6 @@
require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
OC_APP::enable($_POST['appid']);
OC_App::enable($_POST['appid']);
?>

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -15,7 +15,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
$name = $_POST["groupname"];
// Return Success story
if( OC_GROUP::deleteGroup( $name )){
if( OC_Group::deleteGroup( $name )){
echo json_encode( array( "status" => "success", "data" => array( "groupname" => $name )));
}
else{

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -15,7 +15,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
$username = $_POST["username"];
// Return Success story
if( OC_USER::deleteUser( $username )){
if( OC_User::deleteUser( $username )){
echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
}
else{

View File

@ -7,7 +7,7 @@ require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
@ -20,13 +20,13 @@ $username = $_POST["username"];
$group = $_POST["group"];
// Toggle group
if( OC_GROUP::inGroup( $username, $group )){
if( OC_Group::inGroup( $username, $group )){
$action = "remove";
$error = "remove user from";
$success = OC_GROUP::removeFromGroup( $username, $group );
$success = OC_Group::removeFromGroup( $username, $group );
}
else{
$success = OC_GROUP::addToGroup( $username, $group );
$success = OC_Group::addToGroup( $username, $group );
}
// Return Success story

View File

@ -1,12 +1,12 @@
<?php
OC_APP::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
// OC_APP::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_HELPER::imagePath( "admin", "administration.png" )));
OC_APP::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_HELPER::imagePath( "admin", "users.png" )));
OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_HELPER::imagePath( "admin", "apps.png" )));
// OC_App::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_Helper::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_Helper::imagePath( "admin", "administration.png" )));
OC_App::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )));
OC_App::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )));
// Add subentries for App installer
OC_APP::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
OC_App::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_Helper::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_Helper::imagePath( "admin", "navicon.png" )));
?>

View File

@ -22,16 +22,14 @@
*/
require_once('../lib/base.php');
include_once('../lib/installer.php');
require( 'template.php' );
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();
}
// Load the files we need
OC_UTIL::addStyle( "admin", "apps" );
OC_UTIL::addScript( "admin", "apps" );
OC_Util::addStyle( "admin", "apps" );
OC_Util::addScript( "admin", "apps" );
if(isset($_GET['id'])) $id=$_GET['id']; else $id=0;
@ -40,32 +38,32 @@ if(isset($_GET['installed'])) $installed=true; else $installed=false;
if($installed){
global $SERVERROOT;
OC_INSTALLER::installShippedApps(false);
$apps = OC_APPCONFIG::getApps();
OC_Installer::installShippedApps(false);
$apps = OC_Appconfig::getApps();
$records = array();
OC_APP::setActiveNavigationEntry( "core_apps" );
OC_App::setActiveNavigationEntry( "core_apps" );
foreach($apps as $app){
$info=OC_APP::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
$info=OC_App::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
$record = array( 'id' => $app,
'name' => $info['name'],
'version' => $info['version'],
'author' => $info['author'],
'enabled' => OC_APP::isEnabled( $app ));
'enabled' => OC_App::isEnabled( $app ));
$records[]=$record;
}
$tmpl = new OC_TEMPLATE( "admin", "appsinst", "admin" );
$tmpl = new OC_Template( "admin", "appsinst", "admin" );
$tmpl->assign( "apps", $records );
$tmpl->printPage();
unset($tmpl);
exit();
}else{
$categories=OC_OCSCLIENT::getCategories();
$categories=OC_OCSClient::getCategories();
if($categories==NULL){
OC_APP::setActiveNavigationEntry( "core_apps" );
OC_App::setActiveNavigationEntry( "core_apps" );
$tmpl = new OC_TEMPLATE( "admin", "app_noconn", "admin" );
$tmpl = new OC_Template( "admin", "app_noconn", "admin" );
$tmpl->printPage();
unset($tmpl);
exit();
@ -73,18 +71,18 @@ if($installed){
if($id==0) {
OC_APP::setActiveNavigationEntry( "core_apps_get" );
OC_App::setActiveNavigationEntry( "core_apps_get" );
if($cat==0){
$numcats=array();
foreach($categories as $key=>$value) $numcats[]=$key;
$apps=OC_OCSCLIENT::getApplications($numcats);
$apps=OC_OCSClient::getApplications($numcats);
}else{
$apps=OC_OCSCLIENT::getApplications($cat);
$apps=OC_OCSClient::getApplications($cat);
}
// return template
$tmpl = new OC_TEMPLATE( "admin", "apps", "admin" );
$tmpl = new OC_Template( "admin", "apps", "admin" );
$tmpl->assign( "categories", $categories );
$tmpl->assign( "apps", $apps );
@ -92,11 +90,11 @@ if($installed){
unset($tmpl);
}else{
OC_APP::setActiveNavigationEntry( "core_apps" );
OC_App::setActiveNavigationEntry( "core_apps" );
$app=OC_OCSCLIENT::getApplication($id);
$app=OC_OCSClient::getApplication($id);
$tmpl = new OC_TEMPLATE( "admin", "app", "admin" );
$tmpl = new OC_Template( "admin", "app", "admin" );
$tmpl->assign( "categories", $categories );
$tmpl->assign( "app", $app );
$tmpl->printPage();

View File

@ -7,11 +7,10 @@
"Modified" => "Ændret",
"Administration" => "Administration",
"System Settings" => "System indstillinger",
"Add user" => "Tilføj bruger",
"Password" => "Kodeord",
"Create user" => "Lav bruger",
"remove" => "slet",
"Users" => "Brugere",
"Groups" => "Grupper",
"Password" => "Kodeord",
"remove" => "slet",
"Create group" => "Lav gruppe",
"Force new password:" => "Tving ny adgangskode",
"Set" => "Indstil",

View File

@ -7,10 +7,10 @@
"Modified" => "Änderungsdatum",
"Administration" => "Verwaltung",
"System Settings" => "Systemeinstellungen",
"Users" => "Nutzer",
"Groups" => "Gruppen",
"Add user" => "Nutzer hinzufügen",
"Password" => "Passwort",
"Create user" => "Nutzer erstellen",
"Create" => "Erstellen",
"remove" => "entfernen",
"Create group" => "Gruppe erstellen",
"Force new password:" => "Neues Passwort:",

20
admin/l10n/fr.php Normal file
View File

@ -0,0 +1,20 @@
<?php $TRANSLATIONS = array(
"read more" => "en lire plus",
"INSTALL" => "INSTALLATION",
"Apps Repository" => "Répertoire d'applications",
"Cannot connect to apps repository" => "Impossible de se connecter au répertoire d'applications",
"Name" => "Nom",
"Modified" => "Modifié le",
"Administration" => "Administration",
"System Settings" => "Préférences Système",
"Users" => "Utilisateurs",
"Groups" => "Groupes",
"Password" => "Mot de passe",
"Create" => "Créer",
"remove" => "retirer",
"Create group" => "Créer un groupe",
"Force new password:" => "Forcer un nouveau mot de passe :",
"Set" => "Appliquer",
"Do you really want to delete user" => "Voulez-vous réellement supprimer cet utilisateur",
"Do you really want to delete group" => "Voulez-vous réellement supprimer ce groupe"
);

View File

@ -7,10 +7,9 @@
"Modified" => "Laatst aangepast",
"Administration" => "Administratie",
"System Settings" => "Systeeminstellingen",
"Users" => "Gebruikers",
"Groups" => "Groepen",
"Add user" => "Gebruiker toevoegen",
"Password" => "Wachtwoord",
"Create user" => "Gebruiker aanmaken",
"remove" => "verwijder",
"Create group" => "Groep aanmaken",
"Force new password:" => "Forceer nieuw wachtwoord:",

View File

@ -7,15 +7,13 @@
"Modified" => "Zmodyfikowano",
"Administration" => "Administracja",
"System Settings" => "Ustawienia systemowe",
"Add user" => "Dodaj użytkownika",
"Password" => "Hasło",
"Create user" => "Utwórz użytkownika",
"remove" => "usuń",
"Users" => "Użytkownicy",
"Groups" => "Grupy",
"Password" => "Hasło",
"remove" => "usuń",
"Create group" => "Utwórz grupę",
"Force new password:" => "Wymuś nowe hasło",
"Set" => "Ustaw",
"Do you really want to delete user" => "Czy naprawdę chcesz usunąć użytkownika",
"Do you really want to delete group" => "Czy naprawdę chcesz usunąć grupę",
"Users" => "Użytkownicy"
"Do you really want to delete group" => "Czy naprawdę chcesz usunąć grupę"
);

View File

@ -22,15 +22,14 @@
*/
require_once('../lib/base.php');
require( 'template.php' );
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();
}
OC_APP::setActiveNavigationEntry( "administration" );
OC_App::setActiveNavigationEntry( "administration" );
$tmpl = new OC_TEMPLATE( "admin", "system", "admin" );
$tmpl = new OC_Template( "admin", "system", "admin" );
$tmpl->printPage();
?>

View File

@ -17,8 +17,8 @@
<tbody>
<?php foreach($_["apps"] as $app): ?>
<tr>
<td width="1"><?php if($app["preview"] <> "") { echo('<a href="'.OC_HELPER::linkTo( "admin", "apps.php" ).'?id='.$app['id'].'"><img class="preview" border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
<td class="name"><a href="<?php echo(OC_HELPER::linkTo( "admin", "apps.php" ).'?id='.$app['id']); ?>" title=""><?php echo $app["name"]; ?></a><br /><?php echo('<span class="type">'.$app['typename'].'</span>'); ?></td>
<td width="1"><?php if($app["preview"] <> "") { echo('<a href="'.OC_Helper::linkTo( "admin", "apps.php" ).'?id='.$app['id'].'"><img class="preview" border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
<td class="name"><a href="<?php echo(OC_Helper::linkTo( "admin", "apps.php" ).'?id='.$app['id']); ?>" title=""><?php echo $app["name"]; ?></a><br /><?php echo('<span class="type">'.$app['typename'].'</span>'); ?></td>
<td class="date"><?php echo $l->l('datetime', $app["changed"]); ?></td>
</tr>
<?php endforeach; ?>

View File

@ -33,7 +33,7 @@
<td x-use="username"><span x-use="usernamediv"><?php echo $user["name"]; ?></span></td>
<td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo "&nbsp";} ?></div></td>
<td>
<?php if($user['name']!=OC_USER::getUser()):?>
<?php if($user['name']!=OC_User::getUser()):?>
<a class="removeuserbutton" href=""><?php echo $l->t( 'remove' ); ?></a>
<?php endif;?>
</td>

View File

@ -22,35 +22,34 @@
*/
require_once('../lib/base.php');
require( 'template.php' );
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();
}
// We have some javascript foo!
OC_UTIL::addScript( "admin", "users" );
OC_UTIL::addStyle( "admin", "users" );
OC_APP::setActiveNavigationEntry( "core_users" );
OC_Util::addScript( "admin", "users" );
OC_Util::addStyle( "admin", "users" );
OC_App::setActiveNavigationEntry( "core_users" );
$users = array();
$groups = array();
foreach( OC_USER::getUsers() as $i ){
foreach( OC_User::getUsers() as $i ){
// Do some more work here soon
$ingroups = array();
foreach( OC_GROUP::getUserGroups( $i ) as $userGroup ){
foreach( OC_Group::getUserGroups( $i ) as $userGroup ){
$ingroups[] = $userGroup;
}
$users[] = array( "name" => $i, "groups" => join( ", ", $ingroups ));
}
foreach( OC_GROUP::getGroups() as $i ){
foreach( OC_Group::getGroups() as $i ){
// Do some more work here soon
$groups[] = array( "name" => $i );
}
$tmpl = new OC_TEMPLATE( "admin", "users", "admin" );
$tmpl = new OC_Template( "admin", "users", "admin" );
$tmpl->assign( "users", $users );
$tmpl->assign( "groups", $groups );
$tmpl->printPage();

View File

@ -1,8 +1,8 @@
<?php
if(OC_APP::getCurrentApp()=='files'){
OC_UTIL::addScript( 'files_imageviewer', 'lightbox' );
OC_UTIL::addStyle( 'files_imageviewer', 'lightbox' );
if(OC_App::getCurrentApp()=='files'){
OC_Util::addScript( 'files_imageviewer', 'lightbox' );
OC_Util::addStyle( 'files_imageviewer', 'lightbox' );
}
?>

View File

@ -25,29 +25,28 @@
// Init owncloud
require_once('../../lib/base.php');
require_once( 'lib_public.php' );
require( 'template.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();
}
OC_APP::setActiveNavigationEntry( "files_publiclink_administration" );
OC_App::setActiveNavigationEntry( "files_publiclink_administration" );
OC_UTIL::addStyle( 'files_publiclink', 'admin' );
OC_UTIL::addScript( 'files_publiclink', 'admin' );
OC_Util::addStyle( 'files_publiclink', 'admin' );
OC_Util::addScript( 'files_publiclink', 'admin' );
if(isset($_SERVER['HTTPS'])) {
$baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
$baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
}else{
$baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
$baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
}
// return template
$tmpl = new OC_TEMPLATE( "files_publiclink", "admin", "admin" );
$tmpl = new OC_Template( "files_publiclink", "admin", "admin" );
$tmpl->assign( 'links', OC_PublicLink::getLinks());
$tmpl->assign('baseUrl',$baseUrl);
$tmpl->printPage();

View File

@ -1,6 +1,6 @@
<?php
OC_APP::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_HELPER::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_HELPER::imagePath( "files_publiclink", "share.png" )));
OC_App::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_Helper::imagePath( "files_publiclink", "share.png" )));
?>

View File

@ -3,7 +3,6 @@ $RUNTIME_NOAPPS=true; //no need to load the apps
$RUNTIME_NOSETUPFS=true; //don't setup the fs yet
require_once '../../lib/base.php';
require( 'template.php' );
require_once 'lib_public.php';
@ -19,18 +18,18 @@ if($path!==false){
$subPath='';
}
$path.=$subPath;
if(!OC_FILESYSTEM::file_exists($path)){
if(!OC_Filesystem::file_exists($path)){
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_TEMPLATE( '', '404', 'guest' );
$tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->assign('file',$subPath);
$tmpl->printPage();
exit;
}
if(OC_FILESYSTEM::is_dir($path)){
if(OC_Filesystem::is_dir($path)){
$files = array();
$rootLength=strlen($root);
foreach( OC_FILES::getdirectorycontent( $path ) as $i ){
$i['date'] = OC_UTIL::formatDate($i['mtime'] );
foreach( OC_Files::getdirectorycontent( $path ) as $i ){
$i['date'] = OC_Util::formatDate($i['mtime'] );
$i['directory']=substr($i['directory'],$rootLength);
if($i['directory']=='/'){
$i['directory']='';
@ -48,36 +47,36 @@ if($path!==false){
}
}
$breadcrumbNav = new OC_TEMPLATE( "files_publiclink", "breadcrumb", "" );
$breadcrumbNav = new OC_Template( "files_publiclink", "breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$breadcrumbNav->assign('token',$token);
$list = new OC_TEMPLATE( 'files_publiclink', 'files', '' );
$list = new OC_Template( 'files_publiclink', 'files', '' );
$list->assign( 'files', $files );
$list->assign('token',$token);
$tmpl = new OC_TEMPLATE( 'files_publiclink', 'index', 'user' );
$tmpl = new OC_Template( 'files_publiclink', 'index', 'user' );
$tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
$tmpl->printPage();
}else{
//get time mimetype and set the headers
$mimetype=OC_FILESYSTEM::getMimeType($path);
$mimetype=OC_Filesystem::getMimeType($path);
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Type: ' . $mimetype);
header('Content-Length: ' . OC_FILESYSTEM::filesize($path));
header('Content-Length: ' . OC_Filesystem::filesize($path));
//download the file
@ob_clean();
OC_FILESYSTEM::readfile($path);
OC_Filesystem::readfile($path);
}
}else{
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_TEMPLATE( '', '404', 'guest' );
$tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->printPage();
die();
}

View File

@ -6,8 +6,8 @@ class OC_PublicLink{
* @param int (optional) expiretime time the link expires, as timestamp
*/
public function __construct($path,$expiretime=0){
if($path and OC_FILESYSTEM::file_exists($path) and OC_FILESYSTEM::is_readable($path)){
$user=OC_USER::getUser();
if($path and OC_Filesystem::file_exists($path) and OC_Filesystem::is_readable($path)){
$user=OC_User::getUser();
$token=sha1("$user-$path-$expiretime");
$query=OC_DB::prepare("INSERT INTO *PREFIX*publiclink VALUES(?,?,?,?)");
$result=$query->execute(array($token,$path,$user,$expiretime));
@ -38,7 +38,7 @@ class OC_PublicLink{
$user=$data[0]['user'];
//prepare the filesystem
OC_UTIL::setupFS($user);
OC_Util::setupFS($user);
return $path;
}else{
@ -60,7 +60,7 @@ class OC_PublicLink{
*/
static public function getLinks(){
$query=OC_DB::prepare("SELECT * FROM *PREFIX*publiclink WHERE user=?");
return $query->execute(array(OC_USER::getUser()))->fetchAll();
return $query->execute(array(OC_User::getUser()))->fetchAll();
}
/**
@ -69,7 +69,7 @@ class OC_PublicLink{
static public function delete($token){
$query=OC_DB::prepare("SELECT user,path FROM *PREFIX*publiclink WHERE token=?");
$result=$query->execute(array($token))->fetchAll();
if(count($result)>0 and $result[0]['user']==OC_USER::getUser()){
if(count($result)>0 and $result[0]['user']==OC_User::getUser()){
$query=OC_DB::prepare("DELETE FROM *PREFIX*publiclink WHERE token=?");
$query->execute(array($token));
}

View File

@ -9,7 +9,7 @@ $uid_shared_with = $_GET['uid_shared_with'];
$permissions = $_GET['permissions'];
foreach ($sources as $source) {
foreach ($uid_shared_with as $uid) {
new OC_SHARE($source, $uid, $permissions);
new OC_Share($source, $uid, $permissions);
}
}

View File

@ -6,6 +6,6 @@ require_once('../lib_share.php');
$source = $_GET['source'];
$uid_shared_with = $_GET['uid_shared_with'];
OC_SHARE::unshare($source, $uid_shared_with);
OC_Share::unshare($source, $uid_shared_with);
?>

View File

@ -3,7 +3,7 @@ $RUNTIME_NOAPPS = true;
require_once('../../../lib/base.php');
if (!OC_USER::isLoggedIn()) {
if (!OC_User::isLoggedIn()) {
echo json_encode(array("status" => "error", "data" => array("message" => "Authentication error")));
exit();
}
@ -11,8 +11,8 @@ $query = $_GET['term'];
$length = strlen($query);
$query = strtolower($query);
$users = array();
$ocusers = OC_USER::getUsers();
$self = OC_USER::getUser();
$ocusers = OC_User::getUsers();
$self = OC_User::getUser();
$groups = OC_GROUP::getUserGroups($self);
foreach ($ocusers as $user) {
if ($user != $self && substr(strtolower($user), 0, $length) == $query) {

View File

@ -2,11 +2,11 @@
require_once('apps/files_sharing/lib_share.php');
OC_UTIL::addScript("files_sharing", "share");
OC_APP::addNavigationSubEntry("files_index", array(
OC_Util::addScript("files_sharing", "share");
OC_App::addNavigationSubEntry("files_index", array(
"id" => "files_sharing_list",
"order" => 10,
"href" => OC_HELPER::linkTo( "files_sharing", "list.php" ),
"href" => OC_Helper::linkTo( "files_sharing", "list.php" ),
"name" => "Shared"));
?>

View File

@ -20,13 +20,13 @@
*
*/
OC_HOOK::connect("OC_FILESYSTEM","post_delete", "OC_SHARE", "deleteItem");
OC_HOOK::connect("OC_FILESYSTEM","post_rename", "OC_SHARE", "renameItem");
OC_Hook::connect("OC_FILESYSTEM","post_delete", "OC_Share", "deleteItem");
OC_Hook::connect("OC_FILESYSTEM","post_rename", "OC_Share", "renameItem");
/**
* This class manages shared items within the database.
*/
class OC_SHARE {
class OC_Share {
const WRITE = 1;
const DELETE = 2;
@ -39,8 +39,8 @@ class OC_SHARE {
*/
public function __construct($source, $uid_shared_with, $permissions, $public = false) {
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
$source = "/".OC_USER::getUser()."/files".$source;
$uid_owner = OC_USER::getUser();
$source = "/".OC_User::getUser()."/files".$source;
$uid_owner = OC_User::getUser();
if ($public) {
// TODO create token for public file
$token = sha1("$uid_owner-$item");
@ -85,8 +85,8 @@ class OC_SHARE {
* @return An array to be used by the IN operator in a query for uid_shared_with
*/
private static function getUserAndGroups() {
$self = OC_USER::getUser();
$groups = OC_GROUP::getUserGroups($self);
$self = OC_User::getUser();
$groups = OC_Group::getUserGroups($self);
array_unshift($groups, $self);
return $groups;
}
@ -104,7 +104,7 @@ class OC_SHARE {
$source = $folders['source'].substr($oldTarget, strlen($folders['target']));
$item = self::getItem($folders['target']);
$query = OC_DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)");
$query->execute(array($item[0]['uid_owner'], OC_USER::getUser(), $source, $newTarget, $item[0]['permissions']));
$query->execute(array($item[0]['uid_owner'], OC_User::getUser(), $source, $newTarget, $item[0]['permissions']));
}
/**
@ -115,7 +115,7 @@ class OC_SHARE {
public static function getItem($target) {
$target = self::cleanPath($target);
$query = OC_DB::prepare("SELECT uid_owner, source, permissions FROM *PREFIX*sharing WHERE target = ? AND uid_shared_with = ? LIMIT 1");
return $query->execute(array($target, OC_USER::getUser()))->fetchAll();
return $query->execute(array($target, OC_User::getUser()))->fetchAll();
}
/**
@ -124,7 +124,7 @@ class OC_SHARE {
*/
public static function getMySharedItems() {
$query = OC_DB::prepare("SELECT uid_shared_with, source, permissions FROM *PREFIX*sharing WHERE uid_owner = ?");
return $query->execute(array(OC_USER::getUser()))->fetchAll();
return $query->execute(array(OC_User::getUser()))->fetchAll();
}
/**
@ -230,7 +230,7 @@ class OC_SHARE {
$oldSource = self::cleanPath($oldSource);
$newSource = self::cleanPath($newSource);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET source = REPLACE(source, ?, ?) WHERE uid_owner = ?");
$query->execute(array($oldSource, $newSource, OC_USER::getUser()));
$query->execute(array($oldSource, $newSource, OC_User::getUser()));
}
/**
@ -245,7 +245,7 @@ class OC_SHARE {
$oldTarget = self::cleanPath($oldTarget);
$newTarget = self::cleanPath($newTarget);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET target = REPLACE(target, ?, ?) WHERE uid_shared_with = ?");
$query->execute(array($oldTarget, $newTarget, OC_USER::getUser()));
$query->execute(array($oldTarget, $newTarget, OC_User::getUser()));
}
/**
@ -260,7 +260,7 @@ class OC_SHARE {
public static function setPermissions($source, $uid_shared_with, $permissions) {
$source = self::cleanPath($source);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET permissions = ? WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
$query->execute(array($permissions, strlen($source), $source, $uid_shared_with, OC_USER::getUser()));
$query->execute(array($permissions, strlen($source), $source, $uid_shared_with, OC_User::getUser()));
}
/**
@ -274,7 +274,7 @@ class OC_SHARE {
public static function unshare($source, $uid_shared_with) {
$source = self::cleanPath($source);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
$query->execute(array(strlen($source), $source, $uid_shared_with, OC_USER::getUser()));
$query->execute(array(strlen($source), $source, $uid_shared_with, OC_User::getUser()));
}
/**
@ -287,7 +287,7 @@ class OC_SHARE {
public static function unshareFromMySelf($target) {
$target = self::cleanPath($target);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(target, 1, ?) = ? AND uid_shared_with = ?");
$query->execute(array(strlen($target), $target, OC_USER::getUser()));
$query->execute(array(strlen($target), $target, OC_User::getUser()));
}
/**
@ -295,10 +295,10 @@ class OC_SHARE {
* @param $arguments Array of arguments passed from OC_HOOK
*/
public static function deleteItem($arguments) {
$source = "/".OC_USER::getUser()."/files".$arguments['path'];
$source = "/".OC_User::getUser()."/files".$arguments['path'];
$source = self::cleanPath($source);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ?");
$query->execute(array(strlen($source), $source, OC_USER::getUser()));
$query->execute(array(strlen($source), $source, OC_User::getUser()));
}
/**
@ -306,9 +306,9 @@ class OC_SHARE {
* @param $arguments Array of arguments passed from OC_HOOK
*/
public static function renameItem($arguments) {
$oldSource = "/".OC_USER::getUser()."/files".$arguments['oldpath'];
$oldSource = "/".OC_User::getUser()."/files".$arguments['oldpath'];
$oldSource = self::cleanPath($oldSource);
$newSource = "/".OC_USER::getUser()."/files".$arguments['newpath'];
$newSource = "/".OC_User::getUser()."/files".$arguments['newpath'];
$newSource = self::cleanPath($newSource);
self::setSource($oldSource, $newSource);
}

View File

@ -22,19 +22,18 @@
require_once('../../lib/base.php');
require_once('lib_share.php');
require('template.php');
if (!OC_USER::isLoggedIn()){
if (!OC_User::isLoggedIn()){
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
exit();
}
OC_APP::setActiveNavigationEntry("files_sharing_list");
OC_App::setActiveNavigationEntry("files_sharing_list");
OC_UTIL::addScript("files_sharing", "list");
OC_Util::addScript("files_sharing", "list");
$tmpl = new OC_TEMPLATE("files_sharing", "list", "user");
$tmpl->assign("shared_items", OC_SHARE::getMySharedItems());
$tmpl = new OC_Template("files_sharing", "list", "user");
$tmpl->assign("shared_items", OC_Share::getMySharedItems());
$tmpl->printPage();
?>

View File

@ -22,12 +22,10 @@
require_once( 'lib_share.php' );
OC_FILESYSTEM::registerStorageType('shared','OC_FILESTORAGE_SHARED',array('datadir'=>'string'));
/**
* Convert target path to source path and pass the function call to the correct storage provider
*/
class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
class OC_Filestorage_Shared extends OC_Filestorage {
private $datadir;
private $sourcePaths = array();
@ -37,7 +35,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
public function getInternalPath($path) {
$mountPoint = OC_FILESYSTEM::getMountPoint($path);
$mountPoint = OC_Filesystem::getMountPoint($path);
$internalPath = substr($path, strlen($mountPoint));
return $internalPath;
}
@ -47,7 +45,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if (array_key_exists($target, $this->sourcePaths)) {
return $this->sourcePaths[$target];
} else {
$source = OC_SHARE::getSource($target);
$source = OC_Share::getSource($target);
$this->sourcePaths[$target] = $source;
return $source;
}
@ -60,7 +58,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
$source = $this->getSource($path);
if ($source) {
if ($this->is_writeable($path)) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->mkdir($this->getInternalPath($source));
}
}
@ -69,14 +67,14 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function rmdir($path) {
// The folder will be removed from the database, but won't be deleted from the owner's filesystem
OC_SHARE::unshareFromMySelf($this->datadir.$path);
OC_Share::unshareFromMySelf($this->datadir.$path);
}
public function opendir($path) {
if ($path == "" || $path == "/") {
global $FAKEDIRS;
$path = $this->datadir.$path;
$sharedItems = OC_SHARE::getItemsInFolder($path);
$sharedItems = OC_Share::getItemsInFolder($path);
if (empty($sharedItems)) {
return false;
}
@ -91,12 +89,12 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
$dh = $storage->opendir($this->getInternalPath($source));
// Remove any duplicate or trailing '/'
$path = rtrim($this->datadir.$path, "/");
$path = preg_replace('{(/)\1+}', "/", $path);
$modifiedItems = OC_SHARE::getItemsInFolder($source);
$modifiedItems = OC_Share::getItemsInFolder($source);
if ($modifiedItems && $dh) {
global $FAKEDIRS;
$sources = array();
@ -147,7 +145,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->is_dir($this->getInternalPath($source));
}
}
@ -156,7 +154,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function is_file($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->is_file($this->getInternalPath($source));
}
}
@ -181,7 +179,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->stat($this->getInternalPath($source));
}
}
@ -193,7 +191,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->filetype($this->getInternalPath($source));
}
}
@ -206,7 +204,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->filesize($this->getInternalPath($source));
}
}
@ -214,7 +212,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getFolderSize($path) {
if ($path == "" || $path == "/") {
$dbpath = $this->datadir;
$dbpath = OC_User::getUser()."/files/Share/";
} else {
$source = $this->getSource($path);
$dbpath = $this->getInternalPath($source);
@ -250,7 +248,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
if ($size > 0) {
if ($path == "" || $path == "/") {
$dbpath = OC_USER::getUser()."/files/Share/";
$dbpath = OC_User::getUser()."/files/Share/";
} else {
$source = $this->getSource($path);
$dbpath = $this->getInternalPath($source);
@ -267,7 +265,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
public function is_writeable($path) {
if ($path == "" || $path == "/" || OC_SHARE::getPermissions($this->datadir.$path) & OC_SHARE::WRITE) {
if ($path == "" || $path == "/" || OC_Share::getPermissions($this->datadir.$path) & OC_Share::WRITE) {
return true;
} else {
return false;
@ -280,7 +278,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->file_exists($this->getInternalPath($source));
}
}
@ -289,7 +287,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function readfile($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->readfile($this->getInternalPath($source));
}
}
@ -308,7 +306,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->filectime($this->getInternalPath($source));
}
}
@ -328,7 +326,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->filemtime($this->getInternalPath($source));
}
}
@ -348,7 +346,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->fileatime($this->getInternalPath($source));
}
}
@ -357,7 +355,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function file_get_contents($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->file_get_contents($this->getInternalPath($source));
}
}
@ -366,7 +364,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path)) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->file_put_contents($this->getInternalPath($source), $data);
}
}
@ -375,29 +373,29 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function unlink($path) {
$target = $this->datadir.$path;
// If the user has delete permission for the item, the source item will be deleted
if (OC_SHARE::getPermissions($target) & OC_SHARE::DELETE) {
if (OC_Share::getPermissions($target) & OC_Share::DELETE) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->unlink($this->getInternalPath($source));
}
// The item will be removed from the database, but won't be touched on the owner's filesystem
} else {
// Check if the item is inside a shared folder
if (OC_SHARE::getParentFolders($target)) {
if (OC_Share::getParentFolders($target)) {
// If entry for item already exists
if (OC_SHARE::getItem($target)) {
OC_SHARE::setTarget($target, "/");
if (OC_Share::getItem($target)) {
OC_Share::setTarget($target, "/");
} else {
OC_SHARE::pullOutOfFolder($target, "/");
OC_Share::pullOutOfFolder($target, "/");
// If this is a folder being deleted, call setTarget in case there are any database entries inside the folder
if (self::is_dir($path)) {
OC_SHARE::setTarget($target, "/");
OC_Share::setTarget($target, "/");
}
}
// Delete the database entry
} else {
OC_SHARE::unshareFromMySelf($target);
OC_Share::unshareFromMySelf($target);
}
}
return true;
@ -408,21 +406,21 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path1)) {
$source = $this->getSource($path1);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->rename($path1, $path2);
}
// The item will be renamed in the database, but won't be touched on the owner's filesystem
} else {
$oldTarget = $this->datadir.$path1;
$newTarget = $this->datadir.$path2;
if (OC_SHARE::getItem($oldTarget)) {
OC_SHARE::setTarget($oldTarget, $newTarget);
if (OC_Share::getItem($oldTarget)) {
OC_Share::setTarget($oldTarget, $newTarget);
// There is no entry in the database for the item, it must be inside a shared folder
} else {
OC_SHARE::pullOutOfFolder($oldTarget, $newTarget);
OC_Share::pullOutOfFolder($oldTarget, $newTarget);
// If this is a folder being renamed, call setTarget in case there are any database entries inside the folder
if (self::is_dir($path1)) {
OC_SHARE::setTarget($oldTarget, $newTarget);
OC_Share::setTarget($oldTarget, $newTarget);
}
}
}
@ -445,7 +443,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function fopen($path, $mode) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->fopen($this->getInternalPath($source), $mode);
}
}
@ -453,7 +451,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function toTmpFile($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->toTmpFile($this->getInternalPath($source));
}
}
@ -462,7 +460,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path)) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->fromTmpFile($tmpFile, $this->getInternalPath($source));
}
} else {
@ -473,7 +471,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function fromUploadedFile($tmpPath, $path) {
$source = $this->getSource($tmpPath);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->fromUploadedFile($this->getInternalPath($source), $path);
}
}
@ -481,7 +479,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getMimeType($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->getMimeType($this->getInternalPath($source));
}
}
@ -489,7 +487,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function delTree($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->delTree($this->getInternalPath($source));
}
}
@ -497,7 +495,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function find($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->find($this->getInternalPath($source));
}
}
@ -505,7 +503,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getTree($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->getTree($this->getInternalPath($source));
}
}
@ -513,7 +511,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function hash($type, $path, $raw) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->hash($type, $this->getInternalPath($source), $raw);
}
}
@ -521,7 +519,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function free_space($path) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_FILESYSTEM::getStorage($source);
$storage = OC_Filesystem::getStorage($source);
return $storage->free_space($this->getInternalPath($source));
}
}

View File

@ -52,22 +52,21 @@ if(!isset($arguments['album'])){
if(!isset($arguments['search'])){
$arguments['search']='';
}
OC_MEDIA_COLLECTION::$uid=OC_USER::getUser();
OC_MEDIA_COLLECTION::$uid=OC_User::getUser();
if($arguments['action']){
switch($arguments['action']){
case 'delete':
$path=$arguments['path'];
OC_MEDIA_COLLECTION::deleteSongByPath($path);
$paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
$paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
if(array_search($path,$paths)!==false){
unset($paths[array_search($path,$paths)]);
OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
}
case 'get_collection':
$artists=OC_MEDIA_COLLECTION::getArtists();
foreach($artists as &$artist){
$artist['albums']=OC_MEDIA_COLLECTION::getAlbums($artist['artist_id']);
$artistHasSongs=false;
foreach($artist['albums'] as &$album){
$album['songs']=OC_MEDIA_COLLECTION::getSongs($artist['artist_id'],$album['album_id']);
}
@ -78,11 +77,11 @@ if($arguments['action']){
case 'scan':
set_time_limit(0); //recursive scan can take a while
$path=$arguments['path'];
if(OC_FILESYSTEM::is_dir($path)){
$paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
if(OC_Filesystem::is_dir($path)){
$paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
if(array_search($path,$paths)===false){
$paths[]=$path;
OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
}
}
echo OC_MEDIA_SCANNER::scanFolder($path);
@ -103,7 +102,7 @@ if($arguments['action']){
case 'play':
ob_end_clean();
$ftype=OC_FILESYSTEM::getMimeType( $arguments['path'] );
$ftype=OC_Filesystem::getMimeType( $arguments['path'] );
$songId=OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
OC_MEDIA_COLLECTION::registerPlay($songId);
@ -112,9 +111,9 @@ if($arguments['action']){
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: '.OC_FILESYSTEM::filesize($arguments['path']));
header('Content-Length: '.OC_Filesystem::filesize($arguments['path']));
OC_FILESYSTEM::readfile($arguments['path']);
OC_Filesystem::readfile($arguments['path']);
exit;
}
}

View File

@ -33,7 +33,7 @@ error_log($_GET['autoupdate']);
$autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
error_log((integer)$autoUpdate);
OC_PREFERENCES::setValue(OC_USER::getUser(),'media','autoupdate',(integer)$autoUpdate);
OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate);
echo json_encode( array( "status" => "success", "data" => $autoUpdate));
?>

View File

@ -22,12 +22,42 @@
require_once('apps/media/lib_media.php');
if(OC_APP::getCurrentApp()=='files'){
OC_UTIL::addScript('media','files');
if(OC_App::getCurrentApp()=='files'){
OC_Util::addScript('media','files');
}
OC_APP::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
OC_APP::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_HELPER::linkTo( 'media', 'index.php' ), 'icon' => OC_HELPER::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
OC_APP::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_HELPER::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_HELPER::imagePath( 'media', 'media.png' )));
OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
OC_App::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_Helper::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_Helper::imagePath( 'media', 'media.png' )));
// add subnavigations
$entry = array(
'id' => "media_playlist",
'order'=>1,
'href' => '#playlist',
'name' => 'Playlist'
);
OC_App::addNavigationSubEntry( "media_index", $entry);
$entry = array(
'id' => "media_collection",
'order'=>1,
'href' => '#collection',
'name' => 'Collection'
);
OC_App::addNavigationSubEntry( "media_index", $entry);
// $entry = array(
// 'id' => "media_recent",
// 'order'=>1,
// 'href' => '#recent',
// 'name' => 'Most Recent'
// );
// OC_App::addNavigationSubEntry( "media_index", $entry);
// $entry = array(
// 'id' => "media_mostplayer",
// 'order'=>1,
// 'href' => '#mostplayed',
// 'name' => 'Most Played'
// );
// OC_App::addNavigationSubEntry( "media_index", $entry);
?>

View File

@ -3,7 +3,15 @@
li button.right.prettybutton{font-size:1em;}
#collection{padding-top:1em;position:relative;width:70ex;float:left;}
#collection li.album,#collection li.song{margin-left:3ex;}
#playlist{margin-left:72ex;}
#playlist li.current{background-color:#ccc;}
#playlist{width:100%;border-spacing:0;}
#playlist th{background-color:#ccc; text-align:left; font-size:1.2em; padding:0.2em}
#playlist tr.selected{background-color:#eee;}
#playlist tr.current{background-color:#ccc;}
#playlist td.time, #playlist th.time{text-align:right; padding-right:1em;}
#collection li button{float:right;}
#collection li,#playlist li{list-style-type:none;}
.template{display:none}
#collection{display:none}/*hide the collection initially*/
#collection li{padding-right:10px;}
img.remove{float:right;};

View File

@ -1,4 +1,4 @@
#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-20px;height:80px;border-bottom:none;}
#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-20px;height:60px;border-bottom:none;}
#jp-interface div.player{height:0px}
#jp-interface ul.jp-controls{list-style-type:none;padding:0;}
#jp-interface ul.jp-controls li{display:inline;}

View File

@ -25,27 +25,33 @@
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();
}
require_once('lib_collection.php');
require_once('lib_scanner.php');
require_once('template.php');
OC_UTIL::addScript('media','player');
OC_UTIL::addScript('media','music');
OC_UTIL::addScript('media','jquery.jplayer.min');
OC_UTIL::addStyle('media','player');
OC_UTIL::addStyle('media','music');
OC_Util::addScript('media','player');
OC_Util::addScript('media','music');
OC_Util::addScript('media','playlist');
OC_Util::addScript('media','collection');
OC_Util::addScript('media','jquery.jplayer.min');
OC_Util::addStyle('media','player');
OC_Util::addStyle('media','music');
OC_APP::setActiveNavigationEntry( 'media_index' );
OC_App::setActiveNavigationEntry( 'media_playlist' );
$tmpl = new OC_TEMPLATE( 'media', 'music', 'user' );
$tmpl = new OC_Template( 'media', 'music', 'user' );
$player = new OC_Template( 'media', 'player');
$playlist = new OC_Template( 'media', 'playlist');
$collection= new OC_Template( 'media', 'collection');
$player = new OC_TEMPLATE( 'media', 'player');
$tmpl->assign('player',$player->fetchPage());
$tmpl->assign('playlist',$playlist->fetchPage());
$tmpl->assign('collection',$collection->fetchPage());
$tmpl->printPage();
?>

150
apps/media/js/collection.js Normal file
View File

@ -0,0 +1,150 @@
Collection={
artists:[],
loaded:false,
loading:false,
loadedListeners:[],
load:function(ready){
if(ready){
Collection.loadedListeners.push(ready);
}
if(!Collection.loading){
Collection.loading=true;
$.ajax({
url: OC.linkTo('media','ajax/api.php')+'?action=get_collection',
dataType: 'json',
success: function(collection){
Collection.artists=collection;
//set the album and artist fieds for the songs
for(var i=0;i<collection.length;i++){
var artist=collection[i];
for(var j=0;j<artist.albums.length;j++){
var album=artist.albums[j]
for(var w=0;w<album.songs.length;w++){
album.songs[w].album_name=album.album_name;
album.songs[w].artist_name=artist.artist_name;
}
}
}
Collection.loaded=true;
Collection.loading=false;
for(var i=0;i<Collection.loadedListeners.length;i++){
Collection.loadedListeners[i]();
}
}
});
}
},
display:function(){
if(Collection.parent){
Collection.parent.show();
}
if(!Collection.loaded){
Collection.load(Collection.display)
}else{
if(Collection.parent){
Collection.parent.children('li.artist').remove();
var template=Collection.parent.children('li.template');
for(var i=0;i<Collection.artists.length;i++){
var artist=Collection.artists[i];
var li=template.clone();
li.data('artist',artist);
li.removeClass('template');
li.addClass('artist');
li.data('type','artist');
li.children('span').text(artist.artist_name);
Collection.addButtons(li);
Collection.parent.append(li);
}
}
}
},
parent:null,
hide:function(){
if(Collection.parent){
Collection.parent.hide();
}
},
showAlbums:function(artistLi){
$('ul.albums').parent().removeClass('active');
$('ul.albums').remove();
var artist=artistLi.data('artist');
if(artist){
var template=Collection.parent.children('li.template');
var ul=$('<ul class="albums"></ul>');
for(var i=0;i<artist.albums.length;i++){
var li=template.clone();
var album=artist.albums[i];
li.removeClass('template');
li.addClass('album');
li.data('album',album);
li.data('type','album');
li.children('span').text(album.album_name);
Collection.addButtons(li);
ul.append(li);
}
artistLi.append(ul);
}
},
showSongs:function(albumLi){
$('ul.songs').parent().removeClass('active');
$('ul.songs').remove();
var album=albumLi.data('album');
var template=Collection.parent.children('li.template');
var ul=$('<ul class="songs"></ul>');
for(var i=0;i<album.songs.length;i++){
var li=template.clone();
var song=album.songs[i];
li.removeClass('template');
li.addClass('song');
li.data('song',song);
li.data('type','song');
li.children('span').text(song.song_name);
Collection.addButtons(li);
ul.append(li);
}
albumLi.append(ul);
},
registerPlay:function(){
var item=PlayList.items[PlayList.current];
for(var i=0;i<Collection.artists.length;i++){
var artist=Collection.artists[i];
for(var j=0;j<artist.albums.length;j++){
var album=artist.albums[j]
for(var w=0;w<album.songs.length;w++){
var song=album.songs[w];
if(song.song_name==item.name && song.artist_name==item.artist && song.album_name==item.album){
song.song_playcount++;
}
}
}
}
},
addButtons:function(parent){
parent.children('button.add').click(function(){
var type=$(this).parent().data('type');
PlayList.add($(this).parent().data(type));
});
parent.children('button.play').click(function(){
var type=$(this).parent().data('type');
var oldSize=PlayList.items.length;
PlayList.add($(this).parent().data(type));
PlayList.play(oldSize);
});
}
}
$(document).ready(function(){
Collection.parent=$('#collection');
Collection.load();
$('#collection li.artist>span').live('click',function(){
$(this).parent().toggleClass('active');
Collection.showAlbums($(this).parent());
});
$('#collection li.album>span').live('click',function(){
$(this).parent().toggleClass('active');
Collection.showSongs($(this).parent());
});
});

View File

@ -1,85 +1,24 @@
$(document).ready(function(){
//load the collection
$.ajax({
url: OC.linkTo('media','ajax/api.php')+'?action=get_collection',
dataType: 'json',
success: function(collection){
displayCollection(collection);
}
$('#plugins a[href="#collection"]').click(function(){
$('#plugins li.subentry a.active').removeClass('active');
$(this).addClass('active');
PlayList.hide();
Collection.display();
});
$('#plugins a[href="#playlist"]').click(function(){
$('#plugins li.subentry a.active').removeClass('active');
$(this).addClass('active');
PlayList.render();
Collection.hide();
});
var tab=window.location.href.slice(window.location.href.indexOf('#') + 1);
if(tab=='collection'){
$('#plugins a[href="#collection"]').trigger('click');
}
});
function displayCollection(collection){
$('#collection').data('collection',collection);
$.each(collection,function(index,artist){
var artistNode=$('<li class="artist">'+artist.artist_name+'<button class="add">Add</button><ul/></li>');
artistNode.data('name',artist.artist_name);
artistNode.data('stuff',artist);
$('#collection>ul').append(artistNode);
$.each(artist.albums,function(index,album){
var albumNode=$('<li class="album">'+album.album_name+'<button class="add">Add</button><ul/></li>');
albumNode.data('name',album.album_name);
albumNode.data('stuff',album);
artistNode.children('ul').append(albumNode);
$.each(album.songs,function(index,song){
var songNode=$('<li class="song">'+song.song_name+'<button class="add">Add</button></li>');
song.artist_name=artist.artist_name;
song.album_name=album.album_name;
songNode.data('name',song.song_name);
songNode.data('stuff',song);
albumNode.children('ul').append(songNode);
});
});
});
$('li.album').hide();
$('li.song').hide();
$('li.artist').click(function(){
$(this).children().children().slideToggle();
return false;
});
$('li.album').click(function(){
$(this).children().children().slideToggle();
return false;
});
$('li.song').click(function(){
return false;
});
$('li>button.add').click(function(){
PlayList.add($(this).parent().data('stuff'));
PlayList.render($('#playlist'));
return false;
});
if(window.location.href.indexOf('#')>-1){//autoplay passed arist/album/song
var vars=getUrlVars();
var play;
if(vars['artist']){
$.each(collection,function(index,artist){
if(artist.artist_name==vars['artist']){
play=artist;
if(vars['album']){
$.each(artist.albums,function(index,album){
if(album.album_name==vars['album']){
play=album;
if(vars['song']){
$.each(album.songs,function(index,song){
if(song.song_name==vars['song']){
play=song;
}
});
}
}
});
}
}
});
}
PlayList.add(play);
PlayList.play();
}else{
PlayList.init();
}
}
function getUrlVars(){
var vars = [], hash;
@ -94,7 +33,7 @@ function getUrlVars(){
}
function musicTypeFromFile(file){
var extention=file.substr(file.indexOf('.')+1);
var extention=file.split('.').pop();
if(extention=='ogg'){
return 'oga'
}

View File

@ -3,13 +3,13 @@ var PlayList={
current:-1,
items:[],
player:null,
parent:null,
next:function(){
var next=PlayList.current+1;
if(next>=PlayList.items.length){
next=0;
}
PlayList.play(next);
PlayList.render();
},
previous:function(){
var next=PlayList.current-1;
@ -17,6 +17,7 @@ var PlayList={
next=PlayList.items.length-1;
}
PlayList.play(next);
PlayList.render();
},
play:function(index){
if(index==null){
@ -30,7 +31,11 @@ var PlayList={
PlayList.init(PlayList.items[index].type,PlayList.play);
}else{
PlayList.player.jPlayer("setMedia", PlayList.items[PlayList.current]);
PlayList.items[index].playcount++;
PlayList.player.jPlayer("play");
if(Collection){
Collection.registerPlay();
}
}
}else{
PlayList.init(PlayList.items[index].type,PlayList.play);
@ -66,6 +71,9 @@ var PlayList={
});
},
add:function(song){
if(!song){
return;
}
if(song.substr){//we are passed a string, asume it's a url to a song
PlayList.addFile(song);
}
@ -81,7 +89,7 @@ var PlayList={
}
if(song.song_name){
var type=musicTypeFromFile(song.song_path);
var item={name:song.song_name,type:type,artist:song.artist_name,album:song.album_name};
var item={name:song.song_name,type:type,artist:song.artist_name,album:song.album_name,length:song.song_length,playcount:song.song_playcount};
item[type]=PlayList.urlBase+encodeURIComponent(song.song_path);
PlayList.items.push(item);
}
@ -92,30 +100,9 @@ var PlayList={
item[type]=PlayList.urlBase+encodeURIComponent(path);
PlayList.items.push(item);
},
render:function(parent){//parent should be an ul element
if(parent){
PlayList.parent=parent;
}else{
parent=PlayList.parent;
}
if(parent){
parent.empty();
for(var i=0;i<PlayList.items.length;i++){
var song=PlayList.items[i];
var item=$('<li>'+song.artist+' - '+song.album+' - '+song.name+'</li>');
item.data('artist',song.artist);
item.data('album',song.album);
item.data('name',song.name);
item.data('index',i);
item.click(function(){
PlayList.play($(this).data('index'));
PlayList.render();
});
if(i==PlayList.current){
item.addClass('current');
}
parent.append(item);
}
}
}
remove:function(index){
PlayList.items.splice(index,1);
PlayList.render();
},
render:function(){}
}

141
apps/media/js/playlist.js Normal file
View File

@ -0,0 +1,141 @@
PlayList.render=function(){
$('#playlist').show();
PlayList.parent.empty();
for(var i=0;i<PlayList.items.length;i++){
var tr=PlayList.template.clone();
var item=PlayList.items[i];
if(i==PlayList.current){
tr.addClass('current');
}
tr.removeClass('template');
tr.data('name',item.name);
tr.data('artist',item.artist);
tr.data('album',item.album);
tr.data('time',item.length);
tr.data('plays',item.playcount);
tr.children('td.name').children('span').text(item.name);
tr.children('td.artist').text(item.artist);
tr.children('td.album').text(item.album);
var secconds=(item.length%60);
if(secconds<10){
secconds='0'+secconds;
}
var length=Math.floor(item.length/60)+':'+secconds;
tr.children('td.time').text(length);
tr.children('td.plays').text(item.playcount);
tr.data('index',i);
tr.click(function(){
PlayList.play($(this).data('index'));
PlayList.render();
});
tr.hover(function(){
var button=$('<img class="remove" title="Remove"/>');
button.attr('src',OC.imagePath('core','actions/delete'));
$(this).children().last().append(button);
button.click(function(event){
event.stopPropagation();
event.preventDefault();
var index=$(this).parent().parent().data('index');
PlayList.remove(index);
});
},function(){
$(this).children().last().children('img.remove').remove();
});
tr.children('td.name').children('input').click(function(event){
event.stopPropagation();
if($(this).attr('checked')){
$(this).parent().parent().addClass('selected');
if($('tbody td.name input:checkbox').length==$('tbody td.name input:checkbox:checked').length){
$('#selectAll').attr('checked',true);
}
}else{
$(this).parent().parent().removeClass('selected');
$('#selectAll').attr('checked',false);
}
procesSelection();
});
PlayList.parent.append(tr);
}
}
PlayList.getSelected=function(){
return $('tbody td.name input:checkbox:checked').parent().parent();
}
PlayList.hide=function(){
$('#playlist').hide();
}
$(document).ready(function(){
PlayList.parent=$('#playlist tbody');
PlayList.template=$('#playlist tr.template');
$('#selectAll').click(function(){
if($(this).attr('checked')){
// Check all
$('tbody td.name input:checkbox').attr('checked', true);
$('tbody td.name input:checkbox').parent().parent().addClass('selected');
}else{
// Uncheck all
$('tbody td.name input:checkbox').attr('checked', false);
$('tbody td.name input:checkbox').parent().parent().removeClass('selected');
}
procesSelection();
});
});
function procesSelection(){
var selected=PlayList.getSelected();
if(selected.length==0){
$('th.name span').text('Name');
$('th.artist').text('Artist');
$('th.album').text('Album');
$('th.time').text('Time');
$('th.plays').empty();
$('th.plays').text('Plays');
}else{
var name=selected.length+' selected';
var artist=$(selected[0]).data('artist');
var album=$(selected[0]).data('album');
var time=$(selected[0]).data('time');
var plays=$(selected[0]).data('plays');
for(var i=1;i<selected.length;i++){
var item=$(selected[i]);
if(artist!='mixed' && item.data('artist')!==artist){
artist='mixed'
}
if(album!='mixed' && item.data('album')!==album){
album='mixed'
}
if(time!='mixed' && item.data('time')!==time){
time='mixed'
}
if(plays!='mixed' && item.data('plays')!==plays){
plays='mixed'
}
}
$('th.name span').text(name);
$('th.artist').text(artist);
$('th.album').text(album);
if(time!='mixed'){
var secconds=(time%60);
if(secconds<10){
secconds='0'+secconds;
}
var time=Math.floor(time/60)+':'+secconds;
}
$('th.time').text(time);
$('th.plays').text(plays);
var button=$('<img class="remove" title="Remove"/>');
button.attr('src',OC.imagePath('core','actions/delete'));
$('th.plays').append(button);
button.click(function(event){
event.stopPropagation();
event.preventDefault();
PlayList.getSelected().each(function(index,element){
var index=$(element).data('index');
PlayList.items[index]=null;
});
PlayList.items=PlayList.items.filter(function(item){return item!==null});
PlayList.render();
procesSelection();
});
}
}

View File

@ -319,11 +319,11 @@ class OC_MEDIA_AMPACHE{
return;
}
if($song=OC_MEDIA_COLLECTION::getSong($params['song'])){
OC_UTIL::setupFS($song["song_user"]);
OC_Util::setupFS($song["song_user"]);
header('Content-type: '.OC_FILESYSTEM::getMimeType($song['song_path']));
header('Content-type: '.OC_Filesystem::getMimeType($song['song_path']));
header('Content-Length: '.$song['song_size']);
OC_FILESYSTEM::readfile($song['song_path']);
OC_Filesystem::readfile($song['song_path']);
}
}

View File

@ -125,10 +125,10 @@ class OC_MEDIA_COLLECTION{
}
$query=OC_DB::prepare("SELECT DISTINCT *PREFIX*media_artists.artist_name AS name , *PREFIX*media_artists.artist_id AS id FROM *PREFIX*media_artists
INNER JOIN *PREFIX*media_songs ON *PREFIX*media_artists.artist_id=*PREFIX*media_songs.song_artist WHERE artist_name LIKE ? AND *PREFIX*media_songs.song_user=?");
$artists=$query->execute(array($search,OC_USER::getUser()))->fetchAll();
$artists=$query->execute(array($search,OC_User::getUser()))->fetchAll();
$result=array();
foreach($artists as $artist){
$result[$artist['id']]=array('artist_name'=>$artist['name'],'artist_id'=>$artist['id']);
$result[]=array('artist_name'=>$artist['name'],'artist_id'=>$artist['id']);
}
return $result;
}
@ -179,7 +179,7 @@ class OC_MEDIA_COLLECTION{
$result=array();
foreach($albums as $album){
if(count(self::getSongs($album['album_artist'],$album['album_id']))){
$result[$album['album_id']]=$album;
$result[]=$album;
}
}
return $result;

View File

@ -22,20 +22,20 @@
*/
//we need to have the sha256 hash of passwords for ampache
OC_HOOK::connect('OC_USER','post_login','OC_MEDIA','loginListener');
OC_Hook::connect('OC_User','post_login','OC_MEDIA','loginListener');
//connect to the filesystem for auto updating if configured
if(OC_PREFERENCES::getValue(OC_USER::getUser(),'media','autoupdate',false)){
OC_HOOK::connect('OC_FILESYSTEM','post_write','OC_MEDIA','updateFile');
if(OC_Preferences::getValue(OC_User::getUser(),'media','autoupdate',false)){
OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile');
}
//listen for file deletions to clean the database if a song is deleted
OC_HOOK::connect('OC_FILESYSTEM','delete','OC_MEDIA','deleteFile');
OC_Hook::connect('OC_Filesystem','delete','OC_MEDIA','deleteFile');
class OC_MEDIA{
/**
* get the sha256 hash of the password needed for ampache
* @param array $params, parameters passed from OC_HOOK
* @param array $params, parameters passed from OC_Hook
*/
public static function loginListener($params){
if(isset($_POST['user']) and $_POST['password']){
@ -56,7 +56,7 @@ class OC_MEDIA{
*/
public static function updateFile($params){
$path=$params['path'];
$folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
$folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
foreach($folderNames as $folder){
if(substr($path,0,strlen($folder))==$folder){
require_once 'lib_scanner.php';
@ -82,7 +82,7 @@ class OC_MEDIA{
}
}
class OC_MediaSearchProvider extends OC_SearchProvider{
class OC_MediaSearchProvider extends OC_Search_Provider{
function search($query){
require_once('lib_collection.php');
$artists=OC_MEDIA_COLLECTION::getArtists($query);
@ -90,18 +90,18 @@ class OC_MediaSearchProvider extends OC_SearchProvider{
$songs=OC_MEDIA_COLLECTION::getSongs(0,0,$query);
$results=array();
foreach($artists as $artist){
$results[]=new OC_SearchResult($artist['artist_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
$results[]=new OC_Search_Result($artist['artist_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
}
foreach($albums as $album){
$artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($album['album_artist']));
$results[]=new OC_SearchResult($album['album_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
$results[]=new OC_Search_Result($album['album_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
}
foreach($songs as $song){
$minutes=floor($song['song_length']/60);
$secconds=$song['song_length']%60;
$artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($song['song_artist']));
$album=urlencode(OC_MEDIA_COLLECTION::getalbumName($song['song_album']));
$results[]=new OC_SearchResult($song['song_name'],"$minutes:$secconds",OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
$results[]=new OC_Search_Result($song['song_name'],"$minutes:$secconds",OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
}
return $results;
}

View File

@ -37,15 +37,15 @@ class OC_MEDIA_SCANNER{
* @return int the number of songs found
*/
public static function scanFolder($path){
if (OC_FILESYSTEM::is_dir($path)) {
if (OC_Filesystem::is_dir($path)) {
$songs=0;
if ($dh = OC_FILESYSTEM::opendir($path)) {
if ($dh = OC_Filesystem::opendir($path)) {
while (($filename = readdir($dh)) !== false) {
if($filename<>'.' and $filename<>'..' and substr($filename,0,1)!='.'){
$file=$path.'/'.$filename;
if(OC_FILESYSTEM::is_dir($file)){
if(OC_Filesystem::is_dir($file)){
$songs+=self::scanFolder($file);
}elseif(OC_FILESYSTEM::is_file($file)){
}elseif(OC_Filesystem::is_file($file)){
if(self::scanFile($file)){
$songs++;
}
@ -53,7 +53,7 @@ class OC_MEDIA_SCANNER{
}
}
}
}elseif(OC_FILESYSTEM::is_file($path)){
}elseif(OC_Filesystem::is_file($path)){
$songs=1;
self::scanFile($path);
}else{
@ -68,8 +68,8 @@ class OC_MEDIA_SCANNER{
* @return boolean
*/
public static function scanFile($path){
$file=OC_FILESYSTEM::getLocalFile($path);
if(substr($path,-3)=='mp3' and OC_HELPER::canExecute("id3info") and OC_HELPER::canExecute("mp3info")){//use the command line tool id3info if possible
$file=OC_Filesystem::getLocalFile($path);
if(substr($path,-3)=='mp3' and OC_Helper::canExecute("id3info") and OC_Helper::canExecute("mp3info")){//use the command line tool id3info if possible
$output=array();
$size=filesize($file);
$length=0;

View File

@ -24,20 +24,19 @@
require_once('../../lib/base.php');
if( !OC_USER::isLoggedIn()){
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
if( !OC_User::isLoggedIn()){
header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
require( 'template.php' );
require( 'lib_collection.php' );
OC_UTIL::addStyle('media','style');
OC_UTIL::addScript('media','settings');
OC_Util::addStyle('media','style');
OC_Util::addScript('media','settings');
OC_APP::setActiveNavigationEntry( 'media_settings' );
OC_App::setActiveNavigationEntry( 'media_settings' );
$folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue($_SESSION['user_id'],'media','paths',''));
$folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue($_SESSION['user_id'],'media','paths',''));
$folders=array();
foreach($folderNames as $folder){
if($folder){
@ -45,9 +44,9 @@ foreach($folderNames as $folder){
}
}
$tmpl = new OC_TEMPLATE( 'media', 'settings', 'admin' );
$tmpl = new OC_Template( 'media', 'settings', 'admin' );
$tmpl->assign('folders',$folders);
$tmpl->assign('autoupdate',OC_PREFERENCES::getValue($_SESSION['user_id'],'media','autoupdate',false));
$tmpl->assign('autoupdate',OC_Preferences::getValue($_SESSION['user_id'],'media','autoupdate',false));
$tmpl->printPage();
?>

View File

@ -0,0 +1,10 @@
<ul id='collection'>
<li class='artist'>
<img src="<?php echo image_path('files','loading.gif') ?>" alt='loading'/>Loading Collection...
</li>
<li class='template'>
<span></span>
<button class='add'>Add</button>
<button class='play'>Play</button>
</li>
</ul>

View File

@ -1,3 +1,3 @@
<?php echo $_['player'];?>
<div id='collection'><ul/></div>
<ul id="playlist"/>
<?php echo $_['collection'];?>
<?php echo $_['playlist'];?>

View File

@ -0,0 +1,30 @@
<table id='playlist'>
<thead>
<tr>
<th class='name'><input id='selectAll' type='checkbox'>Name</th>
<th class='artist'>Artist</th>
<th class='album'>Album</th>
<th class='time'>Time</th>
<th class='plays'>Plays</th>
</tr>
</thead>
<tbody>
<tr>
<td>
The playlist is empty
</td>
</tr>
</tbody>
<tfoot>
<tr class='template'>
<td class='name'>
<input type='checkbox'>
<span></span>
</td>
<td class='artist'></td>
<td class='album'></td>
<td class='time'></td>
<td class='plays'></td>
</tr>
</tfoot>
</table>

View File

@ -28,8 +28,8 @@ require_once('lib_collection.php');
$user=isset($_POST['user'])?$_POST['user']:'';
$pass=isset($_POST['pass'])?$_POST['pass']:'';
if(OC_USER::checkPassword($user,$pass)){
OC_UTIL::setupFS($user);
if(OC_User::checkPassword($user,$pass)){
OC_Util::setupFS($user);
OC_MEDIA_COLLECTION::$uid=$user;
}else{
exit;
@ -40,14 +40,14 @@ if(isset($_POST['play']) and $_POST['play']=='true'){
exit;
}
$song=OC_MEDIA_COLLECTION::getSong($_POST['song']);
$ftype=OC_FILESYSTEM::getMimeType( $song['song_path'] );
$ftype=OC_Filesystem::getMimeType( $song['song_path'] );
header('Content-Type:'.$ftype);
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: '.OC_FILESYSTEM::filesize($song['song_path']));
header('Content-Length: '.OC_Filesystem::filesize($song['song_path']));
OC_FILESYSTEM::readfile($song['song_path']);
OC_Filesystem::readfile($song['song_path']);
}
$artist=isset($_POST['artist'])?'%'.$_POST['artist'].'%':'';
@ -59,7 +59,7 @@ $album=OC_MEDIA_COLLECTION::getAlbumId($album,$artist);
$songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song);
$baseUrl=OC_UTIL::getServerURL().OC_HELPER::linkTo('media','tomahawk.php');
$baseUrl=OC_Util::getServerURL().OC_Helper::linkTo('media','tomahawk.php');
$results=array();
foreach($songs as $song) {
@ -68,7 +68,7 @@ foreach($songs as $song) {
'album' => OC_MEDIA_COLLECTION::getAlbumName($song['song_album']),
'track' => $song['song_name'],
'source' => 'ownCloud',
'mimetype' => OC_FILESYSTEM::getMimeType($song['song_path']),
'mimetype' => OC_Filesystem::getMimeType($song['song_path']),
'extension' => substr($song['song_path'],strrpos($song['song_path'],'.')),
'url' => $baseUrl.'?play=true&song='.$song['song_id'],
'bitrate' => round($song['song_id']/$song['song_length'],0),

View File

@ -27,13 +27,13 @@ require_once('apps/user_ldap/user_ldap.php');
define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389);
// register user backend
OC_USER::useBackend( "LDAP" );
OC_User::useBackend( "LDAP" );
// add settings page to navigation
$entry = array(
'id' => "user_ldap_settings",
'order'=>1,
'href' => OC_HELPER::linkTo( "user_ldap", "settings.php" ),
'href' => OC_Helper::linkTo( "user_ldap", "settings.php" ),
'name' => 'LDAP'
);
OC_APP::addNavigationSubEntry( "core_users", $entry);
OC_App::addNavigationSubEntry( "core_users", $entry);

View File

@ -22,10 +22,9 @@
*/
require_once('../../lib/base.php');
require( 'template.php' );
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();
}
@ -33,20 +32,20 @@ $params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_password', 'ldap_base
foreach($params as $param){
if(isset($_POST[$param])){
OC_APPCONFIG::setValue('user_ldap', $param, $_POST[$param]);
OC_Appconfig::setValue('user_ldap', $param, $_POST[$param]);
}
}
OC_APP::setActiveNavigationEntry( "user_ldap_settings" );
OC_App::setActiveNavigationEntry( "user_ldap_settings" );
// fill template
$tmpl = new OC_TEMPLATE( 'user_ldap', 'settings', 'admin' );
$tmpl = new OC_Template( 'user_ldap', 'settings', 'admin' );
foreach($params as $param){
$value = OC_APPCONFIG::getValue('user_ldap', $param,'');
$value = OC_Appconfig::getValue('user_ldap', $param,'');
$tmpl->assign($param, $value);
}
// ldap_port has a default value
$tmpl->assign( 'ldap_port', OC_APPCONFIG::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
$tmpl->assign( 'ldap_port', OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
$tmpl->printPage();

View File

@ -21,9 +21,7 @@
*
*/
require_once('User/backend.php');
class OC_USER_LDAP extends OC_USER_BACKEND {
class OC_USER_LDAP extends OC_User_Backend {
protected $ds;
protected $configured = false;
@ -37,12 +35,12 @@ class OC_USER_LDAP extends OC_USER_BACKEND {
protected $ldap_filter;
function __construct() {
$this->ldap_host = OC_APPCONFIG::getValue('user_ldap', 'ldap_host','');
$this->ldap_port = OC_APPCONFIG::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT );
$this->ldap_dn = OC_APPCONFIG::getValue('user_ldap', 'ldap_dn','');
$this->ldap_password = OC_APPCONFIG::getValue('user_ldap', 'ldap_password','');
$this->ldap_base = OC_APPCONFIG::getValue('user_ldap', 'ldap_base','');
$this->ldap_filter = OC_APPCONFIG::getValue('user_ldap', 'ldap_filter','');
$this->ldap_host = OC_Appconfig::getValue('user_ldap', 'ldap_host','');
$this->ldap_port = OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT );
$this->ldap_dn = OC_Appconfig::getValue('user_ldap', 'ldap_dn','');
$this->ldap_password = OC_Appconfig::getValue('user_ldap', 'ldap_password','');
$this->ldap_base = OC_Appconfig::getValue('user_ldap', 'ldap_base','');
$this->ldap_filter = OC_Appconfig::getValue('user_ldap', 'ldap_filter','');
if( !empty($this->ldap_host)
&& !empty($this->ldap_port)

View File

@ -6,15 +6,15 @@ if (!in_array ('curl', get_loaded_extensions())){
}
$urlBase=((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'];
OC_UTIL::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_HELPER::linkTo( "user_openid", "user.php" ).'/'));
OC_UTIL::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_HELPER::linkTo( "user_openid", "user.php" ).'/'));
OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
require_once 'apps/user_openid/user_openid.php';
OC_APP::addSettingsPage( array( "id" => "user_openid_settings", 'order'=>1, "href" => OC_HELPER::linkTo( "user_openid", "settings.php" ), "name" => "OpenID"));
OC_App::addSettingsPage( array( "id" => "user_openid_settings", 'order'=>1, "href" => OC_Helper::linkTo( "user_openid", "settings.php" ), "name" => "OpenID"));
//active the openid backend
OC_USER::useBackend('openid');
OC_User::useBackend('openid');
//check for results from openid requests
if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){

View File

@ -12,9 +12,6 @@
* @version 0.9
*/
require( 'template.php' );
/**
* Set a constant to indicate that phpMyID is running
*/
@ -208,7 +205,7 @@ function authorize_mode () {
$profile['idp_url']=$IDENTITY;
if (isset($_SERVER['PHP_AUTH_USER']) && $profile['authorized'] === false && $_SERVER['PHP_AUTH_USER']==$USERNAME) {
if (OC_USER::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login!
if (OC_User::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login!
// return to the refresh url if they get in
$_SESSION['openid_auth']=true;
$_SESSION['openid_user']=$USERNAME;
@ -562,7 +559,7 @@ function logout_mode () {
*/
function no_mode () {
global $USERNAME, $profile;
$tmpl = new OC_TEMPLATE( 'user_openid', 'nomode', 'guest' );
$tmpl = new OC_Template( 'user_openid', 'nomode', 'guest' );
if(substr($profile['req_url'],-1,1)!=='/'){//the identity should always end with a /
$profile['req_url'].='/';
}

View File

@ -1,23 +1,22 @@
<?php
require_once('../../lib/base.php');
require( 'template.php' );
if( !OC_USER::isLoggedIn()){
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
if( !OC_User::isLoggedIn()){
header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
if(isset($_POST['input_identity'])){
OC_PREFERENCES::setValue(OC_USER::getUser(),'user_openid','identity',$_POST['input_identity']);
OC_Preferences::setValue(OC_User::getUser(),'user_openid','identity',$_POST['input_identity']);
}
OC_APP::setActiveNavigationEntry( "user_openid_settings" );
OC_App::setActiveNavigationEntry( "user_openid_settings" );
$identity=OC_PREFERENCES::getValue(OC_USER::getUser(),'user_openid','identity','');
$identity=OC_Preferences::getValue(OC_User::getUser(),'user_openid','identity','');
$tmpl = new OC_TEMPLATE( "user_openid", "settings", "admin");
$tmpl = new OC_Template( "user_openid", "settings", "admin");
$tmpl->assign('identity',$identity);
$tmpl->assign('user',OC_USER::getUser());
$tmpl->assign('user',OC_User::getUser());
$tmpl->printPage();

View File

@ -38,7 +38,7 @@ $RUNTIME_NOAPPS=true;
$RUNTIME_NOAPPS=false;
require_once '../../lib/base.php';
if(!OC_USER::userExists($USERNAME)){
if(!OC_User::userExists($USERNAME)){
error_log($USERNAME.' doesn\'t exist');
$USERNAME='';
}

View File

@ -21,13 +21,12 @@
*
*/
require_once('User/backend.php');
require_once('class.openid.v3.php');
/**
* Class for user management in a SQL Database (e.g. MySQL, SQLite)
*/
class OC_USER_OPENID extends OC_USER_BACKEND {
class OC_USER_OPENID extends OC_User_Backend {
/**
* @brief Check if the password is correct
* @param $uid The username

View File

@ -23,6 +23,7 @@ form input[type="submit"]:active { outline:0; }
form input[type="button"], form input[type="text"] { font-size:0.9em; }
fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; }
legend { padding:0.5em; font-size:1.2em; }
.template{display:none;}
div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
@ -31,7 +32,7 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1
#body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
#body-login p.info a { font-weight:bold; }
#login div.header { margin-top:-2em; height:10em;
#body-login header { margin-top:-2em; height:10em;
-moz-box-shadow:0 0 5px #000; -webkit-box-shadow:0 0 20px #000; box-shadow:0 0 20px #000;
background: #1d2d44; /* Old browsers */
background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
@ -87,9 +88,9 @@ input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../
#plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; }
#plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins a:active { outline:0; }
#plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins li.subentry a {padding-left:4em;}
#plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; color:#000; outline:0; }
#plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; color:#000; outline:0; }
#plugins li.subentry a { padding-left:3.7em; font-size:1em; }
/* CONTENT ------------------------------------------------------------------ */
#content { margin:3.5em 0 0 15.7em; }

View File

@ -47,18 +47,38 @@ OC={
},
addScript:function(app,script,ready){
var path=OC.filePath(app,'js',script+'.js');
if(ready){
$.getScript(path,ready);
if(OC.addStyle.loaded.indexOf(path)==-1){
OC.addStyle.loaded.push(path);
if(ready){
$.getScript(path,ready);
}else{
$.getScript(path);
}
}else{
$.getScript(path);
if(ready){
ready();
}
}
},
addStyle:function(app,style){
var path=OC.filePath(app,'css',style+'.css');
var style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>');
$('head').append(style);
if(OC.addScript.loaded.indexOf(path)==-1){
OC.addScript.loaded.push(path);
var style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>');
$('head').append(style);
}
},
search:function(query){
if(query){
OC.addScript('search','result',function(){
OC.addStyle('search','results');
$.getJSON(OC.filePath('search','ajax','search.php')+'?query='+encodeURIComponent(query), OC.search.showResults);
});
}
}
}
OC.addStyle.loaded=[];
OC.addScript.loaded=[];
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun /*, thisp*/) {
@ -112,4 +132,15 @@ $(document).ready(function(){
element.attr('src',src.substr(0,src.length-3)+'png');
});
};
$('#searchbox').keyup(function(){
var query=$('#searchbox').val();
if(query.length>2){
OC.search(query);
}else{
if(OC.search.hide){
OC.search.hide();
}
}
});
$('#searchbox').click(function(){$('#searchbox').trigger('keyup')});
});

17
core/l10n/bg_BG.php Normal file
View File

@ -0,0 +1,17 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Грешка 404, обклакът не намерен",
"Advanced" => "Разширено",
"Set where to store the data." => "Изберете къде да записва данните",
"Data directory:" => "Директория за данни:",
"SQLite" => "SQLite",
"Database name:" => "Име на базата:",
"Host:" => "хост:",
"Table prefix:" => "Префикс за таблиците:",
"Finish setup" => "Завършване на настройките",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> е персонален облак който работи от Ваш собствен сървър.</p>",
"Login failed!" => "Входа пропадна!",
"You are logged out." => "Вие излязохте.",
"prev" => "пред.",
"next" => "следващо",
"Search" => "Търсене"
);

View File

@ -1,22 +1,12 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Fejl 404, Skyen kan ikke findes",
"Welcome to <strong>ownCloud</strong>, your personnal cloud." => "Velkommen til <strong>ownCloud</strong>, din personlige Sky.",
"To finish the installation, please follow the steps below." => "For at fuldføre installationen, følg venligst nedenstående trin",
"Create an <strong>admin account.</strong>" => "Lav en <strong>administrator konto.</strong>",
"Login:" => "Login:",
"Password:" => "Kodeord:",
"Advanced" => "Avanceret",
"Set where to store the data." => "Indstil data mappe.",
"Data directory:" => "Data mappe:",
"Configure your database." => "Konfigurer din database.",
"I will use a SQLite database. You have nothing to do!" => "Jeg vil benytte en SQLite database. Du skal ikke gøre noget!",
"SQLite" => "SQLite",
"I will use a MySQL database." => "Jeg vil benytte en MySQL database.",
"Host:" => "Host:",
"Database name:" => "Database navn:",
"Host:" => "Host:",
"Table prefix:" => "Tabel prefix:",
"MySQL user login:" => "MySQL bruger login:",
"MySQL user password:" => "MySQL bruger password:",
"Finish setup" => "Afslut installation",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> er din personly sky der køre på din egen server.</p>",
"Login failed!" => "Login mislykkedes",

View File

@ -1,27 +1,28 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Cloud konnte nicht gefunden werden.",
"Welcome to <strong>ownCloud</strong>, your personnal cloud." => "Willkommen bei <strong>ownCloud</strong>, deinem persönlichen Online-Speicher.",
"To finish the installation, please follow the steps below." => "Die Installation ist fast abgeschlossen.",
"Create an <strong>admin account.</strong>" => "<strong>Verwaltungskonto</strong> erstellen.",
"Login:" => "Benutzername:",
"Password:" => "Passwort:",
"<strong>ownCloud</strong> is your personal web storage." => "<strong>ownCloud</strong> ist dein persönlicher Online-Speicher.",
"Finish the setup by following the steps below." => "Die Installation ist fast abgeschlossen.",
"Create an <strong>admin account</strong>." => "<strong>Verwalter-Konto</strong> erstellen",
"Username" => "Nutzername",
"Password" => "Passwort",
"Advanced" => "Erweitert",
"Set where to store the data." => "Speicherort der Daten",
"Data directory:" => "Datenverzeichnis:",
"Configure your database." => "Datenbank einstellen.",
"I will use a SQLite database. You have nothing to do!" => "Es wird eine SQLite-Datenbank genutzt.",
"Configure the database." => "Datenbank einrichten",
"SQLite will be used for the database. You have nothing to do." => "SQLite wird als Datenbank genutzt.",
"SQLite" => "SQLite",
"I will use a MySQL database." => "Es wird eine MySQL-Datenbank genutzt.",
"Host:" => "Host:",
"MySQL will be used for the database." => "MySQL wird als Datenbank genutzt.",
"MySQL username:" => "MySQL-Nutzername:",
"MySQL password:" => "MySQL-Passwort:",
"Database name:" => "Datenbankname:",
"Host:" => "Host:",
"Table prefix:" => "Tabellenpräfix:",
"MySQL user login:" => "MySQL-Nutzername:",
"MySQL user password:" => "MySQL-Passwort:",
"Finish setup" => "Installation abschließen",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> ist ein privater Online-Speicher für deinen eigenen Server.</p>",
"Login failed!" => "Anmeldung Fehlgeschlagen!",
"You are logged out." => "Sie wurden abgemeldet.",
"prev" => "zurück",
"next" => "weiter",
"Search" => "Suchen",
"Finish setup" => "Installation abschließen"
"Login failed!" => "Anmeldung fehlgeschlagen!",
"Remember login" => "Anmeldung merken",
"You are logged out." => "Erfolgreich abgemeldet.",
"prev" => "Zurück",
"next" => "Weiter",
"Search" => "Suchen"
);

28
core/l10n/fr.php Normal file
View File

@ -0,0 +1,28 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Erreur 404, la page demandée n'existe pas",
"<strong>ownCloud</strong> is your personal web storage." => "<strong>ownCloud</strong> est votre espace de stockage web personnel.",
"Finish the setup by following the steps below." => "Terminez l'installation en suivant les étapes ci-dessous.",
"Create an <strong>admin account</strong>." => "Veuillez créer un <strong>compte administrateur.</strong>",
"Username" => "Nom d'utilisateur",
"Password" => "Mot de passe",
"Advanced" => "Avancé",
"Set where to store the data." => "Sélectionnez où sauvegarder les données",
"Data directory:" => "Répertoire de données",
"Configure the database." => "Configurez la base de données.",
"SQLite will be used for the database. You have nothing to do." => "SQLite sera utilisé comme moteur pour la base de données. Vous n'avez rien de plus à faire.",
"SQLite" => "SQLite",
"MySQL will be used for the database." => "MySQL sera utilisé comme moteur pour la base de données.",
"MySQL username:" => "Nom d'utilisateur MySQL :",
"MySQL password:" => "Mot de passe MySQL :",
"Database name:" => "Nom de la base de données :",
"Host:" => "Hôte :",
"Table prefix:" => "Préfixe de table :",
"Finish setup" => "Terminer l'installation",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> est votre solution cloud personnelle qui tourne sur votre propre serveur.</p>",
"Login failed!" => "Échec de la connexion !",
"Remember login" => "Se souvenir de moi",
"You are logged out." => "Vous êtes désormais déconnecté.",
"prev" => "précédent",
"next" => "suivant",
"Search" => "Rechercher"
);

View File

@ -1,22 +1,12 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Fout 404, Cloud niet gevonden.",
"Welcome to <strong>ownCloud</strong>, your personnal cloud." => "Welkom by <strong>ownCloud</strong>, uw persoonlijke cloud",
"To finish the installation, please follow the steps below." => "Volg de volgende stappen om de installatie te voltooien.",
"Create an <strong>admin account.</strong>" => "Maak een <strong>beheerdersaccount</strong> aan",
"Login:" => "Gebruikersnaam:",
"Password:" => "Wachtwoord:",
"Advanced" => "Geavanceerd",
"Set where to store the data." => "Bepaal de opslaglocatie.",
"Data directory:" => "Gegevensmap:",
"Configure your database." => "Configureer uw database.",
"I will use a SQLite database. You have nothing to do!" => "Er zal een SQLite database gebruikt worden. U hoeft geen verdere instellingen te maken.",
"SQLite" => "SQLite",
"I will use a MySQL database." => "Er zal een MySQL database gebruikt worden.",
"Host:" => "Host:",
"Database name:" => "Databasenaam:",
"Host:" => "Host:",
"Table prefix:" => "Voorvoegsel voor tabelnamen:",
"MySQL user login:" => "MySQL gebruikersnaam.",
"MySQL user password:" => "MySQL wachtwoord",
"Finish setup" => "Installatie afronden",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> is een persoonlijke cloud die op uw eigen server draait.</p>",
"Login failed!" => "Aanmelden mislukt.",

View File

@ -1,22 +1,12 @@
<?php $TRANSLATIONS = array(
"Error 404, Cloud not found" => "Błąd 404, Chmura nie znaleziona",
"Welcome to <strong>ownCloud</strong>, your personnal cloud." => "Witaj w <strong>ownCloud</strong>, Twojej osobistej chmurze.",
"To finish the installation, please follow the steps below." => "By zakończyć instalację, podążaj poniższymi krokami.",
"Create an <strong>admin account.</strong>" => "Utwórz <strong>konto administratora</strong>.",
"Login:" => "Login:",
"Password:" => "Hasło:",
"Advanced" => "Zaawansowane",
"Set where to store the data." => "Ustaw, gdzie przechowywać dane.",
"Data directory:" => "Katalog danych:",
"Configure your database." => "Skonfiguruj Twoją bazę danych.",
"I will use a SQLite database. You have nothing to do!" => "Użyję bazy SQLite. Nie masz tu nic do roboty!",
"SQLite" => "SQLite",
"I will use a MySQL database." => "Użyję bazy danych MySQL.",
"Host:" => "Host:",
"Database name:" => "Nazwa bazy:",
"Host:" => "Host:",
"Table prefix:" => "Przedrostek tabeli:",
"MySQL user login:" => "Login użytkownika MySQL:",
"MySQL user password:" => "Hasło użytkownika MySQL:",
"Finish setup" => "Zakończ instalację",
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs on your own server.</p>" => "<a href=\"http://owncloud.org/\">ownCloud</a> jest osobistą chmurą działającą na Twoim własnym serwerze.</p>",
"Login failed!" => "Nie udało się zalogować!",

View File

@ -1,19 +1,18 @@
<?php
if(!isset($_)){//also provide standalone error page
require_once '../../lib/base.php';
require( 'template.php' );
$tmpl = new OC_TEMPLATE( '', '404', 'guest' );
$tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->printPage();
exit;
}
?>
<div id="login">
<img src="<?php echo image_path("", "weather-clear.png"); ?>" alt="ownCloud" />
<header><img src="<?php echo image_path('', 'weather-clear.png'); ?>" alt="ownCloud" /></header>
<ul>
<li class='error'>
<?php echo $l->t( 'Error 404, Cloud not found' ); ?><br/>
<p class='hint'><?php if(isset($_['file'])) echo $_['file']?></p>
</li>
</ul>
</div>
</div>

View File

@ -1,10 +1,5 @@
<?php
/*
* Template for error page
*/
?>
<div id="login">
<img src="<?php echo image_path("", "owncloud-logo-medium-white.png"); ?>" alt="ownCloud" />
<header><img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" /></header>
<ul>
<?php foreach($_["errors"] as $error):?>
<li class='error'>

View File

@ -24,15 +24,15 @@
<fieldset>
<legend><?php echo $l->t( 'Create an <strong>admin account</strong>.' ); ?></legend>
<p><label for="adminlogin"><?php echo $l->t( 'Username' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" autofocus /></p>
<p><label for="adminpass"><?php echo $l->t( 'Password' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
<p><label for="adminlogin"><?php echo $l->t( 'Username' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autofocus /></p>
<p><label for="adminpass"><?php echo $l->t( 'Password' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" /></p>
</fieldset>
<a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
<a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_Helper::imagePath('','drop-arrow.png'); ?>'></img></a>
<fieldset id='datadirField'>
<legend><?php echo $l->t( 'Set where to store the data.' ); ?></legend>
<p><label for="directory"><?php echo $l->t( 'Data directory:' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_HELPER::init_var('directory', $_['directory']); ?>" /></p>
<p><label for="directory"><?php echo $l->t( 'Data directory:' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" /></p>
</fieldset>
<fieldset id='databaseField'>
@ -43,7 +43,7 @@
<p><?php echo $l->t( 'SQLite will be used for the database. You have nothing to do.' ); ?></p>
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
<?php else: ?>
<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_HELPER::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
<?php endif; ?>
<?php endif; ?>
@ -53,14 +53,14 @@
<p><?php echo $l->t( 'MySQL will be used for the database.' ); ?></p>
<input type="hidden" id="dbtype" name="dbtype" value="mysql" />
<?php else: ?>
<p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_HELPER::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
<p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
<?php endif; ?>
<div id="use_mysql">
<p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
<p><label for="dbpass"><?php echo $l->t( 'MySQL password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
<p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_HELPER::init_var('dbname'); ?>" /></p>
<p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
<p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_HELPER::init_var('dbtableprefix', 'oc_'); ?>" /></p>
<p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" /></p>
<p><label for="dbpass"><?php echo $l->t( 'MySQL password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" /></p>
<p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" /></p>
<p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" /></p>
<p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" /></p>
</div>
<?php endif; ?>

View File

@ -47,7 +47,7 @@
<?php if( sizeof( $entry["subnavigation"] )): ?>
<ul>
<?php foreach($entry["subnavigation"] as $subentry):?>
<li class="subentry"><a style="background-image:url(<?php echo $subentry['icon']; ?>)" href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry['active'] ): ?>class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
<li class="subentry"><a style="background-image:url(<?php echo $subentry['icon']; ?>)" href="<?php echo $subentry['href']; ?>" title="" class="subentry<?php if( $subentry['active'] ): ?> active<?php endif; ?>"><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

View File

@ -1,3 +1,3 @@
<form class="searchbox" action="<?php echo $_['searchurl']?>" method="post">
<input type="search" name="query" value="<?php if(isset($_POST['query'])){echo $_POST['query'];};?>" class="prettybutton" />
<input id='searchbox' type="search" name="query" value="<?php if(isset($_POST['query'])){echo $_POST['query'];};?>" class="prettybutton" />
</form>

View File

@ -29,15 +29,12 @@ $RUNTIME_NOSETUPFS = true;
require_once('../lib/base.php');
// We need the file system although we said do not load it! Do it by hand now
OC_UTIL::setupFS();
// We load OC_TEMPLATE, too. This one is not loaded by base
require( 'template.php' );
OC_Util::setupFS();
// The user should have admin rights. This is an admin page!
if( !OC_USER::isLoggedIn() || !OC_USER::ingroup( $_SESSION['username'], 'admin' )){
if( !OC_User::isLoggedIn() || !OC_User::ingroup( $_SESSION['username'], 'admin' )){
// Bad boy! Go to the very first page of owncloud
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
@ -46,7 +43,7 @@ $myvar = 2;
$myarray = array( "foo" => array( 0, 1, 2 ), "bar" => "baz" );
// Preparing for output!
$tmpl = new OC_TEMPLATE( "skeleton", "admin", "admin" ); // Programname, template, mode
$tmpl = new OC_Template( "skeleton", "admin", "admin" ); // Programname, template, mode
// Assign the vars
$tmpl->assign( "var", $myvar );
$tmpl->assign( "array", $myarray );

View File

@ -4,12 +4,12 @@
*/
// Hello, we are here
OC_APP::register( array( "id" => "skeleton", "name" => "Files", "order" => 1000 ));
OC_App::register( array( "id" => "skeleton", "name" => "Files", "order" => 1000 ));
// Add application to navigation
OC_UTIL::addNavigationEntry( array( "id" => "skeleton_index", "order" => 1000, "href" => OC_HELPER::linkTo( "skeleton", "index.php" ), "icon" => OC_HELPER::imagePath( "skeleton", "app.png" ), "name" => "Example app" ));
OC_Util::addNavigationEntry( array( "id" => "skeleton_index", "order" => 1000, "href" => OC_Helper::linkTo( "skeleton", "index.php" ), "icon" => OC_Helper::imagePath( "skeleton", "app.png" ), "name" => "Example app" ));
// Add an admin page
OC_UTIL::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "skeleton", "admin.php" ), "name" => "Example app options" ));
OC_Util::addAdminPage( array( "order" => 1, "href" => OC_Helper::linkTo( "skeleton", "admin.php" ), "name" => "Example app options" ));
?>

View File

@ -24,23 +24,22 @@
// Init owncloud
require_once('../lib/base.php');
require( 'template.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;
}
@ -56,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();

View File

@ -24,26 +24,25 @@
// Init owncloud
require_once('../lib/base.php');
require( 'template.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();

View File

@ -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);
}
}

View File

@ -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';
}

View File

@ -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);
?>

View File

@ -2,13 +2,12 @@
// Init owncloud
require_once('../../lib/base.php');
require_once('../../lib/template.php');
// We send json data
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();
}
@ -29,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();
@ -37,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());

View File

@ -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" )));

View File

@ -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();
}

View File

@ -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{

View File

@ -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);

View File

@ -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( ... ));
?>

View File

@ -6,6 +6,7 @@
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
.file_upload_filename, #file_newfolder_name { background-repeat:no-repeat; background-position:0.5em 0; padding-left:2em; }
.file_upload_filename { background-image:url("../img/file.png"); font-weight:bold; }.file_upload_start { opacity:0;filter:alpha(opacity = 0); }
input.highlight{ background-color:#ffc100; border:#dda600 1px solid; }
#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:11em; }
.file_upload_start, .file_upload_filename { position:absolute; top:0px; left:0px; width:11em; font-size:0.9em; }
@ -16,13 +17,15 @@
/* FILE TABLE */
span#emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; }
table { position:relative; top:37px; width:100%; }
tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; }
tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; height:1em; }
tbody a { color:#000; }
span.extention, td.date { color:#999; }
div.crumb { float:left; display:block; background:no-repeat right 0; font-weight:bold; padding:8px 1.5em 0 1em; height:28px; /*36-8*/ }
div.crumb { float:left; display:block; background:no-repeat right 0; padding:8px 1.5em 0 1em; height:28px; /*36-8*/ }
div.crumb:last-child { font-weight:bold; }
table tr.mouseOver td { background-color:#eee; }
table th { padding:.5em; height:2em; }
table th { height:2em; padding:0 .5em; color:#999; }
table th .name { float:left; margin-left:.5em; }
table th.multiselect { background:#ddd; color:#000; font-weight:bold; }
table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; }
table td { border-bottom:1px solid #eee; font-style:normal; }
table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:right; }

View File

@ -23,33 +23,32 @@
// Init owncloud
require_once('../lib/base.php');
require( 'template.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 );
?>

View File

@ -24,29 +24,28 @@
// Init owncloud
require_once('../lib/base.php');
require( 'template.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'],'.'));
@ -68,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();
?>

View File

@ -23,9 +23,9 @@ FileList={
}else{
simpleSize='Pending';
}
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
sizeColor = Math.round(200-size/(1024*1024)*2);
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*14);
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
html+='<td class="date" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</td>';
html+='</tr>';
@ -66,6 +66,10 @@ FileList={
remove:function(name){
$('tr[data-file="'+name+'"] td.filename').draggable('destroy');
$('tr[data-file="'+name+'"]').remove();
if($('tr[data-file]').length==0){
$('#emptyfolder').show();
$('.file_upload_filename').addClass('highlight');
}
},
insertElement:function(name,type,element){
//find the correct spot to insert the file or folder
@ -93,6 +97,8 @@ FileList={
}else{
$('#fileList').append(element);
}
$('#emptyfolder').hide();
$('.file_upload_filename').removeClass('highlight');
},
loadingDone:function(name){
$('tr[data-file="'+name+'"]').data('loading',false);

View File

@ -1,4 +1,8 @@
$(document).ready(function() {
if($('tr[data-file]').length==0){
$('.file_upload_filename').addClass('highlight');
}
$('#file_action_panel').attr('activeAction', false);
//drag/drop of files
@ -338,7 +342,7 @@ function procesSelection(){
$('#headerName>span.name').text('Name');
$('#headerSize').text('Size MB');
$('#modified').text('Modified');
$('th').css({background:'#fff',fontWeight:'normal'});
$('th').removeClass('multiselect');
$('.selectedActions').hide();
}else{
$('.selectedActions').show();
@ -372,7 +376,7 @@ function procesSelection(){
}
$('#headerName>span.name').text(selection);
$('#modified').text('');
$('th').css({background:'#ddd', fontWeight:'bold'});
$('th').addClass('multiselect');
}
}
@ -433,4 +437,4 @@ function getMimeIcon(mime){
mime='file';
}
return OC.imagePath('core','mimetypes/'+mime+'.png');
}
}

View File

@ -24,23 +24,22 @@
// Init owncloud
require_once('../lib/base.php');
require( 'template.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;
}
@ -56,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();

View File

@ -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']):?>

View File

@ -1,10 +1,10 @@
<?php if(!$_['files']) echo '<span id="emptyfolder">Nothing in here. Upload something!</span><style>.file_upload_filename { background-color:#ffc100; border:#dda600 1px solid; }</style>';
foreach($_['files'] as $file):
<span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span>
<?php foreach($_['files'] as $file):
$simple_file_size = simple_file_size($file['size']);
$simple_size_color = 200-intval($file['size']/(1024*1024)*5);
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
if($simple_size_color<0) $simple_size_color = 0;
$relative_modified_date = relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*7); //days ago
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
if($relative_date_color>200) $relative_date_color = 200; ?>
<tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
<td class="filename">

View File

@ -28,11 +28,6 @@ $RUNTIME_NOSETUPFS = true;
require_once('../lib/base.php');
require_once('Sabre/autoload.php');
require_once('Connector/Sabre/auth.php');
require_once('Connector/Sabre/node.php');
require_once('Connector/Sabre/file.php');
require_once('Connector/Sabre/directory.php');
require_once('Connector/Sabre/locks.php');
// Create ownCloud Dir
$publicDir = new OC_Connector_Sabre_Directory('');

View File

@ -1,14 +1,14 @@
<?php
OC_APP::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
// Workaround for having help as the last entry always
$entry = array( "id" => "help", "order" => 1000, "href" => OC_HELPER::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_HELPER::imagePath( "help", "help.png" ));
if( isset( $_SESSION["user_id"] ) && OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){
OC_APP::addAdminPage( $entry );
$entry = array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" ));
if( isset( $_SESSION["user_id"] ) && OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
OC_App::addAdminPage( $entry );
}
else{
OC_APP::addSettingsPage( $entry );
OC_App::addSettingsPage( $entry );
}
?>

View File

@ -1,9 +1,8 @@
<?php
require_once('../lib/base.php');
require( 'template.php' );
if( !OC_USER::isLoggedIn()){
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
if( !OC_User::isLoggedIn()){
header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
@ -13,13 +12,13 @@ $page=2;
// Load the files we need
OC_UTIL::addStyle( "help", "help" );
OC_APP::setActiveNavigationEntry( "help" );
OC_Util::addStyle( "help", "help" );
OC_App::setActiveNavigationEntry( "help" );
$kbe=OC_OCSCLIENT::getKnownledgebaseEntries();
$kbe=OC_OCSClient::getKnownledgebaseEntries();
$tmpl = new OC_TEMPLATE( "help", "index", "admin" );
$tmpl = new OC_Template( "help", "index", "admin" );
$tmpl->assign( "kbe", $kbe );
$tmpl->assign( "pagecount", $pagecount );
$tmpl->assign( "page", $page );

4
help/l10n/bg_BG.php Normal file
View File

@ -0,0 +1,4 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Въпроси и отговори",
"ASK A QUESTION" => "ЗАДАЙТЕ ВЪПРОС"
);

4
help/l10n/fr.php Normal file
View File

@ -0,0 +1,4 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Questions / Réponses",
"ASK A QUESTION" => "Poser une question"
);

Some files were not shown because too many files have changed in this diff Show More