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

This commit is contained in:
Georg Ehrke 2011-10-06 13:21:38 +02:00
commit bf017fb4bd
19 changed files with 137 additions and 65 deletions

View File

@ -11,8 +11,8 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
?>
<form id="calendar">
<fieldset class="personalblock">
<label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
<select style="display: none;" id="timezone" name="timezone">
<table class="nostyle">
<tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
<?php
$continent = '';
foreach($_['timezones'] as $timezone):
@ -27,33 +27,17 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endif;
endforeach;?>
</select>&nbsp;&nbsp;
<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
</select></td></tr>
<tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
</select><br />
<label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label>
<select style="display: none;" id="firstdayofweek" name="firstdayofweek">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select><br />
<label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label>
<select id="weekend" name="weekend[]" style="width: 50%;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select><br />
<label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label>
<input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?>
<br />
</select>
</td></tr>
</table>
<?php echo $l->t('Calendar CalDAV syncing address:');?>
<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
</fieldset>

View File

@ -53,16 +53,7 @@ $name = $_POST['name'];
$value = $_POST['value'];
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
if(is_array($value)){
$value = OC_Contacts_VCard::escapeSemicolons($value);
}
$property = new Sabre_VObject_Property( $name, $value );
$parameternames = array_keys($parameters);
foreach($parameternames as $i){
$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
}
$vcard->add($property);
OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
$line = count($vcard->children) - 1;
$checksum = md5($property->serialize());

View File

