Merge branch 'master' into fullcalendar
This commit is contained in:
commit
e5a3ab8aad
|
@ -40,3 +40,6 @@ nbproject
|
||||||
|
|
||||||
# Mac OS
|
# Mac OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# WebFinger
|
||||||
|
.well-known
|
||||||
|
|
|
@ -4,8 +4,6 @@ php_value upload_max_filesize 512M
|
||||||
php_value post_max_size 512M
|
php_value post_max_size 512M
|
||||||
SetEnv htaccessWorking true
|
SetEnv htaccessWorking true
|
||||||
</IfModule>
|
</IfModule>
|
||||||
<IfModule !mod_php5.c>
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
||||||
</IfModule>
|
|
||||||
Options -Indexes
|
Options -Indexes
|
||||||
|
|
|
@ -71,6 +71,7 @@ include 'Sabre/DAV/IExtendedCollection.php';
|
||||||
/* Node abstract implementations */
|
/* Node abstract implementations */
|
||||||
include 'Sabre/DAV/Node.php';
|
include 'Sabre/DAV/Node.php';
|
||||||
include 'Sabre/DAV/File.php';
|
include 'Sabre/DAV/File.php';
|
||||||
|
include 'Sabre/DAV/Collection.php';
|
||||||
include 'Sabre/DAV/Directory.php';
|
include 'Sabre/DAV/Directory.php';
|
||||||
|
|
||||||
/* Utilities */
|
/* Utilities */
|
||||||
|
@ -124,4 +125,3 @@ include 'Sabre/DAV/Auth/Backend/PDO.php';
|
||||||
/* DavMount plugin */
|
/* DavMount plugin */
|
||||||
include 'Sabre/DAV/Mount/Plugin.php';
|
include 'Sabre/DAV/Mount/Plugin.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UserAddressBook class
|
* The AddressBook class represents a CardDAV addressbook, owned by a specific user
|
||||||
|
*
|
||||||
|
* The AddressBook can contain multiple vcards
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
|
@ -9,12 +11,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* The AddressBook class represents a CardDAV addressbook, owned by a specific user
|
|
||||||
*
|
|
||||||
* The AddressBook can contain multiple vcards
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_CardDAV_IAddressBook, Sabre_DAV_IProperties, Sabre_DAVACL_IACL {
|
class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_CardDAV_IAddressBook, Sabre_DAV_IProperties, Sabre_DAVACL_IACL {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Backend class
|
* Abstract Backend class
|
||||||
|
*
|
||||||
|
* This class serves as a base-class for addressbook backends
|
||||||
|
*
|
||||||
|
* Note that there are references to 'addressBookId' scattered throughout the
|
||||||
|
* class. The value of the addressBookId is completely up to you, it can be any
|
||||||
|
* arbitrary value you can use as an unique identifier.
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
|
@ -9,14 +15,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* This class serves as a base-class for addressbook backends
|
|
||||||
*
|
|
||||||
* Note that there are references to 'addressBookId' scattered throughout the
|
|
||||||
* class. The value of the addressBookId is completely up to you, it can be any
|
|
||||||
* arbitrary value you can use as an unique identifier.
|
|
||||||
*/
|
|
||||||
abstract class Sabre_CardDAV_Backend_Abstract {
|
abstract class Sabre_CardDAV_Backend_Abstract {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDO CardDAV backend
|
* PDO CardDAV backend
|
||||||
|
*
|
||||||
|
* This CardDAV backend uses PDO to store addressbooks
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
|
@ -9,10 +11,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* This CardDAV backend uses PDO to store addressbooks
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract {
|
class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Card class
|
* The Card object represents a single Card from an addressbook
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*
|
*/
|
||||||
/
|
|
||||||
/**
|
|
||||||
* The Card object represents a single Card from an addressbook
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard, Sabre_DAVACL_IACL {
|
class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard, Sabre_DAVACL_IACL {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,18 +2,16 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Card interface
|
* Card interface
|
||||||
|
*
|
||||||
|
* Extend the ICard interface to allow your custom nodes to be picked up as
|
||||||
|
* 'Cards'.
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*
|
*/
|
||||||
/
|
|
||||||
/**
|
|
||||||
* Extend the ICard interface to allow your custom nodes to be picked up as
|
|
||||||
* 'Cards'.
|
|
||||||
*/
|
|
||||||
interface Sabre_CardDAV_ICard extends Sabre_DAV_IFile {
|
interface Sabre_CardDAV_ICard extends Sabre_DAV_IFile {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CardDAV plugin
|
* CardDAV plugin
|
||||||
|
*
|
||||||
|
* The CardDAV plugin adds CardDAV functionality to the WebDAV server
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
|
@ -9,11 +11,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The CardDAV plugin adds CardDAV functionality to the WebDAV server
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
|
class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,17 +2,15 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UserAddressBooks class
|
* UserAddressBooks class
|
||||||
*
|
*
|
||||||
|
* The UserAddressBooks collection contains a list of addressbooks associated with a user
|
||||||
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* The UserAddressBooks collection contains a list of addressbooks associated with a user
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_UserAddressBooks extends Sabre_DAV_Collection implements Sabre_DAV_IExtendedCollection, Sabre_DAVACL_IACL {
|
class Sabre_CardDAV_UserAddressBooks extends Sabre_DAV_Collection implements Sabre_DAV_IExtendedCollection, Sabre_DAVACL_IACL {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version Class
|
* Version Class
|
||||||
|
*
|
||||||
|
* This class contains the Sabre_CardDAV version information
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage CardDAV
|
* @subpackage CardDAV
|
||||||
|
@ -9,10 +11,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* This class contains the Sabre_CardDAV version information
|
|
||||||
*/
|
|
||||||
class Sabre_CardDAV_Version {
|
class Sabre_CardDAV_Version {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -88,7 +88,7 @@ class Sabre_DAV_Browser_GuessContentType extends Sabre_DAV_ServerPlugin {
|
||||||
protected function getContentType($fileName) {
|
protected function getContentType($fileName) {
|
||||||
|
|
||||||
// Just grabbing the extension
|
// Just grabbing the extension
|
||||||
$extension = substr($fileName,strrpos($fileName,'.')+1);
|
$extension = strtolower(substr($fileName,strrpos($fileName,'.')+1));
|
||||||
if (isset($this->extensionMap[$extension]))
|
if (isset($this->extensionMap[$extension]))
|
||||||
return $this->extensionMap[$extension];
|
return $this->extensionMap[$extension];
|
||||||
|
|
||||||
|
|
|
@ -821,7 +821,7 @@ class Sabre_DAV_Server {
|
||||||
|
|
||||||
$node->put($body);
|
$node->put($body);
|
||||||
$this->httpResponse->setHeader('Content-Length','0');
|
$this->httpResponse->setHeader('Content-Length','0');
|
||||||
$this->httpResponse->sendStatus(200);
|
$this->httpResponse->sendStatus(204);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_DAV_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.5.3';
|
const VERSION = '1.5.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NeedPrivileges
|
* NeedPrivileges
|
||||||
|
*
|
||||||
|
* The 403-need privileges is thrown when a user didn't have the appropriate
|
||||||
|
* permissions to perform an operation
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage DAVACL
|
* @subpackage DAVACL
|
||||||
|
@ -10,13 +13,6 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* NeedPrivileges
|
|
||||||
*
|
|
||||||
* The 403-need privileges is thrown when a user didn't have the appropriate
|
|
||||||
* permissions to perform an operation
|
|
||||||
*/
|
|
||||||
class Sabre_DAVACL_Exception_NeedPrivileges extends Sabre_DAV_Exception_Forbidden {
|
class Sabre_DAVACL_Exception_NeedPrivileges extends Sabre_DAV_Exception_Forbidden {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* The users are instances of Sabre_DAV_Auth_Principal
|
* The users are instances of Sabre_DAV_Auth_Principal
|
||||||
*
|
*
|
||||||
* @package Sabre
|
* @package Sabre
|
||||||
* @subpackage DAV
|
* @subpackage DAVACL
|
||||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||||
|
|
|
@ -83,13 +83,16 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
|
||||||
if (!is_null($itemValue)) {
|
if (!is_null($itemValue)) {
|
||||||
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
||||||
}
|
}
|
||||||
|
$item->parent = $this;
|
||||||
$this->children[] = $item;
|
$this->children[] = $item;
|
||||||
} elseif(is_string($item)) {
|
} elseif(is_string($item)) {
|
||||||
|
|
||||||
if (!is_scalar($itemValue)) {
|
if (!is_scalar($itemValue)) {
|
||||||
throw new InvalidArgumentException('The second argument must be scalar');
|
throw new InvalidArgumentException('The second argument must be scalar');
|
||||||
}
|
}
|
||||||
$this->children[] = new Sabre_VObject_Property($item,$itemValue);
|
$item = new Sabre_VObject_Property($item,$itemValue);
|
||||||
|
$item->parent = $this;
|
||||||
|
$this->children[] = $item;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -208,16 +211,19 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
|
||||||
$overWrite = count($matches)?key($matches):null;
|
$overWrite = count($matches)?key($matches):null;
|
||||||
|
|
||||||
if ($value instanceof Sabre_VObject_Component || $value instanceof Sabre_VObject_Property) {
|
if ($value instanceof Sabre_VObject_Component || $value instanceof Sabre_VObject_Property) {
|
||||||
|
$value->parent = $this;
|
||||||
if (!is_null($overWrite)) {
|
if (!is_null($overWrite)) {
|
||||||
$this->children[$overWrite] = $value;
|
$this->children[$overWrite] = $value;
|
||||||
} else {
|
} else {
|
||||||
$this->children[] = $value;
|
$this->children[] = $value;
|
||||||
}
|
}
|
||||||
} elseif (is_scalar($value)) {
|
} elseif (is_scalar($value)) {
|
||||||
|
$property = new Sabre_VObject_Property($name,$value);
|
||||||
|
$property->parent = $this;
|
||||||
if (!is_null($overWrite)) {
|
if (!is_null($overWrite)) {
|
||||||
$this->children[$overWrite] = new Sabre_VObject_Property($name,$value);
|
$this->children[$overWrite] = $property;
|
||||||
} else {
|
} else {
|
||||||
$this->children[] = new Sabre_VObject_Property($name,$value);
|
$this->children[] = $property;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('You must pass a Sabre_VObject_Component, Sabre_VObject_Property or scalar type');
|
throw new InvalidArgumentException('You must pass a Sabre_VObject_Component, Sabre_VObject_Property or scalar type');
|
||||||
|
@ -237,6 +243,7 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
|
||||||
foreach($matches as $k=>$child) {
|
foreach($matches as $k=>$child) {
|
||||||
|
|
||||||
unset($this->children[$k]);
|
unset($this->children[$k]);
|
||||||
|
$child->parent = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
$this->setValue($dt->format('Ymd\\THis'));
|
$this->setValue($dt->format('Ymd\\THis'));
|
||||||
$this->offsetUnset('VALUE');
|
$this->offsetUnset('VALUE');
|
||||||
$this->offsetUnset('TZID');
|
$this->offsetUnset('TZID');
|
||||||
$this->offsetSet('VALUE','DATE-TIME');
|
$this->offsetSet('VALUE','DATE-TIME');
|
||||||
break;
|
break;
|
||||||
case self::UTC :
|
case self::UTC :
|
||||||
$dt->setTimeZone(new DateTimeZone('UTC'));
|
$dt->setTimeZone(new DateTimeZone('UTC'));
|
||||||
|
@ -116,7 +116,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
list(
|
list(
|
||||||
$this->dateType,
|
$this->dateType,
|
||||||
$this->dateTime
|
$this->dateTime
|
||||||
) = self::parseData($this->value, $this->offsetGet('TZID'));
|
) = self::parseData($this->value, $this);
|
||||||
return $this->dateTime;
|
return $this->dateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
list(
|
list(
|
||||||
$this->dateType,
|
$this->dateType,
|
||||||
$this->dateTime,
|
$this->dateTime,
|
||||||
) = self::parseData($this->value, $this->offsetGet('TZID'));
|
) = self::parseData($this->value, $this);
|
||||||
return $this->dateType;
|
return $this->dateType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -151,12 +151,12 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
* 2. A DateTime object (or null)
|
* 2. A DateTime object (or null)
|
||||||
*
|
*
|
||||||
* @param string|null $propertyValue The string to parse (yymmdd or
|
* @param string|null $propertyValue The string to parse (yymmdd or
|
||||||
* ymmddThhmmss, etc..)
|
* ymmddThhmmss, etc..)
|
||||||
* @param string|null $tzid The value of the 'TZID' property.
|
* @param Sabre_VObject_Property|null $property The instance of the
|
||||||
|
* property we're parsing.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
static public function parseData($propertyValue, $tzid) {
|
static public function parseData($propertyValue, Sabre_VObject_Property $property = null) {
|
||||||
|
|
||||||
|
|
||||||
if (is_null($propertyValue)) {
|
if (is_null($propertyValue)) {
|
||||||
return array(null, null);
|
return array(null, null);
|
||||||
|
@ -195,6 +195,8 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finding the timezone.
|
||||||
|
$tzid = $property['TZID'];
|
||||||
if (!$tzid) {
|
if (!$tzid) {
|
||||||
return array(
|
return array(
|
||||||
self::LOCAL,
|
self::LOCAL,
|
||||||
|
@ -202,7 +204,32 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tz = new DateTimeZone($tzid->value);
|
try {
|
||||||
|
$tz = new DateTimeZone($tzid->value);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// The id was invalid, we're going to try to find the information
|
||||||
|
// through the VTIMEZONE object.
|
||||||
|
|
||||||
|
// First we find the root object
|
||||||
|
$root = $property;
|
||||||
|
while($root->parent) {
|
||||||
|
$root = $root->parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($root->VTIMEZONE)) {
|
||||||
|
foreach($root->VTIMEZONE as $vtimezone) {
|
||||||
|
if (((string)$vtimezone->TZID) == $tzid) {
|
||||||
|
if (isset($vtimezone->{'X-LIC-LOCATION'})) {
|
||||||
|
$tzid = (string)$vtimezone->{'X-LIC-LOCATION'};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$tz = new DateTimeZone($tzid);
|
||||||
|
|
||||||
|
}
|
||||||
$dt = new DateTime($dateStr, $tz);
|
$dt = new DateTime($dateStr, $tz);
|
||||||
$dt->setTimeZone($tz);
|
$dt->setTimeZone($tz);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
||||||
$val[] = $i->format('Ymd\\THis');
|
$val[] = $i->format('Ymd\\THis');
|
||||||
}
|
}
|
||||||
$this->setValue(implode(',',$val));
|
$this->setValue(implode(',',$val));
|
||||||
$this->offsetSet('VALUE','DATE-TIME');
|
$this->offsetSet('VALUE','DATE-TIME');
|
||||||
break;
|
break;
|
||||||
case Sabre_VObject_Element_DateTime::UTC :
|
case Sabre_VObject_Element_DateTime::UTC :
|
||||||
$val = array();
|
$val = array();
|
||||||
|
@ -121,7 +121,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
||||||
list(
|
list(
|
||||||
$type,
|
$type,
|
||||||
$dt
|
$dt
|
||||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
|
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
|
||||||
$dts[] = $dt;
|
$dts[] = $dt;
|
||||||
$this->dateType = $type;
|
$this->dateType = $type;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
||||||
list(
|
list(
|
||||||
$type,
|
$type,
|
||||||
$dt
|
$dt
|
||||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
|
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
|
||||||
$dts[] = $dt;
|
$dts[] = $dt;
|
||||||
$this->dateType = $type;
|
$this->dateType = $type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,13 @@ abstract class Sabre_VObject_Node implements IteratorAggregate, ArrayAccess, Cou
|
||||||
*/
|
*/
|
||||||
protected $iterator = null;
|
protected $iterator = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A link to the parent node
|
||||||
|
*
|
||||||
|
* @var Sabre_VObject_Node
|
||||||
|
*/
|
||||||
|
protected $parent = null;
|
||||||
|
|
||||||
/* {{{ IteratorAggregator interface */
|
/* {{{ IteratorAggregator interface */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -149,13 +149,16 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
|
||||||
if (!is_null($itemValue)) {
|
if (!is_null($itemValue)) {
|
||||||
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
||||||
}
|
}
|
||||||
|
$item->parent = $this;
|
||||||
$this->parameters[] = $item;
|
$this->parameters[] = $item;
|
||||||
} elseif(is_string($item)) {
|
} elseif(is_string($item)) {
|
||||||
|
|
||||||
if (!is_scalar($itemValue)) {
|
if (!is_scalar($itemValue)) {
|
||||||
throw new InvalidArgumentException('The second argument must be scalar');
|
throw new InvalidArgumentException('The second argument must be scalar');
|
||||||
}
|
}
|
||||||
$this->parameters[] = new Sabre_VObject_Parameter($item,$itemValue);
|
$parameter = new Sabre_VObject_Parameter($item,$itemValue);
|
||||||
|
$parameter->parent = $this;
|
||||||
|
$this->parameters[] = $parameter;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -231,12 +234,15 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
|
||||||
throw new InvalidArgumentException('A parameter name must be specified. This means you cannot use the $array[]="string" to add parameters.');
|
throw new InvalidArgumentException('A parameter name must be specified. This means you cannot use the $array[]="string" to add parameters.');
|
||||||
|
|
||||||
$this->offsetUnset($name);
|
$this->offsetUnset($name);
|
||||||
$this->parameters[] = new Sabre_VObject_Parameter($name, $value);
|
$parameter = new Sabre_VObject_Parameter($name, $value);
|
||||||
|
$parameter->parent = $this;
|
||||||
|
$this->parameters[] = $parameter;
|
||||||
|
|
||||||
} elseif ($value instanceof Sabre_VObject_Parameter) {
|
} elseif ($value instanceof Sabre_VObject_Parameter) {
|
||||||
if (!is_null($name))
|
if (!is_null($name))
|
||||||
throw new InvalidArgumentException('Don\'t specify a parameter name if you\'re passing a Sabre_VObject_Parameter. Add using $array[]=$parameterObject.');
|
throw new InvalidArgumentException('Don\'t specify a parameter name if you\'re passing a Sabre_VObject_Parameter. Add using $array[]=$parameterObject.');
|
||||||
|
|
||||||
|
$value->parent = $this;
|
||||||
$this->parameters[] = $value;
|
$this->parameters[] = $value;
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('You can only add parameters to the property object');
|
throw new InvalidArgumentException('You can only add parameters to the property object');
|
||||||
|
@ -258,6 +264,7 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach($this->parameters as $key=>$parameter) {
|
foreach($this->parameters as $key=>$parameter) {
|
||||||
if ($parameter->name == $name) {
|
if ($parameter->name == $name) {
|
||||||
|
$parameter->parent = null;
|
||||||
unset($this->parameters[$key]);
|
unset($this->parameters[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Sabre_VObject_Reader {
|
||||||
|
|
||||||
while(stripos($nextLine,"END:")!==0) {
|
while(stripos($nextLine,"END:")!==0) {
|
||||||
|
|
||||||
$obj->children[] = self::readLine($lines);
|
$obj->add(self::readLine($lines));
|
||||||
$nextLine = current($lines);
|
$nextLine = current($lines);
|
||||||
|
|
||||||
if ($nextLine===false)
|
if ($nextLine===false)
|
||||||
|
@ -140,7 +140,9 @@ class Sabre_VObject_Reader {
|
||||||
|
|
||||||
if ($matches['parameters']) {
|
if ($matches['parameters']) {
|
||||||
|
|
||||||
$obj->parameters = self::readParameters($matches['parameters']);
|
foreach(self::readParameters($matches['parameters']) as $param) {
|
||||||
|
$obj->add($param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_VObject_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.2.2';
|
const VERSION = '1.2.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
$l=new OC_L10N('admin_dependencies_chk');
|
||||||
|
|
||||||
|
OC_App::register( array(
|
||||||
|
'order' => 14,
|
||||||
|
'id' => 'admin_dependencies_chk',
|
||||||
|
'name' => 'Owncloud Install Info' ));
|
||||||
|
|
||||||
|
OC_APP::registerAdmin('admin_dependencies_chk','settings');
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<info>
|
||||||
|
<id>admin_dependencies_chk</id>
|
||||||
|
<name>Owncloud dependencies info</name>
|
||||||
|
<version>0.01</version>
|
||||||
|
<licence>AGPL</licence>
|
||||||
|
<author>Brice Maron (eMerzh)</author>
|
||||||
|
<require>2</require>
|
||||||
|
<description>Display OwnCloud's dependencies informations (missings modules, ...)</description>
|
||||||
|
<default_enable/>
|
||||||
|
</info>
|
|
@ -0,0 +1,9 @@
|
||||||
|
#status_list legend { font-weight: bold; color: #888888; }
|
||||||
|
.state > li { margin-bottom: 3px; padding-left: 0.5em; list-style-type: circle; }
|
||||||
|
.state .state_module { font-weight:bold; text-shadow: 0 1px 0 #DDD; cursor:help;}
|
||||||
|
|
||||||
|
.state_used ul, .state_used li { display:inline; }
|
||||||
|
|
||||||
|
.state_ok .state_module { color: #009700; }
|
||||||
|
.state_warning .state_module { color: #FF9B29; }
|
||||||
|
.state_error .state_module { color: #FF3B3B; }
|
|
@ -0,0 +1,96 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ownCloud - user_ldap
|
||||||
|
*
|
||||||
|
* @author Brice Maron
|
||||||
|
* @copyright 2011 Brice Maron brice __from__ bmaron _DOT_ net
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 3 of the License, or any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$l=new OC_L10N('admin_dependencies_chk');
|
||||||
|
$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings');
|
||||||
|
|
||||||
|
$modules = array();
|
||||||
|
|
||||||
|
//Possible status are : ok, error, warning
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => function_exists('json_encode') ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-json',
|
||||||
|
'modules'=> array('core'),
|
||||||
|
'message'=> $l->t('The php-json module is needed by the many applications for inter communications'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => function_exists('curl_init') ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-curl',
|
||||||
|
'modules'=> array('bookmarks'),
|
||||||
|
'message'=> $l->t('The php-curl modude is needed to fetch the page title when adding a bookmarks'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => function_exists('imagepng') ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-gd',
|
||||||
|
'modules'=> array('gallery'),
|
||||||
|
'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
|
||||||
|
'part'=> 'mp3info',
|
||||||
|
'modules'=> array('media'),
|
||||||
|
'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => OC_Helper::canExecute("ldap_bind") ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-ldap',
|
||||||
|
'modules'=> array('user_ldap'),
|
||||||
|
'message'=> $l->t('The php-ldap module is needed connect to your ldap server'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => class_exists('ZipArchive') ? 'ok' : 'warning',
|
||||||
|
'part'=> 'php-zip',
|
||||||
|
'modules'=> array('admin_export','core'),
|
||||||
|
'message'=> $l->t('The php-zip module is needed download multiple files at once'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => function_exists('mb_detect_encoding') ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-mb_multibyte ',
|
||||||
|
'modules'=> array('core'),
|
||||||
|
'message'=> $l->t('The php-mb_multibyte module is needed to manage correctly the encoding.'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => function_exists('ctype_digit') ? 'ok' : 'error',
|
||||||
|
'part'=> 'php-ctype',
|
||||||
|
'modules'=> array('core'),
|
||||||
|
'message'=> $l->t('The php-ctype module is needed validate data.'));
|
||||||
|
|
||||||
|
$modules[] =array(
|
||||||
|
'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
|
||||||
|
'part'=> 'allow_url_fopen',
|
||||||
|
'modules'=> array('core'),
|
||||||
|
'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
|
||||||
|
|
||||||
|
foreach($modules as $key => $module) {
|
||||||
|
$enabled = false ;
|
||||||
|
foreach($module['modules'] as $app) {
|
||||||
|
if(OC_App::isEnabled($app) || $app=='core'){
|
||||||
|
$enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($enabled == false) unset($modules[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
OC_UTIL::addStyle('admin_dependencies_chk', 'style');
|
||||||
|
$tmpl->assign( 'items', $modules );
|
||||||
|
|
||||||
|
return $tmpl->fetchPage();
|
|
@ -0,0 +1,16 @@
|
||||||
|
<fieldset id="status_list" class="personalblock">
|
||||||
|
<legend><?php echo $l->t('Dependencies status');?></legend>
|
||||||
|
<ul class="state">
|
||||||
|
<?php foreach($_['items'] as $item):?>
|
||||||
|
<li class="state_<?php echo $item['status'];?>">
|
||||||
|
<span class="state_module" title="<?php echo $item['message'];?>"><?php echo $item['part'];?></span>
|
||||||
|
<div class="state_used"><?php echo $l->t('Used by :');?>
|
||||||
|
<ul>
|
||||||
|
<?php foreach($item['modules'] as $module):?>
|
||||||
|
<li><?php echo $module;?></li>
|
||||||
|
<?php endforeach;?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<?php endforeach;?>
|
||||||
|
</ul>
|
||||||
|
</fieldset>
|
|
@ -54,13 +54,7 @@ $params=array(
|
||||||
);
|
);
|
||||||
$query->execute($params);
|
$query->execute($params);
|
||||||
|
|
||||||
if($CONFIG_DBTYPE == 'pgsql')
|
$b_id = OC_DB::insertid('*PREFIX*bookmarks');
|
||||||
{
|
|
||||||
$query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')");
|
|
||||||
$b_id = $query->execute()->fetchOne();
|
|
||||||
} else {
|
|
||||||
$b_id = OC_DB::insertid();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if($b_id !== false) {
|
if($b_id !== false) {
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
|
|
||||||
$tmpl = new OC_Template( 'bookmarks', 'settings');
|
$tmpl = new OC_Template( 'bookmarks', 'settings');
|
||||||
|
|
||||||
OC_Util::addScript('bookmarks','settings');
|
//OC_Util::addScript('bookmarks','settings');
|
||||||
|
|
||||||
return $tmpl->fetchPage();
|
return $tmpl->fetchPage();
|
||||||
|
|
|
@ -111,7 +111,7 @@ class OC_Calendar_Calendar{
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
|
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*calendar_calendar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +131,7 @@ class OC_Calendar_Calendar{
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
|
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*calendar_calendars');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -106,7 +106,7 @@ class OC_Calendar_Object{
|
||||||
|
|
||||||
OC_Calendar_Calendar::touchCalendar($id);
|
OC_Calendar_Calendar::touchCalendar($id);
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*calendar_objects');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,7 +125,7 @@ class OC_Calendar_Object{
|
||||||
|
|
||||||
OC_Calendar_Calendar::touchCalendar($id);
|
OC_Calendar_Calendar::touchCalendar($id);
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*calendar_objects');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,9 +13,7 @@
|
||||||
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
||||||
<?php
|
<?php
|
||||||
if (!isset($_['categories'])) {$_['categories'] = array();}
|
if (!isset($_['categories'])) {$_['categories'] = array();}
|
||||||
foreach($_['category_options'] as $category){
|
echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true));
|
||||||
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select></td>
|
</select></td>
|
||||||
<th width="75px"> <?php echo $l->t("Calendar");?>:</th>
|
<th width="75px"> <?php echo $l->t("Calendar");?>:</th>
|
||||||
|
@ -23,9 +21,7 @@
|
||||||
<select style="width:140px;" name="calendar">
|
<select style="width:140px;" name="calendar">
|
||||||
<?php
|
<?php
|
||||||
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
||||||
foreach($_['calendar_options'] as $calendar){
|
echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
|
||||||
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select></td>
|
</select></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -66,9 +62,7 @@
|
||||||
<select name="repeat" style="width:350px;">
|
<select name="repeat" style="width:350px;">
|
||||||
<?php
|
<?php
|
||||||
if (isset($_['repeat_options'])) {
|
if (isset($_['repeat_options'])) {
|
||||||
foreach($_['repeat_options'] as $id => $label){
|
echo html_select_options($_['repeat_options'], $_['repeat']);
|
||||||
echo '<option value="' . $id . '"' . ($_['repeat'] == $id ? ' selected="selected"' : '') . '>' . $label . '</option>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select></td>
|
</select></td>
|
||||||
|
|
|
@ -51,10 +51,22 @@ if(is_null($vcard)){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$property_types = array(
|
||||||
|
'ADR' => $l10n->t('Address'),
|
||||||
|
'TEL' => $l10n->t('Telephone'),
|
||||||
|
'EMAIL' => $l10n->t('Email'),
|
||||||
|
'ORG' => $l10n->t('Organization'),
|
||||||
|
);
|
||||||
|
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
|
||||||
|
$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
|
||||||
|
|
||||||
$details = OC_Contacts_VCard::structureContact($vcard);
|
$details = OC_Contacts_VCard::structureContact($vcard);
|
||||||
$tmpl = new OC_Template('contacts','part.details');
|
$tmpl = new OC_Template('contacts','part.details');
|
||||||
$tmpl->assign('details',$details);
|
$tmpl->assign('details',$details);
|
||||||
$tmpl->assign('id',$id);
|
$tmpl->assign('id',$id);
|
||||||
|
$tmpl->assign('property_types',$property_types);
|
||||||
|
$tmpl->assign('adr_types',$adr_types);
|
||||||
|
$tmpl->assign('phone_types',$phone_types);
|
||||||
$page = $tmpl->fetchPage();
|
$page = $tmpl->fetchPage();
|
||||||
|
|
||||||
OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));
|
OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));
|
||||||
|
|
|
@ -29,9 +29,14 @@ $l10n = new OC_L10N('contacts');
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
OC_JSON::checkAppEnabled('contacts');
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
|
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
|
||||||
|
$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
|
||||||
|
|
||||||
$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
|
$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
|
||||||
$tmpl = new OC_Template('contacts','part.addcardform');
|
$tmpl = new OC_Template('contacts','part.addcardform');
|
||||||
$tmpl->assign('addressbooks',$addressbooks);
|
$tmpl->assign('addressbooks',$addressbooks);
|
||||||
|
$tmpl->assign('adr_types',$adr_types);
|
||||||
|
$tmpl->assign('phone_types',$phone_types);
|
||||||
$page = $tmpl->fetchPage();
|
$page = $tmpl->fetchPage();
|
||||||
|
|
||||||
OC_JSON::success(array('data' => array( 'page' => $page )));
|
OC_JSON::success(array('data' => array( 'page' => $page )));
|
||||||
|
|
|
@ -61,11 +61,13 @@ if(is_null($line)){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
|
||||||
|
|
||||||
$tmpl = new OC_Template('contacts','part.setpropertyform');
|
$tmpl = new OC_Template('contacts','part.setpropertyform');
|
||||||
$tmpl->assign('id',$id);
|
$tmpl->assign('id',$id);
|
||||||
$tmpl->assign('checksum',$checksum);
|
$tmpl->assign('checksum',$checksum);
|
||||||
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line]));
|
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line]));
|
||||||
|
$tmpl->assign('adr_types',$adr_types);
|
||||||
$page = $tmpl->fetchPage();
|
$page = $tmpl->fetchPage();
|
||||||
|
|
||||||
OC_JSON::success(array('data' => array( 'page' => $page )));
|
OC_JSON::success(array('data' => array( 'page' => $page )));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
#contacts_deletecard {position:absolute;top:15px;right:0;}
|
#contacts_deletecard {position:absolute;top:15px;right:0;}
|
||||||
#contacts_details_list { list-style:none; }
|
#contacts_details_list { list-style:none; }
|
||||||
#contacts_details_list li { overflow:hidden; }
|
#contacts_details_list li { overflow:hidden; }
|
||||||
#contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em; }
|
#contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em;color:#666; }
|
||||||
#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%; overflow:hidden; }
|
#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%; overflow:hidden; }
|
||||||
#contacts_addproperty, #contacts_addproperty_button { margin-left:25%; }
|
#contacts_addproperty_button, #contacts_setproperty_button { margin-left:25%; }
|
||||||
|
|
||||||
.contacts_property_data ul, .contacts_property_data ol { list-style:none; }
|
.contacts_property_data ul, .contacts_property_data ol { list-style:none; }
|
||||||
.contacts_property_data li { overflow: hidden; }
|
.contacts_property_data li { overflow: hidden; }
|
||||||
|
|
|
@ -56,13 +56,13 @@ $(document).ready(function(){
|
||||||
$('#contacts_addpropertyform #contacts_fieldpart').remove();
|
$('#contacts_addpropertyform #contacts_fieldpart').remove();
|
||||||
$('#contacts_addpropertyform #contacts_generic').remove();
|
$('#contacts_addpropertyform #contacts_generic').remove();
|
||||||
if($(this).val() == 'ADR'){
|
if($(this).val() == 'ADR'){
|
||||||
$('#contacts_addresspart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
$('#contacts_addresspart').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
|
||||||
}
|
}
|
||||||
else if($(this).val() == 'TEL'){
|
else if($(this).val() == 'TEL'){
|
||||||
$('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
$('#contacts_phonepart').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
$('#contacts_generic').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class OC_Contacts_Addressbook{
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*contacts_addressbooks');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -113,7 +113,7 @@ class OC_Contacts_Addressbook{
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*contacts_addressbooks');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -95,10 +95,15 @@ class OC_Contacts_VCard{
|
||||||
|
|
||||||
$card = self::parse($data);
|
$card = self::parse($data);
|
||||||
if(!is_null($card)){
|
if(!is_null($card)){
|
||||||
|
// VCARD must have a version
|
||||||
|
$hasversion = false;
|
||||||
foreach($card->children as $property){
|
foreach($card->children as $property){
|
||||||
if($property->name == 'FN'){
|
if($property->name == 'FN'){
|
||||||
$fn = $property->value;
|
$fn = $property->value;
|
||||||
}
|
}
|
||||||
|
elseif($property->name == 'VERSION'){
|
||||||
|
$hasversion = true;
|
||||||
|
}
|
||||||
elseif(is_null($uri) && $property->name == 'UID' ){
|
elseif(is_null($uri) && $property->name == 'UID' ){
|
||||||
$uri = $property->value.'.vcf';
|
$uri = $property->value.'.vcf';
|
||||||
}
|
}
|
||||||
|
@ -109,6 +114,11 @@ class OC_Contacts_VCard{
|
||||||
$card->add(new Sabre_VObject_Property('UID',$uid));
|
$card->add(new Sabre_VObject_Property('UID',$uid));
|
||||||
$data = $card->serialize();
|
$data = $card->serialize();
|
||||||
};
|
};
|
||||||
|
// Add version if needed
|
||||||
|
if(!$hasversion){
|
||||||
|
$card->add(new Sabre_VObject_Property('VERSION','3.0'));
|
||||||
|
$data = $card->serialize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// that's hard. Creating a UID and not saving it
|
// that's hard. Creating a UID and not saving it
|
||||||
|
@ -121,7 +131,7 @@ class OC_Contacts_VCard{
|
||||||
|
|
||||||
OC_Contacts_Addressbook::touch($id);
|
OC_Contacts_Addressbook::touch($id);
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*contacts_cards');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,7 +157,7 @@ class OC_Contacts_VCard{
|
||||||
|
|
||||||
OC_Contacts_Addressbook::touch($id);
|
OC_Contacts_Addressbook::touch($id);
|
||||||
|
|
||||||
return OC_DB::insertid();
|
return OC_DB::insertid('*PREFIX*contacts_cards');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -362,4 +372,24 @@ class OC_Contacts_VCard{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static function getTypesOfProperty($l, $prop){
|
||||||
|
switch($prop){
|
||||||
|
case 'ADR':
|
||||||
|
return array(
|
||||||
|
'WORK' => $l->t('Work'),
|
||||||
|
'HOME' => $l->t('Home'),
|
||||||
|
);
|
||||||
|
case 'TEL':
|
||||||
|
return array(
|
||||||
|
'HOME' => $l->t('Home'),
|
||||||
|
'CELL' => $l->t('Mobile'),
|
||||||
|
'WORK' => $l->t('Work'),
|
||||||
|
'TEXT' => $l->t('Text'),
|
||||||
|
'VOICE' => $l->t('Voice'),
|
||||||
|
'FAX' => $l->t('Fax'),
|
||||||
|
'VIDEO' => $l->t('Video'),
|
||||||
|
'PAGER' => $l->t('Pager'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="id"><?php echo $l->t('Group'); ?></label>
|
<label class="label" for="id"><?php echo $l->t('Group'); ?></label>
|
||||||
<select name="id" size="1">
|
<select name="id" size="1">
|
||||||
<?php foreach($_['addressbooks'] as $addressbook): ?>
|
<?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
|
||||||
<option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -19,7 +17,7 @@
|
||||||
<ol>
|
<ol>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="fn"><?php echo $l->t('Name'); ?></label>
|
<label class="label" for="fn"><?php echo $l->t('Name'); ?></label>
|
||||||
<input type="text" name="fn" value=""><br>
|
<input id="fn" type="text" name="fn" value=""><br>
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="org"><?php echo $l->t('Organization'); ?></label>
|
<label class="label" for="org"><?php echo $l->t('Organization'); ?></label>
|
||||||
|
@ -46,14 +44,7 @@
|
||||||
<li class="fragment">
|
<li class="fragment">
|
||||||
<label for="tel_type"><?php echo $l->t('Type'); ?></label>
|
<label for="tel_type"><?php echo $l->t('Type'); ?></label>
|
||||||
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
|
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
|
||||||
<option value="home"><?php echo $l->t('Home'); ?></option>
|
<?php echo html_select_options($_['phone_types'], 'CELL') ?>
|
||||||
<option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
|
|
||||||
<option value="work"><?php echo $l->t('Work'); ?></option>
|
|
||||||
<option value="text"><?php echo $l->t('Text'); ?></option>
|
|
||||||
<option value="voice"><?php echo $l->t('Voice'); ?></option>
|
|
||||||
<option value="fax"><?php echo $l->t('Fax'); ?></option>
|
|
||||||
<option value="video"><?php echo $l->t('Video'); ?></option>
|
|
||||||
<option value="pager"><?php echo $l->t('Pager'); ?></option>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -67,8 +58,7 @@
|
||||||
<li class="input">
|
<li class="input">
|
||||||
<label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
|
<label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
|
||||||
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
|
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
|
||||||
<option value="work"><?php echo $l->t('Work'); ?></option>
|
<?php echo html_select_options($_['adr_types'], 'HOME') ?>
|
||||||
<option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
|
@ -81,19 +71,19 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
|
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
|
||||||
<input type="text" for="adr_street" name="value[ADR][2]" value="">
|
<input type="text" id="adr_street" name="value[ADR][2]" value="">
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
|
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
|
||||||
<input type="text" for="adr_city" name="value[ADR][3]" value="">
|
<input type="text" id="adr_city" name="value[ADR][3]" value="">
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
|
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
|
||||||
<input type="text" for="adr_region" name="value[ADR][4]" value="">
|
<input type="text" id="adr_region" name="value[ADR][4]" value="">
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
||||||
<input type="text" for="adr_zipcode" name="value[ADR][5]" value="">
|
<input type="text" id="adr_zipcode" name="value[ADR][5]" value="">
|
||||||
</li>
|
</li>
|
||||||
<li class="input stringish">
|
<li class="input stringish">
|
||||||
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
|
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
|
||||||
|
|
|
@ -27,15 +27,13 @@
|
||||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||||
<p class="contacts_property_name">
|
<p class="contacts_property_name">
|
||||||
<select name="name" size="1">
|
<select name="name" size="1">
|
||||||
<option value="ADR"><?php echo $l->t('Address'); ?></option>
|
<?php echo html_select_options($_['property_types'], 'EMAIL') ?>
|
||||||
<option value="TEL"><?php echo $l->t('Telephone'); ?></option>
|
|
||||||
<option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option>
|
|
||||||
<option value="ORG"><?php echo $l->t('Organization'); ?></option>
|
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<p class="contacts_property_data" id="contacts_generic">
|
<p class="contacts_property_data" id="contacts_generic">
|
||||||
<input type="text" name="value" value="">
|
<input type="text" name="value" value="">
|
||||||
</p><br>
|
</p>
|
||||||
|
<br>
|
||||||
<input id="contacts_addproperty_button" type="submit" value="<?php echo $l->t('Add'); ?>">
|
<input id="contacts_addproperty_button" type="submit" value="<?php echo $l->t('Add'); ?>">
|
||||||
</form>
|
</form>
|
||||||
<div id="contacts_addcontactsparts" style="display:none;">
|
<div id="contacts_addcontactsparts" style="display:none;">
|
||||||
|
@ -43,8 +41,7 @@
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_type"><?php echo $l->t('Type'); ?></label>
|
<label for="adr_type"><?php echo $l->t('Type'); ?></label>
|
||||||
<select id="adr_type" name="parameters[TYPE]" size="1">
|
<select id="adr_type" name="parameters[TYPE]" size="1">
|
||||||
<option value="work"><?php echo $l->t('Work'); ?></option>
|
<?php echo html_select_options($_['adr_types'], 'HOME') ?>
|
||||||
<option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -79,14 +76,7 @@
|
||||||
<p class="contacts_property_data" id="contacts_phonepart">
|
<p class="contacts_property_data" id="contacts_phonepart">
|
||||||
<input type="text" name="value" value="">
|
<input type="text" name="value" value="">
|
||||||
<select name="parameters[TYPE]" size="1">
|
<select name="parameters[TYPE]" size="1">
|
||||||
<option value="home"><?php echo $l->t('Home'); ?></option>
|
<?php echo html_select_options($_['phone_types'], 'CELL') ?>
|
||||||
<option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
|
|
||||||
<option value="work"><?php echo $l->t('Work'); ?></option>
|
|
||||||
<option value="text"><?php echo $l->t('Text'); ?></option>
|
|
||||||
<option value="voice"><?php echo $l->t('Voice'); ?></option>
|
|
||||||
<option value="fax"><?php echo $l->t('Fax'); ?></option>
|
|
||||||
<option value="video"><?php echo $l->t('Video'); ?></option>
|
|
||||||
<option value="pager"><?php echo $l->t('Pager'); ?></option>
|
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<p class="contacts_property_data" id="contacts_generic">
|
<p class="contacts_property_data" id="contacts_generic">
|
||||||
|
|
|
@ -5,42 +5,48 @@
|
||||||
<?php if($_['property']['name']=='ADR'): ?>
|
<?php if($_['property']['name']=='ADR'): ?>
|
||||||
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
|
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
|
||||||
<ol class="contacts_property_data" id="contacts_addresspart">
|
<ol class="contacts_property_data" id="contacts_addresspart">
|
||||||
|
<li class="input">
|
||||||
|
<label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
|
||||||
|
<select id="adr_type" name="parameters[TYPE]" size="1">
|
||||||
|
<?php echo html_select_options($_['adr_types'], strtoupper($_['property']['parameters']['TYPE'])) ?>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
|
<label for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
|
||||||
<input id="adr_pobox" type="text" name="value[0]" value="">
|
<input id="adr_pobox" type="text" name="value[0]" value="<?php echo $_['property']['value'][0] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_extended"><?php echo $l->t('Extended'); ?></label>
|
<label for="adr_extended"><?php echo $l->t('Extended'); ?></label>
|
||||||
<input id="adr_extended" type="text" name="value[1]" value="">
|
<input id="adr_extended" type="text" name="value[1]" value="<?php echo $_['property']['value'][1] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_street"><?php echo $l->t('Street'); ?></label>
|
<label for="adr_street"><?php echo $l->t('Street'); ?></label>
|
||||||
<input id="adr_street" type="text" name="value[2]" value="">
|
<input id="adr_street" type="text" name="value[2]" value="<?php echo $_['property']['value'][2] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_city"><?php echo $l->t('City'); ?></label>
|
<label for="adr_city"><?php echo $l->t('City'); ?></label>
|
||||||
<input id="adr_city" type="text" name="value[3]" value="">
|
<input id="adr_city" type="text" name="value[3]" value="<?php echo $_['property']['value'][3] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_region"><?php echo $l->t('Region'); ?></label>
|
<label for="adr_region"><?php echo $l->t('Region'); ?></label>
|
||||||
<input id="adr_region" type="text" name="value[4]" value="">
|
<input id="adr_region" type="text" name="value[4]" value="<?php echo $_['property']['value'][4] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
<label for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
||||||
<input id="adr_zipcode" type="text" name="value[5]" value="">
|
<input id="adr_zipcode" type="text" name="value[5]" value="<?php echo $_['property']['value'][5] ?>">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="adr_country"><?php echo $l->t('Country'); ?></label>
|
<label for="adr_country"><?php echo $l->t('Country'); ?></label>
|
||||||
<input id="adr_country" type="text" name="value[6]" value="">
|
<input id="adr_country" type="text" name="value[6]" value="<?php echo $_['property']['value'][6] ?>">
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
<?php elseif($_['property']['name']=='TEL'): ?>
|
<?php elseif($_['property']['name']=='TEL'): ?>
|
||||||
<p class="contacts_property_name"><label for="tel"><?php echo $l->t('Address'); ?></label></p>
|
<p class="contacts_property_name"><label for="tel"><?php echo $l->t('Phone'); ?></label></p>
|
||||||
<p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
<p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
||||||
<?php elseif($_['property']['name']=='EMAIL'): ?>
|
<?php elseif($_['property']['name']=='EMAIL'): ?>
|
||||||
<p class="contacts_property_name"><label for="email"><?php echo $l->t('Email'); ?></label></p>
|
<p class="contacts_property_name"><label for="email"><?php echo $l->t('Email'); ?></label></p>
|
||||||
<p class="contacts_property_data"><input id="email" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
<p class="contacts_property_data"><input id="email" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
||||||
<?php elseif($_['property']['name']=='EMAIL'): ?>
|
<?php elseif($_['property']['name']=='ORG'): ?>
|
||||||
<p class="contacts_property_name"><label for="org"><?php echo $l->t('Organization'); ?></label></p>
|
<p class="contacts_property_name"><label for="org"><?php echo $l->t('Organization'); ?></label></p>
|
||||||
<p class="contacts_property_data"><input id="org" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
<p class="contacts_property_data"><input id="org" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -10,7 +10,7 @@ $(document).ready(function() {
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
|
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: 'source='+file,
|
data: {source: file},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(users) {
|
success: function(users) {
|
||||||
if (users) {
|
if (users) {
|
||||||
|
@ -46,6 +46,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$('.share').click(function(event) {
|
$('.share').click(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
var filenames = getSelectedFiles('name');
|
var filenames = getSelectedFiles('name');
|
||||||
var length = filenames.length;
|
var length = filenames.length;
|
||||||
var files = '';
|
var files = '';
|
||||||
|
@ -184,8 +185,8 @@ function createDropdown(filename, files) {
|
||||||
html += '<input id="link" style="display:none; width:90%;" />';
|
html += '<input id="link" style="display:none; width:90%;" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
if (filename) {
|
if (filename) {
|
||||||
$('tr[data-file="'+filename+'"]').addClass('mouseOver');
|
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||||
$(html).appendTo($('tr[data-file="'+filename+'"] td.filename'));
|
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
|
||||||
} else {
|
} else {
|
||||||
$(html).appendTo($('thead .share'));
|
$(html).appendTo($('thead .share'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,7 +267,7 @@ class OC_MEDIA_COLLECTION{
|
||||||
$query=self::$queries['addsong'];
|
$query=self::$queries['addsong'];
|
||||||
}
|
}
|
||||||
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
|
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
|
||||||
$songId=OC_DB::insertid();
|
$songId=OC_DB::insertid('*PREFIX*media_songs');
|
||||||
// self::setLastUpdated();
|
// self::setLastUpdated();
|
||||||
return self::getSongId($name,$artist,$album);
|
return self::getSongId($name,$artist,$album);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,6 @@ class OC_remoteStorage {
|
||||||
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
|
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
|
||||||
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
|
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
|
||||||
$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
|
$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
|
||||||
if( PEAR::isError($result)) {
|
|
||||||
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
|
|
||||||
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
|
|
||||||
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
|
|
||||||
die( $entry );
|
|
||||||
}
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
while($row=$result->fetchRow()){
|
while($row=$result->fetchRow()){
|
||||||
$ret[$row['token']]=$userAddress;
|
$ret[$row['token']]=$userAddress;
|
||||||
|
@ -21,12 +15,6 @@ class OC_remoteStorage {
|
||||||
$user=OC_User::getUser();
|
$user=OC_User::getUser();
|
||||||
$query=OC_DB::prepare("SELECT token,appUrl,userAddress,dataScope FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
|
$query=OC_DB::prepare("SELECT token,appUrl,userAddress,dataScope FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
|
||||||
$result=$query->execute(array($user));
|
$result=$query->execute(array($user));
|
||||||
if( PEAR::isError($result)) {
|
|
||||||
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
|
|
||||||
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
|
|
||||||
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
|
|
||||||
die( $entry );
|
|
||||||
}
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
while($row=$result->fetchRow()){
|
while($row=$result->fetchRow()){
|
||||||
$ret[$row['token']] = array(
|
$ret[$row['token']] = array(
|
||||||
|
@ -42,23 +30,11 @@ class OC_remoteStorage {
|
||||||
$user=OC_User::getUser();
|
$user=OC_User::getUser();
|
||||||
$query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND user=?");
|
$query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND user=?");
|
||||||
$result=$query->execute(array($token,$user));
|
$result=$query->execute(array($token,$user));
|
||||||
if( PEAR::isError($result)) {
|
|
||||||
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
|
|
||||||
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
|
|
||||||
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
|
|
||||||
die( $entry );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private static function addToken($token, $appUrl, $userAddress, $dataScope){
|
private static function addToken($token, $appUrl, $userAddress, $dataScope){
|
||||||
$user=OC_User::getUser();
|
$user=OC_User::getUser();
|
||||||
$query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`userAddress`,`dataScope`) VALUES(?,?,?,?,?)");
|
$query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`userAddress`,`dataScope`) VALUES(?,?,?,?,?)");
|
||||||
$result=$query->execute(array($token,$appUrl,$user,$userAddress,$dataScope));
|
$result=$query->execute(array($token,$appUrl,$user,$userAddress,$dataScope));
|
||||||
if( PEAR::isError($result)) {
|
|
||||||
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
|
|
||||||
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
|
|
||||||
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
|
|
||||||
die( $entry );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static function createDataScope($appUrl, $userAddress, $dataScope){
|
public static function createDataScope($appUrl, $userAddress, $dataScope){
|
||||||
$token=uniqid();
|
$token=uniqid();
|
||||||
|
|
|
@ -4,7 +4,14 @@ if($_SERVER['SCRIPT_NAME'] == '/.well-known/webfinger.php') {
|
||||||
} else {
|
} else {
|
||||||
header('Please-first: activate');
|
header('Please-first: activate');
|
||||||
}
|
}
|
||||||
header("Content-Type: application/xml+xrd");
|
// header("Content-Type: application/xml+xrd");
|
||||||
|
|
||||||
|
// calculate the documentroot
|
||||||
|
// modified version of the one in lib/base.php that takes the .well-known symlink into account
|
||||||
|
$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
|
||||||
|
$SERVERROOT=str_replace("\\",'/',dirname(dirname(dirname(dirname(__FILE__)))));
|
||||||
|
$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
|
||||||
|
$WEBROOT=substr($SUBURI,0,-34);
|
||||||
|
|
||||||
if($_GET['q']) {
|
if($_GET['q']) {
|
||||||
$bits = explode('@', $_GET['q']);
|
$bits = explode('@', $_GET['q']);
|
||||||
|
@ -20,5 +27,5 @@ echo "<";
|
||||||
?xml version="1.0" encoding="UTF-8"?>
|
?xml version="1.0" encoding="UTF-8"?>
|
||||||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
|
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
|
||||||
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
|
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
|
||||||
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
|
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'].$WEBROOT ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
|
@ -32,14 +32,14 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
|
||||||
|
|
||||||
/* INPUTS */
|
/* INPUTS */
|
||||||
input[type="text"], input[type="password"] { cursor:text; }
|
input[type="text"], input[type="password"] { cursor:text; }
|
||||||
input, select, .button, #quota, div.jp-progress, .pager li a { 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; outline:none; }
|
input, select, button, .button, #quota, div.jp-progress, .pager li a { 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; outline:none; }
|
||||||
input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; }
|
input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; }
|
||||||
input[type="text"], input[type="password"], input[type="search"] { -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; }
|
input[type="text"], input[type="password"], input[type="search"] { -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; }
|
||||||
input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,
|
input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,
|
||||||
input[type="password"]:hover, input[type="password"]:focus, input[type="password"]:active,
|
input[type="password"]:hover, input[type="password"]:focus, input[type="password"]:active,
|
||||||
.searchbox input[type="search"]:hover, .searchbox input[type="search"]:focus, .searchbox input[type="search"]:active { background-color:#fff; color:#333; opacity:1; }
|
.searchbox input[type="search"]:hover, .searchbox input[type="search"]:focus, .searchbox input[type="search"]:active { background-color:#fff; color:#333; opacity:1; }
|
||||||
|
|
||||||
input[type="submit"], input[type="button"], .button, #quota, div.jp-progress, .pager li a { 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"], input[type="button"], button, .button, #quota, div.jp-progress, .pager li a { 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, .button:hover { background:#fff; color:#333; }
|
input[type="submit"]:hover, input[type="submit"]:focus, input[type="button"]:hover, input[type="button"]:focus, .button:hover { background:#fff; color:#333; }
|
||||||
input[type="checkbox"] { width:auto; }
|
input[type="checkbox"] { width:auto; }
|
||||||
#quota { cursor:default; }
|
#quota { cursor:default; }
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 236 B |
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="16"
|
||||||
|
height="16"
|
||||||
|
id="svg3875"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.1 r9760"
|
||||||
|
sodipodi:docname="download.svg"
|
||||||
|
inkscape:export-filename="/home/jancborchardt/owncloud/core/img/actions/play.png"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-ydpi="90">
|
||||||
|
<defs
|
||||||
|
id="defs3877" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="17.921875"
|
||||||
|
inkscape:cx="-5.3403178"
|
||||||
|
inkscape:cy="10.148736"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="true"
|
||||||
|
inkscape:window-width="1280"
|
||||||
|
inkscape:window-height="776"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="24"
|
||||||
|
inkscape:window-maximized="1">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid3883"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata3880">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-1036.3622)">
|
||||||
|
<path
|
||||||
|
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||||
|
d="m 10,1051.3622 -4,0 -1,-7 -4,0 7,-7 7,7 -4,0 z"
|
||||||
|
id="path3086"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cccccccc" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
|
@ -365,7 +365,7 @@ $(document).ready(function(){
|
||||||
$('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true});
|
$('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true});
|
||||||
$('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true});
|
$('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true});
|
||||||
$('.password .action').tipsy({gravity:'se', fade:true, live:true});
|
$('.password .action').tipsy({gravity:'se', fade:true, live:true});
|
||||||
$('.file_upload_button_wrapper').tipsy({gravity:'e', fade:true});
|
$('.file_upload_button_wrapper').tipsy({gravity:'w', fade:true});
|
||||||
$('.selectedActions a.delete').tipsy({gravity: 'se', fade:true, live:true});
|
$('.selectedActions a.delete').tipsy({gravity: 'se', fade:true, live:true});
|
||||||
$('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
|
$('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
|
||||||
$('#headerSize').tipsy({gravity:'s', fade:true, live:true});
|
$('#headerSize').tipsy({gravity:'s', fade:true, live:true});
|
||||||
|
@ -401,3 +401,10 @@ if (!Array.prototype.map){
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter Jquery selector by attribute value
|
||||||
|
**/
|
||||||
|
$.fn.filterAttr = function(attr_name, attr_value) {
|
||||||
|
return this.filter(function() { return $(this).attr(attr_name) === attr_value; });
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Init owncloud
|
||||||
|
require_once('../../lib/base.php');
|
||||||
|
|
||||||
|
OC_JSON::checkLoggedIn();
|
||||||
|
|
||||||
|
// Get the params
|
||||||
|
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
|
||||||
|
$filename = isset( $_GET['filename'] ) ? $_GET['filename'] : '';
|
||||||
|
$content = isset( $_GET['content'] ) ? $_GET['content'] : '';
|
||||||
|
|
||||||
|
if($filename == '') {
|
||||||
|
OC_JSON::error(array("data" => array( "message" => "Empty Filename" )));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(OC_Files::newFile($dir, $filename, 'file')) {
|
||||||
|
if($content){
|
||||||
|
OC_Filesystem::file_put_contents($dir.'/'.$filename,$content);
|
||||||
|
}
|
||||||
|
OC_JSON::success(array("data" => array('content'=>$content)));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OC_JSON::error(array("data" => array( "message" => "Error when creating the file" )));
|
|
@ -3,15 +3,22 @@
|
||||||
See the COPYING-README file. */
|
See the COPYING-README file. */
|
||||||
|
|
||||||
/* FILE MENU */
|
/* FILE MENU */
|
||||||
.actions { padding:.3em; float:left; }
|
.actions { padding:.3em; float:left; height:2em; }
|
||||||
.actions input { margin:0; }
|
.actions input, .actions button, .actions .button { margin:0; }
|
||||||
#file_menu { right:0; position:absolute; top:0; }
|
#file_menu { right:0; position:absolute; top:0; }
|
||||||
#file_menu a { display:block; float:left; background-image:none; text-decoration:none; }
|
#file_menu a { display:block; float:left; background-image:none; text-decoration:none; }
|
||||||
.file_upload_form, #file_newfolder_form { display:inline; float: left; margin-left:.5em; }
|
.file_upload_form, #file_newfolder_form { display:inline; float: left; margin-left:0; }
|
||||||
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
|
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
|
||||||
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
|
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
|
||||||
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em .1em .1em 0em;}
|
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:0;}
|
||||||
.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
|
.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
|
||||||
|
#new { float:left; border-top-right-radius:0; border-bottom-right-radius:0; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; }
|
||||||
|
#new.active { border-bottom-left-radius:0; border-bottom:none; background:#f8f8f8 }
|
||||||
|
#new>a{ padding-left:1em; padding-right:1em; }
|
||||||
|
#new>ul { display:none; position:fixed; text-align:left; padding:.5em; background:#f8f8f8; margin-top:0.075em; border:1px solid #ddd; min-width:7em; margin-left:-.5em; z-index:-1; }
|
||||||
|
#new>ul>li { margin:.3em; padding-left:2em; background-repeat:no-repeat; cursor:pointer; padding-bottom:0.1em }
|
||||||
|
#new>ul>li>p { cursor:pointer; }
|
||||||
|
#new>ul>li>input { padding:0.3em; margin:-0.3em; }
|
||||||
|
|
||||||
#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; }
|
#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; }
|
||||||
.file_upload_start, .file_upload_filename { font-size:1em; }
|
.file_upload_start, .file_upload_filename { font-size:1em; }
|
||||||
|
@ -19,7 +26,9 @@
|
||||||
.file_upload_target { display:none; }
|
.file_upload_target { display:none; }
|
||||||
|
|
||||||
.file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;}
|
.file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;}
|
||||||
.file_upload_filename { z-index:100; cursor:pointer;}
|
.file_upload_filename.active { border-bottom-right-radius:0 }
|
||||||
|
.file_upload_filename { z-index:100; cursor:pointer; border-top-left-radius:0; border-bottom-left-radius:0; padding:.3em; }
|
||||||
|
|
||||||
|
|
||||||
.file_upload_form, .file_upload_wrapper, .file_upload_start, .file_upload_filename, #file_upload_submit { cursor:pointer; }
|
.file_upload_form, .file_upload_wrapper, .file_upload_start, .file_upload_filename, #file_upload_submit { cursor:pointer; }
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,10 @@ $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'
|
||||||
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
|
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
|
||||||
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
|
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
|
||||||
|
|
||||||
|
$freeSpace=OC_Filesystem::free_space('/');
|
||||||
|
$freeSpace=max($freeSpace,0);
|
||||||
|
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
|
||||||
|
|
||||||
$tmpl = new OC_Template( "files", "index", "user" );
|
$tmpl = new OC_Template( "files", "index", "user" );
|
||||||
$tmpl->assign( "fileList", $list->fetchPage() );
|
$tmpl->assign( "fileList", $list->fetchPage() );
|
||||||
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
|
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
|
||||||
|
|
|
@ -56,7 +56,7 @@ FileActions={
|
||||||
$('#fileList .action').remove();
|
$('#fileList .action').remove();
|
||||||
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
||||||
var file=FileActions.getCurrentFile();
|
var file=FileActions.getCurrentFile();
|
||||||
if($('tr[data-file="'+file+'"]').data('renaming')){
|
if($('tr').filterAttr('data-file',file).data('renaming')){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
||||||
|
|
|
@ -4,7 +4,7 @@ FileList={
|
||||||
},
|
},
|
||||||
addFile:function(name,size,lastModified,loading){
|
addFile:function(name,size,lastModified,loading){
|
||||||
var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
|
var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
|
||||||
var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">';
|
var html='<tr data-type="file" data-size="'+size+'">';
|
||||||
if(name.indexOf('.')!=-1){
|
if(name.indexOf('.')!=-1){
|
||||||
var basename=name.substr(0,name.lastIndexOf('.'));
|
var basename=name.substr(0,name.lastIndexOf('.'));
|
||||||
var extention=name.substr(name.lastIndexOf('.'));
|
var extention=name.substr(name.lastIndexOf('.'));
|
||||||
|
@ -29,16 +29,21 @@ FileList={
|
||||||
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
|
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
|
||||||
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
|
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
|
||||||
html+='</tr>';
|
html+='</tr>';
|
||||||
FileList.insertElement(name,'file',$(html));
|
FileList.insertElement(name,'file',$(html).attr('data-file',name));
|
||||||
if(loading){
|
if(loading){
|
||||||
$('tr[data-file="'+name+'"]').data('loading',true);
|
$('tr').filterAttr('data-file',name).data('loading',true);
|
||||||
}else{
|
}else{
|
||||||
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
|
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addDir:function(name,size,lastModified){
|
addDir:function(name,size,lastModified){
|
||||||
var html='<tr data-file="'+name+'" data-type="dir" data-size="'+size+'">';
|
html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name});
|
||||||
html+='<td class="filename" style="background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')"><input type="checkbox" /><a class="name" href="index.php?dir='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
|
td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
|
||||||
|
td.append('<input type="checkbox" />');
|
||||||
|
var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name) });
|
||||||
|
link_elem.append($('<span></span>').addClass('nametext').text(name));
|
||||||
|
td.append(link_elem);
|
||||||
|
html.append(td);
|
||||||
if(size!='Pending'){
|
if(size!='Pending'){
|
||||||
simpleSize=simpleFileSize(size);
|
simpleSize=simpleFileSize(size);
|
||||||
}else{
|
}else{
|
||||||
|
@ -47,13 +52,15 @@ FileList={
|
||||||
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
|
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
|
||||||
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
|
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
|
||||||
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
|
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
|
||||||
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
|
td = $('<td></td>').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize);
|
||||||
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
|
html.append(td);
|
||||||
html+='</tr>';
|
|
||||||
|
|
||||||
FileList.insertElement(name,'dir',$(html));
|
td = $('<td></td>').attr({ "class": "date" });
|
||||||
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
|
td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) ));
|
||||||
$('tr[data-file="'+name+'"] td.filename').droppable(folderDropOptions);
|
html.append(td);
|
||||||
|
FileList.insertElement(name,'dir',html);
|
||||||
|
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
|
||||||
|
$('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions);
|
||||||
},
|
},
|
||||||
refresh:function(data) {
|
refresh:function(data) {
|
||||||
result = jQuery.parseJSON(data.responseText);
|
result = jQuery.parseJSON(data.responseText);
|
||||||
|
@ -64,8 +71,8 @@ FileList={
|
||||||
resetFileActionPanel();
|
resetFileActionPanel();
|
||||||
},
|
},
|
||||||
remove:function(name){
|
remove:function(name){
|
||||||
$('tr[data-file="'+name+'"] td.filename').draggable('destroy');
|
$('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy');
|
||||||
$('tr[data-file="'+name+'"]').remove();
|
$('tr').filterAttr('data-file',name).remove();
|
||||||
if($('tr[data-file]').length==0){
|
if($('tr[data-file]').length==0){
|
||||||
$('#emptyfolder').show();
|
$('#emptyfolder').show();
|
||||||
$('.file_upload_filename').addClass('highlight');
|
$('.file_upload_filename').addClass('highlight');
|
||||||
|
@ -101,7 +108,7 @@ FileList={
|
||||||
$('.file_upload_filename').removeClass('highlight');
|
$('.file_upload_filename').removeClass('highlight');
|
||||||
},
|
},
|
||||||
loadingDone:function(name){
|
loadingDone:function(name){
|
||||||
var tr=$('tr[data-file="'+name+'"]');
|
var tr=$('tr').filterAttr('data-file',name);
|
||||||
tr.data('loading',false);
|
tr.data('loading',false);
|
||||||
var mime=tr.data('mime');
|
var mime=tr.data('mime');
|
||||||
tr.attr('data-mime',mime);
|
tr.attr('data-mime',mime);
|
||||||
|
@ -111,13 +118,13 @@ FileList={
|
||||||
tr.find('td.filename').draggable(dragOptions);
|
tr.find('td.filename').draggable(dragOptions);
|
||||||
},
|
},
|
||||||
isLoading:function(name){
|
isLoading:function(name){
|
||||||
return $('tr[data-file="'+name+'"]').data('loading');
|
return $('tr').filterAttr('data-file',name).data('loading');
|
||||||
},
|
},
|
||||||
rename:function(name){
|
rename:function(name){
|
||||||
var tr=$('tr[data-file="'+name+'"]');
|
var tr=$('tr').filterAttr('data-file',name);
|
||||||
tr.data('renaming',true);
|
tr.data('renaming',true);
|
||||||
var td=tr.children('td.filename');
|
var td=tr.children('td.filename');
|
||||||
var input=$('<input value="'+name+'" class="filename"></input>');
|
var input=$('<input class="filename"></input>').val(name);
|
||||||
var form=$('<form action="#"></form>')
|
var form=$('<form action="#"></form>')
|
||||||
form.append(input);
|
form.append(input);
|
||||||
td.children('a.name').text('');
|
td.children('a.name').text('');
|
||||||
|
@ -143,7 +150,7 @@ FileList={
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'ajax/rename.php',
|
url: 'ajax/rename.php',
|
||||||
data: "dir="+$('#dir').val()+"&newname="+encodeURIComponent(newname)+"&file="+encodeURIComponent(name)
|
data: { dir : $('#dir').val(), newname: newname, file: name }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
form.click(function(event){
|
form.click(function(event){
|
||||||
|
@ -165,9 +172,10 @@ FileList={
|
||||||
files=[files];
|
files=[files];
|
||||||
}
|
}
|
||||||
$.each(files,function(index,file){
|
$.each(files,function(index,file){
|
||||||
$('tr[data-file="'+file+'"]').hide();
|
var files = $('tr').filterAttr('data-file',file);
|
||||||
$('tr[data-file="'+file+'"]').find('input[type="checkbox"]').removeAttr('checked');
|
files.hide();
|
||||||
$('tr[data-file="'+file+'"]').removeClass('selected');
|
files.find('input[type="checkbox"]').removeAttr('checked');
|
||||||
|
files.removeClass('selected');
|
||||||
});
|
});
|
||||||
procesSelection();
|
procesSelection();
|
||||||
FileList.deleteCanceled=false;
|
FileList.deleteCanceled=false;
|
||||||
|
@ -208,7 +216,7 @@ $(document).ready(function(){
|
||||||
if($('#notification').data('deletefile'))
|
if($('#notification').data('deletefile'))
|
||||||
{
|
{
|
||||||
$.each(FileList.deleteFiles,function(index,file){
|
$.each(FileList.deleteFiles,function(index,file){
|
||||||
$('tr[data-file="'+file+'"]').show();
|
$('tr').filterAttr('data-file',file).show();
|
||||||
// alert(file);
|
// alert(file);
|
||||||
});
|
});
|
||||||
FileList.deleteCanceled=true;
|
FileList.deleteCanceled=true;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#fileList tr').each(function(){
|
||||||
|
//little hack to set unescape filenames in attribute
|
||||||
|
$(this).attr('data-file',decodeURIComponent($(this).attr('data-file')));
|
||||||
|
});
|
||||||
|
|
||||||
if($('tr[data-file]').length==0){
|
if($('tr[data-file]').length==0){
|
||||||
$('.file_upload_filename').addClass('highlight');
|
$('.file_upload_filename').addClass('highlight');
|
||||||
}
|
}
|
||||||
|
@ -64,7 +69,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
procesSelection();
|
procesSelection();
|
||||||
} else {
|
} else {
|
||||||
var filename=$(this).parent().parent().data('file');
|
var filename=$(this).parent().parent().attr('data-file');
|
||||||
if(!FileList.isLoading(filename)){
|
if(!FileList.isLoading(filename)){
|
||||||
var mime=$(this).parent().parent().data('mime');
|
var mime=$(this).parent().parent().data('mime');
|
||||||
var type=$(this).parent().parent().data('type');
|
var type=$(this).parent().parent().data('type');
|
||||||
|
@ -158,7 +163,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.file_upload_start').live('change',function(){
|
$('.file_upload_start').live('change',function(){
|
||||||
var form=$(this).parent().parent();
|
var form=$(this).closest('form');
|
||||||
var uploadId=form.attr('data-upload-id');
|
var uploadId=form.attr('data-upload-id');
|
||||||
var files=this.files;
|
var files=this.files;
|
||||||
var target=form.children('iframe');
|
var target=form.children('iframe');
|
||||||
|
@ -185,9 +190,9 @@ $(document).ready(function() {
|
||||||
if(response[0] != undefined && response[0].status == 'success'){
|
if(response[0] != undefined && response[0].status == 'success'){
|
||||||
for(var i=0;i<response.length;i++){
|
for(var i=0;i<response.length;i++){
|
||||||
var file=response[i];
|
var file=response[i];
|
||||||
$('tr[data-file="'+file.name+'"]').data('mime',file.mime);
|
$('tr').filterAttr('data-file',file.name).data('mime',file.mime);
|
||||||
if(size=='Pending'){
|
if(size=='Pending'){
|
||||||
$('tr[data-file='+file.name+'] td.filesize').text(file.size);
|
$('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size);
|
||||||
}
|
}
|
||||||
FileList.loadingDone(file.name);
|
FileList.loadingDone(file.name);
|
||||||
}
|
}
|
||||||
|
@ -255,32 +260,82 @@ $(document).ready(function() {
|
||||||
text=text.substr(0,text.length-6)+'...';
|
text=text.substr(0,text.length-6)+'...';
|
||||||
crumb.text(text);
|
crumb.text(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(window).click(function(){
|
||||||
|
$('#new>ul').hide();
|
||||||
|
$('#new').removeClass('active');
|
||||||
|
$('button.file_upload_filename').removeClass('active');
|
||||||
|
$('#new li').each(function(i,element){
|
||||||
|
if($(element).children('p').length==0){
|
||||||
|
$(element).children('input').remove();
|
||||||
|
$(element).append('<p>'+$(element).data('text')+'</p>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('#new').click(function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
$('#new>a').click(function(){
|
||||||
|
$('#new>ul').toggle();
|
||||||
|
$('#new').toggleClass('active');
|
||||||
|
$('button.file_upload_filename').toggleClass('active');
|
||||||
|
});
|
||||||
|
$('#new li').click(function(){
|
||||||
|
if($(this).children('p').length==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#new li').each(function(i,element){
|
||||||
|
if($(element).children('p').length==0){
|
||||||
|
$(element).children('input').remove();
|
||||||
|
$(element).append('<p>'+$(element).data('text')+'</p>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var type=$(this).data('type');
|
||||||
|
var text=$(this).children('p').text();
|
||||||
|
$(this).data('text',text);
|
||||||
|
$(this).children('p').remove();
|
||||||
|
var input=$('<input>');
|
||||||
|
$(this).append(input);
|
||||||
|
input.focus();
|
||||||
|
input.change(function(){
|
||||||
|
var name=$(this).val();
|
||||||
|
switch(type){
|
||||||
|
case 'file':
|
||||||
|
$.ajax({
|
||||||
|
url: OC.filePath('files','ajax','newfile.php'),
|
||||||
|
data: "dir="+encodeURIComponent($('#dir').val())+"&filename="+encodeURIComponent(name)+'&content=%20%0A',
|
||||||
|
complete: function(data){boolOperationFinished(data, function(){
|
||||||
|
var date=new Date();
|
||||||
|
FileList.addFile(name,0,date);
|
||||||
|
var tr=$('tr').filterAttr('data-file',name);
|
||||||
|
tr.data('mime','text/plain');
|
||||||
|
getMimeIcon('text/plain',function(path){
|
||||||
|
tr.find('td.filename').attr('style','background-image:url('+path+')');
|
||||||
|
});
|
||||||
|
});}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'folder':
|
||||||
|
$.ajax({
|
||||||
|
url: OC.filePath('files','ajax','newfolder.php'),
|
||||||
|
data: "dir="+encodeURIComponent($('#dir').val())+"&foldername="+encodeURIComponent(name),
|
||||||
|
complete: function(data){boolOperationFinished(data, function(){
|
||||||
|
var date=new Date();
|
||||||
|
FileList.addDir(name,0,date);
|
||||||
|
});}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var li=$(this).parent();
|
||||||
|
$(this).remove();
|
||||||
|
li.append('<p>'+li.data('text')+'</p>');
|
||||||
|
$('#new>a').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var adjustNewFolderSize = function() {
|
|
||||||
if($('#file_newfolder_name').val() != '') {
|
|
||||||
splitSize($('#file_newfolder_name'),$('#file_newfolder_submit'));
|
|
||||||
$('#file_newfolder_name').unbind('keyup', adjustNewFolderSize);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function splitSize(existingEl, appearingEl) {
|
|
||||||
nw = parseInt($(existingEl).css('width')) - parseInt($(appearingEl).css('width'));
|
|
||||||
$(existingEl).css('width', nw + 'px');
|
|
||||||
$(appearingEl).fadeIn(250);
|
|
||||||
}
|
|
||||||
|
|
||||||
function unsplitSize(stayingEl, vanishingEl) {
|
|
||||||
nw = parseInt($(stayingEl).css('width')) + parseInt($(vanishingEl).css('width'));
|
|
||||||
$(stayingEl).css('width', nw + 'px');
|
|
||||||
$(vanishingEl).fadeOut(250);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetFileActionPanel() {
|
|
||||||
$('#file_action_panel form').css({"display":"none"});
|
|
||||||
$('#file_action_panel').attr('activeAction', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function boolOperationFinished(data, callback) {
|
function boolOperationFinished(data, callback) {
|
||||||
result = jQuery.parseJSON(data.responseText);
|
result = jQuery.parseJSON(data.responseText);
|
||||||
if(result.status == 'success'){
|
if(result.status == 'success'){
|
||||||
|
@ -343,7 +398,7 @@ var folderDropOptions={
|
||||||
url: 'ajax/move.php',
|
url: 'ajax/move.php',
|
||||||
data: "dir="+dir+"&file="+file+'&target='+dir+'/'+target,
|
data: "dir="+dir+"&file="+file+'&target='+dir+'/'+target,
|
||||||
complete: function(data){boolOperationFinished(data, function(){
|
complete: function(data){boolOperationFinished(data, function(){
|
||||||
var el=$('#fileList tr[data-file="'+file+'"] td.filename');
|
var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename');
|
||||||
el.draggable('destroy');
|
el.draggable('destroy');
|
||||||
FileList.remove(file);
|
FileList.remove(file);
|
||||||
});}
|
});}
|
||||||
|
@ -445,7 +500,7 @@ function getSelectedFiles(property){
|
||||||
var files=[];
|
var files=[];
|
||||||
elements.each(function(i,element){
|
elements.each(function(i,element){
|
||||||
var file={
|
var file={
|
||||||
name:$(element).data('file'),
|
name:$(element).attr('data-file'),
|
||||||
mime:$(element).data('mime'),
|
mime:$(element).data('mime'),
|
||||||
type:$(element).data('type'),
|
type:$(element).data('type'),
|
||||||
size:$(element).data('size'),
|
size:$(element).data('size'),
|
||||||
|
|
|
@ -2,20 +2,27 @@
|
||||||
<?php echo($_['breadcrumb']); ?>
|
<?php echo($_['breadcrumb']); ?>
|
||||||
<?php if (!isset($_['readonly']) || !$_['readonly']) {?>
|
<?php if (!isset($_['readonly']) || !$_['readonly']) {?>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<form data-upload-id='1' class="file_upload_form" action="ajax/upload.php" method="post" enctype="multipart/form-data" target="file_upload_target_1">
|
<div id='new' class='button'>
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
|
<a>
|
||||||
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
|
<?php echo $l->t('New');?>
|
||||||
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
|
</a>
|
||||||
<div class="file_upload_wrapper svg">
|
<ul class="popup popupTop">
|
||||||
<input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload'); ?>"/>
|
<li style="background-image:url('<?php echo mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
|
||||||
|
<li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
|
||||||
|
<!-- <li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='web'><p><?php echo $l->t('From the web');?></p></li> -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="file_upload_wrapper svg">
|
||||||
|
<form data-upload-id='1' class="file_upload_form" action="ajax/upload.php" method="post" enctype="multipart/form-data" target="file_upload_target_1">
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
|
||||||
|
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
|
||||||
|
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
|
||||||
|
<button class="file_upload_filename"><img class='svg action' alt="Upload" src="<?php echo image_path("core", "actions/upload.svg"); ?>" /></button>
|
||||||
<input class="file_upload_start" type="file" name='files[]'/>
|
<input class="file_upload_start" type="file" name='files[]'/>
|
||||||
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo 'max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
|
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
|
||||||
</div>
|
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
|
||||||
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
|
</form>
|
||||||
</form>
|
</div>
|
||||||
<form id="file_newfolder_form">
|
|
||||||
<input class="svg" type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="<?php echo $l->t('New Folder')?>" />
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="file_action_panel">
|
<div id="file_action_panel">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
$relative_modified_date = relative_modified_date($file['mtime']);
|
$relative_modified_date = relative_modified_date($file['mtime']);
|
||||||
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
|
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
|
||||||
if($relative_date_color>200) $relative_date_color = 200; ?>
|
if($relative_date_color>200) $relative_date_color = 200; ?>
|
||||||
<tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
|
<tr data-file="<?php echo str_replace('+','%20',urlencode($file['name']));?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
|
||||||
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
|
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
|
||||||
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
|
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
|
||||||
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$file['directory'].'/'.$file['name']; else echo $_['downloadURL'].urlencode($file['directory']).'/'.urlencode($file['name']); ?>" title="">
|
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$file['directory'].'/'.$file['name']; else echo $_['downloadURL'].urlencode($file['directory']).'/'.urlencode($file['name']); ?>" title="">
|
||||||
|
|
|
@ -100,11 +100,11 @@ class OC_App{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief enables an app
|
* @brief disables an app
|
||||||
* @param $app app
|
* @param $app app
|
||||||
* @returns true/false
|
* @returns true/false
|
||||||
*
|
*
|
||||||
* This function set an app as enabled in appconfig.
|
* This function set an app as disabled in appconfig.
|
||||||
*/
|
*/
|
||||||
public static function disable( $app ){
|
public static function disable( $app ){
|
||||||
OC_Appconfig::setValue( $app, 'enabled', 'no' );
|
OC_Appconfig::setValue( $app, 'enabled', 'no' );
|
||||||
|
|
|
@ -77,6 +77,9 @@ class OC{
|
||||||
// set some stuff
|
// set some stuff
|
||||||
//ob_start();
|
//ob_start();
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
|
if (defined('DEBUG') && DEBUG){
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
}
|
||||||
|
|
||||||
date_default_timezone_set('Europe/Berlin');
|
date_default_timezone_set('Europe/Berlin');
|
||||||
ini_set('arg_separator.output','&');
|
ini_set('arg_separator.output','&');
|
||||||
|
|
|
@ -29,7 +29,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
|
||||||
*/
|
*/
|
||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
return OC_Filesystem::file_get_contents($this->path);
|
return OC_Filesystem::fopen($this->path,'r');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
lib/db.php
10
lib/db.php
|
@ -224,6 +224,7 @@ class OC_DB {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief gets last value of autoincrement
|
* @brief gets last value of autoincrement
|
||||||
|
* @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix
|
||||||
* @returns id
|
* @returns id
|
||||||
*
|
*
|
||||||
* MDB2 lastInsertID()
|
* MDB2 lastInsertID()
|
||||||
|
@ -231,9 +232,14 @@ class OC_DB {
|
||||||
* Call this method right after the insert command or other functions may
|
* Call this method right after the insert command or other functions may
|
||||||
* cause trouble!
|
* cause trouble!
|
||||||
*/
|
*/
|
||||||
public static function insertid(){
|
public static function insertid($table=null){
|
||||||
self::connect();
|
self::connect();
|
||||||
return self::$connection->lastInsertId();
|
if($table !== null){
|
||||||
|
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
|
||||||
|
$suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" );
|
||||||
|
$table = str_replace( '*PREFIX*', $prefix, $table );
|
||||||
|
}
|
||||||
|
return self::$connection->lastInsertId($table.$suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,6 +84,11 @@ class OC_Filestorage_Local extends OC_Filestorage{
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
public function rename($path1,$path2){
|
public function rename($path1,$path2){
|
||||||
|
if(! $this->file_exists($path1)){
|
||||||
|
OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if($return=rename($this->datadir.$path1,$this->datadir.$path2)){
|
if($return=rename($this->datadir.$path1,$this->datadir.$path2)){
|
||||||
$this->clearFolderSizeCache($path1);
|
$this->clearFolderSizeCache($path1);
|
||||||
$this->clearFolderSizeCache($path2);
|
$this->clearFolderSizeCache($path2);
|
||||||
|
|
|
@ -20,7 +20,7 @@ class OC_Hook{
|
||||||
* TODO: write example
|
* TODO: write example
|
||||||
*/
|
*/
|
||||||
static public function connect( $signalclass, $signalname, $slotclass, $slotname ){
|
static public function connect( $signalclass, $signalname, $slotclass, $slotname ){
|
||||||
// Cerate the data structure
|
// Create the data structure
|
||||||
if( !array_key_exists( $signalclass, self::$registered )){
|
if( !array_key_exists( $signalclass, self::$registered )){
|
||||||
self::$registered[$signalclass] = array();
|
self::$registered[$signalclass] = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,9 @@ class OC_Log{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
$fh=fopen($logFile,'r');
|
$fh=fopen($logFile,'r');
|
||||||
|
if($fh === false){ // Unable to read log file!
|
||||||
|
return array();
|
||||||
|
}
|
||||||
while(!feof($fh)){
|
while(!feof($fh)){
|
||||||
$line=fgets($fh);
|
$line=fgets($fh);
|
||||||
if($line){
|
if($line){
|
||||||
|
|
|
@ -108,6 +108,7 @@ class OC_OCSClient{
|
||||||
|
|
||||||
$xml=@file_get_contents($url);
|
$xml=@file_get_contents($url);
|
||||||
if($xml==FALSE){
|
if($xml==FALSE){
|
||||||
|
OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
$data=simplexml_load_string($xml);
|
$data=simplexml_load_string($xml);
|
||||||
|
@ -143,6 +144,7 @@ class OC_OCSClient{
|
||||||
$kbe=array();
|
$kbe=array();
|
||||||
$xml=@file_get_contents($url);
|
$xml=@file_get_contents($url);
|
||||||
if($xml==FALSE){
|
if($xml==FALSE){
|
||||||
|
OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
$data=simplexml_load_string($xml);
|
$data=simplexml_load_string($xml);
|
||||||
|
|
|
@ -82,7 +82,7 @@ class OC_Setup {
|
||||||
$dbpass = $options['dbpass'];
|
$dbpass = $options['dbpass'];
|
||||||
$dbname = $options['dbname'];
|
$dbname = $options['dbname'];
|
||||||
$dbhost = $options['dbhost'];
|
$dbhost = $options['dbhost'];
|
||||||
$dbtableprefix = OC_Config::getValue('dbtableprefix','oc_');
|
$dbtableprefix = $options['dbtableprefix'];
|
||||||
OC_Config::setValue('dbname', $dbname);
|
OC_Config::setValue('dbname', $dbname);
|
||||||
OC_Config::setValue('dbhost', $dbhost);
|
OC_Config::setValue('dbhost', $dbhost);
|
||||||
OC_Config::setValue('dbtableprefix', $dbtableprefix);
|
OC_Config::setValue('dbtableprefix', $dbtableprefix);
|
||||||
|
@ -135,7 +135,7 @@ class OC_Setup {
|
||||||
$dbpass = $options['dbpass'];
|
$dbpass = $options['dbpass'];
|
||||||
$dbname = $options['dbname'];
|
$dbname = $options['dbname'];
|
||||||
$dbhost = $options['dbhost'];
|
$dbhost = $options['dbhost'];
|
||||||
$dbtableprefix = OC_Config::getValue('dbtableprefix','oc_');
|
$dbtableprefix = $options['dbtableprefix'];
|
||||||
OC_CONFIG::setValue('dbname', $dbname);
|
OC_CONFIG::setValue('dbname', $dbname);
|
||||||
OC_CONFIG::setValue('dbhost', $dbhost);
|
OC_CONFIG::setValue('dbhost', $dbhost);
|
||||||
OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);
|
OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);
|
||||||
|
|
|
@ -98,6 +98,33 @@ function relative_modified_date($timestamp) {
|
||||||
else { return $l->t('years ago'); }
|
else { return $l->t('years ago'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function html_select_options($options, $selected, $params=array()) {
|
||||||
|
if (!is_array($selected)){
|
||||||
|
$selected=array($selected);
|
||||||
|
}
|
||||||
|
if (isset($params['combine']) && $params['combine']){
|
||||||
|
$options = array_combine($options, $options);
|
||||||
|
}
|
||||||
|
$value_name = $label_name = false;
|
||||||
|
if (isset($params['value'])){
|
||||||
|
$value_name = $params['value'];
|
||||||
|
}
|
||||||
|
if (isset($params['label'])){
|
||||||
|
$label_name = $params['label'];
|
||||||
|
}
|
||||||
|
$html = '';
|
||||||
|
foreach($options as $value => $label){
|
||||||
|
if ($value_name && is_array($label)){
|
||||||
|
$value = $label[$value_name];
|
||||||
|
}
|
||||||
|
if ($label_name && is_array($label)){
|
||||||
|
$label = $label[$label_name];
|
||||||
|
}
|
||||||
|
$select = in_array($value, $selected) ? ' selected="selected"' : '';
|
||||||
|
$html .= '<option value="' . $value . '"' . $select . '>' . $label . '</option>';
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the templates for owncloud.
|
* This class provides the templates for owncloud.
|
||||||
|
|
|
@ -9,7 +9,10 @@
|
||||||
<?php
|
<?php
|
||||||
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
|
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
|
||||||
$pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
|
$pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
|
||||||
$pageNavi->printPage();
|
if($pageNavi)
|
||||||
|
{
|
||||||
|
$pageNavi->printPage();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</diV>
|
</diV>
|
||||||
<?php if(is_null($_["kbe"])):?>
|
<?php if(is_null($_["kbe"])):?>
|
||||||
|
|
Loading…
Reference in New Issue