From c6f499c68551b216f59292801c3ebb91fb08e8e4 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Tue, 9 Aug 2011 17:42:54 +0200 Subject: [PATCH 01/28] Some more fixes. It basically works but looks ugly --- apps/contacts/ajax/addphoto.php | 59 -------------- apps/contacts/ajax/deletebook.php | 1 - apps/contacts/ajax/deleteproperty.php | 10 ++- apps/contacts/ajax/setphoto.php | 77 ------------------- apps/contacts/ajax/setproperty.php | 10 ++- apps/contacts/ajax/showsetproperty.php | 11 ++- apps/contacts/js/interface.js | 46 +++++------ apps/contacts/lib/addressbook.php | 15 ++-- apps/contacts/templates/index.php | 2 +- .../templates/part.addpropertyform.php | 19 ++--- apps/contacts/templates/part.contacts.php | 2 +- apps/contacts/templates/part.details.php | 7 +- apps/contacts/templates/part.property.php | 36 +++++---- .../templates/part.setpropertyform.php | 3 - 14 files changed, 90 insertions(+), 208 deletions(-) delete mode 100644 apps/contacts/ajax/addphoto.php delete mode 100644 apps/contacts/ajax/setphoto.php diff --git a/apps/contacts/ajax/addphoto.php b/apps/contacts/ajax/addphoto.php deleted file mode 100644 index 03d5e6b3ce..0000000000 --- a/apps/contacts/ajax/addphoto.php +++ /dev/null @@ -1,59 +0,0 @@ -. - * - */ - -// 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 ))); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php index ba36c494cd..8506284cc0 100644 --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -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!')))); diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index 9f8b5dbbaf..d141cc00b8 100644 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -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;$ichildren);$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(); } diff --git a/apps/contacts/ajax/setphoto.php b/apps/contacts/ajax/setphoto.php deleted file mode 100644 index c29b532602..0000000000 --- a/apps/contacts/ajax/setphoto.php +++ /dev/null @@ -1,77 +0,0 @@ -. - * - */ - -// 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 ))); diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php index 6f33c68631..08d8892254 100644 --- a/apps/contacts/ajax/setproperty.php +++ b/apps/contacts/ajax/setproperty.php @@ -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;$ichildren);$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(); } diff --git a/apps/contacts/ajax/showsetproperty.php b/apps/contacts/ajax/showsetproperty.php index 75c3ff88f5..a00043384f 100644 --- a/apps/contacts/ajax/showsetproperty.php +++ b/apps/contacts/ajax/showsetproperty.php @@ -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;$ichildren);$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 ))); diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 0aae7d15d4..bab71eec42 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -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); diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index cb7b0b4671..8b91cdbd6f 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -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; diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index e6dd45739b..6a29c7bd68 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -22,6 +22,6 @@ OC_Util::addStyle('contacts','styles'); t('Add Contact'); ?> -
+
inc("part.details"); ?>
diff --git a/apps/contacts/templates/part.addpropertyform.php b/apps/contacts/templates/part.addpropertyform.php index ff9090b76d..32affde952 100644 --- a/apps/contacts/templates/part.addpropertyform.php +++ b/apps/contacts/templates/part.addpropertyform.php @@ -1,7 +1,6 @@
- - + + t('PO Box'); ?> t('Extended Address'); ?> @@ -28,15 +27,17 @@
-
- -
diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index fa6d4790cf..6664a3671a 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -1,3 +1,3 @@ -
  • +
  • diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 4aca8dbc79..0d738b5a0a 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -17,6 +17,7 @@ - - - +
    + + +
    diff --git a/apps/contacts/templates/part.property.php b/apps/contacts/templates/part.property.php index 1a4266b3a2..1611e54b65 100644 --- a/apps/contacts/templates/part.property.php +++ b/apps/contacts/templates/part.property.php @@ -1,40 +1,48 @@ -
    +
    t('Name'); ?>
    - +
    t('Birthday'); ?>
    l('date',new DateTime($_['property']['value'])); ?> - - +
    t('Organisation'); ?>
    - - + +
    t('Email'); ?>
    - - + +
    -
    t('Telefon'); ?>
    +
    t('Telephone'); ?>
    - - + + (t('tel_'.strtolower($_['property']['parameters']['TYPE'])); ?>) + + +
    -
    t('Address'); ?>
    +
    + t('Address'); ?> + +
    + (t('adr_'.strtolower($_['property']['parameters']['TYPE'])); ?>) + +
    t('PO Box'); ?>
    t('Extended Address'); ?>
    @@ -43,8 +51,8 @@ t('Region'); ?>
    t('Postal Code'); ?>
    t('Country'); ?> - - + +
    diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php index cd774ee659..d8127bb08b 100644 --- a/apps/contacts/templates/part.setpropertyform.php +++ b/apps/contacts/templates/part.setpropertyform.php @@ -1,6 +1,5 @@ - t('PO Box'); ?> @@ -12,8 +11,6 @@ t('Country'); ?> - - From ce76cece09d751c27c2364d31e7b93ae3df80cc8 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Tue, 9 Aug 2011 18:00:14 +0200 Subject: [PATCH 02/28] Remove warning --- apps/contacts/templates/part.details.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 0d738b5a0a..e463459e78 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -1,10 +1,15 @@ -inc('part.property', array('property' => $_['details']['FN'][0])); ?> + + + inc('part.property', array('property' => $_['details']['FN'][0])); ?> + + inc('part.property', array('property' => $_['details']['BDAY'][0])); ?> + inc('part.property', array('property' => $_['details']['ORG'][0])); ?> @@ -17,6 +22,7 @@ +
    From 891ac04c195cae36abbf6febeaecfcca6f45d88f Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Tue, 9 Aug 2011 18:05:52 +0200 Subject: [PATCH 03/28] Remove references to "multiple addressbooks" :-( --- apps/contacts/templates/index.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 6a29c7bd68..5f61ec1078 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -3,19 +3,6 @@ OC_Util::addScript('contacts','interface'); OC_Util::addStyle('contacts','styles'); ?> - -
    - Addressbooks -
    - -
    */ -?>
      inc("part.contacts"); ?> From 34529b1c35bf14439b63ab0aca5bbbfc361738ee Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 22:33:56 +0200 Subject: [PATCH 04/28] removed required parameter again because of issues --- core/templates/installation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/templates/installation.php b/core/templates/installation.php index e9f7daf7b8..b578ed94c3 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -56,10 +56,10 @@
      - + - - + +
      From 9e4fb257e39224b0860b171affa862c4bb1eda0c Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 22:43:58 +0200 Subject: [PATCH 05/28] proper advanced options --- core/css/styles.css | 4 ++-- core/templates/installation.php | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 4cb630d4a9..246a5b130e 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -73,8 +73,8 @@ legend { padding:.2em; font-size:1.2em; } #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 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 { position:absolute; display:block; margin:.8em 0 .8em -5.5em; font-size:1.5em; color:#666; } + #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; } diff --git a/core/templates/installation.php b/core/templates/installation.php index b578ed94c3..41fc4526d6 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -59,8 +59,7 @@ - - +
    @@ -70,8 +69,10 @@ t( 'Advanced' ); ?> ▾
    - t( 'Set data folder' ); ?> -

    + + + +
    From 2ea86fbaba71076cd4b2149413c185f515b2f985 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 22:46:49 +0200 Subject: [PATCH 06/28] lowered text in input boxes .1em like a boss --- core/css/styles.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 246a5b130e..1183b089ae 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -29,7 +29,7 @@ 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; } @@ -48,8 +48,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; @@ -73,7 +73,7 @@ legend { padding:.2em; font-size:1.2em; } #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 legend { font-weight:bold; } -#login form label { position:absolute; display:block; margin:.8em 0 .8em -5.5em; font-size:1.5em; color:#666; } +#login form label { position:absolute; display:block; margin:.95em 0 .8em -5.5em; font-size:1.5em; color:#666; } #login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; } From 9817b51c211e3b54e27d6c7b18182fa73d058d77 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 22:48:19 +0200 Subject: [PATCH 07/28] who took a

    in here? --- core/templates/installation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/templates/installation.php b/core/templates/installation.php index 41fc4526d6..6a18a0264a 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -18,8 +18,8 @@

    t( 'Create an admin account' ); ?> -

    -

    + +
    From ec2dd5be3a84df804adbc453d4a4ec2ec77c7eb7 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 22:51:08 +0200 Subject: [PATCH 08/28] removed some autocompletion --- core/templates/installation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/templates/installation.php b/core/templates/installation.php index 6a18a0264a..c5e95b04a3 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -18,7 +18,7 @@
    t( 'Create an admin account' ); ?> - +
    @@ -56,9 +56,9 @@
    - + - +
    From 74be4644edf4c13cd4e36779d8caa821865b7512 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 9 Aug 2011 23:34:10 +0200 Subject: [PATCH 09/28] fixed some styling again, the dirty way --- core/css/styles.css | 3 ++- core/templates/installation.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 1183b089ae..4a9fe01679 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -73,7 +73,8 @@ legend { padding:.2em; font-size:1.2em; } #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 legend { font-weight:bold; } -#login form label { position:absolute; display:block; margin:.95em 0 .8em -5.5em; font-size:1.5em; color:#666; } +#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; } diff --git a/core/templates/installation.php b/core/templates/installation.php index c5e95b04a3..80c3c27308 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -72,7 +72,7 @@ - +
    From 7b653dbca69e1d69898f2ea9b63759a495ef98b0 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 11:08:30 +0200 Subject: [PATCH 10/28] use sprintf for translations --- lib/l10n.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/l10n.php b/lib/l10n.php index 5271bd4e58..2d565ad079 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -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 ); } /** From c958a44e467dfc2e283efb0815ccae73f4feab87 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 11:18:35 +0200 Subject: [PATCH 11/28] Copying globals to OC::* --- lib/base.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/base.php b/lib/base.php index 51dee60d67..f59e375e76 100644 --- a/lib/base.php +++ b/lib/base.php @@ -96,6 +96,12 @@ 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); From 2b59912b3dc6e26ddf21afa089aec6b79b3bf062 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 11:19:12 +0200 Subject: [PATCH 12/28] Add CardDAV path --- apps/contacts/templates/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 5f61ec1078..ea76621674 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -12,3 +12,6 @@ OC_Util::addStyle('contacts','styles');
    inc("part.details"); ?>
    + + t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.$_['addressbooks'][0]['uri'])); ?> + From 58ab3883b940f7c651185217049cfdc68c9f985c Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 11:32:06 +0200 Subject: [PATCH 13/28] Add description to contacts --- apps/contacts/appinfo/info.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/contacts/appinfo/info.xml b/apps/contacts/appinfo/info.xml index 93463b9cf0..77c9dc91bf 100644 --- a/apps/contacts/appinfo/info.xml +++ b/apps/contacts/appinfo/info.xml @@ -6,4 +6,5 @@ AGPL Jakob Sack 2 + Address book with CardDAV support. From ae862ddf6994955217b26bdc0dcf37c9973c64be Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 12:34:49 +0200 Subject: [PATCH 14/28] Improve l10n.pl o more information o drop l10n/xgettextfiles o read all php and js files inside a folder that has a "l10n" folder --- admin/l10n/xgettextfiles | 5 --- core/l10n/xgettextfiles | 7 ---- help/l10n/xgettextfiles | 1 - l10n/l10n.pl | 66 ++++++++++++++++++++++++++++++++----- log/l10n/xgettextfiles | 1 - settings/l10n/xgettextfiles | 3 -- 6 files changed, 57 insertions(+), 26 deletions(-) delete mode 100644 admin/l10n/xgettextfiles delete mode 100644 core/l10n/xgettextfiles delete mode 100644 help/l10n/xgettextfiles delete mode 100644 log/l10n/xgettextfiles delete mode 100644 settings/l10n/xgettextfiles diff --git a/admin/l10n/xgettextfiles b/admin/l10n/xgettextfiles deleted file mode 100644 index 37acbc25de..0000000000 --- a/admin/l10n/xgettextfiles +++ /dev/null @@ -1,5 +0,0 @@ -../templates/app.php -../templates/app_noconn.php -../templates/apps.php -../templates/system.php -../templates/users.php diff --git a/core/l10n/xgettextfiles b/core/l10n/xgettextfiles deleted file mode 100644 index b5d83a880d..0000000000 --- a/core/l10n/xgettextfiles +++ /dev/null @@ -1,7 +0,0 @@ -../templates/404.php -../templates/installation.php -../templates/layout.guest.php -../templates/login.php -../templates/logout.php -../templates/part.pagenavi.php -../templates/part.searchbox.php diff --git a/help/l10n/xgettextfiles b/help/l10n/xgettextfiles deleted file mode 100644 index a24bcc89a8..0000000000 --- a/help/l10n/xgettextfiles +++ /dev/null @@ -1 +0,0 @@ -../templates/index.php diff --git a/l10n/l10n.pl b/l10n/l10n.pl index b993727e8f..736a7bc043 100644 --- a/l10n/l10n.pl +++ b/l10n/l10n.pl @@ -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(){ + 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 = (); diff --git a/log/l10n/xgettextfiles b/log/l10n/xgettextfiles deleted file mode 100644 index a24bcc89a8..0000000000 --- a/log/l10n/xgettextfiles +++ /dev/null @@ -1 +0,0 @@ -../templates/index.php diff --git a/settings/l10n/xgettextfiles b/settings/l10n/xgettextfiles deleted file mode 100644 index 8a2f185f23..0000000000 --- a/settings/l10n/xgettextfiles +++ /dev/null @@ -1,3 +0,0 @@ -../templates/index.php -../ajax/changepassword.php -../ajax/setlanguage.php \ No newline at end of file From 476ed149653895528e212fdec15ba60c00e7e3f1 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 10 Aug 2011 12:57:02 +0200 Subject: [PATCH 15/28] all the features are implemented and world domination is near. So the TODO file is no longer needed --- docs/TODO | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 docs/TODO diff --git a/docs/TODO b/docs/TODO deleted file mode 100644 index 1165ed7e72..0000000000 --- a/docs/TODO +++ /dev/null @@ -1,2 +0,0 @@ -Database: - - Stored procedures! From 32be4746f8514e06e838b4aa0ee45cb832df1b2c Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 10 Aug 2011 13:04:31 +0200 Subject: [PATCH 16/28] remove outdated stuff --- docs/owncloud.sql | 134 -------------------------- docs/skeleton/admin.php | 53 ---------- docs/skeleton/appinfo/app.sample.php | 15 --- docs/skeleton/css/skeleton.css | 4 - docs/skeleton/css/special.css | 3 - docs/skeleton/img/put_images_here.txt | 1 - docs/skeleton/index.php | 63 ------------ docs/skeleton/js/app.js | 3 - docs/skeleton/templates/admin.php | 8 -- docs/skeleton/templates/index.php | 12 --- 10 files changed, 296 deletions(-) delete mode 100644 docs/owncloud.sql delete mode 100644 docs/skeleton/admin.php delete mode 100644 docs/skeleton/appinfo/app.sample.php delete mode 100644 docs/skeleton/css/skeleton.css delete mode 100644 docs/skeleton/css/special.css delete mode 100644 docs/skeleton/img/put_images_here.txt delete mode 100644 docs/skeleton/index.php delete mode 100644 docs/skeleton/js/app.js delete mode 100644 docs/skeleton/templates/admin.php delete mode 100644 docs/skeleton/templates/index.php diff --git a/docs/owncloud.sql b/docs/owncloud.sql deleted file mode 100644 index 8037e4a25d..0000000000 --- a/docs/owncloud.sql +++ /dev/null @@ -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; diff --git a/docs/skeleton/admin.php b/docs/skeleton/admin.php deleted file mode 100644 index 20df8a0c71..0000000000 --- a/docs/skeleton/admin.php +++ /dev/null @@ -1,53 +0,0 @@ -. -* -*/ - -// 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(); - -?> diff --git a/docs/skeleton/appinfo/app.sample.php b/docs/skeleton/appinfo/app.sample.php deleted file mode 100644 index ce310996b0..0000000000 --- a/docs/skeleton/appinfo/app.sample.php +++ /dev/null @@ -1,15 +0,0 @@ - "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" )); - -?> diff --git a/docs/skeleton/css/skeleton.css b/docs/skeleton/css/skeleton.css deleted file mode 100644 index aa68a8be86..0000000000 --- a/docs/skeleton/css/skeleton.css +++ /dev/null @@ -1,4 +0,0 @@ -/* - * To include this css file, call "OC_UTIL::addStyle( "skeleton", "skeleton" )" - * in your app. (appname) (cssname) - */ \ No newline at end of file diff --git a/docs/skeleton/css/special.css b/docs/skeleton/css/special.css deleted file mode 100644 index 8fd75917bf..0000000000 --- a/docs/skeleton/css/special.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - * If you want to you can use more css files ... - */ diff --git a/docs/skeleton/img/put_images_here.txt b/docs/skeleton/img/put_images_here.txt deleted file mode 100644 index 8d1c8b69c3..0000000000 --- a/docs/skeleton/img/put_images_here.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/skeleton/index.php b/docs/skeleton/index.php deleted file mode 100644 index 1004388784..0000000000 --- a/docs/skeleton/index.php +++ /dev/null @@ -1,63 +0,0 @@ -. -* -*/ - - -// 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(); - -?> diff --git a/docs/skeleton/js/app.js b/docs/skeleton/js/app.js deleted file mode 100644 index 5d5b668eeb..0000000000 --- a/docs/skeleton/js/app.js +++ /dev/null @@ -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 diff --git a/docs/skeleton/templates/admin.php b/docs/skeleton/templates/admin.php deleted file mode 100644 index 63fcd5cd39..0000000000 --- a/docs/skeleton/templates/admin.php +++ /dev/null @@ -1,8 +0,0 @@ - -

    Admin

    diff --git a/docs/skeleton/templates/index.php b/docs/skeleton/templates/index.php deleted file mode 100644 index fb0544e76e..0000000000 --- a/docs/skeleton/templates/index.php +++ /dev/null @@ -1,12 +0,0 @@ - -

    Skeleton

    - - -

    - - - From 9059b559791b9f5333c24815c4bfd77cc6201c5e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 9 Aug 2011 17:54:02 +0200 Subject: [PATCH 17/28] make more strings translatable --- admin/templates/users.php | 17 +++-- apps/media/appinfo/app.php | 4 +- apps/media/js/collection.js | 2 +- apps/media/js/music.js | 2 +- apps/media/js/playlist.js | 14 ++-- apps/media/js/scanner.js | 4 +- apps/media/l10n/xgettextfiles | 6 ++ apps/media/templates/music.php | 18 ++--- core/css/styles.css | 1 + core/js/js.js | 6 +- core/l10n/xgettextfiles | 8 ++ core/templates/layout.user.php | 3 +- files/appinfo/app.php | 4 +- files/js/filelist.js | 2 +- files/js/files.js | 14 ++-- files/l10n/xgettextfiles | 5 ++ files/templates/index.php | 14 ++-- files/templates/part.list.php | 2 +- l10n/templates/admin.pot | 58 ++++++++++++++ l10n/templates/core.pot | 136 +++++++++++++++++++++++++++++++++ l10n/templates/files.pot | 64 ++++++++++++++++ l10n/templates/help.pot | 22 ++++++ l10n/templates/settings.pot | 86 +++++++++++++++++++++ lib/app.php | 11 +-- settings/templates/index.php | 2 +- 25 files changed, 450 insertions(+), 55 deletions(-) create mode 100644 apps/media/l10n/xgettextfiles create mode 100644 core/l10n/xgettextfiles create mode 100644 files/l10n/xgettextfiles create mode 100644 l10n/templates/admin.pot create mode 100644 l10n/templates/core.pot create mode 100644 l10n/templates/files.pot create mode 100644 l10n/templates/help.pot create mode 100644 l10n/templates/settings.pot diff --git a/admin/templates/users.php b/admin/templates/users.php index 8e34c908fc..00daf4c526 100644 --- a/admin/templates/users.php +++ b/admin/templates/users.php @@ -1,17 +1,17 @@
    - - + +
    - - - + + - +
      @@ -30,10 +30,13 @@ - Remove'/> + Remove'/>
    +
    + +
    diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index bc80536a96..ebd360eccb 100644 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -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') )); ?> diff --git a/apps/media/js/collection.js b/apps/media/js/collection.js index df7b79e332..e49024973f 100644 --- a/apps/media/js/collection.js +++ b/apps/media/js/collection.js @@ -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'); } diff --git a/apps/media/js/music.js b/apps/media/js/music.js index 7034824cad..c04c579d1c 100644 --- a/apps/media/js/music.js +++ b/apps/media/js/music.js @@ -15,7 +15,7 @@ $(document).ready(function(){ PlayList.play(oldSize); PlayList.render(); }); - var button=$(''); + var button=$(''); button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')') button.click(function(event){ event.stopPropagation(); diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js index 636ae29c55..ad6c63a033 100644 --- a/apps/media/js/playlist.js +++ b/apps/media/js/playlist.js @@ -19,7 +19,7 @@ PlayList.render=function(){ PlayList.render(); }); tr.hover(function(){ - var button=$(''); + var button=$(''); 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'); diff --git a/apps/media/js/scanner.js b/apps/media/js/scanner.js index 165f86d05f..0ebf408e70 100644 --- a/apps/media/js/scanner.js +++ b/apps/media/js/scanner.js @@ -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')); } } diff --git a/apps/media/l10n/xgettextfiles b/apps/media/l10n/xgettextfiles new file mode 100644 index 0000000000..39a310a453 --- /dev/null +++ b/apps/media/l10n/xgettextfiles @@ -0,0 +1,6 @@ +../appinfo/app.php +../templates/music.php +../js/scanner.js +../js/collection.js +../js/music.js +../js/playlist.js diff --git a/apps/media/templates/music.php b/apps/media/templates/music.php index 5d0b0b6f0c..d103e10b75 100644 --- a/apps/media/templates/music.php +++ b/apps/media/templates/music.php @@ -24,14 +24,14 @@ - - + + @@ -49,16 +49,16 @@
    - +
    - - + +
    NameArtistt('Name')?>t('Artist')?>
    - The playlist is empty + t('The playlist is empty')?>
    - - - + + + diff --git a/core/css/styles.css b/core/css/styles.css index 4a9fe01679..da64adbd14 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -97,6 +97,7 @@ legend { padding:.2em; font-size:1.2em; } #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; } +#navigation #settings>span{padding-bottom:1em}; /* 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; } diff --git a/core/js/js.js b/core/js/js.js index 952c1b86ea..aef3ad1acc 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -270,7 +270,11 @@ $(document).ready(function(){ $('#expand').click(function() { $('#settings li').slideToggle(); }); - + $('#expand').hover(function(){ + $('#navigation #settings>span').fadeIn(); + },function(){ + $('#navigation #settings>span').fadeOut(); + }) }); diff --git a/core/l10n/xgettextfiles b/core/l10n/xgettextfiles new file mode 100644 index 0000000000..932042b337 --- /dev/null +++ b/core/l10n/xgettextfiles @@ -0,0 +1,8 @@ +../templates/404.php +../templates/installation.php +../templates/layout.guest.php +../templates/login.php +../templates/logout.php +../templates/part.pagenavi.php +../templates/part.searchbox.php +../../lib/app.php diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2dce647873..3b065ef6ed 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -32,7 +32,7 @@ ownCloud
      -
    • +
    @@ -52,6 +52,7 @@
      + t('Settings');?>
    • class="active">
    • diff --git a/files/appinfo/app.php b/files/appinfo/app.php index a4cec3d6ec..94cd43ab0a 100644 --- a/files/appinfo/app.php +++ b/files/appinfo/app.php @@ -1,7 +1,9 @@ 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") )); ?> diff --git a/files/js/filelist.js b/files/js/filelist.js index ce9595d349..4a34385fd0 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -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){ diff --git a/files/js/files.js b/files/js/files.js index 49e7cecd09..519d48a523 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -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); diff --git a/files/l10n/xgettextfiles b/files/l10n/xgettextfiles new file mode 100644 index 0000000000..9e22680e45 --- /dev/null +++ b/files/l10n/xgettextfiles @@ -0,0 +1,5 @@ +../appinfo/app.php +../templates/index.php +../templates/part.list.php +../js/filelist.js +../js/files.js diff --git a/files/templates/index.php b/files/templates/index.php index bb58f5e754..27af6665df 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -8,13 +8,13 @@
      - +
      - +
      @@ -29,12 +29,12 @@ t( 'Name' ); ?> - Download + Download
    - + @@ -42,14 +42,10 @@
    ArtistAlbumTitlet('Artist')?>t('Album')?>t('Title')?>
    t( 'Size MB' ); ?>t( 'Modified' ); ?>Deletet( 'Modified' ); ?><?php echo $l->t('Delete')?>
    -
    +

    t( 'The files you are trying to upload exceed the maximum size for file uploads on this server.' ); ?>

    -
    -

    These items will be permanently deleted and cannot be recovered. Are you sure?

    -
    - diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 5051c19949..8b3823f391 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,4 +1,4 @@ - >Nothing in here. Upload something! + >t('Nothing in here. Upload something!')?> , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/l10n/templates/core.pot b/l10n/templates/core.pot new file mode 100644 index 0000000000..7189eb4988 --- /dev/null +++ b/l10n/templates/core.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 admin account" +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 "" +"ownCloud is a personal cloud which runs " +"on your own server.

    " +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 "" diff --git a/l10n/templates/files.pot b/l10n/templates/files.pot new file mode 100644 index 0000000000..271ca0fcb4 --- /dev/null +++ b/l10n/templates/files.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/l10n/templates/help.pot b/l10n/templates/help.pot new file mode 100644 index 0000000000..0e24e1c965 --- /dev/null +++ b/l10n/templates/help.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/l10n/templates/settings.pot b/l10n/templates/settings.pot new file mode 100644 index 0000000000..dc438e488c --- /dev/null +++ b/l10n/templates/settings.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/lib/app.php b/lib/app.php index f1363c8af5..411c08cbe5 100644 --- a/lib/app.php +++ b/lib/app.php @@ -199,14 +199,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); diff --git a/settings/templates/index.php b/settings/templates/index.php index 0b5a14626f..48c3f54201 100644 --- a/settings/templates/index.php +++ b/settings/templates/index.php @@ -14,7 +14,7 @@ - + From cdf91b6b3e0f6d9fc435497b9dcc051ff24d6c7e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 10 Aug 2011 12:20:43 +0200 Subject: [PATCH 18/28] work in new app management --- admin/apps.php | 85 +++++--------------------- admin/css/apps.css | 17 +----- admin/js/apps.js | 55 +++++++++++------ admin/templates/app.php | 22 ------- admin/templates/app_noconn.php | 1 - admin/templates/apps.php | 36 ++++++----- admin/templates/appsinst.php | 7 --- apps/files_textviewer/appinfo/info.xml | 2 +- core/css/styles.css | 1 + lib/app.php | 17 +++++- lib/base.php | 3 +- 11 files changed, 92 insertions(+), 154 deletions(-) delete mode 100644 admin/templates/app.php delete mode 100644 admin/templates/app_noconn.php delete mode 100644 admin/templates/appsinst.php diff --git a/admin/apps.php b/admin/apps.php index de11dccc3d..83a48b6524 100644 --- a/admin/apps.php +++ b/admin/apps.php @@ -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; - } - - $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" ); - - $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( "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); - - } +$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; } +$categories=OC_OCSClient::getCategories(); +// print_r($categories); + +$tmpl = new OC_Template( "admin", "apps", "user" ); +$tmpl->assign('apps',$apps); + +$tmpl->printPage(); + ?> diff --git a/admin/css/apps.css b/admin/css/apps.css index 92ab64df55..6106ff3f7e 100644 --- a/admin/css/apps.css +++ b/admin/css/apps.css @@ -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} diff --git a/admin/js/apps.js b/admin/js/apps.js index 4def5ed555..069681e1cd 100644 --- a/admin/js/apps.js +++ b/admin/js/apps.js @@ -1,17 +1,38 @@ -$("input[x-use='appenablebutton']").live( "click", function(){ - appid = $(this).parent().data("uid"); - - //alert("dsfsdfsdf"); - if($(this).val() == "enabled"){ - $(this).attr("value","disabled"); - $(this).removeClass( "enabled" ); - $(this).addClass( "disabled" ); - $.post( "ajax/disableapp.php", 'appid='+appid); - } - else if($(this).val() == "disabled"){ - $(this).attr("value","enabled"); - $(this).removeClass( "disabled" ); - $(this).addClass( "enabled" ); - $.post( "ajax/enableapp.php", 'appid='+appid); - } -}); \ No newline at end of file +$(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); + + $('#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'); + } + 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; + } + }); +}); diff --git a/admin/templates/app.php b/admin/templates/app.php deleted file mode 100644 index 06896121d0..0000000000 --- a/admin/templates/app.php +++ /dev/null @@ -1,22 +0,0 @@ - -

    -'.$app['typename'].'
    '); ?>
    -l('datetime', $app["changed"]); ?>
    - - - - - - - - -
    - "") { echo('
    '); } ?> - "") { echo('
    '); } ?> - "") { echo('
    '); } ?> -
    - -
    - '.$l->t( 'read more' ).'
    '); ?> -
    t( 'Install' ); ?>
    - diff --git a/admin/templates/app_noconn.php b/admin/templates/app_noconn.php deleted file mode 100644 index f22d365628..0000000000 --- a/admin/templates/app_noconn.php +++ /dev/null @@ -1 +0,0 @@ -

    t( 'Cannot connect to apps repository' ); ?>

    diff --git a/admin/templates/apps.php b/admin/templates/apps.php index 732326f659..a7f0a4a79e 100644 --- a/admin/templates/apps.php +++ b/admin/templates/apps.php @@ -1,19 +1,17 @@ - - - - - - - - - - - - - - - - - -
    t( 'Name' ); ?>t( 'Modified' ); ?>
    "") { echo(''); } ?> " title="">
    '.$app['typename'].''); ?>
    l('datetime', $app["changed"]); ?>
    - +
      + +
    • data-id=""> + + +
    • + +
    +
    +

    t('Select an App');?>

    +

    + + + +
    diff --git a/admin/templates/appsinst.php b/admin/templates/appsinst.php deleted file mode 100644 index 035a75c9e8..0000000000 --- a/admin/templates/appsinst.php +++ /dev/null @@ -1,7 +0,0 @@ -
      - -
    • by - -
    • - -
    diff --git a/apps/files_textviewer/appinfo/info.xml b/apps/files_textviewer/appinfo/info.xml index 112a416c35..209b414034 100644 --- a/apps/files_textviewer/appinfo/info.xml +++ b/apps/files_textviewer/appinfo/info.xml @@ -4,6 +4,6 @@ Text viewer 0.3 AGPL - Icewind + Robin Appelman 2 diff --git a/core/css/styles.css b/core/css/styles.css index da64adbd14..2b94dbe5e2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -104,3 +104,4 @@ legend { padding:.2em; font-size:1.2em; } #quota_indicator div { background-color:#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; } +.hidden{display:none} \ No newline at end of file diff --git a/lib/app.php b/lib/app.php index 411c08cbe5..9c7b7e75dc 100644 --- a/lib/app.php +++ b/lib/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; } @@ -242,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(); } @@ -332,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; + } } diff --git a/lib/base.php b/lib/base.php index f59e375e76..93b8e0b584 100644 --- a/lib/base.php +++ b/lib/base.php @@ -90,7 +90,8 @@ 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; From 1f1498ceca51c5b30130b80a59c00c1b37dc7009 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 10 Aug 2011 12:36:32 +0200 Subject: [PATCH 19/28] remove Log completely --- lib/app.php | 2 +- lib/files.php | 2 - lib/log.php | 151 ---------------------------------------- lib/ocs.php | 28 +------- lib/user.php | 2 - log/appinfo/app.php | 6 -- log/img/logs.png | Bin 213 -> 0 bytes log/index.php | 107 ---------------------------- log/js/log.js | 25 ------- log/l10n/bg_BG.php | 14 ---- log/l10n/da.php | 14 ---- log/l10n/de.php | 14 ---- log/l10n/es.php | 14 ---- log/l10n/fr.php | 14 ---- log/l10n/nl.php | 14 ---- log/l10n/pl.php | 14 ---- log/templates/index.php | 53 -------------- 17 files changed, 2 insertions(+), 472 deletions(-) delete mode 100644 lib/log.php delete mode 100644 log/appinfo/app.php delete mode 100644 log/img/logs.png delete mode 100644 log/index.php delete mode 100644 log/js/log.js delete mode 100644 log/l10n/bg_BG.php delete mode 100644 log/l10n/da.php delete mode 100644 log/l10n/de.php delete mode 100644 log/l10n/es.php delete mode 100644 log/l10n/fr.php delete mode 100644 log/l10n/nl.php delete mode 100644 log/l10n/pl.php delete mode 100644 log/templates/index.php diff --git a/lib/app.php b/lib/app.php index 9c7b7e75dc..6a2e307859 100644 --- a/lib/app.php +++ b/lib/app.php @@ -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' ); } diff --git a/lib/files.php b/lib/files.php index d189a96fd8..eec1007de1 100644 --- a/lib/files.php +++ b/lib/files.php @@ -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; diff --git a/lib/log.php b/lib/log.php deleted file mode 100644 index 1ed8e0e33c..0000000000 --- a/lib/log.php +++ /dev/null @@ -1,151 +0,0 @@ -. - * - */ -/* - * - * 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().'"
    '; - $entry .= 'Offending command was: '.$query.'
    '; - 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 momentexecute($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 momentexecute(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; - } -} diff --git a/lib/ocs.php b/lib/ocs.php index bcacfe704c..536ee754e8 100644 --- a/lib/ocs.php +++ b/lib/ocs.php @@ -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); diff --git a/lib/user.php b/lib/user.php index 9b8f5fb13e..a2ede8234b 100644 --- a/lib/user.php +++ b/lib/user.php @@ -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; } diff --git a/log/appinfo/app.php b/log/appinfo/app.php deleted file mode 100644 index a3aa19d528..0000000000 --- a/log/appinfo/app.php +++ /dev/null @@ -1,6 +0,0 @@ - 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" ))); - -*/ ?> diff --git a/log/img/logs.png b/log/img/logs.png deleted file mode 100644 index c3fad71133a3de35266b1c28328212cde86f09cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjr0prDM{GXIaZK%pd07sn8b)5!@EpBeOIwlR3R`njxgN@xNA Dd5uxd diff --git a/log/index.php b/log/index.php deleted file mode 100644 index a4fbc36470..0000000000 --- a/log/index.php +++ /dev/null @@ -1,107 +0,0 @@ -. -* -*/ - -//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(); - -*/ ?> diff --git a/log/js/log.js b/log/js/log.js deleted file mode 100644 index 42ae1b4c85..0000000000 --- a/log/js/log.js +++ /dev/null @@ -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', - }); -}); - diff --git a/log/l10n/bg_BG.php b/log/l10n/bg_BG.php deleted file mode 100644 index 407b447905..0000000000 --- a/log/l10n/bg_BG.php +++ /dev/null @@ -1,14 +0,0 @@ - "Филтър:", -"Logins" => "Влизания:", -"Logouts" => "Изходи:", -"Downloads" => "Тегления", -"Uploads" => "Качвания", -"Creations" => "Създавания:", -"Deletions" => "Изтривания:", -"Show:" => "Показва:", -"entries per page." => "записа на страница.", -"What" => "Какво", -"When" => "Кога", -"Clear log entries before" => "Изчисти записите от журналите" -); diff --git a/log/l10n/da.php b/log/l10n/da.php deleted file mode 100644 index 8fbfae67a6..0000000000 --- a/log/l10n/da.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/l10n/de.php b/log/l10n/de.php deleted file mode 100644 index 9cf804d6cf..0000000000 --- a/log/l10n/de.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/l10n/es.php b/log/l10n/es.php deleted file mode 100644 index 4a640871b8..0000000000 --- a/log/l10n/es.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/l10n/fr.php b/log/l10n/fr.php deleted file mode 100644 index d411a0e159..0000000000 --- a/log/l10n/fr.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/l10n/nl.php b/log/l10n/nl.php deleted file mode 100644 index f381619b5f..0000000000 --- a/log/l10n/nl.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/l10n/pl.php b/log/l10n/pl.php deleted file mode 100644 index 322e5df1ad..0000000000 --- a/log/l10n/pl.php +++ /dev/null @@ -1,14 +0,0 @@ - "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" -); diff --git a/log/templates/index.php b/log/templates/index.php deleted file mode 100644 index 863ac73fdb..0000000000 --- a/log/templates/index.php +++ /dev/null @@ -1,53 +0,0 @@ - -
    -

    - t( 'Filter:' ); ?> - - - name="login" id="logins" /> - name="logout" id="logouts" /> - name="read" id="downloads" /> - name="write" id="uploads" /> - name="create" id="creations" /> - name="delete" id="deletions" /> -

    -

    - t( 'Show:' ); ?> -  t( 'entries per page.' ); ?> - - -

    -
    -
    - - - - - - - - - - - - - - - - -
    t( 'What' ); ?>t( 'When' ); ?>
    "> l('datetime', $entry["date"] ); ?>
    - - - -
    -
    -

    - t( 'Clear log entries before' ); ?> - - - - -

    -
    -
    -*/ ?> From c4931cff3427a56deeeffe9bab536728593119d4 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 14:28:14 +0200 Subject: [PATCH 20/28] Delete addressbooks of deleted users --- apps/contacts/appinfo/app.php | 4 ++-- apps/contacts/lib/hooks.php | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 apps/contacts/lib/hooks.php diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index 7ff4726525..30aa0e1aaa 100644 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -1,7 +1,9 @@ 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' )); - -?> diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php new file mode 100644 index 0000000000..70f1fe1851 --- /dev/null +++ b/apps/contacts/lib/hooks.php @@ -0,0 +1,41 @@ +. + * + */ + +/** + * 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; + } +} From f633492dfcd2018907592ea93cdb3b56c04f4811 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 14:39:12 +0200 Subject: [PATCH 21/28] Update SabreDAV --- 3rdparty/Sabre/CardDAV/Card.php | 2 +- 3rdparty/Sabre/DAV/Browser/Plugin.php | 6 +++--- 3rdparty/Sabre/DAV/Server.php | 12 ++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/3rdparty/Sabre/CardDAV/Card.php b/3rdparty/Sabre/CardDAV/Card.php index 98189aa9fd..52d8b79d7d 100644 --- a/3rdparty/Sabre/CardDAV/Card.php +++ b/3rdparty/Sabre/CardDAV/Card.php @@ -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']) . '"'; } diff --git a/3rdparty/Sabre/DAV/Browser/Plugin.php b/3rdparty/Sabre/DAV/Browser/Plugin.php index 81a90558f9..8e0ca24cff 100644 --- a/3rdparty/Sabre/DAV/Browser/Plugin.php +++ b/3rdparty/Sabre/DAV/Browser/Plugin.php @@ -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.= '

    Create new folder

    - + Name:

    Upload file

    - + Name (optional):
    File:
    diff --git a/3rdparty/Sabre/DAV/Server.php b/3rdparty/Sabre/DAV/Server.php index e5e9e482fe..c6c63143d1 100644 --- a/3rdparty/Sabre/DAV/Server.php +++ b/3rdparty/Sabre/DAV/Server.php @@ -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 * From 6822a7a2158d0cc4688f030dd45a38c8c47b2d9b Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 14:27:23 +0200 Subject: [PATCH 22/28] better CSS, remove legacy --- core/css/styles.css | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 2b94dbe5e2..b604d19e5a 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -7,7 +7,7 @@ body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana /* 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 */ @@ -58,10 +58,10 @@ 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; } +#controls { width:100%; top:3.5em; height:3em; margin:0; background-color:#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; } #body-settings #content { padding:1em; } -#leftcontent { position:absolute; top:6.5em; width:50em; } +#leftcontent { position:absolute; top:6.5em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; } #rightcontent { position:absolute; top:6.5em; left:32em; } /* LOG IN & INSTALLATION ------------------------------------------------------------ */ @@ -88,13 +88,10 @@ legend { padding:.2em; font-size:1.2em; } #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 { 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 { 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 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; } #navigation #settings>span{padding-bottom:1em}; @@ -104,4 +101,4 @@ legend { padding:.2em; font-size:1.2em; } #quota_indicator div { background-color:#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; } -.hidden{display:none} \ No newline at end of file +.hidden{display:none} From f754d6dc5178901196db6ff51934c620f5405e80 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 15:10:32 +0200 Subject: [PATCH 23/28] lots of CSS details --- core/css/styles.css | 30 +++++++++++++++--------------- files/css/files.css | 2 +- files/templates/index.php | 4 +--- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index b604d19e5a..427187722a 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -24,7 +24,7 @@ h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercas 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; } +a, a img, a strong, a span, input, select, li { cursor:pointer; } /* INPUTS */ @@ -33,8 +33,8 @@ input, select { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; 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; } @@ -58,20 +58,20 @@ 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: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; } +#controls { width:100%; top:3.5em; height:2.9em; 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; } #body-settings #content { padding:1em; } #leftcontent { position:absolute; top:6.5em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; } -#rightcontent { position:absolute; top:6.5em; left:32em; } +#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 label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; } #login form label#directorylabel { display:block; margin:.95em 0 .8em -5.5em; } @@ -90,15 +90,15 @@ legend { padding:.2em; font-size:1.2em; } /* NAVIGATION ------------------------------------------------------------- */ #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 { 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 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 #settings { position:absolute; bottom:3.5em; width:100%; } #navigation #expand { margin:0 0 .2em 1.2em; cursor:pointer; } -#navigation #settings>span{padding-bottom:1em}; +#navigation #settings>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; } -.hidden{display:none} +li.error { list-style:none; 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; } diff --git a/files/css/files.css b/files/css/files.css index bfd96bc2ac..0ec1698bf3 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -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; } diff --git a/files/templates/index.php b/files/templates/index.php index 27af6665df..3951787a25 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -1,7 +1,5 @@
    - - - +
    From 3e3488139ecd112e192e977dc7b4e1d975c471a7 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 16:02:28 +0200 Subject: [PATCH 24/28] added CSS reset --- core/css/styles.css | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 427187722a..cd715a7701 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -2,7 +2,16 @@ 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; } @@ -21,10 +30,6 @@ 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, select, li { cursor:pointer; } /* INPUTS */ @@ -81,7 +86,7 @@ legend { padding:.2em; font-size:1.2em; } #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; } @@ -89,7 +94,7 @@ legend { padding:.2em; font-size:1.2em; } /* NAVIGATION ------------------------------------------------------------- */ #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 { list-style-type:none; border-top:1px solid #ccc; } +#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 #settings { position:absolute; bottom:3.5em; width:100%; } @@ -100,5 +105,5 @@ legend { padding:.2em; font-size:1.2em; } #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:#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; } +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; } From 338e350e0f3cc23bc99f7f90c5ee479ef077d706 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 16:05:13 +0200 Subject: [PATCH 25/28] removed settings padding --- core/css/styles.css | 1 - 1 file changed, 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index cd715a7701..445b434de3 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -65,7 +65,6 @@ legend { padding:.2em; font-size:1.2em; } /* CONTENT ------------------------------------------------------------------ */ #controls { width:100%; top:3.5em; height:2.9em; 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; } -#body-settings #content { padding:1em; } #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; } From 8ff736b571d7400ec64c6dd4737d096f8ff443b6 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 16:46:54 +0200 Subject: [PATCH 26/28] some app styling --- admin/templates/apps.php | 5 ++--- core/css/styles.css | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/admin/templates/apps.php b/admin/templates/apps.php index a7f0a4a79e..025fbc4c81 100644 --- a/admin/templates/apps.php +++ b/admin/templates/apps.php @@ -9,9 +9,8 @@
    -

    t('Select an App');?>

    +

    t('Select an App');?>

    - - +
    diff --git a/core/css/styles.css b/core/css/styles.css index 445b434de3..70179b050b 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -63,7 +63,7 @@ legend { padding:.2em; font-size:1.2em; } .template{display:none;} /* CONTENT ------------------------------------------------------------------ */ -#controls { width:100%; top:3.5em; height:2.9em; 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; } +#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; } From 613ab41eb3a5aedb872a18b231f26fd60f1b4356 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 10 Aug 2011 17:24:38 +0200 Subject: [PATCH 27/28] more work on the encryption library --- lib/crypt.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/lib/crypt.php b/lib/crypt.php index baa433f9dc..d75515cf2d 100755 --- a/lib/crypt.php +++ b/lib/crypt.php @@ -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 @@ -51,11 +72,56 @@ class OC_Crypt { * This function decrypts an content */ public static function decrypt( $content, $key) { - $bf = new Crypt_Blowfish($key); - return($bf->encrypt($contents)); + $bf = new Crypt_Blowfish($key); + return($bf->encrypt($contents)); } + /** + * @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); + } + From fbf86c6683da91c8cadad128e5ac7c0742aaffed Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 17:29:26 +0200 Subject: [PATCH 28/28] made sliding settings more awesome --- core/css/styles.css | 5 ++--- core/js/js.js | 12 +++++------- core/templates/layout.user.php | 3 +++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 70179b050b..9da216a80d 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -2,7 +2,6 @@ This file is licensed under the Affero General Public License version 3 or later. See the COPYING-README file. */ - 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; } @@ -97,8 +96,8 @@ legend { padding:.2em; font-size:1.2em; } #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 #settings { position:absolute; bottom:3.5em; width:100%; } -#navigation #expand { margin:0 0 .2em 1.2em; cursor:pointer; } -#navigation #settings>span { position:relative; bottom:.4em; left:.2em; font-size:1.2em; color:#666; text-shadow:#f8f8f8 0 1px 0; } +#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 #ccc; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; } diff --git a/core/js/js.js b/core/js/js.js index aef3ad1acc..f4756d97b2 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -266,14 +266,12 @@ $(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(); }); - $('#expand').hover(function(){ - $('#navigation #settings>span').fadeIn(); - },function(){ - $('#navigation #settings>span').fadeOut(); + $('#settings #expand').hover(function(){ + $('#settings #expand+span').fadeToggle(); }) }); diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 3b065ef6ed..f172e894e7 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -50,9 +50,11 @@ +