@ -104,6 +104,8 @@ $(document).ready(function(){
if(jsondata.status == 'success'){
$('#rightcontent').data('id',jsondata.data.id);
$('#rightcontent').html(jsondata.data.page);
$('#leftcontent .active').removeClass('active');
$('#leftcontent ul').append('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'">'+jsondata.data.name+'</a></li>');
}
else{
alert(jsondata.data.message);

View File

@ -246,7 +246,7 @@ class OC_Contacts_VCard{
public static function escapeSemicolons($value){
foreach($value as &$i ){
$i = implode("\\\\;", explode(';', $i));
} unset($i);
}
return implode(';',$value);
}
@ -272,6 +272,26 @@ class OC_Contacts_VCard{
return $array;
}
/**
* @brief Add property to vcard object
* @param object $vcard
* @param object $name of property
* @param object $value of property
* @param object $paramerters of property
*/
public static function addVCardProperty($vcard, $name, $value, $parameters=array()){
if(is_array($value)){
$value = OC_Contacts_VCard::escapeSemicolons($value);
}
$property = new Sabre_VObject_Property( $name, $value );
$parameternames = array_keys($parameters);
foreach($parameternames as $i){
$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
}
$vcard->add($property);
}
/**
* @brief Data structure of vCard
* @param object $property

View File

@ -11,5 +11,41 @@
<?php endif; ?>
<label for="fn"><?php echo $l->t('Name'); ?></label>
<input type="text" name="fn" value=""><br>
<label for="ADR"><?php echo $l->t('Address'); ?></label>
<div id="contacts_addresspart">
<select id="ADR" name="parameters[ADR][TYPE]" size="1">
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
<p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p>
<p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p>
<p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p>
<p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p>
<p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p>
</div>
<label for="TEL"><?php echo $l->t('Telephone'); ?></label>
<div id="contacts_phonepart">
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
<option value="home"><?php echo $l->t('Home'); ?></option>
<option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
<option value="work"><?php echo $l->t('Work'); ?></option>
<option value="text"><?php echo $l->t('Text'); ?></option>
<option value="voice"><?php echo $l->t('Voice'); ?></option>
<option value="fax"><?php echo $l->t('Fax'); ?></option>
<option value="video"><?php echo $l->t('Video'); ?></option>
<option value="pager"><?php echo $l->t('Pager'); ?></option>
</select>
<input type="text" name="value[TEL]" value="">
</div>
<label for="EMAIL"><?php echo $l->t('Email'); ?></label>
<div id="contacts_email">
<input id="EMAIL" type="text" name="value[EMAIL]" value="">
</div>
<label for="ORG"><?php echo $l->t('Organization'); ?></label>
<div id="contacts_organisation">
<input id="ORG" type="text" name="value[ORG]" value="">
</div>
<input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
</form>

View File

@ -45,7 +45,7 @@ $box_size = 200;
$album_name = $_GET['album'];
$x = $_GET['x'];
$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` == *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$x = min((int)($x/($box_size/$result->numRows())), $result->numRows()-1); // get image to display
$result->seek($x); // never throws

View File

@ -7,12 +7,12 @@ if (!OC_User::IsLoggedIn()) {
}
$a = array();
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?');
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?');
$result = $stmt->execute(array(OC_User::getUser()));
while ($r = $result->fetchRow()) {
$album_name = $r['album_name'];
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?');
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?');
$tmp_res = $stmt->execute(array($r['album_id']));
$a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
}

View File

@ -46,7 +46,7 @@ if( !OC_User::isLoggedIn()){
$box_size = 200;
$album_name= $_GET['album_name'];
$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` = *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$numOfItems = min($result->numRows(),10);

View File

@ -7,5 +7,4 @@
<author>Bartosz Przybylski</author>
<require>2</require>
<description></description>
<default_enable/>
</info>

View File

@ -28,21 +28,21 @@ class OC_GALLERY_SCANNER {
}
$current_album['imagesCount'] = count($current_album['images']);
$albums[] = $current_album;
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
if ($result->numRows() == 0 && count($current_album['images'])) {
$stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)');
$stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
$stmt->execute(array(OC_User::getUser(), $current_album['name']));
}
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
$albumId = $result->fetchRow();
$albumId = $albumId['album_id'];
foreach ($current_album['images'] as $img) {
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE "album_id" = ? AND "file_path" = ?');
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?');
$result = $stmt->execute(array($albumId, $img));
if ($result->numRows() == 0) {
$stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos ("album_id", "file_path") VALUES (?, ?)');
$stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
$stmt->execute(array($albumId, $img));
}
}

View File

@ -18,7 +18,7 @@ a.jp-mute,a.jp-unmute { left:24em; }
div.jp-volume-bar { position:absolute; overflow:hidden; background:#eee; width:4em; height:0.4em; cursor:pointer; top:1.3em; left:27em; }
div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
#collection { padding-top:1em; position:relative; width:70em; float:left; }
#collection { padding-top:1em; position:relative; width:100%; float:left; }
#collection li.album,#collection li.song { margin-left:3em; }
#leftcontent img.remove { display:none; float:right; cursor:pointer; }
#leftcontent li:hover img.remove { display:inline; }

View File

@ -3,7 +3,7 @@
class OC_remoteStorage {
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
$result=$query->execute(array($user,$userAddress,$dataScope));
$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';

View File

@ -15,9 +15,9 @@ body { background:#fefefe; font:normal .8em/1.6em "Lucida Grande", Arial, Verdan
/* HEADERS */
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; }
#body-login #header { margin: -2em auto 0; text-align:center; height:10em;
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
-moz-box-shadow:0 0 1em rgba(0, 0, 0, .5); -webkit-box-shadow:0 0 1em rgba(0, 0, 0, .5); box-shadow:0 0 1em rgba(0, 0, 0, .5);
background: #1d2d44; /* Old browsers */
background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */
@ -53,7 +53,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
#controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; }
#controls .button { display:inline-block; }
#content { margin:3.5em 0 0 12.5em; }
#leftcontent, .leftcontent { position:absolute; top:6.4em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; }
#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; }
#leftcontent li, .leftcontent li { padding:.3em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; }
#rightcontent, .rightcontent { position:absolute; top:6.4em; left:33em; }
@ -69,7 +69,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
#login form { width:22em; margin:2em auto 2em; padding:0; }
#login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
#login form fieldset legend { font-weight:bold; }
#login form label { margin:.8em .8em; color:#666; }
#login form label { margin:.9em .8em .7em;; color:#666; }
/* NEEDED FOR INFIELD LABELS */
p.infield { position: relative; }
label.infield { cursor: text !important; }
@ -98,13 +98,14 @@ label.infield { cursor: text !important; }
/* VARIOUS REUSABLE SELECTORS */
.hidden { display:none; }
.bold { font-weight: bold; }
#notification { z-index:101; cursor:pointer; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
.action, .selectedActions a, #logout { opacity:.3; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; }
.action:hover, .selectedActions a:hover, #logout:hover { opacity:1; }
table tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
table:not(.nostyle) tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
tbody tr:hover, tr:active { background-color:#f8f8f8; }
#body-settings .personalblock, #body-settings .helpblock { padding:.5em 1em; margin:1em; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }

View File

@ -244,7 +244,36 @@ function object(o) {
return new F();
}
/**
* Fills height of window. (more precise than height: 100%;)
*/
function fillHeight(selector) {
var height = parseFloat($(window).height())-parseFloat(selector.css('top'));
selector.css('height', height + 'px');
if(selector.outerHeight() > selector.height())
selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px');
}
/**
* Fills height and width of window. (more precise than height: 100%; or width: 100%;)
*/
function fillWindow(selector) {
fillHeight(selector);
var width = parseFloat($(window).width())-parseFloat(selector.css('left'));
selector.css('width', width + 'px');
if(selector.outerWidth() > selector.width())
selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px');
}
$(document).ready(function(){
$(window).resize(function () {
fillHeight($('#leftcontent'));
fillWindow($('#rightcontent'));
});
$(window).trigger('resize');
if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg
replaceSVG();
}else{

View File

@ -1,5 +1,6 @@
<form action="index.php" method="post">
<fieldset>
<?php if(!empty($_['redirect'])) { echo '<input type="hidden" name="redirect_url" value="'.$_['redirect'].'" />'; } ?>
<?php if($_['error']): ?>
<a href="./core/lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
<?php endif; ?>

View File

@ -68,6 +68,9 @@ else {
OC_User::setUserId($_COOKIE['oc_username']);
OC_Util::redirectToDefaultPage();
}
else {
OC_User::unsetMagicInCookie();
}
}
// Someone wants to log in :
@ -90,5 +93,5 @@ else {
}
}
OC_Template::printGuestPage('', 'login', array('error' => $error ));
OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
}

View File

@ -61,7 +61,7 @@ class OC_Helper {
}
if($redirect_url)
return $urlLinkTo.'?redirect_url='.$redirect_url;
return $urlLinkTo.'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]);
else
return $urlLinkTo;

View File

@ -321,7 +321,11 @@ class OC_Util {
* Redirect to the user default page
*/
public static function redirectToDefaultPage(){
if(isset($_REQUEST['redirect_url'])) {
header( 'Location: '.$_REQUEST['redirect_url']);
} else {
header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php'));
}
exit();
}
}

View File

@ -9,11 +9,13 @@ input#identity { width:20em; }
.msg.success{ color:#fff; background-color:#0f0; padding:3px; text-shadow:1px 1px #000; }
.msg.error{ color:#fff; background-color:#f00; padding:3px; text-shadow:1px 1px #000; }
table.nostyle label { margin-right: 2em; }
table.nostyle td { padding: 0.2em 0; }
/* USERS */
form { display:inline; }
table th { height:2em; color:#999; }
table th, table td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
table:not(.nostyle) th { height:2em; color:#999; }
table:not(.nostyle) th, table:not(.nostyle) td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
td.name, td.password { padding-left:.8em; }
td.password>img, td.remove>img, td.quota>img { visibility:hidden; }
td.password, td.quota { width:12em; cursor:pointer; }
@ -24,8 +26,8 @@ tr:hover>td.password>span { margin:0; cursor:pointer; }
tr:hover>td.remove>img, tr:hover>td.password>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; }
tr:hover>td.remove>img { float:right; }
li.selected { background-color:#ddd; }
#content>table { margin-top:6.5em; }
table { width:100%; }
#content>table:not(.nostyle) { margin-top:6.5em; }
table:not(.nostyle) { width:100%; }
/* APPS */