aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-10-14 14:56:18 +0200
committerBart Visscher <bartv@thisnet.nl>2011-10-15 11:45:58 +0200
commit9cfae56df588c7ddb6e6199ab79afaa39cd7f94e (patch)
treefb2f9f37f2483273ef5a163874adb3455d7f2b53 /apps
parent8d4039b678c2e35e3fd6834d56b8db6879beab89 (diff)
downloadnextcloud-server-9cfae56df588c7ddb6e6199ab79afaa39cd7f94e.tar.gz
nextcloud-server-9cfae56df588c7ddb6e6199ab79afaa39cd7f94e.zip
Fix calendar colors with new calendar
Diffstat (limited to 'apps')
-rw-r--r--apps/calendar/ajax/editcalendar.php11
-rw-r--r--apps/calendar/ajax/newcalendar.php2
-rw-r--r--apps/calendar/js/calendar.js3
-rw-r--r--apps/calendar/lib/calendar.php12
4 files changed, 17 insertions, 11 deletions
diff --git a/apps/calendar/ajax/editcalendar.php b/apps/calendar/ajax/editcalendar.php
index 5f61cf50135..d23e5287868 100644
--- a/apps/calendar/ajax/editcalendar.php
+++ b/apps/calendar/ajax/editcalendar.php
@@ -11,17 +11,8 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
-$calendarcolor_options = array(
- 'ff0000', // "Red"
- '00ff00', // "Green"
- 'ffff00', // "Yellow"
- '808000', // "Olive"
- 'ffa500', // "Orange"
- 'ff7f50', // "Coral"
- 'ee82ee', // "Violet"
- 'ecc255', // dark yellow
-);
OC_JSON::checkAppEnabled('calendar');
+$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
diff --git a/apps/calendar/ajax/newcalendar.php b/apps/calendar/ajax/newcalendar.php
index f00dd0fb862..a7935c95672 100644
--- a/apps/calendar/ajax/newcalendar.php
+++ b/apps/calendar/ajax/newcalendar.php
@@ -12,6 +12,7 @@ if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
+$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = array(
'id' => 'new',
'displayname' => '',
@@ -19,6 +20,7 @@ $calendar = array(
);
$tmpl = new OC_Template('calendar', 'part.editcalendar');
$tmpl->assign('new', true);
+$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
?>
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index efddac40426..1582dcd67b3 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -479,7 +479,8 @@ Calendar={
},
newCalendar:function(object){
var tr = $(document.createElement('tr'))
- .load(OC.filePath('calendar', 'ajax', 'newcalendar.php'));
+ .load(OC.filePath('calendar', 'ajax', 'newcalendar.php'),
+ function(){Calendar.UI.Calendar.colorPicker(this)});
$(object).closest('tr').after(tr).hide();
},
edit:function(object, calendarid){
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 959cb14bf8f..c19c0e73c08 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -228,4 +228,16 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid;
}
+ public static function getCalendarColorOptions(){
+ return array(
+ 'ff0000', // "Red"
+ '00ff00', // "Green"
+ 'ffff00', // "Yellow"
+ '808000', // "Olive"
+ 'ffa500', // "Orange"
+ 'ff7f50', // "Coral"
+ 'ee82ee', // "Violet"
+ 'ecc255', // dark yellow
+ );
+ }
}