new changes (e.g. show events) by Bart Visscher
parent
9a60313c3b
commit
5678d78d54
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*************************************************
|
||||
* ownCloud - Calendar Plugin *
|
||||
* *
|
||||
* (c) Copyright 2011 Georg Ehrke *
|
||||
* author: Georg Ehrke *
|
||||
* email: ownclouddev at georgswebsite dot de *
|
||||
* homepage: ownclouddev.georgswebsite.de *
|
||||
* manual: ownclouddev.georgswebsite.de/manual *
|
||||
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
|
||||
* *
|
||||
* If you are not able to view the License, *
|
||||
* <http://www.gnu.org/licenses/> *
|
||||
* <http://ownclouddev.georgswebsite.de/license/> *
|
||||
* please write to the Free Software Foundation. *
|
||||
* Address: *
|
||||
* 59 Temple Place, Suite 330, Boston, *
|
||||
* MA 02111-1307 USA *
|
||||
*************************************************/
|
||||
require_once('../../../lib/base.php');
|
||||
$l10n = new OC_L10N('calendar');
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
|
||||
$tmpl = new OC_Template("calendar", "part.editcalendar");
|
||||
$tmpl->assign('calendar',$calendar);
|
||||
$tmpl->printPage();
|
||||
?>
|
||||
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$l=new OC_L10N('calendar');
|
||||
|
||||
// We send json data
|
||||
header( "Content-Type: application/jsonrequest" );
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
|
||||
exit();
|
||||
}
|
||||
|
||||
// Get data
|
||||
if( isset( $_POST['timezone'] ) ){
|
||||
$timezone=$_POST['timezone'];
|
||||
OC_Preferences::setValue( OC_User::getUser(), 'calendar', 'timezone', $timezone );
|
||||
echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Timezone changed") )));
|
||||
}else{
|
||||
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Invalid request") )));
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*************************************************
|
||||
* ownCloud - Calendar Plugin *
|
||||
* *
|
||||
* (c) Copyright 2011 Georg Ehrke *
|
||||
* author: Georg Ehrke *
|
||||
* email: ownclouddev at georgswebsite dot de *
|
||||
* homepage: ownclouddev.georgswebsite.de *
|
||||
* manual: ownclouddev.georgswebsite.de/manual *
|
||||
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
|
||||
* *
|
||||
* If you are not able to view the License, *
|
||||
* <http://www.gnu.org/licenses/> *
|
||||
* <http://ownclouddev.georgswebsite.de/license/> *
|
||||
* please write to the Free Software Foundation. *
|
||||
* Address: *
|
||||
* 59 Temple Place, Suite 330, Boston, *
|
||||
* MA 02111-1307 USA *
|
||||
*************************************************/
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$l10n = new OC_L10N('calendar');
|
||||
|
||||
// We send json data
|
||||
header( "Content-Type: application/jsonrequest" );
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
|
||||
exit();
|
||||
}
|
||||
|
||||
$calendarid = $_POST['id'];
|
||||
OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
|
||||
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
|
||||
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
|
||||
$tmpl = new OC_Template('calendar', 'part.calendar.row');
|
||||
$tmpl->assign('calendar', $calendar);
|
||||
echo json_encode( array( "status" => "success", "data" => $tmpl->fetchPage() ));
|
||||
@ -0,0 +1,15 @@
|
||||
$(document).ready(function(){
|
||||
$("#timezone").change( function(){
|
||||
// Serialize the data
|
||||
var post = $( "#timezone" ).serialize();
|
||||
// Ajax foo
|
||||
$.post( oc_webroot + '/apps/calendar/ajax/settimezone.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
}
|
||||
else{
|
||||
$('#timezoneerror').html( data.data.message );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$tmpl = new OC_Template( 'calendar', 'settings');
|
||||
$timezone=OC_Preferences::getValue(OC_User::getUser(),'calendar','timezone','');
|
||||
$tmpl->assign('timezone',$timezone);
|
||||
$tmpl->assign('timezones',DateTimeZone::listIdentifiers());
|
||||
|
||||
OC_Util::addScript('calendar','settings');
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
echo "<td width=\"20px\"><input id=\"active_" . $_['calendar']["id"] . "\" type=\"checkbox\" onClick=\"oc_cal_calender_activation(this, " . $_['calendar']["id"] . ")\"" . ($_['calendar']["active"] ? ' checked="checked"' : '') . "></td>";
|
||||
echo "<td><label for=\"active_" . $_['calendar']["id"] . "\">" . $_['calendar']["displayname"] . "</label></td>";
|
||||
echo "<td width=\"20px\"><a style=\"display: block; opacity: 0.214133;\" href=\"#\" title=\"" . $l->t("Download") . "\" class=\"action\"><img src=\"/owncloud/core/img/actions/download.svg\"></a></td><td width=\"20px\"><a style=\"display: block; opacity: 0.214133;\" href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"oc_cal_editcalendar(this, " . $_['calendar']["id"] . ");\"><img src=\"/owncloud/core/img/actions/rename.svg\"></a></td>";
|
||||
@ -0,0 +1,32 @@
|
||||
<td id="editcalendar_dialog" title="<?php echo $l->t("Edit calendar"); ?>" colspan="4">
|
||||
<table width="100%" style="border: 0;">
|
||||
<tr>
|
||||
<th><?php echo $l->t('Displayname') ?></th>
|
||||
<td>
|
||||
<input id="displayname_<?php echo $_['calendar']['id'] ?>" type="text" value="<?php echo $_['calendar']['displayname'] ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input id="active_<?php echo $_['calendar']['id'] ?>" type="checkbox"<?php echo ($_['calendar']['active'] ? ' checked="checked"' : '' ) ?>>
|
||||
<label for="active_<?php echo $_['calendar']['id'] ?>">
|
||||
<?php echo $l->t('Active') ?>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $l->t('Description') ?></th>
|
||||
<td>
|
||||
<textarea id="description_<?php echo $_['calendar']['id'] ?>"><?php echo $_['calendar']['description'] ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $l->t('Calendar color') ?></th>
|
||||
<td>
|
||||
<input id="calendarcolor_<?php echo $_['calendar']['id'] ?>" type="text" value="<?php echo $_['calendar']['calendarcolor'] ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input style="float: left;" type="button" onclick="oc_cal_editcalendar_submit(this, <?php echo $_['calendar']['id'] ?>);" value="<?php echo $l->t("Submit"); ?>">
|
||||
</td>
|
||||
@ -0,0 +1,19 @@
|
||||
<form id="calendar">
|
||||
<fieldset class="personalblock">
|
||||
<label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
|
||||
<select id="timezone" name="timezone">
|
||||
<?php foreach($_['timezones'] as $timezone):
|
||||
if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $timezone ) ):
|
||||
$ex=explode('/', $timezone, 2);//obtain continent,city
|
||||
if ($continent!=$ex[0]):
|
||||
if ($continent!="") echo '</optgroup>';
|
||||
echo '<optgroup label="'.$ex[0].'">';
|
||||
endif;
|
||||
$city=$ex[1];
|
||||
$continent=$ex[0];
|
||||
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
|
||||
endif;
|
||||
endforeach;?>
|
||||
</select><span id="timezoneerror"></span>
|
||||
</fieldset>
|
||||
</form>
|
||||
Loading…
Reference in New Issue