better multiple language support, first integration of new calendar class

This commit is contained in:
Georg Ehrke 2011-08-23 18:02:36 +02:00
parent b2fddc408c
commit bf68cd8ba4
10 changed files with 89 additions and 19 deletions

View File

@ -0,0 +1,27 @@
<?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>");
}
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
$output -> printpage();
?>

View File

@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Addressbook
* ownCloud - Calendar
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de

View File

@ -52,4 +52,4 @@
.onemonthview_item {text-align: center; height: 80px; margin: 0; padding: 0; vertical-align: top; background: #ffffff; width: 14%; height: 16%;}
.weekend{text-align: center;margin: 0; padding: 0;vertical-align: top;background: #F3F3F3; height: 80px;width: 100%; }
.weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;}
.thisday{background: #FFFABC;text-align: center;}
.thisday{background: #FFFABC;text-align: center;}

View File

@ -22,19 +22,15 @@ if(!OC_USER::isLoggedIn()) {
header("Location: " . OC_HELPER::linkTo("", "index.php"));
exit;
}
// Create default calendar ...
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
if( count($calendars) == 0){
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
}
OC_UTIL::addScript("calendar", "calendar");
OC_UTIL::addScript("calendar", "calendar_init");
OC_UTIL::addScript("calendar", "calendar_dialog");
OC_UTIL::addStyle("calendar", "style");
OC_APP::setActiveNavigationEntry("calendar_index");
$output = new OC_TEMPLATE("calendar", "calendar", "user");
$output -> printPage();

View File

@ -873,4 +873,12 @@ function oc_cal_newevent(date, time){
}else{
alert(t("calendar", "You can't open more than one dialog per site!"));
}
}
function oc_cal_choosecalendar(){
if(oc_cal_opendialog == 0){
$("#dialog_holder").load(oc_webroot + "/apps/calendar/ajax/choosecalendar.php");
oc_cal_opendialog = 1;
}else{
alert(t("calendar", "You can't open more than one dialog per site!"));
}
}

View File

@ -50,6 +50,7 @@ var oc_cal_listview_numofevents = 0;
var oc_cal_listview_count = 0;
var oc_cal_opendialog = 0;
var oc_cal_datemonthyear = String(oc_cal_dayofmonth) + String(oc_cal_month) + String(oc_cal_year);
var oc_cal_calendars = new Array();
//event vars
var oc_cal_events = new Array(2011);
oc_cal_events[2011] = new Array(0,1,2,3,4,5,6,7,8,9,10,11);

View File

@ -63,6 +63,16 @@
"Calendars" => "Kalender",
"Time" => "Uhrzeit",
"All day" => "Ganztägig",
"Does not repeat" => "Keine Wiederholung",
"Daily" => "Täglich",
"Weekly" => "Wöchentlich",
"Every Weekday" => "jeden Wochentag",
"Bi-Weekly" => "jede 2. Woche",
"Monthly" => "Monatlich",
"Yearly" => "Jährlich",
"Description of the Event" => "Beschreibung des Termins",
"" => "",
"" => "",
"" => ""
);
?>

View File

@ -28,7 +28,7 @@
<form>
<div id="choosecalendar">
<input type="button" id="today_input" value="Today" onclick="oc_cal_switch2today();"/>
<input type="button" id="choosecalendar_input" value="Calendars" onclick="" />
<input type="button" id="choosecalendar_input" value="Calendars" onclick="oc_cal_choosecalendar();" />
</div>
</form>
<form>

View File

@ -0,0 +1,26 @@
<div id="choosecalendar_dialog" title="<?php echo $l->t("Choose active calendars"); ?>">
<?php
$option_calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
for($i = 0; $i < count($option_calendars); $i++){
echo "<input type=\"button\" id=\"button_" . $option_calendars[$i]["id"] . "\" value=\"" . $option_calendars[$i]["displayname"] . "\">";
}
?>
<br /><br /><br />
<input style="float: left;" type="button" onclick="oc_cal_choosecalendar_submit();" value="<?php echo $l->t("Submit"); ?>">
</div>
<script type="text/javascript">
$( "#choosecalendar_dialog" ).dialog({
width : 500,
close : function() {
oc_cal_opendialog = 0;
var lastchild = document.getElementById("body-user").lastChild
while(lastchild.id != "lightbox"){
document.getElementById("body-user").removeChild(lastchild);
lastchild = document.getElementById("body-user").lastChild;
}
}
});
function highlight_button(id){
document.getElementById("button_" + id).style.color = "#000000";
}
</script>

View File

@ -25,10 +25,12 @@
<td width="75px">&nbsp;&nbsp;&nbsp;<?php echo $l -> t("Calendar");?>:</td>
<td>
<select class="formselect" id="formcalendar_select" style="width:140px;">
<option>Coming soon</option><!--
<option>Calendar 1</option>
<option>Calendar 2</option>
<option>Calendar 3</option>-->
<?php
$option_calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
for($i = 0; $i < count($option_calendars); $i++){
echo "<option id=\"option_" . $option_calendars[$i]["id"] . "\">" . $option_calendars[$i]["displayname"] . "</option>";
}
?>
</select></td>
</tr>
</table>
@ -86,13 +88,13 @@
<td width="75px"><?php echo $l -> t("Repeat");?>:</td>
<td>
<select class="formselect" id="formrepeat_select" style="width:350px;">
<option id="doesnotrepeat" selected="selected">Does not repeat</option>
<option>Daily</option>
<option>Weekly</option>
<option>Every Weekday</option>
<option>Bi-Weekly</option>
<option>Monthly</option>
<option>Yearly</option>
<option id="repeat_doesnotrepeat" selected="selected"><?php echo $l->t("Does not repeat");?></option>
<option id="repeat_daily"><?php echo $l->t("Daily");?></option>
<option id="repeat_weekly"><?php echo $l->t("Weekly");?></option>
<option id="repeat_weekday"><?php echo $l->t("Every Weekday");?></option>
<option id="repeat_biweekly"><?php echo $l->t("Bi-Weekly");?></option>
<option id="repeat_monthly"><?php echo $l->t("Monthly");?></option>
<option id="repeat_yearly"><?php echo $l->t("Yearly");?></option>
</select></td>
</tr>
</table>
@ -107,7 +109,7 @@
<table>
<tr>
<td width="75px" style="vertical-align: top;"><?php echo $l -> t("Description");?>:</td>
<td> <textarea style="width:350px;height: 150px;"placeholder="Description of the Event"></textarea></td>
<td> <textarea style="width:350px;height: 150px;"placeholder="<?php echo $l->t("Description of the Event");?>"></textarea></td>
</tr>
</table>
<span id="newcalendar_actions">