Merge branch 'master' into sharing

Conflicts:
	files/templates/index.php
This commit is contained in:
Michael Gapczynski 2011-08-10 13:40:47 -04:00
commit e1bde1a78e
90 changed files with 878 additions and 1277 deletions

View File

@ -122,7 +122,7 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
*/
public function getETag() {
return md5($this->cardData['carddata']);
return '"' . md5($this->cardData['carddata']) . '"';
}

View File

@ -94,7 +94,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
public function httpPOSTHandler($method, $uri) {
if ($method!='POST') return true;
if (isset($_POST['action'])) switch($_POST['action']) {
if (isset($_POST['sabreAction'])) switch($_POST['sabreAction']) {
case 'mkcol' :
if (isset($_POST['name']) && trim($_POST['name'])) {
@ -249,13 +249,13 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
if ($this->enablePost) {
$html.= '<tr><td><form method="post" action="">
<h3>Create new folder</h3>
<input type="hidden" name="action" value="mkcol" />
<input type="hidden" name="sabreAction" value="mkcol" />
Name: <input type="text" name="name" /><br />
<input type="submit" value="create" />
</form>
<form method="post" action="" enctype="multipart/form-data">
<h3>Upload file</h3>
<input type="hidden" name="action" value="put" />
<input type="hidden" name="sabreAction" value="put" />
Name (optional): <input type="text" name="name" /><br />
File: <input type="file" name="file" /><br />
<input type="submit" value="upload" />

View File

@ -1396,6 +1396,18 @@ class Sabre_DAV_Server {
$this->broadcastEvent('afterBind',array($uri));
}
/**
* This method is invoked by sub-systems creating a new directory.
*
* @param string $uri
* @return void
*/
public function createDirectory($uri) {
$this->createCollection($uri,array('{DAV:}collection'),array());
}
/**
* Use this method to create a new collection
*

View File

@ -31,76 +31,21 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
OC_Util::addStyle( "admin", "apps" );
OC_Util::addScript( "admin", "apps" );
if(isset($_GET['id'])) $id=$_GET['id']; else $id=0;
if(isset($_GET['cat'])) $cat=$_GET['cat']; else $cat=0;
if(isset($_GET['installed'])) $installed=true; else $installed=false;
if($installed){
global $SERVERROOT;
OC_Installer::installShippedApps(false);
$apps = OC_Appconfig::getApps();
$records = array();
OC_App::setActiveNavigationEntry( "core_apps" );
foreach($apps as $app){
$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 ));
$records[]=$record;
$registeredApps=OC_App::getAllApps();
$apps=array();
foreach($registeredApps as $app){
$info=OC_App::getAppInfo($app);
$active=(OC_Appconfig::getValue($app,'enabled','no')=='yes')?true:false;
$info['active']=$active;
$apps[]=$info;
}
$tmpl = new OC_Template( "admin", "appsinst", "user" );
$tmpl->assign( "apps", $records );
$tmpl->printPage();
unset($tmpl);
exit();
}else{
$categories=OC_OCSClient::getCategories();
if($categories==NULL){
OC_App::setActiveNavigationEntry( "core_apps" );
// print_r($categories);
$tmpl = new OC_Template( "admin", "app_noconn", "user" );
$tmpl->printPage();
unset($tmpl);
exit();
}
if($id==0) {
OC_App::setActiveNavigationEntry( "core_apps_get" );
if($cat==0){
$numcats=array();
foreach($categories as $key=>$value) $numcats[]=$key;
$apps=OC_OCSClient::getApplications($numcats);
}else{
$apps=OC_OCSClient::getApplications($cat);
}
// return template
$tmpl = new OC_Template( "admin", "apps", "user" );
$tmpl->assign('apps',$apps);
$tmpl->assign( "categories", $categories );
$tmpl->assign( "apps", $apps );
$tmpl->printPage();
unset($tmpl);
}else{
OC_App::setActiveNavigationEntry( "core_apps" );
$app=OC_OCSClient::getApplication($id);
$tmpl = new OC_Template( "admin", "app", "user" );
$tmpl->assign( "categories", $categories );
$tmpl->assign( "app", $app );
$tmpl->printPage();
unset($tmpl);
}
}
?>

View File

@ -1,14 +1,3 @@
/* APPS TABLE */
table td.date { width:5em; padding:.5em 1em; text-align:left; }
table td.version, table td.enabled, table td.disabled { padding:.5em 1em; text-align:left; }
.preview { padding:3px; text-align:left; }
table td.date { width:11em; color:#555; }
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:left; }
table td.name a { padding:6px; text-decoration:none; color:#555; }
.type { text-decoration:none; color:#888; font-size:.8em; }
.description { text-decoration:none; color:#666; font-size:.9em; }
#content ul#apps { width:40em; list-style:none; }
#content ul#apps li { display:block; padding:.2em; clear:right; }
#content ul#apps em { color:#555; }
#content ul#apps input { float:right; }
li{color:#888}
li.active{color:#000}
span.version{margin-left:3em;color:#ddd}

View File

@ -1,17 +1,38 @@
$("input[x-use='appenablebutton']").live( "click", function(){
appid = $(this).parent().data("uid");
$(document).ready(function(){
$('#leftcontent li').each(function(index,li){
var app=$.parseJSON($(this).children('span').text());
$(li).data('app',app);
});
$('#leftcontent li').click(function(){
var app=$(this).data('app');
$('#rightcontent p').show();
$('#rightcontent span.name').text(app.name);
$('#rightcontent span.version').text(app.version);
$('#rightcontent p.description').text(app.description);
$('#rightcontent span.author').text(app.author);
$('#rightcontent span.licence').text(app.licence);
//alert("dsfsdfsdf");
if($(this).val() == "enabled"){
$(this).attr("value","disabled");
$(this).removeClass( "enabled" );
$(this).addClass( "disabled" );
$.post( "ajax/disableapp.php", 'appid='+appid);
$('#rightcontent input.enable').show();
$('#rightcontent input.enable').val((app.active)?t('admin','Disable'):t('admin','Enable'));
$('#rightcontent input.enable').data('appid',app.id);
$('#rightcontent input.enable').data('active',app.active);
});
$('#rightcontent input.enable').click(function(){
var app=$(this).data('appid');
var active=$(this).data('active');
if(app){
if(active){
$.post(OC.filePath('admin','ajax','disableapp.php'),{appid:app});
$('#leftcontent li[data-id="'+app+'"]').removeClass('active');
}else{
$.post(OC.filePath('admin','ajax','enableapp.php'),{appid:app});
$('#leftcontent li[data-id="'+app+'"]').addClass('active');
}
else if($(this).val() == "disabled"){
$(this).attr("value","enabled");
$(this).removeClass( "disabled" );
$(this).addClass( "enabled" );
$.post( "ajax/enableapp.php", 'appid='+appid);
active=!active;
$(this).data('active',active);
$(this).val((active)?t('admin','Disable'):t('admin','Enable'));
var appData=$('#leftcontent li[data-id="'+app+'"]');
appData.active=active;
}
});
});

View File

@ -1,5 +0,0 @@
../templates/app.php
../templates/app_noconn.php
../templates/apps.php
../templates/system.php
../templates/users.php

View File

@ -1,22 +0,0 @@
<?php $app=$_['app']; ?>
<h1><?php echo $app["name"]; ?></h1>
<?php echo('<span class="type">'.$app['typename'].'</span>'); ?><br />
<span class="date"><?php echo $l->l('datetime', $app["changed"]); ?></span><br />
<table cellspacing="6" border="0" width="100%">
<tr>
<td width="1" valign="top">
<?php if($app["preview1"]<>"") { echo('<img class="preview" border="0" src="'.$app["preview1"].'" /><br />'); } ?>
<?php if($app["preview2"]<>"") { echo('<img class="preview" border="0" src="'.$app["preview2"].'" /><br />'); } ?>
<?php if($app["preview3"]<>"") { echo('<img class="preview" border="0" src="'.$app["preview3"].'" /><br />'); } ?>
</td>
<td class="description" valign="top">
<?php echo $app["description"]; ?>
<br />
<?php echo('<a class="description" target="_blank" href="'.$app["detailpage"].'">'.$l->t( 'read more' ).'</a><br />'); ?>
</td>
<td width="1" valign="top"><a class="prettybutton" href=""><?php echo $l->t( 'Install' ); ?></a></td>
</tr>
</table>

View File

@ -1 +0,0 @@
<h2><?php echo $l->t( 'Cannot connect to apps repository' ); ?></h2>

View File

@ -1,19 +1,16 @@
<table cellspacing="0">
<thead>
<tr>
<th></th>
<th><?php echo $l->t( 'Name' ); ?></th>
<th><?php echo $l->t( 'Modified' ); ?></th>
</tr>
</thead>
<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 class="date"><?php echo $l->l('datetime', $app["changed"]); ?></td>
</tr>
<ul id="leftcontent">
<?php foreach($_['apps'] as $app):?>
<li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>">
<?php echo $app['name'] ?>
<span class="hidden">
<?php echo json_encode($app) ?>
</span>
</li>
<?php endforeach;?>
</tbody>
</table>
</ul>
<div id="rightcontent">
<h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span class="version"></span></h3>
<p class="description"></p>
<p class="hidden"><span class="licence"></span><?php echo $l->t('-licensed');?> <?php echo $l->t('by');?> <span class="author"></span></p>
<input class="enable hidden" type="submit"></input>
</div>

View File

@ -1,7 +0,0 @@
<ul id="apps">
<?php foreach($_["apps"] as $app): ?>
<li data-uid="<?php echo($app['id']); ?>"><strong><?php echo($app['name']); ?></strong> <?php echo($app['version']); ?> <em>by <?php echo($app['author']); ?></em>
<input x-use="appenablebutton" type="submit" value="<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" class="appbutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" />
</li>
<?php endforeach; ?>
</ul>

View File

@ -1,17 +1,17 @@
<div id="controls">
<form id="newgroup">
<input id="newgroupname" placeholder="name"></input>
<input type="submit" value="create"></input>
<input id="newgroupname" placeholder="<?php echo $l->t('Name')?>"></input>
<input type="submit" value="<?php echo $l->t('Create')?>"></input>
</form>
<form id="newuser">
<input id="newusername" placeholder="username"></input>
<input type="password" id="newuserpassword" placeholder="password"></input>
<select id="newusergroups" data-placeholder="groups" title="groups" multiple="multiple">
<input id="newusername" placeholder="<?php echo $l->t('Name')?>"></input>
<input type="password" id="newuserpassword" placeholder="<?php echo $l->t('Password')?>"></input>
<select id="newusergroups" data-placeholder="groups" title="<?php echo $l->t('Groups')?>" multiple="multiple">
<?php foreach($_["groups"] as $group): ?>
<option value="<?php echo $group['name'];?>"><?php echo $group['name'];?></option>
<?php endforeach;?>
</select>
<input type="submit" value="Create"></input>
<input type="submit" value="<?php echo $l->t('Create')?>"></input>
</form>
</div>
<ul id="leftcontent">
@ -30,10 +30,13 @@
<td class="groups"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo "&nbsp";} ?></td>
<td class="remove">
<?php if($user['name']!=OC_User::getUser()):?>
<img alt="Remove" title="Remove" class='svg' src='<?php echo image_path('core','actions/delete.svg') ?>'/>
<img alt="Remove" title="<?php echo $l->t('Remove')?>" class='svg' src='<?php echo image_path('core','actions/delete.svg') ?>'/>
<?php endif;?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div id="#selecteduser">
</div>

View File

@ -1,59 +0,0 @@
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
require_once('../../../lib/base.php');
$id = $_POST['id'];
$l10n = new OC_L10N('contacts');
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
exit();
}
$card = OC_Contacts_Addressbook::findCard( $id );
if( $card === false ){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
exit();
}
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
exit();
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg';
$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name']));
$photo = new Sabre_VObject_Property( 'PHOTO', $photobase );
$photo->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype);
$photo->parameters[] = new Sabre_VObject_Parameter('ENCODING','b');
$vcard->add($photo);
$line = count($vcard->children) - 1;
$checksum = md5($vcard->children[$line]->serialize());
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum )));

View File

@ -33,7 +33,6 @@ if( !OC_User::isLoggedIn()){
exit();
}
$addressbook = OC_Contacts_Addressbook::findAddressbook( $id );
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));

View File

@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_GET['id'];
$line = $_GET['line'];
$checksum = $_GET['checksum'];
@ -50,8 +49,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
if(md5($vcard->children[$line]->serialize()) != $checksum ){
$line = null;
for($i=0;$i<count($vcard->children);$i++){
if(md5($vcard->children[$i]->serialize()) == $checksum ){
$line = $i;
}
}
if(is_null($line)){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
exit();
}

View File

@ -1,77 +0,0 @@
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
require_once('../../../lib/base.php');
$id = $_POST['id'];
$line = $_POST['line'];
$checksum = $_POST['checksum'];
$l10n = new OC_L10N('contacts');
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
exit();
}
$card = OC_Contacts_Addressbook::findCard( $id );
if( $card === false ){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
exit();
}
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
exit();
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg';
$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name']));
if(md5($vcard->children[$line]->serialize()) != $checksum){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
exit();
}
// replace photo
$vcard->children[$line]->setValue($photobase);
$encoding = $type = false;
foreach($vcard->children[$line]->parameters as &$parameter){
if($parameter->name == 'TYPE'){
$parameter->value = $mimetype;
$type = true;
}
elseif($parameter->name == 'ENCODING'){
$parameter->value = 'b';
$encoding = true;
}
} unset($parameter);
if(!$encoding) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('ENCODING','b');
if(!$type) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype);
$checksum = md5($vcard->children[$line]->serialize());
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum )));

View File

@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_POST['id'];
$line = $_POST['line'];
$checksum = $_POST['checksum'];
$l10n = new OC_L10N('contacts');
@ -47,8 +46,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
if(md5($vcard->children[$line]->serialize()) != $checksum){
$line = null;
for($i=0;$i<count($vcard->children);$i++){
if(md5($vcard->children[$i]->serialize()) == $checksum ){
$line = $i;
}
}
if(is_null($line)){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
exit();
}

View File

@ -24,7 +24,6 @@
require_once('../../../lib/base.php');
$id = $_GET['id'];
$line = $_GET['line'];
$checksum = $_GET['checksum'];
$l10n = new OC_L10N('contacts');
@ -47,7 +46,13 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
}
$vcard = Sabre_VObject_Reader::read($card['carddata']);
if(md5($vcard->children[$line]->serialize()) != $checksum){
$line = null;
for($i=0;$i<count($vcard->children);$i++){
if(md5($vcard->children[$i]->serialize()) == $checksum ){
$line = $i;
}
}
if(is_null($line)){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
exit();
}
@ -56,7 +61,7 @@ if(md5($vcard->children[$line]->serialize()) != $checksum){
$tmpl = new OC_Template('contacts','part.setpropertyform');
$tmpl->assign('id',$id);
$tmpl->assign('checksum',$checksum);
$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line],$line));
$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line]));
$page = $tmpl->fetchPage();
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));

