Skip to content
Snippets Groups Projects
Commit ef073a14 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

make calendar compatible with public.php

parent 936c8ba1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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){
......
<?php
require_once('../../lib/base.php');
$token = strip_tags($_GET['t']);
$shared = OC_Calendar_Share::getElementByToken($token);
$nl = "\n\r";
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment