Merge branch 'master' of gitorious.org:owncloud/owncloud into calendar

This commit is contained in:
Georg Ehrke 2011-10-15 17:16:00 +02:00
commit 323a98adb7
13 changed files with 54 additions and 24 deletions

View File

@ -11,17 +11,8 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) { if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>"); 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'); OC_JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']); $calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar"); $tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl->assign('new', false); $tmpl->assign('new', false);

View File

@ -12,6 +12,7 @@ if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>"); die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
} }
OC_JSON::checkAppEnabled('calendar'); OC_JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = array( $calendar = array(
'id' => 'new', 'id' => 'new',
'displayname' => '', 'displayname' => '',
@ -19,6 +20,7 @@ $calendar = array(
); );
$tmpl = new OC_Template('calendar', 'part.editcalendar'); $tmpl = new OC_Template('calendar', 'part.editcalendar');
$tmpl->assign('new', true); $tmpl->assign('new', true);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar); $tmpl->assign('calendar', $calendar);
$tmpl->printPage(); $tmpl->printPage();
?> ?>

View File

@ -9,8 +9,8 @@
require_once ("../../lib/base.php"); require_once ("../../lib/base.php");
OC_Util::checkLoggedIn(); OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('calendar'); OC_Util::checkAppEnabled('calendar');
$cal = $_GET["calid"]; $cal = isset($_GET["calid"]) ? $_GET["calid"] : NULL;
$event = $_GET["eventid"]; $event = isset($_GET["eventid"]) ? $_GET["eventid"] : NULL;
if(isset($cal)){ if(isset($cal)){
$calendar = OC_Calendar_Calendar::findCalendar($cal); $calendar = OC_Calendar_Calendar::findCalendar($cal);
if($calendar["userid"] != OC_User::getUser()){ if($calendar["userid"] != OC_User::getUser()){

View File

@ -112,7 +112,7 @@ Calendar={
formatTime:function(date){ formatTime:function(date){
return date[3] + ':' + date[4]; return date[3] + ':' + date[4];
}, },
updateView:function(task) { updateView:function() {
this.current.removeEvents(); this.current.removeEvents();
this.current.renderCal(); this.current.renderCal();
this.current.showEvents(); this.current.showEvents();
@ -516,7 +516,8 @@ Calendar={
}, },
newCalendar:function(object){ newCalendar:function(object){
var tr = $(document.createElement('tr')) 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(); $(object).closest('tr').after(tr).hide();
}, },
edit:function(object, calendarid){ edit:function(object, calendarid){

View File

@ -228,4 +228,16 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri); list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid; 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
);
}
} }

View File

@ -10,7 +10,6 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
*/ */
public $propertyMap = array( public $propertyMap = array(
'{DAV:}displayname' => 'displayname', '{DAV:}displayname' => 'displayname',
'{urn:ietf:params:xml:ns:caldav}calendar-description' => 'description',
'{urn:ietf:params:xml:ns:caldav}calendar-timezone' => 'timezone', '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => 'timezone',
'{http://apple.com/ns/ical/}calendar-order' => 'calendarorder', '{http://apple.com/ns/ical/}calendar-order' => 'calendarorder',
'{http://apple.com/ns/ical/}calendar-color' => 'calendarcolor', '{http://apple.com/ns/ical/}calendar-color' => 'calendarcolor',

View File

@ -20,4 +20,13 @@
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
z-index:9999; z-index:9999;
} }
#lightbox_loader{
text-align:center;
position:fixed;
top: 40%;
left: 50%;
color:white;
}
#lightbox_loader img { margin-right: 1em;}

View File

@ -2,11 +2,17 @@
var lightBoxShown=false; var lightBoxShown=false;
$(document).ready(function() { $(document).ready(function() {
images={};//image cache images={};//image cache
var overlay=$('<div id="lightbox_overlay"/>'); loading_str = t('files_imageviewer','Loading');
var overlay=$('<div id="lightbox_overlay"><div id="lightbox_loader"><img /></div></div>');
overlay.find('#lightbox_loader img')
.attr('src',OC.imagePath('core', 'loading-dark.gif'))
.attr('alt',loading_str)
.after(loading_str);
$( 'body' ).append(overlay); $( 'body' ).append(overlay);
var container=$('<div id="lightbox"/>'); var container=$('<div id="lightbox"/>');
$( 'body' ).append(container); $( 'body' ).append(container);
$( 'body' ).click(hideLightbox); $( '#lightbox_overlay' ).click(hideLightbox);
$( '#lightbox' ).click(hideLightbox);
if(typeof FileActions!=='undefined'){ if(typeof FileActions!=='undefined'){
FileActions.register('image','View','',function(filename){ FileActions.register('image','View','',function(filename){
viewImage($('#dir').val(),filename); viewImage($('#dir').val(),filename);
@ -35,7 +41,8 @@ function viewImage(dir,file){
var img = new Image(); var img = new Image();
img.onload = function(){ img.onload = function(){
images[location]=img; images[location]=img;
showLightbox(container,img); if($('#lightbox_overlay').is(':visible'))
showLightbox(container,img);
} }
img.src = location; img.src = location;
}else{ }else{
@ -67,10 +74,10 @@ function showLightbox(container,img){
} }
function hideLightbox(event){ function hideLightbox(event){
if(lightBoxShown){ if(event){
event.stopPropagation(); event.stopPropagation();
$('#lightbox_overlay').hide(); $('#lightbox_overlay').hide();
$('#lightbox').hide(); $('#lightbox').hide();
lightBoxShown=false; lightBoxShown=false;
} }
} }

View File

@ -122,3 +122,4 @@ div.jp-play-bar, div.jp-seek-bar { padding:0; }
.pager li { display:inline-block; } .pager li { display:inline-block; }
li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#ffe .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#ffe .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { overflow: hidden; text-overflow: ellipsis; }

BIN
core/img/loading-dark.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@ -37,7 +37,7 @@
</fieldset> </fieldset>
<fieldset id='databaseField'> <fieldset id='databaseField'>
<?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; //other than SQLite ?> <?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
<legend><?php echo $l->t( 'Configure the database' ); ?></legend> <legend><?php echo $l->t( 'Configure the database' ); ?></legend>
<div id="selectDbType"> <div id="selectDbType">
<?php if($_['hasSQLite']): ?> <?php if($_['hasSQLite']): ?>

View File

@ -100,6 +100,14 @@ else {
$error = true; $error = true;
} }
} }
// The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
elseif(isset($_SERVER["PHP_AUTH_USER"]) && isset($_SERVER["PHP_AUTH_PW"])){
if (OC_User::login($_SERVER["PHP_AUTH_USER"],$_SERVER["PHP_AUTH_PW"])) {
OC_User::unsetMagicInCookie();
OC_Util::redirectToDefaultPage();
}else{
$error = true;
}
}
OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' )); OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
} }

View File

@ -21,7 +21,7 @@ return array(
'ms_MY'=>'Bahasa Melayu', 'ms_MY'=>'Bahasa Melayu',
'nb_NO'=>'Norwegian Bokmål', 'nb_NO'=>'Norwegian Bokmål',
'nl'=>'Nederlands', 'nl'=>'Nederlands',
'pl'=>'język polski', 'pl'=>'Polski',
'pt_BR'=>'Português brasileiro', 'pt_BR'=>'Português brasileiro',
'pt_PT'=>'Português', 'pt_PT'=>'Português',
'ro'=>'română', 'ro'=>'română',