View File

@ -1,7 +1,9 @@
<?php
OC::$CLASSPATH['OC_Contacts_Addressbook'] = 'apps/contacts/lib/addressbook.php';
OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/connector_sabre.php';
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Contacts_Hooks', 'deleteUser');
OC_App::register( array(
'order' => 10,
@ -14,5 +16,3 @@ OC_App::addNavigationEntry( array(
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ),
'icon' => OC_Helper::imagePath( 'contacts', 'icon.png' ),
'name' => 'Contacts' ));
?>

View File

@ -6,4 +6,5 @@
<licence>AGPL</licence>
<author>Jakob Sack</author>
<require>2</require>
<description>Address book with CardDAV support.</description>
</info>

View File

@ -5,10 +5,10 @@ $(document).ready(function(){
});*/
$('#contacts_contacts li').live('click',function(){
var id = $(this).attr('x-id');
var id = $(this).data('id');
$.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_details').attr('x-id',jsondata.data.id);
$('#contacts_details').data('id',jsondata.data.id);
$('#contacts_details').html(jsondata.data.page);
}
else{
@ -19,11 +19,11 @@ $(document).ready(function(){
});
$('#contacts_deletecard').live('click',function(){
var id = $('#contacts_details').attr('x-id');
var id = $('#contacts_details').data('id');
$.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_contacts [x-id="'+jsondata.data.id+'"]').remove();
$('#contacts_details').attr('x-id','');
$('#contacts_contacts [data-id="'+jsondata.data.id+'"]').remove();
$('#contacts_details').data('id','');
$('#contacts_details').html('');
}
else{
@ -34,7 +34,7 @@ $(document).ready(function(){
});
$('#contacts_addproperty').live('click',function(){
var id = $('#contacts_details').attr('x-id');
var id = $('#contacts_details').data('id');
$.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_details').append(jsondata.data.page);
@ -57,9 +57,6 @@ $(document).ready(function(){
else if($(this).val() == 'TEL'){
$('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
}
else if($(this).val() == 'NOTE'){
$('#contacts_fieldpart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
}
else{
$('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
}
@ -68,8 +65,9 @@ $(document).ready(function(){
$('#contacts_addpropertyform input[type="submit"]').live('click',function(){
$.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_details').append(jsondata.data.page);
$('#contacts_cardoptions').before(jsondata.data.page);
$('#contacts_addpropertyform').remove();
$('#contacts_addcontactsparts').remove();
}
else{
alert(jsondata.data.message);
@ -81,7 +79,7 @@ $(document).ready(function(){
$('#contacts_newcontact').click(function(){
$.getJSON('ajax/showaddcard.php',{},function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_details').attr('x-id','');
$('#contacts_details').data('id','');
$('#contacts_details').html(jsondata.data.page);
}
else{
@ -94,7 +92,7 @@ $(document).ready(function(){
$('#contacts_addcardform input[type="submit"]').live('click',function(){
$.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){
if(jsondata.status == 'success'){
$('#contacts_details').attr('x-id',jsondata.data.id);
$('#contacts_details').data('id',jsondata.data.id);
$('#contacts_details').html(jsondata.data.page);
}
else{
@ -104,13 +102,12 @@ $(document).ready(function(){
return false;
});
$('.contacts_property [x-use="edit"]').live('click',function(){
var id = $('#contacts_details').attr('x-id');
var checksum = $(this).parent().parent().attr('x-checksum');
var line = $(this).parent().parent().attr('x-line');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){
$('.contacts_property [data-use="edit"]').live('click',function(){
var id = $('#contacts_details').data('id');
var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
$('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page);
$('.contacts_property[data-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@ -122,7 +119,7 @@ $(document).ready(function(){
$('#contacts_setpropertyform input[type="submit"]').live('click',function(){
$.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){
if(jsondata.status == 'success'){
$('.contacts_property[x-line="'+jsondata.data.line+'"][x-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
$('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
}
else{
alert(jsondata.data.message);
@ -131,13 +128,12 @@ $(document).ready(function(){
return false;
});
$('.contacts_property [x-use="delete"]').live('click',function(){
var id = $('#contacts_details').attr('x-id');
var checksum = $(this).parent().parent().attr('x-checksum');
var line = $(this).parent().parent().attr('x-line');
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){
$('.contacts_property [data-use="delete"]').live('click',function(){
var id = $('#contacts_details').data('id');
var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
$('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"]').remove();
$('.contacts_property[data-checksum="'+checksum+'"]').remove();
}
else{
alert(jsondata.data.message);

View File

@ -291,32 +291,35 @@ class OC_Contacts_Addressbook{
public static function structureContact($object){
$details = array();
$line = 0;
foreach($object->children as $property){
$temp = self::structureProperty($property,$line);
$temp = self::structureProperty($property);
if(array_key_exists($property->name,$details)){
$details[$property->name][] = $temp;
}
else{
$details[$property->name] = array($temp);
}
$line++;
}
return $details;
}
public static function structureProperty($property,$line=null){
public static function structureProperty($property){
$value = $property->value;
if($property->name == 'ADR'){
$value = htmlspecialchars($value);
if($property->name == 'ADR' || $property->name == 'N'){
$value = self::unescapeSemicolons($value);
}
$temp = array(
'name' => $property->name,
'value' => $value,
'line' => $line,
'parameters' => array(),
'checksum' => md5($property->serialize()));
foreach($property->parameters as $parameter){
// Faulty entries by kaddressbook
if($parameter->name == 'TYPE' && $parameter->value == 'PREF'){
$parameter->name = 'PREF';
$parameter->value = '1';
}
$temp['parameters'][$parameter->name] = $parameter->value;
}
return $temp;

View File

@ -0,0 +1,41 @@
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* This class contains all hooks.
*/
class OC_Contacts_Hooks{
/**
* @brief Deletes all Addressbooks of a certain user
* @param paramters parameters from postDeleteUser-Hook
* @return array
*/
public function deleteUser($parameters) {
$addressbooks = OC_Contacts_Addressbook::allAddressbooks($parameters['uid']);
foreach($addressbooks as $addressbook) {
OC_Contacts_Addressbook::deleteAddressbook($addressbook['id']);
}
return true;
}
}

View File

@ -3,25 +3,15 @@ OC_Util::addScript('contacts','interface');
OC_Util::addStyle('contacts','styles');
?>
<?php
/*<div class="contacts_addressbooks">
<div class="contacts_addressbooksexpander">
Addressbooks
</div>
<div class="contacts_addressbooksdetails" style="display:none;">
<?php foreach($_['addressbooks'] as $addressbook): ?>
<?php echo $addressbook['displayname']; ?>: <?php echo $addressbook['description']; ?><br>
<?php endforeach; ?>
<br>To use this addressbook, use .../apps/contacts/carddav.php/addressbooks/USERNAME/addressbookname.php
</div>
</div>*/
?>
<div id="contacts_contacts" class="leftcontent">
<ul>
<?php echo $this->inc("part.contacts"); ?>
</ul>
<a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a>
</div>
<div id="contacts_details" class="rightcontent" x-id="<?php echo $_['id']; ?>">
<div id="contacts_details" class="rightcontent" data-id="<?php echo $_['id']; ?>">
<?php echo $this->inc("part.details"); ?>
</div>
<?php if(count($_['addressbooks']) == 1 ): ?>
<?php echo $l->t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.$_['addressbooks'][0]['uri'])); ?>
<?php endif; ?>

View File

@ -1,7 +1,6 @@
<form id="contacts_addpropertyform">
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
<select name="name" size="1">
<option value="BDAY"><?php echo $l->t('Birthday'); ?></option>
<option value="ADR"><?php echo $l->t('Address'); ?></option>
<option value="TEL"><?php echo $l->t('Telephone'); ?></option>
<option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option>
@ -15,8 +14,8 @@
<div id="contacts_addcontactsparts" style="display:none;">
<div id="contacts_addresspart">
<select name="parameters[TYPE]" size="1">
<option value="WORK"><?php echo $l->t('Work'); ?></option>
<option value="HOME" selected="selected"><?php echo $l->t('Home'); ?></option>
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
<?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="">
<?php echo $l->t('Extended Address'); ?> <input type="text" name="value[1]" value="">
@ -28,15 +27,17 @@
</div>
<div id="contacts_phonepart">
<select name="parameters[TYPE]" size="1">
<option value="WORK"><?php echo $l->t('Work'); ?></option>
<option value="CELL" selected="selected"><?php echo $l->t('Mobile'); ?></option>
<option value="HOME"><?php echo $l->t('Home'); ?></option>
<option value="home"><?php echo $l->t('tel_home'); ?></option>
<option value="cell" selected="selected"><?php echo $l->t('tel_cell'); ?></option>
<option value="work"><?php echo $l->t('tel_work'); ?></option>
<option value="text"><?php echo $l->t('tel_text'); ?></option>
<option value="voice"><?php echo $l->t('tel_voice'); ?></option>
<option value="fax"><?php echo $l->t('tel_fax'); ?></option>
<option value="video"><?php echo $l->t('tel_video'); ?></option>
<option value="pager"><?php echo $l->t('tel_pager'); ?></option>
</select>
<input type="text" name="value" value="">
</div>
<div id="contacts_fieldpart">
<textarea type="text" name="value"></textarea>
</div>
<div id="contacts_generic">
<input type="text" name="value" value="">
</div>

View File

@ -1,3 +1,3 @@
<?php foreach( $_['contacts'] as $contact ): ?>
<li x-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a> </li>
<li data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a> </li>
<?php endforeach; ?>

View File

@ -1,10 +1,15 @@
<?php if(array_key_exists('PHOTO',$_['details'])): ?>
<img src="photo.php?id=<?php echo $_['id']; ?>">
<?php endif; ?>
<?php if(array_key_exists('FN',$_['details'])): ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?>
<?php endif; ?>
<?php if(isset($_['details']['BDAY'])): // Emails first ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?>
<?php endif; ?>
<?php if(isset($_['details']['ORG'])): // Emails first ?>
<?php echo $this->inc('part.property', array('property' => $_['details']['ORG'][0])); ?>
<?php endif; ?>
@ -18,5 +23,7 @@
<?php endif; ?>
<?php endforeach; ?>
<div id="contacts_cardoptions">
<a id="contacts_deletecard"><img src="../../core/img/actions/delete.png"></a>
<a id="contacts_addproperty"><img src="../../core/img/actions/download.png"></a>
</div>

View File

@ -1,40 +1,48 @@
<div class="contacts_property" x-line="<?php echo $_['property']['line']; ?>" x-checksum="<?php echo $_['property']['checksum']; ?>">
<div class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
<?php if($_['property']['name'] == 'FN'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Name'); ?></div>
<div class="contacts_propertyvalue">
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<?php echo $_['property']['value']; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span>
</div>
<?php elseif($_['property']['name'] == 'BDAY'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Birthday'); ?></div>
<div class="contacts_propertyvalue">
<?php echo $l->l('date',new DateTime($_['property']['value'])); ?>
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span>
</div>
<?php elseif($_['property']['name'] == 'ORG'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Organisation'); ?></div>
<div class="contacts_propertyvalue">
<?php echo $_['property']['value']; ?>
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span>
</div>
<?php elseif($_['property']['name'] == 'EMAIL'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Email'); ?></div>
<div class="contacts_propertyvalue">
<?php echo $_['property']['value']; ?>
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span>
</div>
<?php elseif($_['property']['name'] == 'TEL'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Telefon'); ?></div>
<div class="contacts_propertyname"><?php echo $l->t('Telephone'); ?></div>
<div class="contacts_propertyvalue">
<?php echo $_['property']['value']; ?>
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
(<?php echo $l->t('tel_'.strtolower($_['property']['parameters']['TYPE'])); ?>)
<?php endif; ?>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span>
</div>
<?php elseif($_['property']['name'] == 'ADR'): ?>
<div class="contacts_propertyname"><?php echo $l->t('Address'); ?></div>
<div class="contacts_propertyname">
<?php echo $l->t('Address'); ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
<br>
(<?php echo $l->t('adr_'.strtolower($_['property']['parameters']['TYPE'])); ?>)
<?php endif; ?>
</div>
<div class="contacts_propertyvalue">
<?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br>
<?php echo $l->t('Extended Address'); ?> <?php echo $_['property']['value'][1]; ?><br>
@ -43,8 +51,8 @@
<?php echo $l->t('Region'); ?> <?php echo $_['property']['value'][4]; ?><br>
<?php echo $l->t('Postal Code'); ?> <?php echo $_['property']['value'][5]; ?><br>
<?php echo $l->t('Country'); ?> <?php echo $_['property']['value'][6]; ?>
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
<span style="display:none;" data-use="edit"><img src="../../core/img/actions/rename.png"></span>
<span style="display:none;" data-use="delete"><img src="../../core/img/actions/delete.png"></span>
</div>
<?php endif; ?>
</div>

View File

@ -1,6 +1,5 @@
<form id="contacts_setpropertyform">
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
<input type="hidden" name="line" value="<?php echo $_['property']['line']; ?>">
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
<?php if($_['property']['name']=='ADR'): ?>
<?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="<?php echo $_['property']['value'][0]; ?>">
@ -12,8 +11,6 @@
<?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="<?php echo $_['property']['value'][6]; ?>">
<?php elseif($_['property']['name']=='TEL'): ?>
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
<?php elseif($_['property']['name']=='NOTE'): ?>
<textarea type="text" name="value"><?php echo $_['property']['value']; ?></textarea>
<?php else: ?>
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
<?php endif; ?>

View File

@ -4,6 +4,6 @@
<name>Text viewer</name>
<version>0.3</version>
<licence>AGPL</licence>
<author>Icewind</author>
<author>Robin Appelman</author>
<require>2</require>
</info>

View File

@ -20,11 +20,13 @@
*
*/
$l=new OC_L10N('media');
require_once('apps/media/lib_media.php');
OC_Util::addScript('media','loader');
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' => 'Music' ));
OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => $l->t('Music') ));
?>

View File

@ -33,7 +33,7 @@ Collection={
Collection.loadedListeners[i]();
}
if(collection.length==0){
$('#scan input.start').val('Scan Collection');
$('#scan input.start').val(t('media','Scan Collection'));
$('#plugins a[href="#collection"]').trigger('click');
}

View File

@ -15,7 +15,7 @@ $(document).ready(function(){
PlayList.play(oldSize);
PlayList.render();
});
var button=$('<input type="button" title="Add to playlist" class="add"></input>');
var button=$('<input type="button" title="'+t('media','Add to playlist')+'" class="add"></input>');
button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
button.click(function(event){
event.stopPropagation();

View File

@ -19,7 +19,7 @@ PlayList.render=function(){
PlayList.render();
});
tr.hover(function(){
var button=$('<img class="remove" title="Remove"/>');
var button=$('<img class="remove" title="'+t('media','Remove')+'"/>');
button.attr('src',OC.imagePath('core','actions/delete'));
$(this).children().last().append(button);
button.click(function(event){
@ -74,14 +74,14 @@ $(document).ready(function(){
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.name span').text(t('media','Name'));
$('th.artist').text(t('media','Artist'));
$('th.album').text(t('media','Album'));
$('th.time').text(t('media','Time'));
$('th.plays').empty();
$('th.plays').text('Plays');
$('th.plays').text(t('media','Plays'));
}else{
var name=selected.length+' selected';
var name=selected.length+' '+t('media','selected');
var artist=$(selected[0]).data('artist');
var album=$(selected[0]).data('album');
var time=$(selected[0]).data('time');

View File

@ -68,10 +68,10 @@ Scanner={
toggle:function(){
if(Scanner.stopScanning){
Scanner.start();
$('#scan input.stop').val('Pause');
$('#scan input.stop').val(t('media','Pause'));
}else{
Scanner.stop();
$('#scan input.stop').val('Resume');
$('#scan input.stop').val(t('media','Resume'));
}
}

View File

@ -0,0 +1,6 @@
../appinfo/app.php
../templates/music.php
../js/scanner.js
../js/collection.js
../js/music.js
../js/playlist.js

View File

@ -24,14 +24,14 @@
<table id="playlist">
<thead>
<tr>
<th class="name"><input id="selectAll" type="checkbox">Name</th>
<th class="artist">Artist</th>
<th class="name"><input id="selectAll" type="checkbox"><?php echo $l->t('Name')?></th>
<th class="artist"><?php echo $l->t('Artist')?></th>
</tr>
</thead>
<tbody>
<tr>
<td>
The playlist is empty
<?php echo $l->t('The playlist is empty')?>
</td>
</tr>
</tbody>
@ -49,16 +49,16 @@
<div id="rightcontent">
<div id="scan">
<p id="scancount" style="display:none"><span class="songCount">0</span> Songs scanned</p>
<p id="scancount" style="display:none"><span class="songCount">0</span> <?php echo $l->t('Songs scanned')?></p>
<div id="scanprogressbar"></div>
<input type="button" class="start" value="Rescan Collection"></input>
<input type="button" class="stop" style="display:none" value="Pause"></input>
<input type="button" class="start" value="<?php echo $l->t('Rescan Collection')?>"></input>
<input type="button" class="stop" style="display:none" value="<?php echo $l->t('Pause')?>"></input>
</div>
<table id="collection">
<thead>
<th>Artist</th>
<th>Album</th>
<th>Title</th>
<th><?php echo $l->t('Artist')?></th>
<th><?php echo $l->t('Album')?></th>
<th><?php echo $l->t('Title')?></th>
</thead>
<tbody>
<tr class="template">

View File

@ -2,12 +2,20 @@
This file is licensed under the Affero General Public License version 3 or later.
See the COPYING-README file. */
* { margin:0; padding:0; border:0; outline:0; cursor:default; }
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section { margin:0; padding:0; border:0; outline:0; font-weight:inherit; font-style:inherit; font-size:100%; font-family:inherit; vertical-align:baseline; cursor:default; }
article, aside, dialog, figure, footer, header, hgroup, nav, section { display:block; }
body { line-height:1.5; }
table { border-collapse:separate; border-spacing:0; white-space:nowrap; }
caption, th, td { text-align:left; font-weight:normal; }
table, td, th { vertical-align:middle; }
a { border:0; color:#000; text-decoration:none;}
a, a img, a strong, a span, input, select, li { cursor:pointer; }
ul { list-style:none; }
body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; margin-bottom:2em; }
/* HEADERS */
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:300; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
#body-login #header { margin:-2em auto 0; text-align:center; height:10em;
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
background: #1d2d44; /* Old browsers */
@ -21,20 +29,16 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
#owncloud { float:left; }
h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; }
p.center { text-align:center; }
a { color:#000; text-decoration:none; }
table { white-space:nowrap; }
a, a img, a strong, a span, input, button, select, li { cursor:pointer; }
/* INPUTS */
input[type="text"], input[type="password"] { cursor:text; }
input, select { font-size:1em; width:10em; margin:.3em; padding:.5em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input, select { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="text"], input[type="password"] { background:#f8f8f8; color:#555; cursor:text; }
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus { background:#fff; color:#333; }
input[type="submit"] { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="submit"]:hover, input[type="submit"]:focus { background:#fff; color:#333; }
input[type="submit"], input[type="button"] { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="submit"]:hover, input[type="submit"]:focus, input[type="button"]:hover, input[type="button"]:focus { background:#fff; color:#333; }
input[type="checkbox"] { width:auto; }
#body-login input { font-size:1.5em; }
@ -48,8 +52,8 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
form#user_settings { max-width:600px; }
form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; }
form p { padding:0.5em 4em 0.5em 0.5em; text-align:left; }
form#user_settings p label { display:block; float:left; width:35%; padding:.4em .5em 0 0; text-align:right; }
form p { padding:.5em 4em .5em .5em; text-align:left; }
form p.form_footer { margin:1em 0 0 0; text-align:right; }
form label { cursor:pointer; }
#body-settings fieldset { padding:1em; width:40em; margin:1em;
@ -58,47 +62,46 @@ legend { padding:.2em; font-size:1.2em; }
.template{display:none;}
/* CONTENT ------------------------------------------------------------------ */
#controls { width:100%; top:3.5em; height:3em; margin:0; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
#content { margin:3.5em 0 0 12.5em; }
#body-settings #content { padding:1em; }
#leftcontent { position:absolute; top:6.5em; width:50em; }
#rightcontent { position:absolute; top:6.5em; left:32em; }
#controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:200; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; }
#content { margin:3.5em 0 0 12.5em; padding-bottom:10em; }
#leftcontent { position:absolute; top:6.5em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; }
#rightcontent { position:absolute; top:6.5em; left:33em; }
/* LOG IN & INSTALLATION ------------------------------------------------------------ */
#body-login { background-color:#ddd; }
#body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; -moz-box-shadow:0 1px 0 #bbb inset; -webkit-box-shadow:0 1px 0 #bbb inset; box-shadow:0 1px 0 #bbb inset; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
#body-login { background:#ddd; }
#body-login p.info { width:16em; margin:2em auto; padding:1em; background:#eee; -moz-box-shadow:0 1px 0 #bbb inset; -webkit-box-shadow:0 1px 0 #bbb inset; box-shadow:0 1px 0 #bbb inset; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
#body-login p.info a { font-weight:bold; }
#login { min-height:30em; margin:2em auto 0; border-bottom:1px solid #f8f8f8; background:#eee; }
#login form { width:18em; margin:2em auto 5em; padding:0; }
#login form fieldset { background-color:transparent; border:0; margin-bottom:2em; padding:0; }
#login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
#login form fieldset legend { font-weight:bold; }
#login form p { position:relative; padding:0; }
#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
#login form label#directorylabel { display:block; margin:.95em 0 .8em -5.5em; }
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
#login form ul.errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 4em 0; padding:1em 1em 1em 5em; }
/* META NAVIGATION (Settings, Log out) ---------------------------------------------------------------- */
#metanav { float:right; position:relative; top:.5em; right:1em; list-style:none; margin:0; padding:0; }
#metanav { float:right; position:relative; top:.5em; right:1em; margin:0; padding:0; }
#metanav li { display:inline; }
#metanav li a { margin:.2em; padding:.7em; }
#metanav li a:hover, #metanav li a:focus { background:rgba(0,0,0,.5); -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:#555 0 1px 0; -moz-box-shadow:#555 0 1px 0; -webkit-box-shadow:#555 0 1px 0; }
#metanav li a img { vertical-align:middle; }
/* NAVIGATION ------------------------------------------------------------- */
#navigation { position:fixed; top:3.5em; float:left; width:12.5em; padding:0; z-index:50; height:100%; background:#eee; border-right: 1px #ccc solid; -moz-box-shadow: -3px 0 7px #000; -webkit-box-shadow: -3px 0 7px #000; box-shadow: -3px 0 7px #000; } }
#navigation ul { list-style-type:none; border-top:1px solid #ccc; }
#navigation a { display:block; padding:.5em .5em .5em 2.5em; background-position:1em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; }
#navigation { position:fixed; top:3.5em; float:left; width:12.5em; padding:0; z-index:250; height:100%; background:#eee; border-right: 1px #ccc solid; -moz-box-shadow: -3px 0 7px #000; -webkit-box-shadow: -3px 0 7px #000; box-shadow: -3px 0 7px #000; } }
#navigation ul { border-top:1px solid #ccc; }
#navigation a { display:block; padding:.6em .5em .4em 2.5em; background:1em center no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; text-shadow:#f8f8f8 0 1px 0; }
#navigation a.active, #navigation a:hover, #navigation a:focus, #navigation a.selected { background-color:#ccc; border-top:1px solid #c8c8c8; border-bottom:1px solid #ccc; color:#000; }
#navigation .subentry { background-color:#ddd; border-top:1px solid #aaa; color:#555; }
#navigation .subentry.active { background-color:#bbb; border-top:1px solid #888; border-bottom:1px solid #bbb; }
#navigation .subentry a { padding-left:3.1em; font-size:1em; }
#navigation #settings { position:absolute; bottom:3.5em; width:100%; }
#navigation #expand { margin:0 0 .2em 1.2em; cursor:pointer; }
#expand { margin:0 0 .2em 1.2em; cursor:pointer; }
#expand+span { position:relative; bottom:.4em; left:.2em; font-size:1.2em; color:#666; text-shadow:#f8f8f8 0 1px 0; }
/* USER SETTINGS ------------------------------------------------------------ */
#quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
#quota_indicator div { background-color:#76A9EA; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
#quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ccc; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
#quota_indicator div { background:#76a9ea; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
li.error { list-style:none; width:640px; margin:4em auto; padding:1em 1em 1em 4em; background-color:#fee; background-image:url('../img/task-attention.png'); background-position:0.8em 0.8em; background-repeat:no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#fee url('../img/task-attention.png') .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
.hidden{ display:none; }

View File

@ -266,11 +266,13 @@ $(document).ready(function(){
}
});
if($('body').attr("id")=="body-user") { $('#settings li').hide(); }
$('#expand').click(function() {
$('#settings li').slideToggle();
if($('body').attr("id")=="body-user") { $('#settings #expanddiv').hide(); }
$('#settings #expand').click(function() {
$('#settings #expanddiv').slideToggle();
});
$('#settings #expand').hover(function(){
$('#settings #expand+span').fadeToggle();
})
});

View File

@ -5,3 +5,4 @@
../templates/logout.php
../templates/part.pagenavi.php
../templates/part.searchbox.php
../../lib/app.php

View File

@ -18,8 +18,8 @@
<fieldset>
<legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
<input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" placeholder="<?php echo $l->t( 'Username' ); ?>" autofocus required /></p>
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" required /></p>
<input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" placeholder="<?php echo $l->t( 'Username' ); ?>" autocomplete="off" autofocus required />
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" required />
</fieldset>
<fieldset id='databaseField'>
@ -56,11 +56,10 @@
<?php if($hasOtherDB): ?>
<div id="use_other_db">
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" required />
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" autocomplete="off" />
<input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'Database password' ); ?>" />
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" required />
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Host' ); ?>" required />
<input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" placeholder="<?php echo $l->t( 'Table prefix' ); ?>" />
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" autocomplete="off" />
</div>
<?php endif; ?>
@ -70,8 +69,10 @@
<a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?> ▾</strong></a>
<fieldset id='datadirField'>
<legend><?php echo $l->t( 'Set data folder' ); ?></legend>
<input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" required /></p>
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Host' ); ?>" />
<input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" placeholder="<?php echo $l->t( 'Table prefix' ); ?>" />
<label id="directorylabel" for="directory"><?php echo $l->t( 'Data folder' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" />
</fieldset>
<input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" />

View File

@ -32,7 +32,7 @@
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img src="<?php echo image_path('', 'owncloud-logo-small-white.png'); ?>" alt="ownCloud" /></a>
<?php echo $_['searchbox']?>
<ul id="metanav">
<li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a></li>
<li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="<?php echo $l->t('Log out');?>"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a></li>
</ul>
</div></header>
@ -50,8 +50,11 @@
</li>
<?php endforeach; ?>
</ul>
<ul id="settings">
<img id="expand" class='svg' src="<?php echo image_path('', 'actions/settings.svg'); ?>" />
<span style="display:none"><?php echo $l->t('Settings');?></span>
<div id="expanddiv">
<?php foreach($_['settingsnavigation'] as $entry):?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
@ -60,6 +63,7 @@
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
</ul>
</div></nav>

View File

@ -1,2 +0,0 @@
Database:
- Stored procedures!

View File

@ -1,134 +0,0 @@
-- phpMyAdmin SQL Dump
-- version 3.4.3.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 22, 2011 at 10:38 PM
-- Server version: 5.1.58
-- PHP Version: 5.3.6-13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `owncloud`
--
-- --------------------------------------------------------
--
-- Table structure for table `appconfig`
--
CREATE TABLE IF NOT EXISTS `appconfig` (
`appid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configkey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configvalue` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `foldersize`
--
CREATE TABLE IF NOT EXISTS `foldersize` (
`path` varchar(512) COLLATE utf8_unicode_ci NOT NULL,
`size` int(11) NOT NULL,
KEY `PATH_INDEX` (`path`(333))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE IF NOT EXISTS `groups` (
`gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `group_user`
--
CREATE TABLE IF NOT EXISTS `group_user` (
`gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`uid` varchar(64) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `locks`
--
CREATE TABLE IF NOT EXISTS `locks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`userid` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`owner` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`timeout` int(10) unsigned DEFAULT NULL,
`created` int(11) DEFAULT NULL,
`token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`scope` tinyint(4) DEFAULT NULL,
`depth` tinyint(4) DEFAULT NULL,
`uri` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `log`
--
CREATE TABLE IF NOT EXISTS `log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`moment` datetime NOT NULL,
`appid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`info` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3437 ;
-- --------------------------------------------------------
--
-- Table structure for table `preferences`
--
CREATE TABLE IF NOT EXISTS `preferences` (
`userid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`appid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configkey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configvalue` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `properties`
--
CREATE TABLE IF NOT EXISTS `properties` (
`userid` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`propertypath` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`propertyname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`propertyvalue` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`uid` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

View File

@ -1,53 +0,0 @@
<?php
/**
* ownCloud - Sample application
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack kde@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Do not prepare the file system (for demonstration purpose)
// We HAVE TO set this var before including base.php
$RUNTIME_NOSETUPFS = true;
// Init owncloud
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();
// The user should have admin rights. This is an admin page!
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" ));
exit();
}
// Do some crazy Stuff over here
$myvar = 2;
$myarray = array( "foo" => array( 0, 1, 2 ), "bar" => "baz" );
// Preparing for output!
$tmpl = new OC_Template( "skeleton", "admin", "admin" ); // Programname, template, mode
// Assign the vars
$tmpl->assign( "var", $myvar );
$tmpl->assign( "array", $myarray );
// Print page
$tmpl->printPage();
?>

View File

@ -1,15 +0,0 @@
<?php
/*
* This file is required. It makes owncloud aware of the app.
*/
// Hello, we are here
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" ));
// Add an admin page
OC_Util::addAdminPage( array( "order" => 1, "href" => OC_Helper::linkTo( "skeleton", "admin.php" ), "name" => "Example app options" ));
?>

View File

@ -1,4 +0,0 @@
/*
* To include this css file, call "OC_UTIL::addStyle( "skeleton", "skeleton" )"
* in your app. (appname) (cssname)
*/

View File

@ -1,3 +0,0 @@
/*
* If you want to you can use more css files ...
*/

View File

@ -1 +0,0 @@

View File

@ -1,63 +0,0 @@
<?php
/**
* ownCloud - ajax frontend
*
* @author Robin Appelman
* @copyright 2010 Robin Appelman icewind1991@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
require_once('../lib/base.php');
// Check if we are a user
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" );
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
$i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
$files[] = $i;
}
// Make breadcrumb
$breadcrumb = array();
$pathtohere = "/";
foreach( explode( "/", $dir ) as $i ){
if( $i != "" ){
$pathtohere .= "$i/";
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
}
}
// return template
$tmpl = new OC_Template( "files", "index", "user" );
$tmpl->assign( "files", $files );
$tmpl->assign( "breadcrumb", $breadcrumb );
$tmpl->printPage();
?>

View File

@ -1,3 +0,0 @@
// Include this file whenever you need it. A simple
// "OC_UTIL::addScript( "skeleton", "app" )" will do this.
// Put your jquery-Stuff here

View File

@ -1,8 +0,0 @@
<?php
/*
* Template for files admin page
*
* See index.php for details
*/
?>
<h1>Admin</h1>

View File

@ -1,12 +0,0 @@
<?php
/*
* Template for files
*/
?>
<h1>Skeleton</h1>
<?php foreach($_["array"] as $item): ?>
<p><?php echo $item; ?></p>
<?php endforeach; ?>
<?php echo $_["anothervar"]; ?>

View File

@ -1,7 +1,9 @@
<?php
$l=new OC_L10N('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::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => $l->t("Files") ));
?>

View File

@ -20,7 +20,7 @@ table { position:relative; top:37px; width:100%; }
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; padding:8px 1.5em 0 1em; height:28px; /*36-8*/ }
div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; }
div.crumb:first-child { padding-left:1.5em; }
div.crumb:last-child { font-weight:bold; }
table tr.mouseOver td { background-color:#eee; }

View File

@ -168,7 +168,7 @@ FileList={
procesSelection();
FileList.deleteCanceled=false;
FileList.deleteFiles=files;
$('#notification').text('undo deletion');
$('#notification').text(t('files','undo deletion'));
$('#notification').fadeIn();
},
finishDelete:function(ready,sync){

View File

@ -137,7 +137,7 @@ $(document).ready(function() {
if(files[i].size>0){
var size=files[i].size;
}else{
var size='Pending';
var size=t('files','Pending');
}
FileList.addFile(files[i].name,size,date,true);
}
@ -306,8 +306,8 @@ function procesSelection(){
var selectedFolders=selected.filter(function(el){return el.type=='dir'});
if(selectedFiles.length==0 && selectedFolders.length==0){
$('#headerName>span.name').text('Name');
$('#headerSize').text('Size MB');
$('#modified').text('Modified');
$('#headerSize').text(t('files','Size MB'));
$('#modified').text(t('files','Modified'));
$('th').removeClass('multiselect');
$('.selectedActions').hide();
$('thead').removeClass('fixed');
@ -336,9 +336,9 @@ function procesSelection(){
var selection='';
if(selectedFolders.length>0){
if(selectedFolders.length==1){
selection+='1 folder';
selection+='1 '+t('files','folder');
}else{
selection+=selectedFolders.length+' folders';
selection+=selectedFolders.length+' '+t('files','folders');
}
if(selectedFiles.length>0){
selection+=' & ';
@ -346,9 +346,9 @@ function procesSelection(){
}
if(selectedFiles.length>0){
if(selectedFiles.length==1){
selection+='1 file';
selection+='1 '+t('files','file');
}else{
selection+=selectedFiles.length+' files';
selection+=selectedFiles.length+' '+t('files','files');
}
}
$('#headerName>span.name').text(selection);

5
files/l10n/xgettextfiles Normal file
View File

@ -0,0 +1,5 @@
../appinfo/app.php
../templates/index.php
../templates/part.list.php
../js/filelist.js
../js/files.js

View File

@ -1,20 +1,18 @@
<div id="controls">
<span class="nav">
<?php echo($_['breadcrumb']); ?>
</span>
<div class="actions">
<form data-upload-id='1' class="file_upload_form" action="ajax/upload.php" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<div class="file_upload_wrapper">
<input type="submit" class="file_upload_filename" value="Upload (max. <?php echo $_['uploadMaxHumanFilesize'];?>)"/>
<input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload');?> (max. <?php echo $_['uploadMaxHumanFilesize'];?>)"/>
<input class="file_upload_start" type="file" name='files[]'/>
</div>
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
</form>
<form id="file_newfolder_form">
<input type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="New Folder" />
<input type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="<?php echo $l->t('New Folder')?>" />
</form>
</div>
<div id="file_action_panel">
@ -29,12 +27,12 @@
<input type="checkbox" id="select_all" />
<span class='name'><?php echo $l->t( 'Name' ); ?></span>
<span class='selectedActions'>
<a href="" title="Download" class="download"><img class='svg' alt="Download" src="../core/img/actions/download.svg" /></a>
<a href="" title="<?php echo $l->t('Download')?>" class="download"><img class='svg' alt="Download" src="../core/img/actions/download.svg" /></a>
<a href="" title="Share" class="share"><img class='svg' alt="Share" src="../core/img/actions/share.svg" /></a>
</span>
</th>
<th id='headerSize'><?php echo $l->t( 'Size MB' ); ?></th>
<th id='headerDate'><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class='selectedActions'><a href="" title="Delete" class="delete"><img class='svg' alt="Delete" src="../core/img/actions/delete.svg" /></a></span></th>
<th id='headerDate'><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class='selectedActions'><a href="" title="Delete" class="delete"><img class='svg' alt="<?php echo $l->t('Delete')?>" src="../core/img/actions/delete.svg" /></a></span></th>
</tr>
</thead>
<tbody id="fileList">
@ -42,14 +40,10 @@
</tbody>
</table>
<div id="uploadsize-message" title="Upload too large">
<div id="uploadsize-message" title="<?php echo $l->t('Upload too large')?>">
<p>
<?php echo $l->t( 'The files you are trying to upload exceed the maximum size for file uploads on this server.' ); ?>
</p>
</div>
<div id="delete-confirm" title="">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
<span id="file_menu"/>

View File

@ -1,4 +1,4 @@
<span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span>
<span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>><?php echo $l->t('Nothing in here. Upload something!')?></span>
<?php foreach($_['files'] as $file):
$simple_file_size = simple_file_size($file['size']);
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2

View File

@ -1 +0,0 @@
../templates/index.php

View File

@ -5,7 +5,28 @@ use Cwd;
use Data::Dumper;
use File::Path;
sub crawl{
sub crawlPrograms{
my( $dir, $ignore ) = @_;
my @found = ();
opendir( DIR, $dir );
my @files = readdir( DIR );
closedir( DIR );
foreach my $i ( @files ){
next if substr( $i, 0, 1 ) eq '.';
if( $i eq 'l10n' && !$ignore ){
push( @found, $dir );
}
elsif( -d $dir.'/'.$i ){
push( @found, crawlPrograms( $dir.'/'.$i ));
}
}
return @found;
}
sub crawlFiles{
my( $dir ) = @_;
my @found = ();
@ -15,17 +36,31 @@ sub crawl{
foreach my $i ( @files ){
next if substr( $i, 0, 1 ) eq '.';
if( -d $dir.'/'.$i ){
push( @found, crawl( $dir.'/'.$i ));
push( @found, crawlFiles( $dir.'/'.$i ));
}
elsif( $i eq 'xgettextfiles' ){
push( @found, $dir );
else{
push(@found,$dir.'/'.$i) if $i =~ /\.js$/ || $i =~ /\.php$/;
}
}
return @found;
}
sub readIgnorelist{
return () unless -e 'l10n/ignorelist';
my %ignore = ();
open(IN,'l10n/ignorelist');
while(<IN>){
my $line = $_;
chomp($line);
$ignore{"./$line"}++;
}
close(IN);
return %ignore;
}
my $task = shift( @ARGV );
my $place = '..';
@ -36,7 +71,7 @@ my $whereami = cwd();
die( "Program must be executed in a l10n-folder called 'l10n'" ) unless $whereami =~ m/\/l10n$/;
# Where are i18n-files?
my @dirs = crawl( $place );
my @dirs = crawlPrograms( $place, 1 );
# Languages
rmtree( 'templates' );
@ -51,28 +86,41 @@ foreach my $i ( @files ){
}
if( $task eq 'read' ){
print "Mode: reading\n";
foreach my $dir ( @dirs ){
my @temp = split( /\//, $dir );
pop( @temp );
my $app = pop( @temp );
chdir( $dir );
my @totranslate = crawlFiles('.');
my %ignore = readIgnorelist();
my $output = "${whereami}/templates/$app.pot";
`xgettext --files-from=xgettextfiles --output="$output" --keyword=t`;
print " Processing $app\n";
foreach my $file ( @totranslate ){
next if $ignore{$file};
my $keyword = ( $file =~ /\.js$/ ? 't:2' : 't');
my $language = ( $file =~ /\.js$/ ? 'C' : 'PHP');
my $joinexisting = ( -e $output ? '--join-existing' : '');
print " Reading $file\n";
`xgettext --output="$output" $joinexisting --keyword=$keyword --language=$language "$file"`;
}
chdir( $whereami );
}
}
elsif( $task eq 'write' ){
print "Mode: write\n";
foreach my $dir ( @dirs ){
my @temp = split( /\//, $dir );
pop( @temp );
my $app = pop( @temp );
chdir( $dir );
chdir( $dir.'/l10n' );
print " Processing $app\n";
foreach my $language ( @languages ){
next if $language eq 'templates';
my $input = "${whereami}/$language/$app.po";
next unless -e $input;
print " Language $language\n";
my $array = Locale::PO->load_file_asarray( $input );
# Create array
my @strings = ();

58
l10n/templates/admin.pot Normal file
View File

@ -0,0 +1,58 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 17:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../templates/app.php:17
msgid "read more"
msgstr ""
#: ../templates/app.php:19
msgid "Install"
msgstr ""
#: ../templates/app_noconn.php:1
msgid "Cannot connect to apps repository"
msgstr ""
#: ../templates/apps.php:5 ../templates/users.php:3 ../templates/users.php:7
msgid "Name"
msgstr ""
#: ../templates/apps.php:6
msgid "Modified"
msgstr ""
#: ../templates/system.php:1
msgid "System Settings"
msgstr ""
#: ../templates/users.php:4 ../templates/users.php:14
msgid "Create"
msgstr ""
#: ../templates/users.php:8
msgid "Password"
msgstr ""
#: ../templates/users.php:9
msgid "Groups"
msgstr ""
#: ../templates/users.php:33
msgid "Remove"
msgstr ""

136
l10n/templates/core.pot Normal file
View File

@ -0,0 +1,136 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 17:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../templates/404.php:12
msgid "Cloud not found"
msgstr ""
#: ../templates/installation.php:20
msgid "Create an <strong>admin account</strong>"
msgstr ""
#: ../templates/installation.php:21
msgid "Username"
msgstr ""
#: ../templates/installation.php:22
msgid "Password"
msgstr ""
#: ../templates/installation.php:27
msgid "Configure the database"
msgstr ""
#: ../templates/installation.php:31
msgid "SQLite will be used."
msgstr ""
#: ../templates/installation.php:34
msgid "SQLite"
msgstr ""
#: ../templates/installation.php:41
msgid "MySQL will be used."
msgstr ""
#: ../templates/installation.php:50
msgid "PostgreSQL will be used."
msgstr ""
#: ../templates/installation.php:59
msgid "Database user"
msgstr ""
#: ../templates/installation.php:60
msgid "Database password"
msgstr ""
#: ../templates/installation.php:61
msgid "Database name"
msgstr ""
#: ../templates/installation.php:62
msgid "Host"
msgstr ""
#: ../templates/installation.php:63
msgid "Table prefix"
msgstr ""
#: ../templates/installation.php:70
msgid "Advanced"
msgstr ""
#: ../templates/installation.php:73
msgid "Set data folder"
msgstr ""
#: ../templates/installation.php:74
msgid "Data folder"
msgstr ""
#: ../templates/installation.php:77
msgid "Finish setup"
msgstr ""
#: ../templates/layout.guest.php:38
msgid ""
"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs "
"on your own server.</p>"
msgstr ""
#: ../templates/login.php:4
msgid "Login failed!"
msgstr ""
#: ../templates/login.php:9 ../templates/login.php:13
msgid "remember"
msgstr ""
#: ../templates/logout.php:1
msgid "You are logged out."
msgstr ""
#: ../templates/part.pagenavi.php:6
msgid "prev"
msgstr ""
#: ../templates/part.pagenavi.php:26
msgid "next"
msgstr ""
#: ../../lib/app.php:204
msgid "Users"
msgstr ""
#: ../../lib/app.php:205
msgid "Apps"
msgstr ""
#: ../../lib/app.php:206
msgid "Files"
msgstr ""
#: ../../lib/app.php:209
msgid "Help"
msgstr ""
#: ../../lib/app.php:210
msgid "Personal"
msgstr ""

64
l10n/templates/files.pot Normal file
View File

@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 17:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../appinfo/app.php:7
msgid "Files"
msgstr ""
#: ../templates/index.php:11
msgid "Upload"
msgstr ""
#: ../templates/index.php:17
msgid "New Folder"
msgstr ""
#: ../templates/index.php:30
msgid "Name"
msgstr ""
#: ../templates/index.php:32
msgid "Download"
msgstr ""
#: ../templates/index.php:36
msgid "Size MB"
msgstr ""
#: ../templates/index.php:37
msgid "Modified"
msgstr ""
#: ../templates/index.php:37
msgid "Delete"
msgstr ""
#: ../templates/index.php:45
msgid "Upload too large"
msgstr ""
#: ../templates/index.php:47
msgid ""
"The files you are trying to upload exceed the maximum size for file uploads "
"on this server."
msgstr ""
#: ../templates/part.list.php:1
msgid "Nothing in here. Upload something!"
msgstr ""

22
l10n/templates/help.pot Normal file
View File

@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 17:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../templates/index.php:21
msgid "Ask a question"
msgstr ""

View File

@ -0,0 +1,86 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 17:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../templates/index.php:3
msgid "Account information"
msgstr ""
#: ../templates/index.php:5
msgid "You're currently using"
msgstr ""
#: ../templates/index.php:5
msgid "of your"
msgstr ""
#: ../templates/index.php:5
msgid "space"
msgstr ""
#: ../templates/index.php:11 ../templates/index.php:17
msgid "Change Password"
msgstr ""
#: ../templates/index.php:12
msgid "Your password got changed"
msgstr ""
#: ../templates/index.php:14
msgid "Old password"
msgstr ""
#: ../templates/index.php:15
msgid "New password"
msgstr ""
#: ../templates/index.php:16
msgid "show"
msgstr ""
#: ../templates/index.php:23
msgid "Language"
msgstr ""
#: ../ajax/changepassword.php:13 ../ajax/setlanguage.php:13
msgid "Authentication error"
msgstr ""
#: ../ajax/changepassword.php:19
msgid "You have to enter the old and the new password!"
msgstr ""
#: ../ajax/changepassword.php:25
msgid "Your old password is wrong!"
msgstr ""
#: ../ajax/changepassword.php:31
msgid "Password changed"
msgstr ""
#: ../ajax/changepassword.php:34
msgid "Unable to change password"
msgstr ""
#: ../ajax/setlanguage.php:21
msgid "Language changed"
msgstr ""
#: ../ajax/setlanguage.php:23
msgid "Invalid request"
msgstr ""

View File

@ -52,7 +52,7 @@ class OC_App{
}
// Our very own core apps are hardcoded
foreach( array( 'admin', 'files', 'log', 'help', 'settings' ) as $app ){
foreach( array( 'admin', 'files', 'help', 'settings' ) as $app ){
require( $app.'/appinfo/app.php' );
}
@ -136,7 +136,6 @@ class OC_App{
* This function returns all data it got via register().
*/
public static function get(){
// TODO: write function
return OC_App::$apps;
}
@ -199,14 +198,15 @@ class OC_App{
* entries are sorted by the key 'order' ascending.
*/
public static function getSettingsNavigation(){
$l=new OC_L10N('core');
$admin=array(
array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )),
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )),
array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )),
array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "admin", "users.png" )),
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "admin", "apps.png" )),
array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => $l->t("Files"), "icon" => OC_Helper::imagePath( "files", "folder.png" )),
);
$settings=array(
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" )),
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => "Personal", "icon" => OC_Helper::imagePath( "settings", "personal.png" ))
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "help", "help.png" )),
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.png" ))
);
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
$settings=array_merge($admin,$settings);
@ -241,7 +241,7 @@ class OC_App{
if(is_file($appid)){
$file=$appid;
}else{
$file='apps/'.$appid.'/appinfo/info.xml';
$file=OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/info.xml';
if(!is_file($file)){
return array();
}
@ -331,4 +331,18 @@ class OC_App{
public static function registerPersonal($app,$page){
self::$personalForms[]='apps/'.$app.'/'.$page.'.php';
}
/**
* get a list of all apps in the apps folder
*/
public static function getAllApps(){
$apps=array();
$dh=opendir(OC::$SERVERROOT.'/apps');
while($file=readdir($dh)){
if(is_file(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/app.php')){
$apps[]=$file;
}
}
return $apps;
}
}

View File

@ -90,12 +90,19 @@ if(substr($scriptName,-1)=='/'){
}
$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen($SUBURI));
OC::$SERVERROOT=$SERVERROOT;
OC::$WEBROOT=$WEBROOT;
if($WEBROOT!='' and $WEBROOT[0]!=='/'){
$WEBROOT='/'.$WEBROOT;
}
// We are going to use OC::* instead of globels soon
OC::$WEBROOT = $WEBROOT;
OC::$SERVERROOT = $SERVERROOT;
OC::$DOCUMENTROOT = $DOCUMENTROOT;
OC::$SUBURI = $SUBURI;
// set the right include path
set_include_path($SERVERROOT.'/lib'.PATH_SEPARATOR.$SERVERROOT.'/config'.PATH_SEPARATOR.$SERVERROOT.'/3rdparty'.PATH_SEPARATOR.get_include_path().PATH_SEPARATOR.$SERVERROOT);

View File

@ -3,7 +3,6 @@
* ownCloud
*
* @author Frank Karlitschek
* @author Jakob Sack
* @copyright 2010 Frank Karlitschek karlitschek@kde.org
*
* This library is free software; you can redistribute it and/or
@ -21,6 +20,15 @@
*
*/
// Todo:
// Crypt/decrypt button in the userinterface
// transparent decrypt/encrpt in filesystem.php
// don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
require_once('Crypt_Blowfish/Blowfish.php');
/**
@ -28,6 +36,19 @@ require_once('Crypt_Blowfish/Blowfish.php');
*/
class OC_Crypt {
static $encription_extension='.encrypted';
public static function createkey( $passcode) {
// generate a random key
$key=mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999);
// encrypt the key with the passcode of the user
$enckey=OC_Crypt::encrypt($key,$passcode);
// Write the file
file_put_contents( "$SERVERROOT/config/encryption.key", $enckey );
}
/**
* @brief encrypts an content
* @param $content the cleartext message you want to encrypt
@ -56,6 +77,51 @@ class OC_Crypt {
}
/**
* @brief encryption of a file
* @param $filename
* @param $key the encryption key
*
* This function encrypts a file
*/
public static function encryptfile( $filename, $key) {
$handleread = fopen($filename, "rb");
if($handleread<>FALSE) {
$handlewrite = fopen($filename.OC_Crypt::$encription_extension, "wb");
while (!feof($handleread)) {
$content = fread($handleread, 8192);
$enccontent=OC_CRYPT::encrypt( $content, $key);
fwrite($handlewrite, $enccontent);
}
fclose($handlewrite);
unlink($filename);
}
fclose($handleread);
}
/**
* @brief decryption of a file
* @param $filename
* @param $key the decryption key
*
* This function decrypts a file
*/
public static function decryptfile( $filename, $key) {
$handleread = fopen($filename.OC_Crypt::$encription_extension, "rb");
if($handleread<>FALSE) {
$handlewrite = fopen($filename, "wb");
while (!feof($handleread)) {
$content = fread($handleread, 8192);
$enccontent=OC_CRYPT::decrypt( $content, $key);
fwrite($handlewrite, $enccontent);
}
fclose($handlewrite);
unlink($filename.OC_Crypt::$encription_extension);
}
fclose($handleread);
}

View File

@ -144,7 +144,6 @@ class OC_Files {
die('403 Forbidden');
}
ob_end_clean();
// OC_Log::event($_SESSION['username'],3,"$dir/$files");
if($zip){
readfile($filename);
unlink($filename);
@ -206,7 +205,6 @@ class OC_Files {
$fileHandle=OC_Filesystem::fopen($file, 'w');
if($fileHandle){
fclose($fileHandle);
// OC_Log::event($_SESSION['username'],4,"$dir/$name");
return true;
}else{
return false;

View File

@ -97,16 +97,17 @@ class OC_L10N{
/**
* @brief Translating
* @param $text The text we need a translation for
* @param $parameters default:array() Parameters for sprintf
* @returns Translation or the same text
*
* Returns the translation. If no translation is found, $text will be
* returned.
*/
public function t($text){
public function t($text, $parameters = array()){
if(array_key_exists($text, $this->translations)){
return $this->translations[$text];
return vsprintf( $this->translations[$text], $parameters );
}
return $text;
return vsprintf( $text, $parameters );
}
/**

View File

@ -1,151 +0,0 @@
<?php
/**
* ownCloud
*
* @author Frank Karlitschek
* @author Jakob Sack
* @copyright 2010 Frank Karlitschek karlitschek@kde.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
*
* The following SQL statement is just a help for developers and will not be
* executed!
*
* CREATE TABLE `log` (
* `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
* `moment` DATETIME NOT NULL ,
* `appid` VARCHAR( 255 ) NOT NULL ,
* `user` VARCHAR( 255 ) NOT NULL ,
* `action` VARCHAR( 255 ) NOT NULL ,
* `info` TEXT NOT NULL
* ) ENGINE = MYISAM ;
*
*/
/**
* This class is for logging
*/
class OC_Log {
/**
* @brief adds an entry to the log
* @param $appid id of the app
* @param $subject username
* @param $predicate action
* @param $object = null; additional information
* @returns true/false
*
* This function adds another entry to the log database
*/
public static function add( $appid, $subject, $predicate, $object = ' ' ){
$query=OC_DB::prepare("INSERT INTO `*PREFIX*log`(moment,appid,`user`,action,info) VALUES(NOW(),?,?,?,?)");
$result=$query->execute(array($appid,$subject,$predicate,$object));
// Die if we have an error
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$query.'<br />';
error_log( $entry );
die( $entry );
}
return true;
}
/**
* @brief Fetches log entries
* @param $filter = array(); array with filter options
* @returns array with entries
*
* This function fetches the log entries according to the filter options
* passed.
*
* $filter is an associative array.
* The following keys are optional:
* - from: all entries after this date
* - until: all entries until this date
* - user: username (default: current user)
* - app: only entries for this app
*/
public static function get( $filter = array()){
$queryString='SELECT * FROM `*PREFIX*log` WHERE 1=1 ORDER BY moment DESC';
$params=array();
if(isset($filter['from'])){
$queryString.='AND moment>? ';
array_push($params,$filter('from'));
}
if(isset($filter['until'])){
$queryString.='AND moment<? ';
array_push($params,$filter('until'));
}
if(isset($filter['user'])){
$queryString.='AND `user`=? ';
array_push($params,$filter('user'));
}
if(isset($filter['app'])){
$queryString.='AND appid=? ';
array_push($params,$filter('app'));
}
$query=OC_DB::prepare($queryString);
$result=$query->execute($params)->fetchAll();
if(count($result)>0 and is_numeric($result[0]['moment'])){
foreach($result as &$row){
$row['moment']=OC_Util::formatDate($row['moment']);
}
}
return $result;
}
/**
* @brief removes log entries
* @param $date delete entries older than this date
* @returns true/false
*
* This function deletes all entries that are older than $date.
*/
public static function deleteBefore( $date ){
$query=OC_DB::prepare("DELETE FROM `*PREFIX*log` WHERE moment<?");
$query->execute(array($date));
return true;
}
/**
* @brief removes all log entries
* @returns true/false
*
* This function deletes all log entries.
*/
public static function deleteAll(){
$query=OC_DB::prepare("DELETE FROM `*PREFIX*log`");
$query->execute();
return true;
}
/**
* @brief filter an array of log entries on action
* @param array $logs the log entries to filter
* @param array $actions an array of actions to filter for
* @returns array
*/
public static function filterAction($logs,$actions){
$filteredLogs=array();
foreach($logs as $log){
if(array_search($log['action'],$actions)!==false){
$filteredLogs[]=$log;
}
}
return $filteredLogs;
}
}

View File

@ -402,33 +402,7 @@ class OC_OCS {
private static function activityGet($format,$page,$pagesize) {
$user=OC_OCS::checkpassword();
$query = OC_DB::prepare('select count(*) as co from *PREFIX*log');
$result = $query->execute();
$entry=$result->fetchRow();
$totalcount=$entry['co'];
$query=OC_DB::prepare('select id,timestamp,`user`,type,message from *PREFIX*log order by timestamp desc limit ?,?');
$result = $query->execute(array(($page*$pagesize),$pagesize))->fetchAll();
$itemscount=count($result);
$url='http://'.substr($_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'],0,-11).'';
$xml=array();
foreach($result as $i=>$log) {
$xml[$i]['id']=$log['id'];
$xml[$i]['personid']=$log['user'];
$xml[$i]['firstname']=$log['user'];
$xml[$i]['lastname']='';
$xml[$i]['profilepage']=$url;
$pic=$url.'/img/owncloud-icon.png';
$xml[$i]['avatarpic']=$pic;
$xml[$i]['timestamp']=date('c',$log['timestamp']);
$xml[$i]['type']=1;
$xml[$i]['message']=OC_Log::$TYPE[$log['type']].' '.strip_tags($log['message']);
$xml[$i]['link']=$url;
}
//TODO
$txt=OC_OCS::generatexml($format,'ok',100,'',$xml,'activity','full',2,$totalcount,$pagesize);
echo($txt);

View File

@ -193,7 +193,6 @@ class OC_User {
if( $run && self::checkPassword( $uid, $password )){
$_SESSION['user_id'] = $uid;
OC_Log::add( "core", $_SESSION['user_id'], "login" );
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid ));
return true;
}
@ -210,7 +209,6 @@ class OC_User {
*/
public static function logout(){
OC_Hook::emit( "OC_User", "logout", array());
OC_Log::add( "core", $_SESSION['user_id'], "logout" );
$_SESSION['user_id'] = false;
return true;
}

View File

@ -1,6 +0,0 @@
<?php /*
OC_App::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
OC_App::addSettingsPage( array( "id" => "log", "order" => 999, "href" => OC_Helper::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_Helper::imagePath( "log", "logs.png" )));
*/ ?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

View File

@ -1,107 +0,0 @@
<?php
/**
* ownCloud - ajax frontend
*
* @author Robin Appelman
* @copyright 2010 Robin Appelman icewind1991@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
//require_once('../../config/config.php');
/*
require_once('../lib/base.php');
if( !OC_User::isLoggedIn()){
header( 'Location: '.OC_Helper::linkTo( 'index.php' ));
exit();
}
//load the script
OC_Util::addScript( "log", "log" );
$allActions=array('login','logout','read','write','create','delete');
//check for a submitted config
if(isset($_POST['save'])){
$selectedActions=array();
foreach($allActions as $action){
if(isset($_POST[$action]) and $_POST[$action]=='on'){
$selectedActions[]=$action;
}
}
OC_Preferences::setValue(OC_User::getUser(),'log','actions',implode(',',$selectedActions));
OC_Preferences::setValue(OC_User::getUser(),'log','pagesize',$_POST['size']);
}
//clear log entries
elseif(isset($_POST['clear'])){
$removeBeforeDate=(isset($_POST['removeBeforeDate']))?$_POST['removeBeforeDate']:0;
if($removeBeforeDate!==0){
$removeBeforeDate=strtotime($removeBeforeDate);
OC_Log::deleteBefore($removeBeforeDate);
}
}
elseif(isset($_POST['clearall'])){
OC_Log::deleteAll();
}
OC_App::setActiveNavigationEntry( 'log' );
$logs=OC_Log::get();
$selectedActions=explode(',',OC_Preferences::getValue(OC_User::getUser(),'log','actions',implode(',',$allActions)));
$logs=OC_Log::filterAction($logs,$selectedActions);
$pageSize=OC_Preferences::getValue(OC_User::getUser(),'log','pagesize',20);
$pageCount=ceil(count($logs)/$pageSize);
$page=isset($_GET['page'])?$_GET['page']:0;
if($page>=$pageCount){
$page=$pageCount-1;
}
$logs=array_slice($logs,$page*$pageSize,$pageSize);
foreach( $logs as &$i ){
$i['date'] =$i['moment'];
}
$url=OC_Helper::linkTo( 'log', 'index.php' ).'?page=';
$pager=OC_Util::getPageNavi($pageCount,$page,$url);
if($pager){
$pagerHTML=$pager->fetchPage();
}
else{
$pagerHTML='';
}
$showActions=array();
foreach($allActions as $action){
if(array_search($action,$selectedActions)!==false){
$showActions[$action]='checked="checked"';
}
else{
$showActions[$action]='';
}
}
$tmpl = new OC_Template( 'log', 'index', 'admin' );
$tmpl->assign( 'logs', $logs );
$tmpl->assign( 'pager', $pagerHTML );
$tmpl->assign( 'size', $pageSize );
$tmpl->assign( 'showActions', $showActions );
$tmpl->printPage();
*/ ?>

View File

@ -1,25 +0,0 @@
$(document).ready(function() {
// Sets the select_all checkbox behaviour :
$('#all').click(function() {
if($(this).attr('checked')){
// Check all
$('input.action:checkbox').attr('checked', true);
}else{
// Uncheck all
$('input.action:checkbox').attr('checked', false);
}
});
$('input.action:checkbox').click(function() {
if(!$(this).attr('checked')){
$('#all').attr('checked',false);
}else{
if($('input.action:checkbox:checked').length==$('input.action:checkbox').length){
$('#all').attr('checked',true);
}
}
});
$('#removeBeforeDate').datepicker({
dateFormat:'MM d, yy',
});
});

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Филтър:",
"Logins" => "Влизания:",
"Logouts" => "Изходи:",
"Downloads" => "Тегления",
"Uploads" => "Качвания",
"Creations" => "Създавания:",
"Deletions" => "Изтривания:",
"Show:" => "Показва:",
"entries per page." => "записа на страница.",
"What" => "Какво",
"When" => "Кога",
"Clear log entries before" => "Изчисти записите от журналите"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filter:",
"Logins" => "Logins",
"Logouts" => "Logouts",
"Downloads" => "Downloads",
"Uploads" => "Uploads",
"Creations" => "Oprettelser",
"Deletions" => "Sletninger",
"Show:" => "Vis:",
"entries per page." => "poster pr side.",
"What" => "Hvilket",
"When" => "Hvornår",
"Clear log entries before" => "Slet log poster før"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filter:",
"Logins" => "Anmeldungen",
"Logouts" => "Abmeldungen",
"Downloads" => "Downloads",
"Uploads" => "Uploads",
"Creations" => "Erstellungen",
"Deletions" => "Löschungen",
"Show:" => "Zeige",
"entries per page." => "Einträge pro Seite",
"What" => "Was",
"When" => "Wann",
"Clear log entries before" => "Lösche Einträge vor dem"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filtro:",
"Logins" => "Inicios de sesión",
"Logouts" => "Cierres de sesión",
"Downloads" => "Descargas",
"Uploads" => "Subidas",
"Creations" => "Creaciones",
"Deletions" => "Eliminaciones",
"Show:" => "Mostrar",
"entries per page." => "Entradas por página.",
"What" => "Qué",
"When" => "Cuándo",
"Clear log entries before" => "Eliminar los registros anteriores a"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filtre :",
"Logins" => "Connexions",
"Logouts" => "Déconnexions",
"Downloads" => "Téléchargements",
"Uploads" => "Téléversements",
"Creations" => "Créations",
"Deletions" => "Suppressions",
"Show:" => "Afficher :",
"entries per page." => "entrées par page.",
"What" => "Quoi",
"When" => "Quand",
"Clear log entries before" => "Effacer les entrées du journal au préalable"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filter:",
"Logins" => "Aanmeldingen",
"Logouts" => "Afmeldingen",
"Downloads" => "Downloads",
"Uploads" => "Uploads",
"Creations" => "Creaties",
"Deletions" => "Verwijderingen",
"Show:" => "Laat",
"entries per page." => "resulaten per pagina zien",
"What" => "Wat",
"When" => "Wanneer",
"Clear log entries before" => "Verwijder logboekitem ouder dan"
);

View File

@ -1,14 +0,0 @@
<?php $TRANSLATIONS = array(
"Filter:" => "Filtr:",
"Logins" => "Zalogowania",
"Logouts" => "Wylogowani",
"Downloads" => "Pobrania",
"Uploads" => "Wgrania",
"Creations" => "Utworzenia",
"Deletions" => "Usunięcia",
"Show:" => "Pokaż:",
"entries per page." => "wpisów na stronę.",
"What" => "Co",
"When" => "Kiedy",
"Clear log entries before" => "Wyczyść spisy dziennika sprzed"
);

View File

@ -1 +0,0 @@
../templates/index.php

View File

@ -1,53 +0,0 @@
<?php /*<div class="controls">
<form id="logs_options" method='post'>
<p>
<span><?php echo $l->t( 'Filter:' ); ?></span>
<input type="checkbox" checked="" name="all" id="all" /> <label for="all">All</label>
<input type="checkbox" class='action' <?php echo $_['showActions']['login']?> name="login" id="logins" /> <label for="logins"><?php echo $l->t( 'Logins' ); ?></label>
<input type="checkbox" class='action' <?php echo $_['showActions']['logout']?> name="logout" id="logouts" /> <label for="logouts"><?php echo $l->t( 'Logouts' ); ?></label>
<input type="checkbox" class='action' <?php echo $_['showActions']['read']?> name="read" id="downloads" /> <label for="downloads"><?php echo $l->t( 'Downloads' ); ?></label>
<input type="checkbox" class='action' <?php echo $_['showActions']['write']?> name="write" id="uploads" /> <label for="uploads"><?php echo $l->t( 'Uploads' ); ?></label>
<input type="checkbox" class='action' <?php echo $_['showActions']['create']?> name="create" id="creations" /> <label for="creations"><?php echo $l->t( 'Creations' ); ?></label>
<input type="checkbox" class='action' <?php echo $_['showActions']['delete']?> name="delete" id="deletions" /> <label for="deletions"><?php echo $l->t( 'Deletions' ); ?></label>
</p>
<p>
<span><?php echo $l->t( 'Show:' ); ?></span>
<input type="text" maxlength="3" size="3" value="<?php echo $_['size']?>" name='size'/>&nbsp;<?php echo $l->t( 'entries per page.' ); ?>
<input class="prettybutton" type="submit" name="save" value="Save" />
</p>
</form>
</div>
<table cellspacing="0">
<thead>
<tr>
<th><?php echo $l->t( 'What' ); ?></th>
<th><?php echo $l->t( 'When' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach($_["logs"] as $entry): ?>
<tr>
<td class="<?php echo $entry["action"]; ?>"><em><?php echo $entry["action"]; ?> <?php echo $entry["user"]; ?></em> <?php echo $entry["info"]; ?></td>
<td class="date"><?php echo $l->l('datetime', $entry["date"] ); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php echo $_['pager'];?>
<div class="controls">
<form id="logs_options" method='post'>
<p>
<span><?php echo $l->t( 'Clear log entries before' ); ?> </span>
<input type="date" id="removeBeforeDate" name="removeBeforeDate"/>
<input class="prettybutton nofloat" type="submit" name="clear" value="Clear" />
<input class="prettybutton" type="submit" name="clearall" value="Clear All" />
</p>
</form>
</div>
*/ ?>

View File

@ -1,3 +0,0 @@
../templates/index.php
../ajax/changepassword.php
../ajax/setlanguage.php

View File

@ -14,7 +14,7 @@
<input type="password" id="pass1" name="oldpassword" placeholder="<?php echo $l->t( 'Old password' );?>" />
<input type="password" id="pass2" name="password" placeholder="<?php echo $l->t( 'New password' );?>" data-typetoggle="#show" />
<input type="checkbox" id="show" name="show" /><label for="show"><?php echo $l->t( 'show' );?></label>
<input id="passwordbutton" type="submit" value="Change password" />
<input id="passwordbutton" type="submit" value="<?php echo $l->t( 'Change Password' );?>" />
</fieldset>
</form>