fix merge conflicts
7
.gitignore
vendored
|
|
@ -35,4 +35,11 @@ nbproject
|
|||
# geany
|
||||
*.geany
|
||||
|
||||
# Cloud9IDE
|
||||
.settings.xml
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
||||
|
||||
# WebFinger
|
||||
.well-known
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ php_value upload_max_filesize 512M
|
|||
php_value post_max_size 512M
|
||||
SetEnv htaccessWorking true
|
||||
</IfModule>
|
||||
<IfModule !mod_php5.c>
|
||||
RewriteEngine on
|
||||
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
||||
</IfModule>
|
||||
Options -Indexes
|
||||
|
|
|
|||
2
3rdparty/Sabre.includes.php
vendored
|
|
@ -71,6 +71,7 @@ include 'Sabre/DAV/IExtendedCollection.php';
|
|||
/* Node abstract implementations */
|
||||
include 'Sabre/DAV/Node.php';
|
||||
include 'Sabre/DAV/File.php';
|
||||
include 'Sabre/DAV/Collection.php';
|
||||
include 'Sabre/DAV/Directory.php';
|
||||
|
||||
/* Utilities */
|
||||
|
|
@ -124,4 +125,3 @@ include 'Sabre/DAV/Auth/Backend/PDO.php';
|
|||
/* DavMount plugin */
|
||||
include 'Sabre/DAV/Mount/Plugin.php';
|
||||
|
||||
|
||||
|
|
|
|||
10
3rdparty/Sabre/CardDAV/AddressBook.php
vendored
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* UserAddressBook class
|
||||
* The AddressBook class represents a CardDAV addressbook, owned by a specific user
|
||||
*
|
||||
* The AddressBook can contain multiple vcards
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
|
|
@ -9,12 +11,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
14
3rdparty/Sabre/CardDAV/Backend/Abstract.php
vendored
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
/**
|
||||
* 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
|
||||
* @subpackage CardDAV
|
||||
|
|
@ -9,14 +15,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
6
3rdparty/Sabre/CardDAV/Backend/PDO.php
vendored
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
/**
|
||||
* PDO CardDAV backend
|
||||
*
|
||||
* This CardDAV backend uses PDO to store addressbooks
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
|
|
@ -9,10 +11,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
8
3rdparty/Sabre/CardDAV/Card.php
vendored
|
|
@ -1,18 +1,14 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Card class
|
||||
* The Card object represents a single Card from an addressbook
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
10
3rdparty/Sabre/CardDAV/ICard.php
vendored
|
|
@ -2,18 +2,16 @@
|
|||
|
||||
/**
|
||||
* Card interface
|
||||
*
|
||||
* Extend the ICard interface to allow your custom nodes to be picked up as
|
||||
* 'Cards'.
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
}
|
||||
|
|
|
|||
9
3rdparty/Sabre/CardDAV/Plugin.php
vendored
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* CardDAV plugin
|
||||
* CardDAV plugin
|
||||
*
|
||||
* The CardDAV plugin adds CardDAV functionality to the WebDAV server
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
|
|
@ -9,11 +11,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
8
3rdparty/Sabre/CardDAV/UserAddressBooks.php
vendored
|
|
@ -2,17 +2,15 @@
|
|||
|
||||
/**
|
||||
* UserAddressBooks class
|
||||
*
|
||||
*
|
||||
* The UserAddressBooks collection contains a list of addressbooks associated with a user
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
6
3rdparty/Sabre/CardDAV/Version.php
vendored
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
/**
|
||||
* Version Class
|
||||
*
|
||||
* This class contains the Sabre_CardDAV version information
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage CardDAV
|
||||
|
|
@ -9,10 +11,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class contains the Sabre_CardDAV version information
|
||||
*/
|
||||
class Sabre_CardDAV_Version {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class Sabre_DAV_Browser_GuessContentType extends Sabre_DAV_ServerPlugin {
|
|||
protected function getContentType($fileName) {
|
||||
|
||||
// Just grabbing the extension
|
||||
$extension = substr($fileName,strrpos($fileName,'.')+1);
|
||||
$extension = strtolower(substr($fileName,strrpos($fileName,'.')+1));
|
||||
if (isset($this->extensionMap[$extension]))
|
||||
return $this->extensionMap[$extension];
|
||||
|
||||
|
|
|
|||
2
3rdparty/Sabre/DAV/Server.php
vendored
|
|
@ -821,7 +821,7 @@ class Sabre_DAV_Server {
|
|||
|
||||
$node->put($body);
|
||||
$this->httpResponse->setHeader('Content-Length','0');
|
||||
$this->httpResponse->sendStatus(200);
|
||||
$this->httpResponse->sendStatus(204);
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
2
3rdparty/Sabre/DAV/Version.php
vendored
|
|
@ -14,7 +14,7 @@ class Sabre_DAV_Version {
|
|||
/**
|
||||
* Full version number
|
||||
*/
|
||||
const VERSION = '1.5.3';
|
||||
const VERSION = '1.5.4';
|
||||
|
||||
/**
|
||||
* Stability : alpha, beta, stable
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
/**
|
||||
* NeedPrivileges
|
||||
*
|
||||
* The 403-need privileges is thrown when a user didn't have the appropriate
|
||||
* permissions to perform an operation
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage DAVACL
|
||||
|
|
@ -10,13 +13,6 @@
|
|||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* The users are instances of Sabre_DAV_Auth_Principal
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage DAV
|
||||
* @subpackage DAVACL
|
||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||
|
|
|
|||
13
3rdparty/Sabre/VObject/Component.php
vendored
|
|
@ -83,13 +83,16 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
|
|||
if (!is_null($itemValue)) {
|
||||
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
||||
}
|
||||
$item->parent = $this;
|
||||
$this->children[] = $item;
|
||||
} elseif(is_string($item)) {
|
||||
|
||||
if (!is_scalar($itemValue)) {
|
||||
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 {
|
||||
|
||||
|
|
@ -208,16 +211,19 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
|
|||
$overWrite = count($matches)?key($matches):null;
|
||||
|
||||
if ($value instanceof Sabre_VObject_Component || $value instanceof Sabre_VObject_Property) {
|
||||
$value->parent = $this;
|
||||
if (!is_null($overWrite)) {
|
||||
$this->children[$overWrite] = $value;
|
||||
} else {
|
||||
$this->children[] = $value;
|
||||
}
|
||||
} elseif (is_scalar($value)) {
|
||||
$property = new Sabre_VObject_Property($name,$value);
|
||||
$property->parent = $this;
|
||||
if (!is_null($overWrite)) {
|
||||
$this->children[$overWrite] = new Sabre_VObject_Property($name,$value);
|
||||
$this->children[$overWrite] = $property;
|
||||
} else {
|
||||
$this->children[] = new Sabre_VObject_Property($name,$value);
|
||||
$this->children[] = $property;
|
||||
}
|
||||
} else {
|
||||
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) {
|
||||
|
||||
unset($this->children[$k]);
|
||||
$child->parent = null;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
43
3rdparty/Sabre/VObject/Element/DateTime.php
vendored
|
|
@ -70,7 +70,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
|||
$this->setValue($dt->format('Ymd\\THis'));
|
||||
$this->offsetUnset('VALUE');
|
||||
$this->offsetUnset('TZID');
|
||||
$this->offsetSet('VALUE','DATE-TIME');
|
||||
$this->offsetSet('VALUE','DATE-TIME');
|
||||
break;
|
||||
case self::UTC :
|
||||
$dt->setTimeZone(new DateTimeZone('UTC'));
|
||||
|
|
@ -116,7 +116,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
|||
list(
|
||||
$this->dateType,
|
||||
$this->dateTime
|
||||
) = self::parseData($this->value, $this->offsetGet('TZID'));
|
||||
) = self::parseData($this->value, $this);
|
||||
return $this->dateTime;
|
||||
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
|||
list(
|
||||
$this->dateType,
|
||||
$this->dateTime,
|
||||
) = self::parseData($this->value, $this->offsetGet('TZID'));
|
||||
) = self::parseData($this->value, $this);
|
||||
return $this->dateType;
|
||||
|
||||
}
|
||||
|
|
@ -151,12 +151,12 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
|
|||
* 2. A DateTime object (or null)
|
||||
*
|
||||
* @param string|null $propertyValue The string to parse (yymmdd or
|
||||
* ymmddThhmmss, etc..)
|
||||
* @param string|null $tzid The value of the 'TZID' property.
|
||||
* ymmddThhmmss, etc..)
|
||||
* @param Sabre_VObject_Property|null $property The instance of the
|
||||
* property we're parsing.
|
||||
* @return array
|
||||
*/
|
||||
static public function parseData($propertyValue, $tzid) {
|
||||
|
||||
static public function parseData($propertyValue, Sabre_VObject_Property $property = null) {
|
||||
|
||||
if (is_null($propertyValue)) {
|
||||
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) {
|
||||
return array(
|
||||
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->setTimeZone($tz);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
|||
$val[] = $i->format('Ymd\\THis');
|
||||
}
|
||||
$this->setValue(implode(',',$val));
|
||||
$this->offsetSet('VALUE','DATE-TIME');
|
||||
$this->offsetSet('VALUE','DATE-TIME');
|
||||
break;
|
||||
case Sabre_VObject_Element_DateTime::UTC :
|
||||
$val = array();
|
||||
|
|
@ -121,7 +121,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
|||
list(
|
||||
$type,
|
||||
$dt
|
||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
|
||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
|
||||
$dts[] = $dt;
|
||||
$this->dateType = $type;
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
|
|||
list(
|
||||
$type,
|
||||
$dt
|
||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
|
||||
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
|
||||
$dts[] = $dt;
|
||||
$this->dateType = $type;
|
||||
}
|
||||
|
|
|
|||
7
3rdparty/Sabre/VObject/Node.php
vendored
|
|
@ -25,6 +25,13 @@ abstract class Sabre_VObject_Node implements IteratorAggregate, ArrayAccess, Cou
|
|||
*/
|
||||
protected $iterator = null;
|
||||
|
||||
/**
|
||||
* A link to the parent node
|
||||
*
|
||||
* @var Sabre_VObject_Node
|
||||
*/
|
||||
protected $parent = null;
|
||||
|
||||
/* {{{ IteratorAggregator interface */
|
||||
|
||||
/**
|
||||
|
|
|
|||
13
3rdparty/Sabre/VObject/Property.php
vendored
|
|
@ -149,13 +149,16 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
|
|||
if (!is_null($itemValue)) {
|
||||
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
|
||||
}
|
||||
$item->parent = $this;
|
||||
$this->parameters[] = $item;
|
||||
} elseif(is_string($item)) {
|
||||
|
||||
if (!is_scalar($itemValue)) {
|
||||
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 {
|
||||
|
||||
|
|
@ -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.');
|
||||
|
||||
$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) {
|
||||
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.');
|
||||
|
||||
|
||||
$value->parent = $this;
|
||||
$this->parameters[] = $value;
|
||||
} else {
|
||||
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();
|
||||
foreach($this->parameters as $key=>$parameter) {
|
||||
if ($parameter->name == $name) {
|
||||
$parameter->parent = null;
|
||||
unset($this->parameters[$key]);
|
||||
}
|
||||
|
||||
|
|
|
|||
6
3rdparty/Sabre/VObject/Reader.php
vendored
|
|
@ -95,7 +95,7 @@ class Sabre_VObject_Reader {
|
|||
|
||||
while(stripos($nextLine,"END:")!==0) {
|
||||
|
||||
$obj->children[] = self::readLine($lines);
|
||||
$obj->add(self::readLine($lines));
|
||||
$nextLine = current($lines);
|
||||
|
||||
if ($nextLine===false)
|
||||
|
|
@ -140,7 +140,9 @@ class Sabre_VObject_Reader {
|
|||
|
||||
if ($matches['parameters']) {
|
||||
|
||||
$obj->parameters = self::readParameters($matches['parameters']);
|
||||
foreach(self::readParameters($matches['parameters']) as $param) {
|
||||
$obj->add($param);
|
||||
}
|
||||
}
|
||||
|
||||
return $obj;
|
||||
|
|
|
|||
2
3rdparty/Sabre/VObject/Version.php
vendored
|
|
@ -14,7 +14,7 @@ class Sabre_VObject_Version {
|
|||
/**
|
||||
* Full version number
|
||||
*/
|
||||
const VERSION = '1.2.2';
|
||||
const VERSION = '1.2.4';
|
||||
|
||||
/**
|
||||
* Stability : alpha, beta, stable
|
||||
|
|
|
|||
9
apps/admin_dependencies_chk/appinfo/app.php
Normal file
|
|
@ -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');
|
||||
11
apps/admin_dependencies_chk/appinfo/info.xml
Normal file
|
|
@ -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>
|
||||
9
apps/admin_dependencies_chk/css/style.css
Normal file
|
|
@ -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; }
|
||||
96
apps/admin_dependencies_chk/settings.php
Normal file
|
|
@ -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();
|
||||
16
apps/admin_dependencies_chk/templates/settings.php
Normal file
|
|
@ -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);
|
||||
|
||||
if($CONFIG_DBTYPE == 'pgsql')
|
||||
{
|
||||
$query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')");
|
||||
$b_id = $query->execute()->fetchOne();
|
||||
} else {
|
||||
$b_id = OC_DB::insertid();
|
||||
}
|
||||
$b_id = OC_DB::insertid('*PREFIX*bookmarks');
|
||||
|
||||
|
||||
if($b_id !== false) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
|
||||
$tmpl = new OC_Template( 'bookmarks', 'settings');
|
||||
|
||||
OC_Util::addScript('bookmarks','settings');
|
||||
//OC_Util::addScript('bookmarks','settings');
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ OC_Util::checkAppEnabled('calendar');
|
|||
// Create default calendar ...
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
|
||||
if( count($calendars) == 0){
|
||||
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar');
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
|
||||
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'Default calendar');
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||
}
|
||||
$eventSources = array();
|
||||
foreach($calendars as $calendar){
|
||||
|
|
|
|||
|
|
@ -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(?,?,?,?,?,?,?,?)' );
|
||||
$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(?,?,?,?,?,?,?,?)' );
|
||||
$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);
|
||||
|
||||
return OC_DB::insertid();
|
||||
return OC_DB::insertid('*PREFIX*calendar_objects');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -125,7 +125,7 @@ class OC_Calendar_Object{
|
|||
|
||||
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") ?>">
|
||||
<?php
|
||||
if (!isset($_['categories'])) {$_['categories'] = array();}
|
||||
foreach($_['category_options'] as $category){
|
||||
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
|
||||
}
|
||||
echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true));
|
||||
?>
|
||||
</select></td>
|
||||
<th width="75px"> <?php echo $l->t("Calendar");?>:</th>
|
||||
|
|
@ -23,9 +21,7 @@
|
|||
<select style="width:140px;" name="calendar">
|
||||
<?php
|
||||
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
||||
foreach($_['calendar_options'] as $calendar){
|
||||
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
|
||||
}
|
||||
echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
|
|
@ -66,9 +62,7 @@
|
|||
<select name="repeat" style="width:350px;">
|
||||
<?php
|
||||
if (isset($_['repeat_options'])) {
|
||||
foreach($_['repeat_options'] as $id => $label){
|
||||
echo '<option value="' . $id . '"' . ($_['repeat'] == $id ? ' selected="selected"' : '') . '>' . $label . '</option>';
|
||||
}
|
||||
echo html_select_options($_['repeat_options'], $_['repeat']);
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
|
|
|
|||
|
|
@ -43,11 +43,25 @@ $parameters = $_POST['parameters'];
|
|||
$vcard = new Sabre_VObject_Component('VCARD');
|
||||
$vcard->add(new Sabre_VObject_Property('FN',$fn));
|
||||
$vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID()));
|
||||
foreach(array('ADR', 'TEL', 'EMAIL', 'ORG') as $propname){
|
||||
|
||||
// Data to add ...
|
||||
$add = array('TEL', 'EMAIL', 'ORG');
|
||||
$address = false;
|
||||
for($i = 0; $i < 7; $i++){
|
||||
if( isset($values['ADR'][$i] ) && $values['ADR'][$i]) $address = true;
|
||||
}
|
||||
if( $address ) $add[] = 'ADR';
|
||||
|
||||
// Add data
|
||||
foreach( $add as $propname){
|
||||
if( !( isset( $values[$propname] ) && $values[$propname] )){
|
||||
continue;
|
||||
}
|
||||
$value = $values[$propname];
|
||||
if (isset($parameters[$propname])){
|
||||
if( isset( $parameters[$propname] ) && count( $parameters[$propname] )){
|
||||
$prop_parameters = $parameters[$propname];
|
||||
} else {
|
||||
}
|
||||
else{
|
||||
$prop_parameters = array();
|
||||
}
|
||||
OC_Contacts_VCard::addVCardProperty($vcard, $propname, $value, $prop_parameters);
|
||||
|
|
|
|||
|
|
@ -51,10 +51,22 @@ if(is_null($vcard)){
|
|||
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);
|
||||
$tmpl = new OC_Template('contacts','part.details');
|
||||
$tmpl->assign('details',$details);
|
||||
$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();
|
||||
|
||||
OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));
|
||||
|
|
|
|||
|
|
@ -29,9 +29,14 @@ $l10n = new OC_L10N('contacts');
|
|||
OC_JSON::checkLoggedIn();
|
||||
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());
|
||||
$tmpl = new OC_Template('contacts','part.addcardform');
|
||||
$tmpl->assign('addressbooks',$addressbooks);
|
||||
$tmpl->assign('adr_types',$adr_types);
|
||||
$tmpl->assign('phone_types',$phone_types);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
OC_JSON::success(array('data' => array( 'page' => $page )));
|
||||
|
|
|
|||
|
|
@ -61,11 +61,13 @@ if(is_null($line)){
|
|||
exit();
|
||||
}
|
||||
|
||||
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.setpropertyform');
|
||||
$tmpl->assign('id',$id);
|
||||
$tmpl->assign('checksum',$checksum);
|
||||
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line]));
|
||||
$tmpl->assign('adr_types',$adr_types);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
OC_JSON::success(array('data' => array( 'page' => $page )));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<id>contacts</id>
|
||||
<name>Contacts</name>
|
||||
|
|
|
|||
272
apps/contacts/css/formtastic.css
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
/* -------------------------------------------------------------------------------------------------
|
||||
|
||||
ownCloud changes: search for OWNCLOUD
|
||||
|
||||
Based on formtastic style sheet
|
||||
This stylesheet forms part of the Formtastic Rails Plugin
|
||||
(c) 2008-2011 Justin French
|
||||
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just .formtastic
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic,
|
||||
.formtastic ul,
|
||||
.formtastic ol,
|
||||
.formtastic li,
|
||||
.formtastic fieldset,
|
||||
.formtastic legend,
|
||||
/*.formtastic input,
|
||||
.formtastic textarea,
|
||||
.formtastic select, COMMENTED BY OWNCLOUD */
|
||||
.formtastic p {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.formtastic fieldset {
|
||||
border:0;
|
||||
}
|
||||
|
||||
.formtastic em,
|
||||
.formtastic strong {
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
.formtastic ol,
|
||||
.formtastic ul {
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
.formtastic abbr,
|
||||
.formtastic acronym {
|
||||
border:0;
|
||||
font-variant:normal;
|
||||
}
|
||||
|
||||
/*.formtastic input,
|
||||
.formtastic textarea {
|
||||
font-family:sans-serif;
|
||||
font-size:inherit;
|
||||
font-weight:inherit;
|
||||
}
|
||||
|
||||
.formtastic input,
|
||||
.formtastic textarea,
|
||||
.formtastic select {
|
||||
font-size:100%;
|
||||
} COMMENTED BY OWNCLOUD */
|
||||
|
||||
.formtastic legend {
|
||||
white-space:normal;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
/* SEMANTIC ERRORS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .errors {
|
||||
color:#cc0000;
|
||||
margin:0.5em 0 1.5em 25%;
|
||||
list-style:square;
|
||||
}
|
||||
|
||||
.formtastic .errors li {
|
||||
padding:0;
|
||||
border:none;
|
||||
display:list-item;
|
||||
}
|
||||
|
||||
|
||||
/* BUTTONS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .buttons {
|
||||
overflow:hidden; /* clear containing floats */
|
||||
padding-left:25%;
|
||||
}
|
||||
|
||||
.formtastic .button {
|
||||
float:left;
|
||||
padding-right:0.5em;
|
||||
border:none; /* ADDED BY OWNCLOUD */
|
||||
}
|
||||
|
||||
|
||||
/* INPUTS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .inputs {
|
||||
overflow:hidden; /* clear containing floats */
|
||||
}
|
||||
|
||||
.formtastic .input {
|
||||
overflow:hidden; /* clear containing floats */
|
||||
padding:0.5em 0; /* padding and negative margin juggling is for Firefox */
|
||||
margin-top:-0.5em;
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
|
||||
/* LEFT ALIGNED LABELS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .input .label {
|
||||
display:block;
|
||||
width:25%;
|
||||
float:left;
|
||||
padding-top:.2em;
|
||||
}
|
||||
|
||||
.formtastic .fragments .label,
|
||||
.formtastic .choices .label {
|
||||
position:absolute;
|
||||
width:95%;
|
||||
left:0px;
|
||||
}
|
||||
|
||||
.formtastic .fragments .label label,
|
||||
.formtastic .choices .label label {
|
||||
position:absolute;
|
||||
}
|
||||
|
||||
/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .choices {
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.formtastic .choices-group {
|
||||
float:left;
|
||||
width:74%;
|
||||
margin:0;
|
||||
padding:0 0 0 25%;
|
||||
}
|
||||
|
||||
.formtastic .choice {
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
|
||||
/* INLINE HINTS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .input .inline-hints {
|
||||
color:#666;
|
||||
margin:0.5em 0 0 25%;
|
||||
}
|
||||
|
||||
|
||||
/* INLINE ERRORS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .inline-errors {
|
||||
color:#cc0000;
|
||||
margin:0.5em 0 0 25%;
|
||||
}
|
||||
|
||||
.formtastic .errors {
|
||||
color:#cc0000;
|
||||
margin:0.5em 0 0 25%;
|
||||
list-style:square;
|
||||
}
|
||||
|
||||
.formtastic .errors li {
|
||||
padding:0;
|
||||
border:none;
|
||||
display:list-item;
|
||||
}
|
||||
|
||||
|
||||
/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .stringish input {
|
||||
width:72%;
|
||||
}
|
||||
|
||||
.formtastic .stringish input[size] {
|
||||
width:auto;
|
||||
max-width:72%;
|
||||
}
|
||||
|
||||
|
||||
/* TEXTAREA OVERRIDES
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .text textarea {
|
||||
width:72%;
|
||||
}
|
||||
|
||||
.formtastic .text textarea[cols] {
|
||||
width:auto;
|
||||
max-width:72%;
|
||||
}
|
||||
|
||||
|
||||
/* HIDDEN OVERRIDES
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .hidden {
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
/* BOOLEAN LABELS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .boolean label {
|
||||
padding-left:25%;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
||||
/* CHOICE GROUPS
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .choices-group {
|
||||
margin-bottom:-0.5em;
|
||||
}
|
||||
|
||||
.formtastic .choice {
|
||||
margin:0.1em 0 0.5em 0;
|
||||
}
|
||||
|
||||
.formtastic .choice label {
|
||||
float:none;
|
||||
width:100%;
|
||||
line-height:100%;
|
||||
padding-top:0;
|
||||
margin-bottom:0.6em;
|
||||
}
|
||||
|
||||
|
||||
/* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input)
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .choice label input,
|
||||
.formtastic .boolean label input {
|
||||
margin:0 0.3em 0 0.1em;
|
||||
line-height:100%;
|
||||
}
|
||||
|
||||
|
||||
/* FRAGMENTED INPUTS (DATE/TIME/DATETIME)
|
||||
--------------------------------------------------------------------------------------------------*/
|
||||
.formtastic .fragments {
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.formtastic .fragments-group {
|
||||
float:left;
|
||||
width:74%;
|
||||
margin:0;
|
||||
padding:0 0 0 25%;
|
||||
}
|
||||
|
||||
.formtastic .fragment {
|
||||
float:left;
|
||||
width:auto;
|
||||
margin:0 .3em 0 0;
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.formtastic .fragment label {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.formtastic .fragment label input {
|
||||
display:inline;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
|
@ -1,3 +1,30 @@
|
|||
.contacts_details_left {text-align:right;vertical-align:top;padding:2px;}
|
||||
.contacts_details_right {text-align:left;vertical-align:top;padding:2px;}
|
||||
#contacts_details_name { font-weight:bold;font-size:1.1em;margin-left:25%;}
|
||||
#contacts_details_photo { margin:.5em 0em .5em 25%; }
|
||||
|
||||
#contacts_deletecard {position:absolute;top:15px;right:0;}
|
||||
#contacts_details_list { list-style:none; }
|
||||
#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;color:#666; }
|
||||
#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%; overflow:hidden; }
|
||||
#contacts_addproperty_button, #contacts_setproperty_button { margin-left:25%; }
|
||||
|
||||
.contacts_property_data ul, .contacts_property_data ol { list-style:none; }
|
||||
.contacts_property_data li { overflow: hidden; }
|
||||
.contacts_property_data li label { width:20%; float:left; text-align:right;padding-right:0.3em; }
|
||||
.contacts_property_data li input { width:70%;overflow:hidden; }
|
||||
|
||||
/* Form setup ----------------------------------------------------------------*/
|
||||
/* .forme {} */
|
||||
/* .forme ul, .forme ol { list-style:none; } */
|
||||
/* .forme .inputs, .forme .buttons { overflow: hidden; } */
|
||||
|
||||
/* Labels --------------------------------------------------------------------*/
|
||||
/* .forme .input .label { width:25%; float:left; display:block; } */
|
||||
|
||||
/* Inputs --------------------------------------------------------------------*/
|
||||
/* .forme .stringish input { width:72%; } */
|
||||
/* .forme .text textarea { width:72%; } */
|
||||
|
||||
/* Buttons -------------------------------------------------------------------*/
|
||||
/* .forme .buttons { padding-left:25%; } */
|
||||
/* .forme .button { float:left; padding-left:0.5em; } */
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ foreach( $openaddressbooks as $addressbook ){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
usort($contacts,'contacts_namesort');
|
||||
$details = array();
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ $(document).ready(function(){
|
|||
var id = $('#rightcontent').data('id');
|
||||
$.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
$('#rightcontent').append(jsondata.data.page);
|
||||
$('#contacts_details_list').append(jsondata.data.page);
|
||||
$('#contacts_addproperty').hide();
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.message);
|
||||
|
|
@ -55,22 +56,20 @@ $(document).ready(function(){
|
|||
$('#contacts_addpropertyform #contacts_fieldpart').remove();
|
||||
$('#contacts_addpropertyform #contacts_generic').remove();
|
||||
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'){
|
||||
$('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||
$('#contacts_phonepart').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
|
||||
}
|
||||
else{
|
||||
$('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||
$('#contacts_generic').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
|
||||
}
|
||||
});
|
||||
|
||||
$('#contacts_addpropertyform input[type="submit"]').live('click',function(){
|
||||
$.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
$('#contacts_details').append(jsondata.data.page);
|
||||
$('#contacts_addpropertyform').remove();
|
||||
$('#contacts_addcontactsparts').remove();
|
||||
$('#contacts_addpropertyform').before(jsondata.data.page);
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.message);
|
||||
|
|
@ -78,7 +77,7 @@ $(document).ready(function(){
|
|||
}, 'json');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$('#contacts_newcontact').click(function(){
|
||||
$.getJSON('ajax/showaddcard.php',{},function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
|
|
@ -107,12 +106,12 @@ $(document).ready(function(){
|
|||
return false;
|
||||
});
|
||||
|
||||
$('.contacts_details_property [data-use="edit"]').live('click',function(){
|
||||
$('.contacts_property [data-use="edit"]').live('click',function(){
|
||||
var id = $('#rightcontent').data('id');
|
||||
var checksum = $(this).parent().parent().data('checksum');
|
||||
var checksum = $(this).parents('li').first().data('checksum');
|
||||
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
$('.contacts_details_property[data-checksum="'+checksum+'"] .contacts_details_right').html(jsondata.data.page);
|
||||
$('.contacts_property[data-checksum="'+checksum+'"]').html(jsondata.data.page);
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.message);
|
||||
|
|
@ -122,9 +121,9 @@ $(document).ready(function(){
|
|||
});
|
||||
|
||||
$('#contacts_setpropertyform input[type="submit"]').live('click',function(){
|
||||
$.post('ajax/setproperty.php',$(this).parent('form').serialize(),function(jsondata){
|
||||
$.post('ajax/setproperty.php',$(this).parents('form').first().serialize(),function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
$('.contacts_details_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
|
||||
$('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.message);
|
||||
|
|
@ -133,12 +132,12 @@ $(document).ready(function(){
|
|||
return false;
|
||||
});
|
||||
|
||||
$('.contacts_details_property [data-use="delete"]').live('click',function(){
|
||||
$('.contacts_property [data-use="delete"]').live('click',function(){
|
||||
var id = $('#rightcontent').data('id');
|
||||
var checksum = $(this).parent().parent().data('checksum');
|
||||
var checksum = $(this).parents('li').first().data('checksum');
|
||||
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
|
||||
if(jsondata.status == 'success'){
|
||||
$('.contacts_details_property[data-checksum="'+checksum+'"]').remove();
|
||||
$('.contacts_property[data-checksum="'+checksum+'"]').remove();
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.message);
|
||||
|
|
@ -148,11 +147,11 @@ $(document).ready(function(){
|
|||
});
|
||||
|
||||
|
||||
$('.contacts_details_property').live('mouseenter',function(){
|
||||
$('.contacts_property').live('mouseenter',function(){
|
||||
$(this).find('span').show();
|
||||
});
|
||||
|
||||
$('.contacts_details_property').live('mouseleave',function(){
|
||||
|
||||
$('.contacts_property').live('mouseleave',function(){
|
||||
$(this).find('span').hide();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class OC_Contacts_Addressbook{
|
|||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
||||
$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(?,?,?,?,?)' );
|
||||
$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);
|
||||
if(!is_null($card)){
|
||||
// VCARD must have a version
|
||||
$hasversion = false;
|
||||
foreach($card->children as $property){
|
||||
if($property->name == 'FN'){
|
||||
$fn = $property->value;
|
||||
}
|
||||
elseif($property->name == 'VERSION'){
|
||||
$hasversion = true;
|
||||
}
|
||||
elseif(is_null($uri) && $property->name == 'UID' ){
|
||||
$uri = $property->value.'.vcf';
|
||||
}
|
||||
|
|
@ -109,6 +114,11 @@ class OC_Contacts_VCard{
|
|||
$card->add(new Sabre_VObject_Property('UID',$uid));
|
||||
$data = $card->serialize();
|
||||
};
|
||||
// Add version if needed
|
||||
if(!$hasversion){
|
||||
$card->add(new Sabre_VObject_Property('VERSION','3.0'));
|
||||
$data = $card->serialize();
|
||||
}
|
||||
}
|
||||
else{
|
||||
// that's hard. Creating a UID and not saving it
|
||||
|
|
@ -121,7 +131,7 @@ class OC_Contacts_VCard{
|
|||
|
||||
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);
|
||||
|
||||
return OC_DB::insertid();
|
||||
return OC_DB::insertid('*PREFIX*contacts_cards');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -231,7 +241,7 @@ class OC_Contacts_VCard{
|
|||
* @param string $uri the uri of the card
|
||||
* @return boolean
|
||||
*/
|
||||
public static function deleteCardFromDAVData($aid,$uri){
|
||||
public static function deleteFromDAVData($aid,$uri){
|
||||
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' );
|
||||
$stmt->execute(array($aid,$uri));
|
||||
|
||||
|
|
@ -362,4 +372,24 @@ class OC_Contacts_VCard{
|
|||
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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php // Include Style and Script
|
||||
OC_Util::addScript('contacts','interface');
|
||||
OC_Util::addStyle('contacts','styles');
|
||||
OC_Util::addStyle('contacts','formtastic');
|
||||
?>
|
||||
|
||||
<div id="controls">
|
||||
|
|
|
|||
|
|
@ -1,51 +1,101 @@
|
|||
<form id="contacts_addcardform">
|
||||
<form class="formtastic" id="contacts_addcardform">
|
||||
<?php if(count($_['addressbooks'])==1): ?>
|
||||
<input type="hidden" name="id" value="<?php echo $_['addressbooks'][0]['id']; ?>">
|
||||
<?php else: ?>
|
||||
<label for="id"><?php echo $l->t('Group'); ?></label>
|
||||
<select name="id" size="1">
|
||||
<?php foreach($_['addressbooks'] as $addressbook): ?>
|
||||
<option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<fieldset class="inputs">
|
||||
<ol>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="id"><?php echo $l->t('Group'); ?></label>
|
||||
<select name="id" size="1">
|
||||
<?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<label for="fn"><?php echo $l->t('Name'); ?></label>
|
||||
<input type="text" name="fn" value=""><br>
|
||||
<label for="ADR"><?php echo $l->t('Address'); ?></label>
|
||||
<div id="contacts_addresspart">
|
||||
<select id="ADR" name="parameters[ADR][TYPE]" size="1">
|
||||
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
|
||||
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
|
||||
</select>
|
||||
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
|
||||
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
|
||||
<p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p>
|
||||
<p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p>
|
||||
<p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p>
|
||||
<p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p>
|
||||
<p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p>
|
||||
</div>
|
||||
<label for="TEL"><?php echo $l->t('Telephone'); ?></label>
|
||||
<div id="contacts_phonepart">
|
||||
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
|
||||
<option value="home"><?php echo $l->t('Home'); ?></option>
|
||||
<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>
|
||||
<input type="text" name="value[TEL]" value="">
|
||||
</div>
|
||||
<label for="EMAIL"><?php echo $l->t('Email'); ?></label>
|
||||
<div id="contacts_email">
|
||||
<input id="EMAIL" type="text" name="value[EMAIL]" value="">
|
||||
</div>
|
||||
<label for="ORG"><?php echo $l->t('Organization'); ?></label>
|
||||
<div id="contacts_organisation">
|
||||
<input id="ORG" type="text" name="value[ORG]" value="">
|
||||
</div>
|
||||
<input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
|
||||
<fieldset class="inputs">
|
||||
<ol>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="fn"><?php echo $l->t('Name'); ?></label>
|
||||
<input id="fn" type="text" name="fn" value=""><br>
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="org"><?php echo $l->t('Organization'); ?></label>
|
||||
<input id="org" type="text" name="value[ORG]" value="">
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<fieldset class="inputs">
|
||||
<ol>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="email"><?php echo $l->t('Email'); ?></label>
|
||||
<input id="email" type="text" name="value[EMAIL]" value="">
|
||||
</li>
|
||||
<li class="input">
|
||||
<fieldset class="fragments">
|
||||
<legend class="label">
|
||||
<label for="tel"><?php echo $l->t('Telephone'); ?></label>
|
||||
</legend>
|
||||
<ol class="fragments-group">
|
||||
<li class="fragment">
|
||||
<label for="tel"><?php echo $l->t('Number'); ?></label>
|
||||
<input type="phone" id="tel" name="value[TEL]" value="">
|
||||
</li>
|
||||
<li class="fragment">
|
||||
<label for="tel_type"><?php echo $l->t('Type'); ?></label>
|
||||
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
|
||||
<?php echo html_select_options($_['phone_types'], 'CELL') ?>
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<fieldset class="inputs">
|
||||
<legend><?php echo $l->t('Address'); ?></legend>
|
||||
<ol>
|
||||
<li class="input">
|
||||
<label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
|
||||
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
|
||||
<?php echo html_select_options($_['adr_types'], 'HOME') ?>
|
||||
</select>
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
|
||||
<input type="text" id="adr_pobox" name="value[ADR][0]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label>
|
||||
<input type="text" id="adr_extended" name="value[ADR][1]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
|
||||
<input type="text" id="adr_street" name="value[ADR][2]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
|
||||
<input type="text" id="adr_city" name="value[ADR][3]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
|
||||
<input type="text" id="adr_region" name="value[ADR][4]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
||||
<input type="text" id="adr_zipcode" name="value[ADR][5]" value="">
|
||||
</li>
|
||||
<li class="input stringish">
|
||||
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
|
||||
<input type="text" id="adr_country" name="value[ADR][6]" value="">
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<fieldset class="buttons">
|
||||
<ol>
|
||||
<li class="commit button">
|
||||
<input class="create" type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
<form id="contacts_addpropertyform">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<select name="name" size="1">
|
||||
<option value="ADR"><?php echo $l->t('Address'); ?></option>
|
||||
<option value="TEL"><?php echo $l->t('Telephone'); ?></option>
|
||||
<option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option>
|
||||
<option value="ORG"><?php echo $l->t('Organization'); ?></option>
|
||||
</select>
|
||||
<div id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
<input type="submit">
|
||||
</form>
|
||||
<div id="contacts_addcontactsparts" style="display:none;">
|
||||
<div id="contacts_addresspart">
|
||||
<select name="parameters[TYPE]" size="1">
|
||||
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
|
||||
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
|
||||
</select>
|
||||
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[0]" value=""></p>
|
||||
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[1]" value=""></p>
|
||||
<p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[2]" value=""></p>
|
||||
<p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[3]" value=""></p>
|
||||
<p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[4]" value=""></p>
|
||||
<p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[5]" value=""></p>
|
||||
<p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[6]" value=""></p>
|
||||
</div>
|
||||
<div id="contacts_phonepart">
|
||||
<select name="parameters[TYPE]" size="1">
|
||||
<option value="home"><?php echo $l->t('Home'); ?></option>
|
||||
<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>
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
<div id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
<?php if(array_key_exists('FN',$_['details'])): ?>
|
||||
<table id="contacts_details">
|
||||
<?php if(isset($_['details']['PHOTO'])): // Emails first ?>
|
||||
<tr class="contacts_details_property">
|
||||
<td class="contacts_details_left"> </td>
|
||||
<td class="contacts_details_right">
|
||||
<img src="photo.php?id=<?php echo $_['id']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?>
|
||||
|
||||
<p id="contacts_details_name"><?php echo $_['details']['FN'][0]['value']; ?></p>
|
||||
<img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
|
||||
|
||||
<?php if(isset($_['details']['PHOTO'])): // Emails first ?>
|
||||
<img id="contacts_details_photo" src="photo.php?id=<?php echo $_['id']; ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<ul id="contacts_details_list">
|
||||
<?php if(isset($_['details']['BDAY'])): // Emails first ?>
|
||||
<?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?>
|
||||
<?php endif; ?>
|
||||
|
|
@ -26,9 +22,67 @@
|
|||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<form>
|
||||
<img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
|
||||
<input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>">
|
||||
</form>
|
||||
<li class="contacts_property_add">
|
||||
<form id="contacts_addpropertyform">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<p class="contacts_property_name">
|
||||
<select name="name" size="1">
|
||||
<?php echo html_select_options($_['property_types'], 'EMAIL') ?>
|
||||
</select>
|
||||
</p>
|
||||
<p class="contacts_property_data" id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</p>
|
||||
<br>
|
||||
<input id="contacts_addproperty_button" type="submit" value="<?php echo $l->t('Add'); ?>">
|
||||
</form>
|
||||
<div id="contacts_addcontactsparts" style="display:none;">
|
||||
<ul class="contacts_property_data" id="contacts_addresspart">
|
||||
<li>
|
||||
<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'], 'HOME') ?>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
|
||||
<input id="adr_pobox" type="text" name="value[0]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_extended"><?php echo $l->t('Extended'); ?></label>
|
||||
<input id="adr_extended" type="text" name="value[1]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_street"><?php echo $l->t('Street'); ?></label>
|
||||
<input id="adr_street" type="text" name="value[2]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_city"><?php echo $l->t('City'); ?></label>
|
||||
<input id="adr_city" type="text" name="value[3]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_region"><?php echo $l->t('Region'); ?></label>
|
||||
<input id="adr_region" type="text" name="value[4]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
||||
<input id="adr_zipcode" type="text" name="value[5]" value="">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_country"><?php echo $l->t('Country'); ?></label>
|
||||
<input id="adr_country" type="text" name="value[6]" value="">
|
||||
</li>
|
||||
</ul>
|
||||
<p class="contacts_property_data" id="contacts_phonepart">
|
||||
<input type="text" name="value" value="">
|
||||
<select name="parameters[TYPE]" size="1">
|
||||
<?php echo html_select_options($_['phone_types'], 'CELL') ?>
|
||||
</select>
|
||||
</p>
|
||||
<p class="contacts_property_data" id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
|
|
@ -1,72 +1,66 @@
|
|||
<tr class="contacts_details_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
|
||||
<?php if($_['property']['name'] == 'FN'): ?>
|
||||
<td class="contacts_details_left"></td>
|
||||
<td class="contacts_details_right">
|
||||
<strong><?php echo $_['property']['value']; ?></strong>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
</td>
|
||||
<?php elseif($_['property']['name'] == 'BDAY'): ?>
|
||||
<td class="contacts_details_left"><?php echo $l->t('Birthday'); ?></td>
|
||||
<td class="contacts_details_right">
|
||||
<?php echo $l->l('date',new DateTime($_['property']['value'])); ?>
|
||||
<li class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
|
||||
<?php if($_['property']['name'] == 'BDAY'): ?>
|
||||
<p class="contacts_property_name"><?php echo $l->t('Birthday'); ?></p>
|
||||
<p class="contacts_property_data">
|
||||
<?php echo $l->l('date',new DateTime($_['property']['value'])); ?>
|
||||
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
|
||||
</td>
|
||||
</p>
|
||||
<?php elseif($_['property']['name'] == 'ORG'): ?>
|
||||
<td class="contacts_details_left"><?php echo $l->t('Organization'); ?></td>
|
||||
<td class="contacts_details_right">
|
||||
<p class="contacts_property_name"><?php echo $l->t('Organization'); ?></p>
|
||||
<p class="contacts_property_data">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
|
||||
</td>
|
||||
</p>
|
||||
<?php elseif($_['property']['name'] == 'EMAIL'): ?>
|
||||
<td class="contacts_details_left"><?php echo $l->t('Email'); ?></td>
|
||||
<td class="contacts_details_right">
|
||||
<p class="contacts_property_name"><?php echo $l->t('Email'); ?></p>
|
||||
<p class="contacts_property_data">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
|
||||
</td>
|
||||
</p>
|
||||
<?php elseif($_['property']['name'] == 'TEL'): ?>
|
||||
<td class="contacts_details_left"><?php echo $l->t('Phone'); ?></td>
|
||||
<td class="contacts_details_right">
|
||||
<p class="contacts_property_name"><?php echo $l->t('Phone'); ?></p>
|
||||
<p class="contacts_property_data">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
|
||||
(<?php echo strtolower($_['property']['parameters']['TYPE']); ?>)
|
||||
(<?php echo $l->t(ucwords(str_replace('cell','mobile',strtolower($_['property']['parameters']['TYPE'])))); ?>)
|
||||
<?php endif; ?>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
|
||||
</td>
|
||||
</p>
|
||||
<?php elseif($_['property']['name'] == 'ADR'): ?>
|
||||
<td class="contacts_details_left">
|
||||
<p class="contacts_property_name">
|
||||
<?php echo $l->t('Address'); ?>
|
||||
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
|
||||
<br>
|
||||
(<?php echo strtolower($_['property']['parameters']['TYPE']); ?>)
|
||||
(<?php echo $l->t(ucwords($_['property']['parameters']['TYPE'])); ?>)
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="contacts_details_right">
|
||||
</p>
|
||||
<p class="contacts_property_data">
|
||||
<?php if(!empty($_['property']['value'][0])): ?>
|
||||
<?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br>
|
||||
<?php echo $_['property']['value'][0]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][1])): ?>
|
||||
<?php echo $l->t('Extended'); ?> <?php echo $_['property']['value'][1]; ?><br>
|
||||
<?php echo $_['property']['value'][1]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][2])): ?>
|
||||
<?php echo $l->t('Street'); ?> <?php echo $_['property']['value'][2]; ?><br>
|
||||
<?php echo $_['property']['value'][2]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][3])): ?>
|
||||
<?php echo $l->t('City'); ?> <?php echo $_['property']['value'][3]; ?><br>
|
||||
<?php echo $_['property']['value'][3]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][4])): ?>
|
||||
<?php echo $l->t('Region'); ?> <?php echo $_['property']['value'][4]; ?><br>
|
||||
<?php echo $_['property']['value'][4]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][5])): ?>
|
||||
<?php echo $l->t('Zipcode'); ?> <?php echo $_['property']['value'][5]; ?><br>
|
||||
<?php echo $_['property']['value'][5]; ?><br>
|
||||
<?php endif; ?>
|
||||
<?php if(!empty($_['property']['value'][6])): ?>
|
||||
<?php echo $l->t('Country'); ?> <?php echo $_['property']['value'][6]; ?>
|
||||
<?php echo $_['property']['value'][6]; ?>
|
||||
<?php endif; ?>
|
||||
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
|
||||
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
|
||||
</td>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,55 @@
|
|||
<form id="contacts_setpropertyform">
|
||||
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<?php if($_['property']['name']=='ADR'): ?>
|
||||
<label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[0]" value="<?php echo $_['property']['value'][0]; ?>"><br>
|
||||
<label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[1]" value="<?php echo $_['property']['value'][1]; ?>"><br>
|
||||
<label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[2]" value="<?php echo $_['property']['value'][2]; ?>"><br>
|
||||
<label><?php echo $l->t('City'); ?></label> <input type="text" name="value[3]" value="<?php echo $_['property']['value'][3]; ?>"><br>
|
||||
<label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[4]" value="<?php echo $_['property']['value'][4]; ?>"><br>
|
||||
<label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[5]" value="<?php echo $_['property']['value'][5]; ?>"><br>
|
||||
<label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[6]" value="<?php echo $_['property']['value'][6]; ?>"><br>
|
||||
<?php elseif($_['property']['name']=='TEL'): ?>
|
||||
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
|
||||
<?php else: ?>
|
||||
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
|
||||
<?php endif; ?>
|
||||
<input type="submit" value="<?php echo $l->t('Edit'); ?>">
|
||||
</form>
|
||||
<li class="contacts_property_edit" data-checksum="<?php echo $_['property']['checksum']; ?>">
|
||||
<form id="contacts_setpropertyform">
|
||||
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<?php if($_['property']['name']=='ADR'): ?>
|
||||
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
|
||||
<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>
|
||||
<label for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
|
||||
<input id="adr_pobox" type="text" name="value[0]" value="<?php echo $_['property']['value'][0] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_extended"><?php echo $l->t('Extended'); ?></label>
|
||||
<input id="adr_extended" type="text" name="value[1]" value="<?php echo $_['property']['value'][1] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_street"><?php echo $l->t('Street'); ?></label>
|
||||
<input id="adr_street" type="text" name="value[2]" value="<?php echo $_['property']['value'][2] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_city"><?php echo $l->t('City'); ?></label>
|
||||
<input id="adr_city" type="text" name="value[3]" value="<?php echo $_['property']['value'][3] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_region"><?php echo $l->t('Region'); ?></label>
|
||||
<input id="adr_region" type="text" name="value[4]" value="<?php echo $_['property']['value'][4] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
|
||||
<input id="adr_zipcode" type="text" name="value[5]" value="<?php echo $_['property']['value'][5] ?>">
|
||||
</li>
|
||||
<li>
|
||||
<label for="adr_country"><?php echo $l->t('Country'); ?></label>
|
||||
<input id="adr_country" type="text" name="value[6]" value="<?php echo $_['property']['value'][6] ?>">
|
||||
</li>
|
||||
</ol>
|
||||
<?php elseif($_['property']['name']=='TEL'): ?>
|
||||
<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>
|
||||
<?php elseif($_['property']['name']=='EMAIL'): ?>
|
||||
<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>
|
||||
<?php elseif($_['property']['name']=='ORG'): ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
<input id="contacts_setproperty_button" type="submit" value="<?php echo $l->t('Edit'); ?>">
|
||||
</form>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<form id="mediaform">
|
||||
<fieldset class="personalblock">
|
||||
<strong>Contacts</strong><br />
|
||||
CardDAV syncing address:
|
||||
CardDAV syncing address:
|
||||
<?php echo OC_Helper::linkTo('apps/contacts', 'carddav.php', null, true); ?><br />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
|||
24
apps/external/ajax/seturls.php
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011, Frank Karlitschek <karlitschek@kde.org>
|
||||
* This file is licensed under the Affero General Public License version 3 or later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_Util::checkAdminUser();
|
||||
|
||||
if(isset($_POST['s1name'])) OC_Config::setValue( 'external-site1name', $_POST['s1name'] );
|
||||
if(isset($_POST['s1url'])) OC_Config::setValue( 'external-site1url', $_POST['s1url'] );
|
||||
if(isset($_POST['s2name'])) OC_Config::setValue( 'external-site2name', $_POST['s2name'] );
|
||||
if(isset($_POST['s2url'])) OC_Config::setValue( 'external-site2url', $_POST['s2url'] );
|
||||
if(isset($_POST['s3name'])) OC_Config::setValue( 'external-site3name', $_POST['s3name'] );
|
||||
if(isset($_POST['s3url'])) OC_Config::setValue( 'external-site3url', $_POST['s3url'] );
|
||||
if(isset($_POST['s4name'])) OC_Config::setValue( 'external-site4name', $_POST['s4name'] );
|
||||
if(isset($_POST['s4url'])) OC_Config::setValue( 'external-site4url', $_POST['s4url'] );
|
||||
if(isset($_POST['s5name'])) OC_Config::setValue( 'external-site5name', $_POST['s5name'] );
|
||||
if(isset($_POST['s5url'])) OC_Config::setValue( 'external-site5url', $_POST['s5url'] );
|
||||
|
||||
echo 'true';
|
||||
|
||||
?>
|
||||
37
apps/external/appinfo/app.php
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - External plugin
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
OC_APP::registerAdmin('external','settings');
|
||||
|
||||
OC_App::register( array( 'order' => 70, 'id' => 'external', 'name' => 'External' ));
|
||||
|
||||
if(OC_Config::getValue( "external-site1name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index1', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=1', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Config::getValue( "external-site1name", '' )));
|
||||
|
||||
if(OC_Config::getValue( "external-site2name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index2', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=2', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Config::getValue( "external-site2name", '' )));
|
||||
|
||||
if(OC_Config::getValue( "external-site3name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index3', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=3', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Config::getValue( "external-site3name", '' )));
|
||||
|
||||
if(OC_Config::getValue( "external-site4name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index4', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=4', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Config::getValue( "external-site4name", '' )));
|
||||
|
||||
if(OC_Config::getValue( "external-site5name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index5', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=5', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Config::getValue( "external-site5name", '' )));
|
||||
|
||||
10
apps/external/appinfo/info.xml
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<id>external</id>
|
||||
<name>External</name>
|
||||
<description>Show external Application in the ownCloud menu</description>
|
||||
<version>1.0</version>
|
||||
<licence>AGPL</licence>
|
||||
<author>Frank Karlitschek</author>
|
||||
<require>2</require>
|
||||
</info>
|
||||
BIN
apps/external/img/external.png
vendored
Normal file
|
After Width: | Height: | Size: 459 B |
292
apps/external/img/external.svg
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
<?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:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="16"
|
||||
height="16"
|
||||
id="svg2457"
|
||||
inkscape:version="0.48.1 r9760"
|
||||
sodipodi:docname="world.svg"
|
||||
inkscape:export-filename="/home/jancborchardt/owncloud-sharing/core/img/actions/settings.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<metadata
|
||||
id="metadata23">
|
||||
<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>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="776"
|
||||
id="namedview21"
|
||||
showgrid="false"
|
||||
inkscape:zoom="17.875"
|
||||
inkscape:cx="-12.837249"
|
||||
inkscape:cy="5.7622378"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2457" />
|
||||
<defs
|
||||
id="defs2459">
|
||||
<linearGradient
|
||||
id="linearGradient5128">
|
||||
<stop
|
||||
id="stop5130"
|
||||
style="stop-color:#e5e5e5;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop5132"
|
||||
style="stop-color:#ababab;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="86.132919"
|
||||
y1="105.105"
|
||||
x2="84.63858"
|
||||
y2="20.895"
|
||||
id="linearGradient3260"
|
||||
xlink:href="#linearGradient5128"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(9.6142312e-2,0,0,9.6142312e-2,1.8468935,1.9430362)" />
|
||||
<linearGradient
|
||||
id="linearGradient3397">
|
||||
<stop
|
||||
id="stop3399"
|
||||
style="stop-color:#aaaaaa;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3401"
|
||||
style="stop-color:#8c8c8c;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="21"
|
||||
y1="0"
|
||||
x2="21"
|
||||
y2="16.004715"
|
||||
id="linearGradient3264"
|
||||
xlink:href="#linearGradient3397"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-17.058189,0)" />
|
||||
<linearGradient
|
||||
x1="63.9995"
|
||||
y1="3.1001"
|
||||
x2="63.9995"
|
||||
y2="122.8994"
|
||||
id="linearGradient3309"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
id="stop3311"
|
||||
style="stop-color:#f6f6f6;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3313"
|
||||
style="stop-color:#cccccc;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="25"
|
||||
y1="0"
|
||||
x2="25"
|
||||
y2="16.000105"
|
||||
id="linearGradient3262"
|
||||
xlink:href="#linearGradient3309"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-17.058189,0)" />
|
||||
<linearGradient
|
||||
id="linearGradient3678">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3680" />
|
||||
<stop
|
||||
style="stop-color:#e6e6e6;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3682" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3309-5"
|
||||
id="linearGradient3066-2"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-17.058189,0)"
|
||||
x1="25"
|
||||
y1="0"
|
||||
x2="25"
|
||||
y2="16.000105" />
|
||||
<linearGradient
|
||||
x1="63.9995"
|
||||
y1="3.1001"
|
||||
x2="63.9995"
|
||||
y2="122.8994"
|
||||
id="linearGradient3309-5"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
id="stop3311-3"
|
||||
style="stop-color:#f6f6f6;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3313-3"
|
||||
style="stop-color:#cccccc;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3678"
|
||||
id="linearGradient3920"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-17.058189,-0.444)"
|
||||
x1="25"
|
||||
y1="0"
|
||||
x2="25"
|
||||
y2="16.000105" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3678-0"
|
||||
id="linearGradient3920-6"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-17.058189,-0.444)"
|
||||
x1="25"
|
||||
y1="0"
|
||||
x2="25"
|
||||
y2="16.000105" />
|
||||
<linearGradient
|
||||
id="linearGradient3678-0">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3680-5" />
|
||||
<stop
|
||||
style="stop-color:#e6e6e6;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3682-7" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
id="linearGradient3784"
|
||||
x1="0.5"
|
||||
y1="7.5560002"
|
||||
x2="15.5"
|
||||
y2="7.5560002"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
x1="46.395508"
|
||||
y1="12.707516"
|
||||
x2="46.395508"
|
||||
y2="38.409042"
|
||||
id="linearGradient3795-2"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.4100229,0,0,0.5447147,28.02322,-5.9219706)" />
|
||||
<linearGradient
|
||||
id="linearGradient3587-6-5-3-5-7">
|
||||
<stop
|
||||
id="stop3589-9-2-2-6-2"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3591-7-4-73-5-1"
|
||||
style="stop-color:#363636;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
id="linearGradient3810"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.4100229,0,0,0.5447147,28.02322,-5.9219706)"
|
||||
x1="46.395508"
|
||||
y1="12.707516"
|
||||
x2="46.395508"
|
||||
y2="38.409042" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
id="linearGradient3813"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.4100229,0,0,0.5447147,10.462268,-5.974418)"
|
||||
x1="46.395508"
|
||||
y1="12.707516"
|
||||
x2="46.395508"
|
||||
y2="38.409042" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
id="linearGradient3816"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="7.4930072"
|
||||
y1="0.0035526801"
|
||||
x2="7.4930072"
|
||||
y2="14.998127" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||
id="linearGradient3798"
|
||||
x1="8.8461542"
|
||||
y1="0.89504272"
|
||||
x2="8.8461542"
|
||||
y2="15.048951"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7-2"
|
||||
id="linearGradient3798-6"
|
||||
x1="8.8461542"
|
||||
y1="0.89504272"
|
||||
x2="8.8461542"
|
||||
y2="15.048951"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3587-6-5-3-5-7-2">
|
||||
<stop
|
||||
id="stop3589-9-2-2-6-2-9"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3591-7-4-73-5-1-7"
|
||||
style="stop-color:#363636;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="translate(-1,-1)"
|
||||
y2="15.048951"
|
||||
x2="8.8461542"
|
||||
y1="0.89504272"
|
||||
x1="8.8461542"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3815"
|
||||
xlink:href="#linearGradient3587-6-5-3-5-7-2"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none"
|
||||
d="M 8,1 C 4.1340071,1 1,4.134007 1,7.9999999 1,11.865994 4.1340071,15 8,15 11.865994,15 15,11.865994 15,7.9999999 15,4.134007 11.865994,1 8,1 z m 0.8020833,0.8932295 c 1.2010717,0.026708 2.2624547,0.7482116 3.3359377,1.2213541 L 13.869792,5.511719 13.596354,6.5416669 14.125,6.8697919 14.1159,8.0911458 c -0.0121,0.349374 0.005,0.6992101 -0.0091,1.048177 -0.166346,0.6623539 -0.550627,1.2665712 -0.875,1.8684892 -0.219888,0.108406 0.02005,-0.7185 -0.11849,-0.97526 C 13.14504,9.4386408 12.642422,9.4660089 12.302112,9.7955727 11.881413,10.041226 10.955977,10.114914 10.92581,9.4492183 10.687264,8.6490761 10.891165,7.7966268 11.217384,7.0520835 L 10.679623,6.3958335 10.87103,4.7096354 10.014259,3.8437502 10.21478,2.8958336 9.2121752,2.3307295 C 9.0145444,2.1755339 8.6384357,2.114115 8.5559252,1.902344 8.6372992,1.897654 8.7219474,1.891447 8.8020189,1.893224 z m -2.4609375,0.00912 c 0.031442,0.00459 0.069992,0.026431 0.1276042,0.072917 C 6.8067806,2.1608975 6.3863479,2.3716106 6.2864583,2.5677086 5.7466682,2.9328038 6.4524911,3.2318365 6.6875,3.5247398 7.0642392,3.4164892 7.4410308,2.8779535 7.9908854,3.0416669 8.6942527,2.8222093 8.5821719,3.630807 8.984375,3.9895836 9.036567,4.1585309 9.8643709,4.7080895 9.3671875,4.5273437 8.9577408,4.2098855 8.5022772,4.2337911 8.2096354,4.6914062 7.4187262,5.1199798 7.8867869,3.8662153 7.5078125,3.5611981 6.9348738,2.9219861 7.1750002,4.0387484 7.1067708,4.3723957 6.7342944,4.364267 6.0387231,4.0858224 5.6575521,4.5364583 L 6.03125,5.1471356 6.4778646,4.4635416 C 6.5864179,4.2161129 6.7226128,4.6558348 6.8424479,4.736979 6.9855355,5.0129459 7.6653536,5.4804485 7.1523438,5.6119794 6.3917179,6.0339397 5.7934201,6.6737624 5.1471354,7.2434895 4.9290953,7.7034971 4.4841468,7.6508764 4.2083333,7.2708332 3.5410706,6.8603335 3.5906422,7.9274218 3.625,8.3281249 l 0.5833333,-0.3645833 0,0.6015625 C 4.19179,8.6789089 4.2058787,8.7972867 4.1992147,8.9114582 3.790491,9.3384813 3.3785344,8.3120287 3.0234334,8.0820311 L 2.9960896,6.5781252 C 3.0089957,6.1556005 2.9197821,5.7229754 3.0052082,5.3111981 3.8089547,4.4486619 4.6253679,3.5550749 5.1015624,2.4583336 l 0.7838542,0 C 6.4331575,2.7236662 6.1210544,1.8701843 6.3411457,1.902344 z M 5.1835938,9.722656 c 0.095099,-0.010145 0.2032823,0.011573 0.3190103,0.072921 0.7379441,0.1056226 1.289687,0.640901 1.8776042,1.048178 0.4687224,0.464525 1.4828124,0.315782 1.5950521,1.102865 -0.1706086,0.853749 -1.0104785,1.312191 -1.75,1.61328 C 7.0406658,13.662851 6.8423351,13.744732 6.6328125,13.77865 5.9471995,13.950405 5.6507787,13.2474 5.5117188,12.721359 5.2012551,12.071255 4.4254987,11.578795 4.5364583,10.779953 4.5547311,10.382752 4.7714976,9.7666104 5.1835938,9.7226607 z"
|
||||
id="path3002" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
47
apps/external/index.php
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - External plugin
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if(isset($_GET['id'])){
|
||||
|
||||
$id=$_GET['id'];
|
||||
$id = (int) $id;
|
||||
|
||||
$url=OC_Config::getValue( "external-site".$id."url", '' );
|
||||
OC_App::setActiveNavigationEntry( 'external_index'.$id );
|
||||
|
||||
$tmpl = new OC_Template( 'external', 'frame', 'user' );
|
||||
$tmpl->assign('url',$url);
|
||||
$tmpl->printPage();
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
68
apps/external/js/admin.js
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
$('#s1name').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s1name" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s1name .msg', data); });
|
||||
});
|
||||
|
||||
$('#s2name').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s2name" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s2name .msg', data); });
|
||||
});
|
||||
|
||||
$('#s3name').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s3name" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s3name .msg', data); });
|
||||
});
|
||||
|
||||
$('#s4name').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s4name" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s4name .msg', data); });
|
||||
});
|
||||
|
||||
$('#s5name').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s5name" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s5name .msg', data); });
|
||||
});
|
||||
|
||||
$('#s1url').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s1url" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s1url .msg', data); });
|
||||
});
|
||||
|
||||
$('#s2url').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s2url" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s2url .msg', data); });
|
||||
});
|
||||
|
||||
$('#s3url').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s3url" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s3url .msg', data); });
|
||||
});
|
||||
|
||||
$('#s4url').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s4url" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s4url .msg', data); });
|
||||
});
|
||||
|
||||
$('#s5url').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#s5url" ).serialize();
|
||||
$.post( OC.filePath('external','ajax','seturls.php') , post, function(data){ OC.msg.finishedSaving('#s5url .msg', data); });
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
22
apps/external/settings.php
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
OC_Util::checkAdminUser();
|
||||
|
||||
OC_Util::addScript( "external", "admin" );
|
||||
|
||||
$tmpl = new OC_Template( 'external', 'settings');
|
||||
|
||||
$tmpl->assign('s1name',OC_Config::getValue( "external-site1name", '' ));
|
||||
$tmpl->assign('s2name',OC_Config::getValue( "external-site2name", '' ));
|
||||
$tmpl->assign('s3name',OC_Config::getValue( "external-site3name", '' ));
|
||||
$tmpl->assign('s4name',OC_Config::getValue( "external-site4name", '' ));
|
||||
$tmpl->assign('s5name',OC_Config::getValue( "external-site5name", '' ));
|
||||
|
||||
$tmpl->assign('s1url',OC_Config::getValue( "external-site1url", '' ));
|
||||
$tmpl->assign('s2url',OC_Config::getValue( "external-site2url", '' ));
|
||||
$tmpl->assign('s3url',OC_Config::getValue( "external-site3url", '' ));
|
||||
$tmpl->assign('s4url',OC_Config::getValue( "external-site4url", '' ));
|
||||
$tmpl->assign('s5url',OC_Config::getValue( "external-site5url", '' ));
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
?>
|
||||
26
apps/external/templates/frame.php
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<iframe src="<?php echo $_['url']; ?>" width="100%" id="ifm" ></iframe>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
|
||||
function pageY(elem) {
|
||||
return elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop;
|
||||
}
|
||||
var buffer = 5; //scroll bar buffer
|
||||
function resizeIframe() {
|
||||
var height = document.documentElement.clientHeight;
|
||||
height -= pageY(document.getElementById('ifm'))+ buffer ;
|
||||
height = (height < 0) ? 0 : height;
|
||||
document.getElementById('ifm').style.height = height + 'px';
|
||||
}
|
||||
|
||||
document.getElementById('ifm').onload=resizeIframe;
|
||||
window.onresize = resizeIframe;
|
||||
|
||||
//-->
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
23
apps/external/templates/settings.php
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<form id="external">
|
||||
<fieldset class="personalblock">
|
||||
<strong>External Sites</strong><br />
|
||||
<input type="text" name="s1name" id="s1name" value="<?php echo $_['s1name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s1url" id="s1url" value="<?php echo $_['s1url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br />
|
||||
<input type="text" name="s2name" id="s2name" value="<?php echo $_['s2name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s2url" id="s2url" value="<?php echo $_['s2url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br />
|
||||
<input type="text" name="s3name" id="s3name" value="<?php echo $_['s3name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s3url" id="s3url" value="<?php echo $_['s3url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br />
|
||||
<input type="text" name="s4name" id="s4name" value="<?php echo $_['s4name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s4url" id="s4url" value="<?php echo $_['s4url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br />
|
||||
<input type="text" name="s5name" id="s5name" value="<?php echo $_['s5name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s5url" id="s5url" value="<?php echo $_['s5url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br />
|
||||
|
||||
|
||||
<span class="msg"></span>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
OC_Util::addScript( 'files_imageviewer', 'lightbox' );
|
||||
OC_Util::addStyle( 'files_imageviewer', 'lightbox' );
|
||||
OC_Util::addScript('files_imageviewer', 'jquery.mousewheel-3.0.4.pack');
|
||||
OC_Util::addScript('files_imageviewer', 'jquery.fancybox-1.3.4.pack');
|
||||
OC_Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' );
|
||||
|
||||
?>
|
||||
|
|
|
|||
359
apps/files_imageviewer/css/jquery.fancybox-1.3.4.css
Normal file
|
|
@ -0,0 +1,359 @@
|
|||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: -20px;
|
||||
margin-left: -20px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
z-index: 1104;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 480px;
|
||||
background-image: url('../img/fancybox/fancybox.png');
|
||||
}
|
||||
|
||||
#fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-tmp {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 20px;
|
||||
z-index: 1101;
|
||||
outline: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-outer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#fancybox-content {
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
z-index: 1102;
|
||||
border: 0px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-hide-sel-frame {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 1101;
|
||||
}
|
||||
|
||||
#fancybox-close {
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
right: -15px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: transparent url('../img/fancybox.png') -40px 0px;
|
||||
cursor: pointer;
|
||||
z-index: 1103;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-error {
|
||||
color: #444;
|
||||
font: normal 12px/20px Arial;
|
||||
padding: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#fancybox-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
line-height: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#fancybox-frame {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left, #fancybox-right {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 100%;
|
||||
width: 35%;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
background: transparent url('../img/blank.gif');
|
||||
z-index: 1102;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-left {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#fancybox-right {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
#fancybox-left-ico, #fancybox-right-ico {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -9999px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
z-index: 1102;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left-ico {
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -30px;
|
||||
}
|
||||
|
||||
#fancybox-right-ico {
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -60px;
|
||||
}
|
||||
|
||||
#fancybox-left:hover, #fancybox-right:hover {
|
||||
visibility: visible; /* IE6 */
|
||||
}
|
||||
|
||||
#fancybox-left:hover span {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#fancybox-right:hover span {
|
||||
left: auto;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.fancybox-bg {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
#fancybox-bg-n {
|
||||
top: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('../img/fancybox-x.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-ne {
|
||||
top: -20px;
|
||||
right: -20px;
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -162px;
|
||||
}
|
||||
|
||||
#fancybox-bg-e {
|
||||
top: 0;
|
||||
right: -20px;
|
||||
height: 100%;
|
||||
background-image: url('../img/fancybox-y.png');
|
||||
background-position: -20px 0px;
|
||||
}
|
||||
|
||||
#fancybox-bg-se {
|
||||
bottom: -20px;
|
||||
right: -20px;
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -182px;
|
||||
}
|
||||
|
||||
#fancybox-bg-s {
|
||||
bottom: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('../img/fancybox-x.png');
|
||||
background-position: 0px -20px;
|
||||
}
|
||||
|
||||
#fancybox-bg-sw {
|
||||
bottom: -20px;
|
||||
left: -20px;
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -142px;
|
||||
}
|
||||
|
||||
#fancybox-bg-w {
|
||||
top: 0;
|
||||
left: -20px;
|
||||
height: 100%;
|
||||
background-image: url('../img/fancybox-y.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-nw {
|
||||
top: -20px;
|
||||
left: -20px;
|
||||
background-image: url('../img/fancybox.png');
|
||||
background-position: -40px -122px;
|
||||
}
|
||||
|
||||
#fancybox-title {
|
||||
font-family: Helvetica;
|
||||
font-size: 12px;
|
||||
z-index: 1102;
|
||||
}
|
||||
|
||||
.fancybox-title-inside {
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-title-outside {
|
||||
padding-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-over {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #FFF;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#fancybox-title-over {
|
||||
padding: 10px;
|
||||
background-image: url('../img/fancybox/fancy_title_over.png');
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-title-float {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap td {
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#fancybox-title-float-left {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('../img/fancybox/fancybox.png') -40px -90px no-repeat;
|
||||
}
|
||||
|
||||
#fancybox-title-float-main {
|
||||
color: #FFF;
|
||||
line-height: 29px;
|
||||
font-weight: bold;
|
||||
padding: 0 0 3px 0;
|
||||
background: url('../img/fancybox/fancybox-x.png') 0px -40px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-right {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('../img/fancybox/fancybox.png') -55px -90px no-repeat;
|
||||
}
|
||||
|
||||
/* IE6 */
|
||||
|
||||
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
|
||||
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
|
||||
height: expression(this.parentNode.clientHeight + "px");
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 {
|
||||
position: absolute; margin-top: 0;
|
||||
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
|
||||
|
||||
/* IE6, IE7, IE8 */
|
||||
|
||||
.fancybox-ie .fancybox-bg { background: transparent !important; }
|
||||
|
||||
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#lightbox_overlay{
|
||||
position:fixed;
|
||||
display:none;
|
||||
height:100%;
|
||||
width:100%;
|
||||
top:0px;
|
||||
left:0px;
|
||||
opacity:0.5;
|
||||
filter: alpha(opacity = 50);
|
||||
background-color:black;
|
||||
z-index:9999;
|
||||
}
|
||||
|
||||
#lightbox{
|
||||
position:fixed;
|
||||
display:none;
|
||||
max-height:90%;
|
||||
max-width:90%;
|
||||
top:10px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
z-index:9999;
|
||||
}
|
||||
|
||||
#lightbox_loader{
|
||||
text-align:center;
|
||||
position:fixed;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
color:white;
|
||||
}
|
||||
#lightbox_loader img { margin-right: 1em;}
|
||||
BIN
apps/files_imageviewer/img/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
apps/files_imageviewer/img/fancy_close.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/files_imageviewer/img/fancy_loading.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
apps/files_imageviewer/img/fancy_nav_left.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
apps/files_imageviewer/img/fancy_nav_right.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
apps/files_imageviewer/img/fancy_shadow_e.png
Normal file
|
After Width: | Height: | Size: 107 B |
BIN
apps/files_imageviewer/img/fancy_shadow_n.png
Normal file
|
After Width: | Height: | Size: 106 B |
BIN
apps/files_imageviewer/img/fancy_shadow_ne.png
Normal file
|
After Width: | Height: | Size: 347 B |
BIN
apps/files_imageviewer/img/fancy_shadow_nw.png
Normal file
|
After Width: | Height: | Size: 324 B |
BIN
apps/files_imageviewer/img/fancy_shadow_s.png
Normal file
|
After Width: | Height: | Size: 111 B |
BIN
apps/files_imageviewer/img/fancy_shadow_se.png
Normal file
|
After Width: | Height: | Size: 352 B |
BIN
apps/files_imageviewer/img/fancy_shadow_sw.png
Normal file
|
After Width: | Height: | Size: 340 B |
BIN
apps/files_imageviewer/img/fancy_shadow_w.png
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
apps/files_imageviewer/img/fancy_title_left.png
Normal file
|
After Width: | Height: | Size: 503 B |
BIN
apps/files_imageviewer/img/fancy_title_main.png
Normal file
|
After Width: | Height: | Size: 96 B |
BIN
apps/files_imageviewer/img/fancy_title_over.png
Normal file
|
After Width: | Height: | Size: 70 B |
BIN
apps/files_imageviewer/img/fancy_title_right.png
Normal file
|
After Width: | Height: | Size: 506 B |
BIN
apps/files_imageviewer/img/fancybox-x.png
Normal file
|
After Width: | Height: | Size: 203 B |
BIN
apps/files_imageviewer/img/fancybox-y.png
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
apps/files_imageviewer/img/fancybox.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
46
apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
||||
14
apps/files_imageviewer/js/jquery.mousewheel-3.0.4.pack.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.4
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
||||
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
||||
|
|
@ -1,18 +1,4 @@
|
|||
|
||||
var lightBoxShown=false;
|
||||
$(document).ready(function() {
|
||||
images={};//image cache
|
||||
loading_str = t('files_imageviewer','Loading');
|
||||
var overlay=$('<div id="lightbox_overlay"><div id="lightbox_loader"><img /></div></div>');
|
||||
overlay.find('#lightbox_loader img')
|
||||
.attr('src',OC.imagePath('core', 'loading-dark.gif'))
|
||||
.attr('alt',loading_str)
|
||||
.after(loading_str);
|
||||
$( 'body' ).append(overlay);
|
||||
var container=$('<div id="lightbox"/>');
|
||||
$( 'body' ).append(container);
|
||||
$( '#lightbox_overlay' ).click(hideLightbox);
|
||||
$( '#lightbox' ).click(hideLightbox);
|
||||
if(typeof FileActions!=='undefined'){
|
||||
FileActions.register('image','View','',function(filename){
|
||||
viewImage($('#dir').val(),filename);
|
||||
|
|
@ -22,7 +8,6 @@ $(document).ready(function() {
|
|||
OC.search.customResults.Images=function(row,item){
|
||||
var image=item.link.substr(item.link.indexOf('file=')+5);
|
||||
var a=row.find('a');
|
||||
var container=$('<div id="lightbox"/>');
|
||||
a.attr('href','#');
|
||||
a.click(function(){
|
||||
var file=image.split('/').pop();
|
||||
|
|
@ -32,52 +17,11 @@ $(document).ready(function() {
|
|||
}
|
||||
});
|
||||
|
||||
function viewImage(dir,file){
|
||||
function viewImage(dir, file) {
|
||||
var location=OC.filePath('files','ajax','download.php')+'?files='+file+'&dir='+dir;
|
||||
var overlay=$('#lightbox_overlay');
|
||||
var container=$('#lightbox');
|
||||
overlay.show();
|
||||
if(!images[location]){
|
||||
var img = new Image();
|
||||
img.onload = function(){
|
||||
images[location]=img;
|
||||
if($('#lightbox_overlay').is(':visible'))
|
||||
showLightbox(container,img);
|
||||
}
|
||||
img.src = location;
|
||||
}else{
|
||||
showLightbox(container,images[location]);
|
||||
}
|
||||
$.fancybox({
|
||||
"href": location,
|
||||
"title": file,
|
||||
"titlePosition": "inside"
|
||||
});
|
||||
}
|
||||
|
||||
function showLightbox(container,img){
|
||||
var maxWidth = $( window ).width() - 50;
|
||||
var maxHeight = $( window ).height() - 50;
|
||||
if( img.width > maxWidth || img.height > maxHeight ) { // One of these is larger than the window
|
||||
var ratio = img.width / img.height;
|
||||
if( img.height >= maxHeight ) {
|
||||
img.height = maxHeight;
|
||||
img.width = maxHeight * ratio;
|
||||
} else {
|
||||
img.width = maxWidth;
|
||||
img.height = maxWidth / ratio;
|
||||
}
|
||||
}
|
||||
container.empty();
|
||||
container.append(img);
|
||||
container.css('top',Math.round( ($( window ).height() - img.height)/2));
|
||||
container.css('left',Math.round( ($( window ).width() - img.width)/2));
|
||||
$('#lightbox').show();
|
||||
setTimeout(function(){
|
||||
lightBoxShown=true;
|
||||
},100);
|
||||
}
|
||||
|
||||
function hideLightbox(event){
|
||||
if(event){
|
||||
event.stopPropagation();
|
||||
$('#lightbox_overlay').hide();
|
||||
$('#lightbox').hide();
|
||||
lightBoxShown=false;
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ $(document).ready(function() {
|
|||
type: 'GET',
|
||||
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
|
||||
dataType: 'json',
|
||||
data: 'source='+file,
|
||||
data: {source: file},
|
||||
async: false,
|
||||
success: function(users) {
|
||||
if (users) {
|
||||
|
|
@ -46,6 +46,7 @@ $(document).ready(function() {
|
|||
|
||||
$('.share').click(function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var filenames = getSelectedFiles('name');
|
||||
var length = filenames.length;
|
||||
var files = '';
|
||||
|
|
@ -184,8 +185,8 @@ function createDropdown(filename, files) {
|
|||
html += '<input id="link" style="display:none; width:90%;" />';
|
||||
html += '</div>';
|
||||
if (filename) {
|
||||
$('tr[data-file="'+filename+'"]').addClass('mouseOver');
|
||||
$(html).appendTo($('tr[data-file="'+filename+'"] td.filename'));
|
||||
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
|
||||
} else {
|
||||
$(html).appendTo($('thead .share'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $
|
|||
default:
|
||||
exit();
|
||||
}
|
||||
if(!$myImage) exit();
|
||||
$ratio_orig = $width_orig/$height_orig;
|
||||
|
||||
if ($thumbnail_width/$thumbnail_height > $ratio_orig) {
|
||||
|
|
@ -52,8 +53,11 @@ $targetImg = imagecreatetruecolor($numOfItems*$box_size, $box_size);
|
|||
$counter = 0;
|
||||
while (($i = $result->fetchRow()) && $counter < $numOfItems) {
|
||||
$imagePath = OC::$CONFIG_DATADIRECTORY . $i['file_path'];
|
||||
CroppedThumbnail($imagePath, $box_size, $box_size, $targetImg, $counter*$box_size);
|
||||
$counter++;
|
||||
if(file_exists($imagePath))
|
||||
{
|
||||
CroppedThumbnail($imagePath, $box_size, $box_size, $targetImg, $counter*$box_size);
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
||||
header('Content-Type: image/png');
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ OC_JSON::checkAppEnabled('gallery');
|
|||
|
||||
function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSrc is a FILE - Returns an image resource.
|
||||
//getting the image dimensions
|
||||
if(! function_exists('imagecreatefromjpeg'))
|
||||
OC_Log::write('gallery','GD module not installed',OC_Log::ERROR);
|
||||
|
||||
list($width_orig, $height_orig) = getimagesize($imgSrc);
|
||||
switch (strtolower(substr($imgSrc, strrpos($imgSrc, '.')+1))) {
|
||||
case "jpeg":
|
||||
|
|
@ -18,6 +21,7 @@ function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSr
|
|||
default:
|
||||
exit();
|
||||
}
|
||||
if(!$myImage) exit();
|
||||
$ratio_orig = $width_orig/$height_orig;
|
||||
|
||||
if ($thumbnail_width/$thumbnail_height > $ratio_orig) {
|
||||
|
|
@ -47,9 +51,10 @@ $img = $_GET['img'];
|
|||
|
||||
$tmp = OC::$CONFIG_DATADIRECTORY . $img;
|
||||
|
||||
header('Content-Type: image/png');
|
||||
$image = CroppedThumbnail($tmp, $box_size, $box_size);
|
||||
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
if(file_exists($tmp))
|
||||
{
|
||||
header('Content-Type: image/png');
|
||||
$image = CroppedThumbnail($tmp, $box_size, $box_size);
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ class OC_GALLERY_SCANNER {
|
|||
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
|
||||
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
|
||||
if ($result->numRows() == 0 && count($current_album['images'])) {
|
||||
$stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
|
||||
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
|
||||
$stmt->execute(array(OC_User::getUser(), $current_album['name']));
|
||||
}
|
||||
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
|
||||
|
|
@ -42,7 +42,7 @@ class OC_GALLERY_SCANNER {
|
|||
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?');
|
||||
$result = $stmt->execute(array($albumId, $img));
|
||||
if ($result->numRows() == 0) {
|
||||
$stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
|
||||
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
|
||||
$stmt->execute(array($albumId, $img));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,17 @@
|
|||
<?php
|
||||
OC_Util::addStyle('gallery', 'styles');
|
||||
OC_Util::addScript('gallery', 'album_cover');
|
||||
OC_Util::addScript( 'files_imageviewer', 'lightbox' );
|
||||
OC_Util::addStyle( 'files_imageviewer', 'lightbox' );
|
||||
OC_Util::addScript('files_imageviewer', 'jquery.mousewheel-3.0.4.pack');
|
||||
OC_Util::addScript('files_imageviewer', 'jquery.fancybox-1.3.4.pack');
|
||||
OC_Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' );
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("a[rel=images]").fancybox({
|
||||
'titlePosition': 'inside'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="controls">
|
||||
<a href="?"><input type="button" value="Back" /></a><br/>
|
||||
|
|
@ -12,7 +20,7 @@ OC_Util::addStyle( 'files_imageviewer', 'lightbox' );
|
|||
<?php
|
||||
foreach ($_['photos'] as $a) {
|
||||
?>
|
||||
<a onclick="javascript:viewImage('/','<?php echo $a; ?>');"><img src="ajax/thumbnail.php?img=<?php echo $a ?>"></a>
|
||||
<a rel="images" href="../../files/ajax/download.php?files=<?php echo $a; ?>"><img src="ajax/thumbnail.php?img=<?php echo $a ?>"></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#playercontrols{
|
||||
display:inline;
|
||||
margin-left:1em;
|
||||
width:7em;
|
||||
width:4em;
|
||||
height:1em;
|
||||
position:fixed;
|
||||
top:auto;
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class OC_MEDIA_COLLECTION{
|
|||
$query=self::$queries['addsong'];
|
||||
}
|
||||
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
|
||||
$songId=OC_DB::insertid();
|
||||
$songId=OC_DB::insertid('*PREFIX*media_songs');
|
||||
// self::setLastUpdated();
|
||||
return self::getSongId($name,$artist,$album);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,6 @@ class OC_remoteStorage {
|
|||
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");
|
||||
$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();
|
||||
while($row=$result->fetchRow()){
|
||||
$ret[$row['token']]=$userAddress;
|
||||
|
|
@ -21,12 +15,6 @@ class OC_remoteStorage {
|
|||
$user=OC_User::getUser();
|
||||
$query=OC_DB::prepare("SELECT token,appUrl,userAddress,dataScope FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
|
||||
$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();
|
||||
while($row=$result->fetchRow()){
|
||||
$ret[$row['token']] = array(
|
||||
|
|
@ -42,23 +30,11 @@ class OC_remoteStorage {
|
|||
$user=OC_User::getUser();
|
||||
$query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND 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){
|
||||
$user=OC_User::getUser();
|
||||
$query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`userAddress`,`dataScope`) VALUES(?,?,?,?,?)");
|
||||
$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){
|
||||
$token=uniqid();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,14 @@ if($_SERVER['SCRIPT_NAME'] == '/.well-known/webfinger.php') {
|
|||
} else {
|
||||
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']) {
|
||||
$bits = explode('@', $_GET['q']);
|
||||
|
|
@ -20,5 +27,5 @@ echo "<";
|
|||
?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">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -32,12 +32,14 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
|
|||
|
||||
/* INPUTS */
|
||||
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"] { -webkit-appearance:textfield; -webkit-box-sizing:content-box; }
|
||||
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus, input[type="search"]:hover, input[type="search"]:focus { background:#fff; color:#333; }
|
||||
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="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; }
|
||||
|
||||
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="checkbox"] { width:auto; }
|
||||
#quota { cursor:default; }
|
||||
|
|
@ -46,7 +48,7 @@ input[type="checkbox"] { width:auto; }
|
|||
#body-login input[type="text"], #body-login input[type="password"] { width: 13em; }
|
||||
#body-login input.login { width: auto; float: right; }
|
||||
#remember_login { margin:.8em .2em 0 1em; }
|
||||
form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.4em; right:3em; padding:.2em .5em .2em 1.5em; background-image:url('../img/actions/search.svg'); background-repeat:no-repeat; background-position:.5em center; border:0; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
|
||||
.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.4em; right:3em; padding:.2em .5em .2em 1.5em; background:#fff url('../img/actions/search.svg') no-repeat .5em center; border:0; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; opacity:.3; -webkit-transition:opacity 300ms; -moz-transition:opacity 300ms; -o-transition:opacity 300ms; transition:opacity 300ms; }
|
||||
input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; }
|
||||
input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
|
||||
|
||||
|
|
@ -70,14 +72,14 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
|
|||
#login form { width:22em; margin:2em auto 2em; padding:0; }
|
||||
#login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
|
||||
#login form fieldset legend { font-weight:bold; }
|
||||
#login form label { margin:.9em .8em .7em;; color:#666; }
|
||||
#login form label { margin:.95em 0 0 .85em; color:#666; }
|
||||
/* NEEDED FOR INFIELD LABELS */
|
||||
p.infield { position: relative; }
|
||||
label.infield { cursor: text !important; }
|
||||
#login form label.infield { position:absolute; font-size:1.5em; color:#AAA; }
|
||||
#login #dbhostlabel, #login #directorylabel { display:block; margin:.95em 0 .8em -8em; }
|
||||
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
|
||||
#login form ul.errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
|
||||
#login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
|
||||
|
||||
#login form #selectDbType { text-align:center; }
|
||||
#login form #selectDbType label { position:static; font-size:1em; margin:0 -.3em 1em; cursor:pointer; padding:.4em; border:1px solid #ddd; font-weight:bold; background:#f8f8f8; color:#555; text-shadow:#eee 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; }
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 55 KiB |