commit
a1d03de666
@ -1,6 +1,11 @@ |
||||
<div class="bookmarks_addBm"> |
||||
<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('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> |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Read later - ownCloud</title> |
||||
<link rel="stylesheet" href="css/readlater.css"> |
||||
</head> |
||||
<body> |
||||
<div class="message"><h1>Saved!</h1></div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,8 @@ |
||||
<?php |
||||
|
||||
function createBookmarklet() { |
||||
$l = new OC_L10N('bookmarks'); |
||||
echo '<small>' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '</small>' |
||||
. '<a class="button" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open(\'' . OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') . '?output=popup&url=\'+c(b.location),\'bkmk_popup\',\'left=\'+((a.screenX||a.screenLeft)+10)+\',top=\'+((a.screenY||a.screenTop)+10)+\',height=230px,width=230px,resizable=1,alwaysRaised=1\');a.setTimeout(function(){d.focus()},300);})();">' |
||||
. $l->t('Read later') . '</a>'; |
||||
} |
@ -0,0 +1,20 @@ |
||||
<?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. |
||||
*/ |
||||
|
||||
require_once('../../../../lib/base.php'); |
||||
OC_JSON::checkLoggedIn(); |
||||
OC_JSON::checkAppEnabled('calendar'); |
||||
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); |
||||
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); |
||||
$tmpl = new OC_Template("calendar", "part.editcalendar"); |
||||
$tmpl->assign('new', false); |
||||
$tmpl->assign('calendarcolor_options', $calendarcolor_options); |
||||
$tmpl->assign('calendar', $calendar); |
||||
$tmpl->printPage(); |
||||
?> |
@ -0,0 +1,120 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2012 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. |
||||
*/ |
||||
//check for calendar rights or create new one |
||||
ob_start(); |
||||
require_once('../../../../lib/base.php'); |
||||
OC_JSON::checkLoggedIn(); |
||||
OC_Util::checkAppEnabled('calendar'); |
||||
$nl = "\n"; |
||||
$progressfile = OC::$SERVERROOT . '/apps/calendar/import_tmp/' . md5(session_id()) . '.txt'; |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '10'); |
||||
fclose($progressfopen); |
||||
} |
||||
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); |
||||
if($_POST['method'] == 'new'){ |
||||
$id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']); |
||||
OC_Calendar_Calendar::setCalendarActive($id, 1); |
||||
}else{ |
||||
$calendar = OC_Calendar_App::getCalendar($_POST['id']); |
||||
if($calendar['userid'] != OC_USER::getUser()){ |
||||
OC_JSON::error(); |
||||
exit(); |
||||
} |
||||
$id = $_POST['id']; |
||||
} |
||||
//analyse the calendar file |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '20'); |
||||
fclose($progressfopen); |
||||
} |
||||
$searchfor = array('VEVENT', 'VTODO', 'VJOURNAL'); |
||||
$parts = $searchfor; |
||||
$filearr = explode($nl, $file); |
||||
$inelement = false; |
||||
$parts = array(); |
||||
$i = 0; |
||||
foreach($filearr as $line){ |
||||
foreach($searchfor as $search){ |
||||
if(substr_count($line, $search) == 1){ |
||||
list($attr, $val) = explode(':', $line); |
||||
if($attr == 'BEGIN'){ |
||||
$parts[]['begin'] = $i; |
||||
$inelement = true; |
||||
} |
||||
if($attr == 'END'){ |
||||
$parts[count($parts) - 1]['end'] = $i; |
||||
$inelement = false; |
||||
} |
||||
} |
||||
} |
||||
$i++; |
||||
} |
||||
//import the calendar |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '40'); |
||||
fclose($progressfopen); |
||||
} |
||||
$start = ''; |
||||
for ($i = 0; $i < $parts[0]['begin']; $i++) { |
||||
if($i == 0){ |
||||
$start = $filearr[0]; |
||||
}else{ |
||||
$start .= $nl . $filearr[$i]; |
||||
} |
||||
} |
||||
$end = ''; |
||||
for($i = $parts[count($parts) - 1]['end'] + 1;$i <= count($filearr) - 1; $i++){ |
||||
if($i == $parts[count($parts) - 1]['end'] + 1){ |
||||
$end = $filearr[$parts[count($parts) - 1]['end'] + 1]; |
||||
}else{ |
||||
$end .= $nl . $filearr[$i]; |
||||
} |
||||
} |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '50'); |
||||
fclose($progressfopen); |
||||
} |
||||
$importready = array(); |
||||
foreach($parts as $part){ |
||||
for($i = $part['begin']; $i <= $part['end'];$i++){ |
||||
if($i == $part['begin']){ |
||||
$content = $filearr[$i]; |
||||
}else{ |
||||
$content .= $nl . $filearr[$i]; |
||||
} |
||||
} |
||||
$importready[] = $start . $nl . $content . $nl . $end; |
||||
} |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '70'); |
||||
fclose($progressfopen); |
||||
} |
||||
if(count($parts) == 1){ |
||||
OC_Calendar_Object::add($id, $file); |
||||
}else{ |
||||
foreach($importready as $import){ |
||||
OC_Calendar_Object::add($id, $import); |
||||
} |
||||
} |
||||
//done the import |
||||
if(is_writable('import_tmp/')){ |
||||
$progressfopen = fopen($progressfile, 'w'); |
||||
fwrite($progressfopen, '100'); |
||||
fclose($progressfopen); |
||||
} |
||||
sleep(3); |
||||
if(is_writable('import_tmp/')){ |
||||
unlink($progressfile); |
||||
} |
||||
OC_JSON::success(); |
@ -0,0 +1,40 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2012 Georg Ehrke <ownclouddev@georgswebsite.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'); |
||||
$id = strip_tags($_GET['id']); |
||||
$idtype = strip_tags($_GET['idtype']); |
||||
$permission = (int) strip_tags($_GET['permission']); |
||||
switch($idtype){ |
||||
case 'calendar': |
||||
case 'event': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
$sharewith = $_GET['sharewith']; |
||||
$sharetype = strip_tags($_GET['sharetype']); |
||||
switch($sharetype){ |
||||
case 'user': |
||||
case 'group': |
||||
case 'public': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'user not found')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'group not found')); |
||||
exit; |
||||
} |
||||
$success = OC_Calendar_Share::changepermission($sharewith, $sharetype, $id, $permission, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::Event)); |
||||
OC_JSON::success(); |
@ -0,0 +1,18 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2012 Georg Ehrke <ownclouddev@georgswebsite.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'); |
||||
$user = OC_USER::getUser(); |
||||
$calid = $_GET['calid']; |
||||
$calendar = OC_Calendar_Calendar::find($calid); |
||||
if($calendar['userid'] != $user){ |
||||
OC_JSON::error(); |
||||
exit; |
||||
} |
||||
$tmpl = new OC_Template('calendar', 'share.dropdown'); |
||||
$tmpl->assign('calid', $calid); |
||||
$tmpl->printPage(); |
@ -0,0 +1,51 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2012 Georg Ehrke <ownclouddev@georgswebsite.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'); |
||||
$id = strip_tags($_GET['id']); |
||||
$idtype = strip_tags($_GET['idtype']); |
||||
switch($idtype){ |
||||
case 'calendar': |
||||
case 'event': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
$sharewith = $_GET['sharewith']; |
||||
$sharetype = strip_tags($_GET['sharetype']); |
||||
switch($sharetype){ |
||||
case 'user': |
||||
case 'group': |
||||
case 'public': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'user not found')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'group not found')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'user' && OC_User::getUser() == $sharewith){ |
||||
OC_JSON::error(array('meesage'=>'you can not share with yourself')); |
||||
} |
||||
$success = OC_Calendar_Share::share(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::Event)); |
||||
if($success){ |
||||
if($sharetype == 'public'){ |
||||
OC_JSON::success(array('message'=>$success)); |
||||
}else{ |
||||
OC_JSON::success(array('message'=>'shared')); |
||||
} |
||||
}else{ |
||||
OC_JSON::error(array('message'=>'can not share')); |
||||
exit; |
||||
} |
@ -0,0 +1,44 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2012 Georg Ehrke <ownclouddev@georgswebsite.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'); |
||||
$id = strip_tags($_GET['id']); |
||||
$idtype = strip_tags($_GET['idtype']); |
||||
switch($idtype){ |
||||
case 'calendar': |
||||
case 'event': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
$sharewith = $_GET['sharewith']; |
||||
$sharetype = strip_tags($_GET['sharetype']); |
||||
switch($sharetype){ |
||||
case 'user': |
||||
case 'group': |
||||
case 'public': |
||||
break; |
||||
default: |
||||
OC_JSON::error(array('message'=>'unexspected parameter')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'user not found')); |
||||
exit; |
||||
} |
||||
if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ |
||||
OC_JSON::error(array('message'=>'group not found')); |
||||
exit; |
||||
} |
||||
$success = OC_Calendar_Share::unshare(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::Event)); |
||||
if($success){ |
||||
OC_JSON::success(); |
||||
}else{ |
||||
OC_JSON::error(array('message'=>'can not unshare')); |
||||
exit; |
||||
} |
@ -0,0 +1,35 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com> |
||||
* 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(); |
||||
$action=isset($_POST['action'])?$_POST['action']:$_GET['action']; |
||||
$result=false; |
||||
switch($action){ |
||||
case 'getValue': |
||||
$result=OC_Appconfig::getValue($_GET['app'],$_GET['key'],$_GET['default']); |
||||
break; |
||||
case 'setValue': |
||||
$result=OC_Appconfig::setValue($_POST['app'],$_POST['key'],$_POST['value']); |
||||
break; |
||||
case 'getApps': |
||||
$result=OC_Appconfig::getApps(); |
||||
break; |
||||
case 'getKeys': |
||||
$result=OC_Appconfig::getKeys($_GET['app']); |
||||
break; |
||||
case 'hasKey': |
||||
$result=OC_Appconfig::hasKey($_GET['app'],$_GET['key']); |
||||
break; |
||||
case 'deleteKey': |
||||
$result=OC_Appconfig::deleteKey($_POST['app'],$_POST['key']); |
||||
break; |
||||
case 'deleteApp': |
||||
$result=OC_Appconfig::deleteApp($_POST['app']); |
||||
break; |
||||
} |
||||
OC_JSON::success(array('data'=>$result)); |
@ -0,0 +1,55 @@ |
||||
/** |
||||
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com> |
||||
* This file is licensed under the Affero General Public License version 3 or later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
OC.AppConfig={ |
||||
url:OC.filePath('core','ajax','appconfig.php'), |
||||
getCall:function(action,data,callback){ |
||||
data.action=action; |
||||
$.getJSON(OC.AppConfig.url,data,function(result){ |
||||
if(result.status='success'){ |
||||
if(callback){ |
||||
callback(result.data); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
postCall:function(action,data,callback){ |
||||
data.action=action; |
||||
$.post(OC.AppConfig.url,data,function(result){ |
||||
if(result.status='success'){ |
||||
if(callback){ |
||||
callback(result.data); |
||||
} |
||||
} |
||||
},'json'); |
||||
}, |
||||
getValue:function(app,key,defaultValue,callback){ |
||||
if(typeof defaultValue=='function'){ |
||||
callback=defaultValue; |
||||
defaultValue=null; |
||||
} |
||||
OC.AppConfig.getCall('getValue',{app:app,key:key,default:defaultValue},callback); |
||||
}, |
||||
setValue:function(app,key,value){ |
||||
OC.AppConfig.postCall('setValue',{app:app,key:key,value:value}); |
||||
}, |
||||
getApps:function(callback){ |
||||
OC.AppConfig.getCall('getApps',{},callback); |
||||
}, |
||||
getKeys:function(app,callback){ |
||||
OC.AppConfig.getCall('getKeys',{app:app},callback); |
||||
}, |
||||
hasKey:function(app,key,callback){ |
||||
OC.AppConfig.getCall('hasKey',{app:app,key:key},callback); |
||||
}, |
||||
deleteKey:function(app,key){ |
||||
OC.AppConfig.postCall('deleteKey',{app:app,key:key}); |
||||
}, |
||||
deleteApp:function(app){ |
||||
OC.AppConfig.postCall('deleteApp',{app:app}); |
||||
}, |
||||
} |
||||
//TODO OC.Preferences
|
Loading…
Reference in new issue