commit
02d7b1a1fc
@ -0,0 +1,18 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Calendar interface |
||||
* |
||||
* Implement this interface to allow a node to be recognized as an calendar. |
||||
* |
||||
* @package Sabre |
||||
* @subpackage CalDAV |
||||
* @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 |
||||
*/ |
||||
interface Sabre_CalDAV_ICalendar extends Sabre_DAV_ICollection { |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* CalendarObject interface |
||||
/** |
||||
* Extend the ICalendarObject interface to allow your custom nodes to be picked up as |
||||
* CalendarObjects. |
||||
* |
||||
* Calendar objects are resources such as Events, Todo's or Journals. |
||||
* |
||||
* @package Sabre |
||||
* @subpackage CalDAV |
||||
* @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 |
||||
*/ |
||||
interface Sabre_CalDAV_ICalendarObject extends Sabre_DAV_IFile { |
||||
|
||||
} |
||||
|
@ -0,0 +1,69 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Supported-address-data property |
||||
* |
||||
* This property is a representation of the supported-address-data property |
||||
* in the CardDAV namespace. |
||||
* |
||||
* @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 |
||||
*/ |
||||
class Sabre_CardDAV_Property_SupportedAddressData extends Sabre_DAV_Property { |
||||
|
||||
/** |
||||
* supported versions |
||||
* |
||||
* @var array |
||||
*/ |
||||
protected $supportedData = array(); |
||||
|
||||
/** |
||||
* Creates the property |
||||
* |
||||
* @param array $components |
||||
*/ |
||||
public function __construct(array $supportedData = null) { |
||||
|
||||
if (is_null($supportedData)) { |
||||
$supportedData = array( |
||||
array('contentType' => 'text/vcard', 'version' => '3.0'), |
||||
array('contentType' => 'text/vcard', 'version' => '4.0'), |
||||
); |
||||
} |
||||
|
||||
$this->supportedData = $supportedData; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Serializes the property in a DOMDocument |
||||
* |
||||
* @param Sabre_DAV_Server $server |
||||
* @param DOMElement $node |
||||
* @return void |
||||
*/ |
||||
public function serialize(Sabre_DAV_Server $server,DOMElement $node) { |
||||
|
||||
$doc = $node->ownerDocument; |
||||
|
||||
$prefix = |
||||
isset($server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV]) ? |
||||
$server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV] : |
||||
'card'; |
||||
|
||||
foreach($this->supportedData as $supported) { |
||||
|
||||
$caldata = $doc->createElementNS(Sabre_CardDAV_Plugin::NS_CARDDAV, $prefix . ':address-data-type'); |
||||
$caldata->setAttribute('content-type',$supported['contentType']); |
||||
$caldata->setAttribute('version',$supported['version']); |
||||
$node->appendChild($caldata); |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,120 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* SimpleFile |
||||
* |
||||
* The 'SimpleFile' class is used to easily add read-only immutable files to |
||||
* the directory structure. One usecase would be to add a 'readme.txt' to a |
||||
* root of a webserver with some standard content. |
||||
* |
||||
* @package Sabre |
||||
* @subpackage DAV |
||||
* @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 |
||||
*/ |
||||
class Sabre_DAV_SimpleFile extends Sabre_DAV_File { |
||||
|
||||
/** |
||||
* File contents |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $contents = array(); |
||||
|
||||
/** |
||||
* Name of this resource |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $name; |
||||
|
||||
/** |
||||
* A mimetype, such as 'text/plain' or 'text/html' |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $mimeType; |
||||
|
||||
/** |
||||
* Creates this node |
||||
* |
||||
* The name of the node must be passed, as well as the contents of the |
||||
* file. |
||||
* |
||||
* @param string $name |
||||
* @param string $contents |
||||
*/ |
||||
public function __construct($name, $contents, $mimeType = null) { |
||||
|
||||
$this->name = $name; |
||||
$this->contents = $contents; |
||||
$this->mimeType = $mimeType; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Returns the node name for this file. |
||||
* |
||||
* This name is used to construct the url. |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getName() { |
||||
|
||||
return $this->name; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Returns the data |
||||
* |
||||
* This method may either return a string or a readable stream resource |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function get() { |
||||
|
||||
return $this->contents; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Returns the size of the file, in bytes. |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getSize() { |
||||
|
||||
return strlen($this->contents); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Returns the ETag for a file |
||||
* |
||||
* An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. |
||||
* The ETag is an arbritrary string, but MUST be surrounded by double-quotes. |
||||
* |
||||
* Return null if the ETag can not effectively be determined |
||||
*/ |
||||
public function getETag() { |
||||
|
||||
return '"' . md5($this->contents) . '"'; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Returns the mime-type for a file |
||||
* |
||||
* If null is returned, we'll assume application/octet-stream |
||||
*/ |
||||
public function getContentType() { |
||||
|
||||
return $this->mimeType; |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
?> |
@ -0,0 +1,33 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* ownCloud - user_ldap |
||||
* |
||||
* @author Dominik Schmidt |
||||
* @copyright 2011 Dominik Schmidt dev@dominik-schmidt.de |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
|
||||
OC_APP::registerAdmin('admin_export','settings'); |
||||
|
||||
// add settings page to navigation |
||||
$entry = array( |
||||
'id' => "admin_export_settings", |
||||
'order'=>1, |
||||
'href' => OC_Helper::linkTo( "admin_export", "settings.php" ), |
||||
'name' => 'Export' |
||||
); |
@ -0,0 +1,10 @@ |
||||
<?xml version="1.0"?> |
||||
<info> |
||||
<id>admin_export</id> |
||||
<name>Import/Export</name> |
||||
<description>Import/Export your owncloud data</description> |
||||
<version>0.1</version> |
||||
<licence>AGPL</licence> |
||||
<author>Thomas Schmidt</author> |
||||
<require>2</require> |
||||
</info> |
@ -0,0 +1,96 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* ownCloud - admin export |
||||
* |
||||
* @author Thomas Schmidt |
||||
* @copyright 2011 Thomas Schmidt tom@opensuse.org |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
OC_Util::checkAdminUser(); |
||||
OC_Util::checkAppEnabled('admin_export'); |
||||
if (isset($_POST['admin_export'])) { |
||||
$root = OC::$SERVERROOT . "/"; |
||||
$zip = new ZipArchive(); |
||||
$filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; |
||||
error_log("Creating export file at: " . $filename); |
||||
if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) { |
||||
exit("Cannot open <$filename>\n"); |
||||
} |
||||
|
||||
if (isset($_POST['owncloud_system'])) { |
||||
// adding owncloud system files |
||||
error_log("Adding owncloud system files to export"); |
||||
zipAddDir($root, $zip, false); |
||||
foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dirname) { |
||||
zipAddDir($root . $dirname, $zip, true, basename($root) . "/"); |
||||
} |
||||
} |
||||
|
||||
if (isset($_POST['owncloud_config'])) { |
||||
// adding owncloud config |
||||
// todo: add database export |
||||
error_log("Adding owncloud config to export"); |
||||
zipAddDir($root . "config/", $zip, true, basename($root) . "/"); |
||||
$zip->addFile($root . '/data/.htaccess', basename($root) . "/data/owncloud.db"); |
||||
} |
||||
|
||||
if (isset($_POST['user_files'])) { |
||||
// adding user files |
||||
$zip->addFile($root . '/data/.htaccess', basename($root) . "/data/.htaccess"); |
||||
$zip->addFile($root . '/data/index.html', basename($root) . "/data/index.html"); |
||||
foreach (OC_User::getUsers() as $i) { |
||||
error_log("Adding owncloud user files of $i to export"); |
||||
zipAddDir($root . "data/" . $i, $zip, true, basename($root) . "/data/"); |
||||
} |
||||
} |
||||
|
||||
$zip->close(); |
||||
|
||||
header("Content-Type: application/zip"); |
||||
header("Content-Disposition: attachment; filename=" . basename($filename)); |
||||
header("Content-Length: " . filesize($filename)); |
||||
ob_end_clean(); |
||||
readfile($filename); |
||||
unlink($filename); |
||||
} else { |
||||
// fill template |
||||
$tmpl = new OC_Template('admin_export', 'settings'); |
||||
return $tmpl->fetchPage(); |
||||
} |
||||
|
||||
function zipAddDir($dir, $zip, $recursive=true, $internalDir='') { |
||||
$dirname = basename($dir); |
||||
$zip->addEmptyDir($internalDir . $dirname); |
||||
$internalDir.=$dirname.='/'; |
||||
|
||||
if ($dirhandle = opendir($dir)) { |
||||
while (false !== ( $file = readdir($dirhandle))) { |
||||
|
||||
if (( $file != '.' ) && ( $file != '..' )) { |
||||
|
||||
if (is_dir($dir . '/' . $file) && $recursive) { |
||||
zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir); |
||||
} elseif (is_file($dir . '/' . $file)) { |
||||
$zip->addFile($dir . '/' . $file, $internalDir . $file); |
||||
} |
||||
} |
||||
} |
||||
closedir($dirhandle); |
||||
} else { |
||||
error_log("Was not able to open directory: " . $dir); |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
<form id="export" action="#" method="post"> |
||||
<fieldset class="personalblock"> |
||||
<legend><strong><?php echo $l->t('Export this ownCloud instance');?></strong></legend>
|
||||
<p><?php echo $l->t('This will create a compressed file that contains the data of this owncloud instance. |
||||
Please choose which components should be included:');?> |
||||
</p> |
||||
<p><input type="checkbox" id="user_files" name="user_files" value="true"><label for="user_files"><?php echo $l->t('User files');?></label><br/>
|
||||
<input type="checkbox" id="owncloud_system" name="owncloud_system" value="true"><label for="owncloud_system"><?php echo $l->t('ownCloud system files');?></label><br/>
|
||||
<input type="checkbox" id="owncloud_config" name="owncloud_config" value="true"><label for="owncloud_config"><?php echo $l->t('ownCloud configuration');?></label>
|
||||
</p> |
||||
<input type="submit" name="admin_export" value="Export" /> |
||||
</fieldset> |
||||
</form> |
@ -1,8 +1,8 @@ |
||||
<div class="bookmarks_addBm"> |
||||
<p><label class="bookmarks_label">Address</label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<? echo $_['URL']; ?>"/></p>
|
||||
<p><label class="bookmarks_label">Title</label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<? echo $_['TITLE']; ?>" /></p>
|
||||
<p><label class="bookmarks_label">Description</label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<? echo $_['DESCRIPTION']; ?>" /></p>
|
||||
<p><label class="bookmarks_label">Tags</label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p> |
||||
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint">Hint: Use space to separate tags.</label></p> |
||||
<p><label class="bookmarks_label"></label><input type="submit" id="bookmark_add_submit" /></p> |
||||
</div> |
||||
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p>
|
||||
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p>
|
||||
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<?php echo $_['DESCRIPTION']; ?>" /></p>
|
||||
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
|
||||
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
|
||||
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
|
||||
</div> |
||||
|
@ -1,30 +1,27 @@ |
||||
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
|
||||
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? 'Bookmarks with tag: ' . urldecode($_GET["tag"]) : 'All bookmarks'; ?></h2>
|
||||
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? $l->t('Bookmarks with tag: ') . urldecode($_GET["tag"]) : $l->t('All bookmarks'); ?></h2>
|
||||
<div class="bookmarks_menu"> |
||||
<input type="button" class="bookmarks_addBtn" value="Add Bookmark"/> |
||||
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');" title="Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.">Add page to ownCloud</a>
|
||||
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>
|
||||
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');" title="<?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?>"><?php echo $l->t('Add page to ownCloud'); ?></a>
|
||||
</div> |
||||
<div class="bookmarks_add"> |
||||
<input type="hidden" id="bookmark_add_id" value="0" /> |
||||
<p><label class="bookmarks_label">Address</label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p> |
||||
<p><label class="bookmarks_label">Title</label><input type="text" id="bookmark_add_title" class="bookmarks_input" /> |
||||
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
|
||||
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
|
||||
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
|
||||
<p><label class="bookmarks_label">Description</label><input type="text" id="bookmark_add_description" class="bookmarks_input" /> |
||||
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" />
|
||||
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
|
||||
<p><label class="bookmarks_label">Tags</label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p> |
||||
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint">Hint: Use space to separate tags.</label></p> |
||||
<p><label class="bookmarks_label"></label><input type="submit" id="bookmark_add_submit" /></p> |
||||
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
|
||||
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
|
||||
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
|
||||
</div> |
||||
<div class="bookmarks_sorting pager"> |
||||
<ul> |
||||
<li class="bookmarks_sorting_recent">Recent Bookmarks</li> |
||||
<li class="bookmarks_sorting_clicks">Most clicks</li> |
||||
<li class="bookmarks_sorting_recent"><?php echo $l->t('Recent Bookmarks'); ?></li>
|
||||
<li class="bookmarks_sorting_clicks"><?php echo $l->t('Most clicks'); ?></li>
|
||||
</ul> |
||||
</div> |
||||
<div class="clear"></div> |
||||
<div class="bookmarks_list"> |
||||
<noscript> |
||||
JavaScript is needed to display your Bookmarks |
||||
</noscript> |
||||
You have no bookmarks |
||||
<?php echo $l->t('You have no bookmarks'); ?> |
||||
</div> |
||||
|
@ -0,0 +1,11 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
echo OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'weekend', '{"Monday":"false","Tuesday":"false","Wednesday":"false","Thursday":"false","Friday":"false","Saturday":"true","Sunday":"true"}'); |
||||
?> |
@ -0,0 +1,12 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
$duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', "60"); |
||||
OC_JSON::encodedPrint(array("duration" => $duration)); |
||||
?> |
@ -0,0 +1,12 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
$firstdayofweek = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstdayofweek', "1"); |
||||
OC_JSON::encodedPrint(array("firstdayofweek" => $firstdayofweek)); |
||||
?> |
@ -1,9 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
?> |
@ -0,0 +1,103 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
error_reporting(E_ALL); |
||||
require_once('../../../lib/base.php'); |
||||
OC_JSON::checkLoggedIn(); |
||||
$data = OC_Calendar_Object::find($_POST["id"]); |
||||
$calendarid = $data["calendarid"]; |
||||
$cal = $calendarid; |
||||
$id = $_POST["id"]; |
||||
$calendar = OC_Calendar_Calendar::findCalendar($calendarid); |
||||
if(OC_User::getUser() != $calendar["userid"]){ |
||||
OC_JSON::error(); |
||||
exit; |
||||
} |
||||
$newdate = $_POST["newdate"]; |
||||
$caldata = array(); |
||||
//modified part of editeventform.php |
||||
$object = Sabre_VObject_Reader::read($data['calendardata']); |
||||
$vevent = $object->VEVENT; |
||||
$dtstart = $vevent->DTSTART; |
||||
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); |
||||
switch($dtstart->getDateType()) { |
||||
case Sabre_VObject_Element_DateTime::LOCALTZ: |
||||
case Sabre_VObject_Element_DateTime::LOCAL: |
||||
$startdate = $dtstart->getDateTime()->format('d-m-Y'); |
||||
$starttime = $dtstart->getDateTime()->format('H:i'); |
||||
$enddate = $dtend->getDateTime()->format('d-m-Y'); |
||||
$endtime = $dtend->getDateTime()->format('H:i'); |
||||
$allday = false; |
||||
break; |
||||
case Sabre_VObject_Element_DateTime::DATE: |
||||
$startdate = $dtstart->getDateTime()->format('d-m-Y'); |
||||
$starttime = '00:00'; |
||||
$dtend->getDateTime()->modify('-1 day'); |
||||
$enddate = $dtend->getDateTime()->format('d-m-Y'); |
||||
$endtime = '23:59'; |
||||
$allday = true; |
||||
break; |
||||
} |
||||
$caldata["title"] = isset($vevent->SUMMARY) ? $vevent->SUMMARY->value : ''; |
||||
$caldata["location"] = isset($vevent->LOCATION) ? $vevent->LOCATION->value : ''; |
||||
$caldata["categories"] = array(); |
||||
if (isset($vevent->CATEGORIES)){ |
||||
$caldata["categories"] = explode(',', $vevent->CATEGORIES->value); |
||||
$caldata["categories"] = array_map('trim', $categories); |
||||
} |
||||
foreach($caldata["categories"] as $category){ |
||||
if (!in_array($category, $category_options)){ |
||||
array_unshift($category_options, $category); |
||||
} |
||||
} |
||||
$caldata["repeat"] = isset($vevent->CATEGORY) ? $vevent->CATEGORY->value : ''; |
||||
$caldata["description"] = isset($vevent->DESCRIPTION) ? $vevent->DESCRIPTION->value : ''; |
||||
//end part of editeventform.php |
||||
$startdatearray = explode("-", $startdate); |
||||
$starttimearray = explode(":", $starttime); |
||||
$startunix = mktime($starttimearray[0], $starttimearray[1], 0, $startdatearray[1], $startdatearray[0], $startdatearray[2]); |
||||
$enddatearray = explode("-", $enddate); |
||||
$endtimearray = explode(":", $endtime); |
||||
$endunix = mktime($endtimearray[0], $endtimearray[1], 0, $enddatearray[1], $enddatearray[0], $enddatearray[2]); |
||||
$difference = $endunix - $startunix; |
||||
if(strlen($newdate) > 10){ |
||||
$newdatestringarray = explode("-", $newdate); |
||||
if($newdatestringarray[1] == "allday"){ |
||||
$allday = true; |
||||
$newdatestringarray[1] = "00:00"; |
||||
}else{ |
||||
if($allday == true){ |
||||
$difference = 3600; |
||||
} |
||||
$allday = false; |
||||
} |
||||
}else{ |
||||
$newdatestringarray = array(); |
||||
$newdatestringarray[0] = $newdate; |
||||
$newdatestringarray[1] = $starttime; |
||||
} |
||||
$newdatearray = explode(".", $newdatestringarray[0]); |
||||
$newtimearray = explode(":", $newdatestringarray[1]); |
||||
$newstartunix = mktime($newtimearray[0], $newtimearray[1], 0, $newdatearray[1], $newdatearray[0], $newdatearray[2]); |
||||
$newendunix = $newstartunix + $difference; |
||||
if($allday == true){ |
||||
$caldata["allday"] = true; |
||||
}else{ |
||||
unset($caldata["allday"]); |
||||
} |
||||
$caldata["from"] = date("d-m-Y", $newstartunix); |
||||
$caldata["fromtime"] = date("H:i", $newstartunix); |
||||
$caldata["to"] = date("d-m-Y", $newendunix); |
||||
$caldata["totime"] = date("H:i", $newendunix); |
||||
//modified part of editevent.php |
||||
$vcalendar = Sabre_VObject_Reader::read($data["calendardata"]); |
||||
OC_Calendar_Object::updateVCalendarFromRequest($caldata, $vcalendar); |
||||
|
||||
$result = OC_Calendar_Object::edit($id, $vcalendar->serialize()); |
||||
OC_JSON::success(); |
||||
//end part of editevent.php |
||||
?> |
@ -0,0 +1,30 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
$weekenddays = array("Monday"=>"false", "Tuesday"=>"false", "Wednesday"=>"false", "Thursday"=>"false", "Friday"=>"false", "Saturday"=>"false", "Sunday"=>"false"); |
||||
for($i = 0;$i < count($_POST["weekend"]); $i++){ |
||||
switch ($_POST["weekend"][$i]){ |
||||
case "Monday": |
||||
case "Tuesday": |
||||
case "Wednesday": |
||||
case "Thursday": |
||||
case "Friday": |
||||
case "Saturday": |
||||
case "Sunday": |
||||
break; |
||||
default: |
||||
OC_JSON::error(); |
||||
exit; |
||||
} |
||||
$weekenddays[$_POST["weekend"][$i]] = "true"; |
||||
} |
||||
$setValue = json_encode($weekenddays); |
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'weekend', $setValue); |
||||
OC_JSON::success(); |
||||
?> |
@ -0,0 +1,17 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
if(isset($_POST["duration"])){ |
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'duration', $_POST["duration"]); |
||||
OC_JSON::success(); |
||||
}else{ |
||||
OC_JSON::error(); |
||||
} |
||||
?> |
||||
|
@ -0,0 +1,16 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
if(isset($_POST["firstdayofweek"])){ |
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstdayofweek', $_POST["firstdayofweek"]); |
||||
OC_JSON::success(); |
||||
}else{ |
||||
OC_JSON::error(); |
||||
} |
||||
?> |
@ -0,0 +1,17 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
if(isset($_POST["timeformat"])){ |
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); |
||||
OC_JSON::success(); |
||||
}else{ |
||||
OC_JSON::error(); |
||||
} |
||||
?> |
||||
|
@ -0,0 +1,12 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||||
* 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_JSON::checkLoggedIn(); |
||||
$timeformat = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24"); |
||||
OC_JSON::encodedPrint(array("timeformat" => $timeformat)); |
||||
?> |
@ -1,57 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1); |
||||
$events = array(); |
||||
foreach($calendars as $calendar) { |
||||
$tmp = OC_Calendar_Object::all($calendar['id']); |
||||
$events = array_merge($events, $tmp); |
||||
} |
||||
$select_year = $_GET["year"]; |
||||
$return_events = array(); |
||||
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); |
||||
foreach($events as $event) |
||||
{ |
||||
if ($select_year != substr($event['startdate'], 0, 4)) |
||||
continue; |
||||
$start_dt = new DateTime($event['startdate'], new DateTimeZone('UTC')); |
||||
$start_dt->setTimezone(new DateTimeZone($user_timezone)); |
||||
$end_dt = new DateTime($event['enddate'], new DateTimeZone('UTC')); |
||||
$end_dt->setTimezone(new DateTimeZone($user_timezone)); |
||||
$year = $start_dt->format('Y'); |
||||
$month = $start_dt->format('n') - 1; // return is 0 based |
||||
$day = $start_dt->format('j'); |
||||
$hour = $start_dt->format('G'); |
||||
|
||||
// hack |
||||
if (strstr($event['calendardata'], 'DTSTART;VALUE=DATE:')) { |
||||
$hour = 'allday'; |
||||
} |
||||
$return_event = array(); |
||||
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop) |
||||
{ |
||||
$return_event[$prop] = $event[$prop]; |
||||
} |
||||
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); |
||||
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); |
||||
$return_event['description'] = $event['summary']; |
||||
if ($hour == 'allday') |
||||
{ |
||||
$return_event['allday'] = true; |
||||
} |
||||
if (isset($return_events[$year][$month][$day][$hour])) |
||||
{ |
||||
$return_events[$year][$month][$day][$hour][] = $return_event; |
||||
} |
||||
else |
||||
{ |
||||
$return_events[$year][$month][$day][$hour] = array(1 => $return_event); |
||||
} |
||||
} |
||||
OC_JSON::encodedPrint($return_events); |
||||
?> |
@ -0,0 +1,6 @@ |
||||
<?php |
||||
|
||||
$tmpl = new OC_Template( 'contacts', 'settings'); |
||||
|
||||
return $tmpl->fetchPage(); |
||||
?> |
@ -0,0 +1,7 @@ |
||||
<form id="mediaform"> |
||||
<fieldset class="personalblock"> |
||||
<strong>Contacts</strong><br /> |
||||
CardDAV syncing address: |
||||
<?php echo OC_Helper::linkTo('apps/contacts', 'carddav.php', null, true); ?><br />
|
||||
</fieldset> |
||||
</form> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue