Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-05-07 17:48:41 +0400
committerGeorg Ehrke <dev@georgswebsite.de>2012-05-07 17:48:41 +0400
commitef073a148f2dfcefc9f1bd2bd68fcb9c33aba3cf (patch)
tree356d2115a355d3c77417982ca6163b49f8922006
parent936c8ba1cc3b36fdc122276fc9a96de4a4003bd1 (diff)
make calendar compatible with public.php
-rwxr-xr-xapps/calendar/appinfo/app.php2
-rw-r--r--apps/calendar/js/calendar.js5
-rw-r--r--apps/calendar/share.php1
-rwxr-xr-xapps/calendar/templates/share.dropdown.php2
4 files changed, 6 insertions, 4 deletions
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index 06fb9257735..0c91bf8f135 100755
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -24,4 +24,4 @@ OCP\App::addNavigationEntry( array(
OCP\App::registerPersonal('calendar', 'settings');
OC_Search::registerProvider('OC_Search_Provider_Calendar');
OCP\CONFIG::setAppValue('core', 'remote_caldav', '/apps/calendar/appinfo/remote.php');
-OCP\CONFIG::setAppValue('core', 'public_calendar', '/apps/calendar/appinfo/share.php'); \ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'public_calendar', '/apps/calendar/share.php'); \ No newline at end of file
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index a16856938ce..b3beb8d44cb 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -517,7 +517,10 @@ Calendar={
},
share:function(id, idtype, sharewith, sharetype){
$.getJSON(OC.filePath('calendar', 'ajax/share', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){
-
+ if(sharetype == 'public'){
+ $('#public_token').val(parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=calendar&t='+data.message);
+ $('#public_token').css('display', 'block');
+ }
});
},
unshare:function(id, idtype, sharewith, sharetype){
diff --git a/apps/calendar/share.php b/apps/calendar/share.php
index 1cc8a2ef15e..68c7d0ffae2 100644
--- a/apps/calendar/share.php
+++ b/apps/calendar/share.php
@@ -1,5 +1,4 @@
<?php
-require_once('../../lib/base.php');
$token = strip_tags($_GET['t']);
$shared = OC_Calendar_Share::getElementByToken($token);
$nl = "\n\r";
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php
index e0dabebf257..0796a880f1f 100755
--- a/apps/calendar/templates/share.dropdown.php
+++ b/apps/calendar/templates/share.dropdown.php
@@ -73,5 +73,5 @@ echo OCP\html_select_options($allgroups, array());
</ul>
<div id="public">
<input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br>
- <input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('apps/calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
+ <input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('', 'public.php?service=calendar&t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
</div> \ No newline at end of file