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

remotes/origin/stable
Michiel@unhosted 14 years ago
commit 6e62911a4e
  1. 3
      .gitignore
  2. 13
      COPYING-README
  3. 1
      apps/bookmarks/addBm.php
  4. 5
      apps/bookmarks/ajax/addBookmark.php
  5. 3
      apps/bookmarks/ajax/editBookmark.php
  6. 2
      apps/bookmarks/ajax/updateList.php
  7. 25
      apps/bookmarks/appinfo/app.php
  8. 7
      apps/bookmarks/appinfo/database.xml
  9. 55
      apps/bookmarks/bookmarksHelper.php
  10. 60
      apps/bookmarks/css/bookmarks.css
  11. 3
      apps/bookmarks/js/addBm.js
  12. 46
      apps/bookmarks/js/bookmarks.js
  13. 13
      apps/bookmarks/settings.php
  14. 1
      apps/bookmarks/templates/addBm.php
  15. 24
      apps/bookmarks/templates/list.php
  16. 14
      apps/bookmarks/templates/settings.php
  17. 2
      apps/calendar/ajax/createcalendar.php
  18. 633
      apps/calendar/ajax/getcal.php
  19. 1
      apps/calendar/ajax/newcalendar.php
  20. 2
      apps/calendar/ajax/updatecalendar.php
  21. 6
      apps/calendar/appinfo/database.xml
  22. 7
      apps/calendar/css/style.css
  23. 2
      apps/calendar/import.php
  24. 4
      apps/calendar/js/calendar.js
  25. 23
      apps/calendar/lib/calendar.php
  26. 6
      apps/calendar/lib/connector_sabre.php
  27. 6
      apps/calendar/templates/part.editcalendar.php
  28. 8
      apps/calendar/templates/part.import.php
  29. 10
      apps/calendar/templates/settings.php
  30. 14
      apps/contacts/ajax/addcard.php
  31. 2
      apps/contacts/ajax/addproperty.php
  32. 1
      apps/contacts/css/styles.css
  33. 11
      apps/contacts/js/interface.js
  34. 1
      apps/contacts/lib/vcard.php
  35. 2
      apps/contacts/templates/index.php
  36. 4
      apps/contacts/templates/part.details.php
  37. 4
      apps/contacts/templates/part.property.php
  38. 7
      apps/files_sharing/get.php
  39. 7
      apps/gallery/ajax/cover.php
  40. 9
      apps/gallery/ajax/createAlbum.php
  41. 9
      apps/gallery/ajax/getAlbums.php
  42. 13
      apps/gallery/ajax/getCovers.php
  43. 11
      apps/gallery/ajax/scanForAlbums.php
  44. 7
      apps/gallery/ajax/thumbnail.php
  45. 4
      apps/gallery/appinfo/app.php
  46. 1
      apps/gallery/index.php
  47. 2
      apps/media/appinfo/app.php
  48. 4
      apps/media/css/music.css
  49. 2
      apps/media/templates/settings.php
  50. 1
      apps/user_openid/appinfo/info.xml
  51. 5
      core/css/styles.css
  52. BIN
      core/img/filetypes/application-pdf.png
  53. BIN
      core/img/filetypes/application-rss+xml.png
  54. BIN
      core/img/filetypes/audio.png
  55. BIN
      core/img/filetypes/code.png
  56. BIN
      core/img/filetypes/database.png
  57. BIN
      core/img/filetypes/file.png
  58. BIN
      core/img/filetypes/flash.png
  59. BIN
      core/img/filetypes/folder.png
  60. BIN
      core/img/filetypes/font.png
  61. BIN
      core/img/filetypes/image-svg+xml.png
  62. BIN
      core/img/filetypes/image.png
  63. BIN
      core/img/filetypes/link.png
  64. BIN
      core/img/filetypes/model.png
  65. BIN
      core/img/filetypes/ms-excel.png
  66. BIN
      core/img/filetypes/ms-powerpoint.png
  67. BIN
      core/img/filetypes/php.png
  68. BIN
      core/img/filetypes/presentation.png
  69. 22
      core/img/filetypes/readme.txt
  70. BIN
      core/img/filetypes/ruby.png
  71. BIN
      core/img/filetypes/script.png
  72. BIN
      core/img/filetypes/spreadsheet.png
  73. BIN
      core/img/filetypes/text-calendar.png
  74. BIN
      core/img/filetypes/text-css.png
  75. BIN
      core/img/filetypes/text-html.png
  76. BIN
      core/img/filetypes/text-x-c++.png
  77. BIN
      core/img/filetypes/text-x-c.png
  78. BIN
      core/img/filetypes/text-x-csharp.png
  79. BIN
      core/img/filetypes/text-x-h.png
  80. BIN
      core/img/filetypes/text.png
  81. BIN
      core/img/filetypes/vcf.png
  82. BIN
      core/img/filetypes/video.png
  83. BIN
      core/img/filetypes/x-.png
  84. BIN
      core/img/places/file.png
  85. 0
      core/img/places/file.svg
  86. BIN
      core/img/places/music.png
  87. 0
      core/img/places/music.svg
  88. BIN
      core/img/places/picture.png
  89. 0
      core/img/places/picture.svg
  90. 2
      core/templates/layout.guest.php
  91. 2
      files/css/files.css
  92. 2
      files/js/filelist.js
  93. 39
      lib/app.php
  94. 12
      lib/helper.php
  95. 4
      settings/js/users.js
  96. 3
      settings/templates/personal.php

3
.gitignore vendored

@ -32,4 +32,7 @@ RCS/*
# netbeans # netbeans
nbproject nbproject
# geany
*.geany
.DS_Store .DS_Store

@ -2,12 +2,13 @@ Files in ownCloud are licensed under the Affero General Public License version 3
the text of which can be found in COPYING-AGPL, or any later version of the AGPL, the text of which can be found in COPYING-AGPL, or any later version of the AGPL,
unless otherwise noted. unless otherwise noted.
Components of ownCloud: Licensing of components:
* jQuery is dual licensed under MIT and GPL * jQuery: MIT / GPL
* HTTP is three clause BSD license * HTTP: 3 clause BSD
* MDB2 uses a custom license in the BSD style * MDB2: BSD style custom
* User is AGPL * User: AGPL
* XML/RPC is both MIT and PHP license * XML/RPC: MIT / PHP
* Silk icons: Creative Commons Attribution
All unmodified files from these and other sources retain their original copyright All unmodified files from these and other sources retain their original copyright
and license notices: see the relevant individual files. and license notices: see the relevant individual files.

@ -41,6 +41,5 @@ $metadata = getURLMetadata($url);
$tmpl->assign('URL', htmlentities($metadata['url'])); $tmpl->assign('URL', htmlentities($metadata['url']));
$tmpl->assign('TITLE', htmlentities($metadata['title'])); $tmpl->assign('TITLE', htmlentities($metadata['title']));
$tmpl->assign('DESCRIPTION', htmlentities($metadata['description']));
$tmpl->printPage(); $tmpl->printPage();

@ -40,15 +40,14 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
//FIXME: Detect when user adds a known URL //FIXME: Detect when user adds a known URL
$query = OC_DB::prepare(" $query = OC_DB::prepare("
INSERT INTO *PREFIX*bookmarks INSERT INTO *PREFIX*bookmarks
(url, title, description, user_id, public, added, lastmodified) (url, title, user_id, public, added, lastmodified)
VALUES (?, ?, ?, ?, 0, $_ut, $_ut) VALUES (?, ?, ?, 0, $_ut, $_ut)
"); ");
$params=array( $params=array(
htmlspecialchars_decode($_GET["url"]), htmlspecialchars_decode($_GET["url"]),
htmlspecialchars_decode($_GET["title"]), htmlspecialchars_decode($_GET["title"]),
htmlspecialchars_decode($_GET["description"]),
OC_User::getUser() OC_User::getUser()
); );
$query->execute($params); $query->execute($params);

@ -41,14 +41,13 @@ $bookmark_id = (int)$_GET["id"];
$query = OC_DB::prepare(" $query = OC_DB::prepare("
UPDATE *PREFIX*bookmarks UPDATE *PREFIX*bookmarks
SET url = ?, title =?, description = ?, lastmodified = $_ut SET url = ?, title =?, lastmodified = $_ut
WHERE id = $bookmark_id WHERE id = $bookmark_id
"); ");
$params=array( $params=array(
htmlspecialchars_decode($_GET["url"]), htmlspecialchars_decode($_GET["url"]),
htmlspecialchars_decode($_GET["title"]), htmlspecialchars_decode($_GET["title"]),
htmlspecialchars_decode($_GET["description"]),
); );
$query->execute($params); $query->execute($params);

@ -59,7 +59,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
} }
$query = OC_DB::prepare(' $query = OC_DB::prepare('
SELECT id, url, title, description, SELECT id, url, title,
CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
THEN GROUP_CONCAT( tag ' .$_gc_separator. ' ) THEN GROUP_CONCAT( tag ' .$_gc_separator. ' )
ELSE \' \' ELSE \' \'

@ -1,27 +1,14 @@
<?php <?php
/** /**
* ownCloud - bookmarks plugin * Copyright (c) 2011 Marvin Thomas Rabe <m.rabe@echtzeitraum.de>
* * Copyright (c) 2011 Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Arthur Schiwon * This file is licensed under the Affero General Public License version 3 or
* @copyright 2011 Arthur Schiwon blizzz@arthur-schiwon.de * later.
* * See the COPYING-README file.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/ */
OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => 'Bookmarks' )); OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => 'Bookmarks' ));
OC_App::registerPersonal('bookmarks', 'settings');

@ -29,13 +29,6 @@
<notnull>true</notnull> <notnull>true</notnull>
<length>140</length> <length>140</length>
</field> </field>
<field>
<name>description</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>255</length>
</field>
<field> <field>
<name>user_id</name> <name>user_id</name>
<type>text</type> <type>text</type>

@ -1,5 +1,52 @@
<?php <?php
// Source: http://www.php.net/manual/de/function.curl-setopt.php#102121
// This works around a safe_mode/open_basedir restriction
function curl_exec_follow(/*resource*/ $ch, /*int*/ &$maxredirect = null) {
$mr = $maxredirect === null ? 5 : intval($maxredirect);
if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $mr > 0);
curl_setopt($ch, CURLOPT_MAXREDIRS, $mr);
} else {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
if ($mr > 0) {
$newurl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
$rch = curl_copy_handle($ch);
curl_setopt($rch, CURLOPT_HEADER, true);
curl_setopt($rch, CURLOPT_NOBODY, true);
curl_setopt($rch, CURLOPT_FORBID_REUSE, false);
curl_setopt($rch, CURLOPT_RETURNTRANSFER, true);
do {
curl_setopt($rch, CURLOPT_URL, $newurl);
$header = curl_exec($rch);
if (curl_errno($rch)) {
$code = 0;
} else {
$code = curl_getinfo($rch, CURLINFO_HTTP_CODE);
if ($code == 301 || $code == 302) {
preg_match('/Location:(.*?)\n/', $header, $matches);
$newurl = trim(array_pop($matches));
} else {
$code = 0;
}
}
} while ($code && --$mr);
curl_close($rch);
if (!$mr) {
if ($maxredirect === null) {
trigger_error('Too many redirects. When following redirects, libcurl hit the maximum amount.', E_USER_WARNING);
} else {
$maxredirect = 0;
}
return false;
}
curl_setopt($ch, CURLOPT_URL, $newurl);
}
}
return curl_exec($ch);
}
function getURLMetadata($url) { function getURLMetadata($url) {
//allow only http(s) and (s)ftp //allow only http(s) and (s)ftp
$protocols = '/^[hs]{0,1}[tf]{0,1}tp[s]{0,1}\:\/\//i'; $protocols = '/^[hs]{0,1}[tf]{0,1}tp[s]{0,1}\:\/\//i';
@ -12,17 +59,11 @@ function getURLMetadata($url) {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($ch); $page = curl_exec_follow($ch);
curl_close($ch); curl_close($ch);
@preg_match( "/<title>(.*)<\/title>/si", $page, $match ); @preg_match( "/<title>(.*)<\/title>/si", $page, $match );
$metadata['title'] = htmlspecialchars_decode(@$match[1]); $metadata['title'] = htmlspecialchars_decode(@$match[1]);
$meta = get_meta_tags($url);
if(array_key_exists('description', $meta)) {
$metadata['description'] = $meta['description'];
}
return $metadata; return $metadata;
} }

@ -12,34 +12,13 @@
padding: 0.5ex; padding: 0.5ex;
} }
.bookmark_actions {
font-size: smaller;
color: #ff44ff;
padding-left: 4em;
}
.bookmark_actions span:hover {
cursor: pointer;
text-decoration: underline;
}
.bookmarks_sorting {
float: left;
margin-left: 2em;
}
.bookmarks_sorting li {
padding: 1ex 1em;
border: 1px solid gray;
-moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em;
}
.bookmarks_sorting_active {
font-weight: bold;
}
.bookmarks_add { .bookmarks_add {
display: none; display: none;
margin-top: 45px;
}
.bookmarks_list {
margin-top: 45px;
} }
.bookmarks_addBml { .bookmarks_addBml {
@ -56,15 +35,28 @@
width: 20em; width: 20em;
} }
.bookmark_actions {
display: none;
font-size: smaller;
color: #666;
padding-left: 4em;
}
.bookmark_actions span:hover {
cursor: pointer;
text-decoration: underline;
}
.bookmark_single { .bookmark_single {
margin-left: 2em; padding: 0.5em 1em;
margin-top: 3ex;
padding: 0.5ex;
/* border-bottom: 1px solid black; */
} }
.bookmark_single:hover { .bookmark_single:hover {
background-color: #ccccff; background-color: #EAEAEA;
}
.bookmark_single:hover .bookmark_actions {
display: block;
} }
.bookmark_title { .bookmark_title {
@ -77,14 +69,10 @@
color: green; color: green;
} }
.bookmark_tags { .bookmark_tag {
color: #ff3333; color: #ff3333;
} }
.clear {
clear:both;
}
.loading_meta { .loading_meta {
display: none; display: none;
margin-left: 5px; margin-left: 5px;

@ -5,11 +5,10 @@ $(document).ready(function() {
function addBookmark(event) { function addBookmark(event) {
var url = $('#bookmark_add_url').val(); var url = $('#bookmark_add_url').val();
var title = $('#bookmark_add_title').val(); var title = $('#bookmark_add_title').val();
var description = $('#bookmark_add_description').val();
var tags = $('#bookmark_add_tags').val(); var tags = $('#bookmark_add_tags').val();
$.ajax({ $.ajax({
url: 'ajax/addBookmark.php', url: 'ajax/addBookmark.php',
data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags), data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
success: function(data){ success: function(data){
location.href='index.php'; location.href='index.php';
} }

@ -12,9 +12,6 @@ $(document).ready(function() {
$(window).scroll(updateOnBottom); $(window).scroll(updateOnBottom);
$('#bookmark_add_url').focusout(getMetadata); $('#bookmark_add_url').focusout(getMetadata);
$('.' + bookmarks_sorting).addClass('bookmarks_sorting_active');
$('.bookmarks_sorting li').click(function(event){changeSorting(this)});
$('.bookmarks_list').empty(); $('.bookmarks_list').empty();
getBookmarks(); getBookmarks();
@ -39,6 +36,7 @@ function getBookmarks() {
for(var i in bookmarks.data) { for(var i in bookmarks.data) {
updateBookmarksList(bookmarks.data[i]); updateBookmarksList(bookmarks.data[i]);
} }
$('.bookmark_link').click(recordClick); $('.bookmark_link').click(recordClick);
$('.bookmark_delete').click(delBookmark); $('.bookmark_delete').click(delBookmark);
$('.bookmark_edit').click(showBookmark); $('.bookmark_edit').click(showBookmark);
@ -57,36 +55,21 @@ function getMetadata() {
success: function(pageinfo){ success: function(pageinfo){
$('#bookmark_add_url').val(pageinfo.data.url); $('#bookmark_add_url').val(pageinfo.data.url);
$('#bookmark_add_title').val(pageinfo.data.title); $('#bookmark_add_title').val(pageinfo.data.title);
if (pageinfo.data.description !== undefined){
$('#bookmark_add_description').val(pageinfo.data.description);
}
$('.loading_meta').css('display','none'); $('.loading_meta').css('display','none');
} }
}); });
} }
function changeSorting(sortEl) {
$('.' + bookmarks_sorting).removeClass('bookmarks_sorting_active');
bookmarks_sorting = sortEl.className;
$('.' + bookmarks_sorting).addClass('bookmarks_sorting_active');
$('.bookmarks_list').empty();
bookmarks_page = 0;
bookmarks_loading = false;
getBookmarks();
}
// function addBookmark() { // function addBookmark() {
// Instead of creating editBookmark() function, Converted the one above to // Instead of creating editBookmark() function, Converted the one above to
// addOrEditBookmark() to make .js file more compact. // addOrEditBookmark() to make .js file more compact.
function addOrEditBookmark(event) { function addOrEditBookmark(event) {
var id = $('#bookmark_add_id').val(); var id = $('#bookmark_add_id').val();
var url = encodeEntities($('#bookmark_add_url').val()) var url = encodeEntities($('#bookmark_add_url').val());
var title = encodeEntities($('#bookmark_add_title').val()) var title = encodeEntities($('#bookmark_add_title').val());
var description = encodeEntities($('#bookmark_add_description').val()) var tags = encodeEntities($('#bookmark_add_tags').val());
var tags = encodeEntities($('#bookmark_add_tags').val()) var taglist = tags.split(' ');
var taglist = tags.split(' ')
var tagshtml = ''; var tagshtml = '';
for ( var i=0, len=taglist.length; i<len; ++i ){ for ( var i=0, len=taglist.length; i<len; ++i ){
tagshtml += '<a class="bookmark_tag" href="?tag=' + encodeURI(taglist[i]) + '">' + taglist[i] + '</a> '; tagshtml += '<a class="bookmark_tag" href="?tag=' + encodeURI(taglist[i]) + '">' + taglist[i] + '</a> ';
@ -95,16 +78,15 @@ function addOrEditBookmark(event) {
if (id == 0) { if (id == 0) {
$.ajax({ $.ajax({
url: 'ajax/addBookmark.php', url: 'ajax/addBookmark.php',
data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags), data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
success: function(response){ success: function(response){
var bookmark_id = response.data; var bookmark_id = response.data;
$('.bookmarks_add').slideToggle(); $('.bookmarks_add').slideToggle();
$('.bookmarks_add').children('p').children('.bookmarks_input').val(''); $('.bookmarks_add').children('p').children('.bookmarks_input').val('');
$('.bookmarks_list').prepend( $('.bookmarks_list').prepend(
'<div class="bookmark_single" data-id="' + bookmark_id + '" >' + '<div class="bookmark_single" data-id="' + bookmark_id + '" >' +
'<p class="bookmark_title"><a href="' + url + '" target="_new" class="bookmark_link">' + title + '</a></p>' + '<p class="bookmark_title"><a href="' + url + '" target="_blank" class="bookmark_link">' + title + '</a></p>' +
'<p class="bookmark_url">' + url + '</p>' + '<p class="bookmark_url">' + url + '</p>' +
'<p class="bookmark_description">' + description + '</p>' +
'<p class="bookmark_tags">' + tagshtml + '</p>' + '<p class="bookmark_tags">' + tagshtml + '</p>' +
'<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' + '<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' +
'</div>' '</div>'
@ -115,8 +97,7 @@ function addOrEditBookmark(event) {
else { else {
$.ajax({ $.ajax({
url: 'ajax/editBookmark.php', url: 'ajax/editBookmark.php',
data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
encodeURI(description) + '&tags=' + encodeURI(tags),
success: function(){ success: function(){
$('.bookmarks_add').slideToggle(); $('.bookmarks_add').slideToggle();
$('.bookmarks_add').children('p').children('.bookmarks_input').val(''); $('.bookmarks_add').children('p').children('.bookmarks_input').val('');
@ -124,7 +105,6 @@ function addOrEditBookmark(event) {
var record = $('.bookmark_single[data-id = "' + id + '"]'); var record = $('.bookmark_single[data-id = "' + id + '"]');
record.children('.bookmark_url:first').text(url); record.children('.bookmark_url:first').text(url);
record.children('.bookmark_description:first').text(description);
var record_title = record.children('.bookmark_title:first').children('a:first'); var record_title = record.children('.bookmark_title:first').children('a:first');
record_title.attr('href', url); record_title.attr('href', url);
@ -138,7 +118,7 @@ function addOrEditBookmark(event) {
} }
function delBookmark(event) { function delBookmark(event) {
var record = $(this).parent().parent() var record = $(this).parent().parent();
$.ajax({ $.ajax({
url: 'ajax/delBookmark.php', url: 'ajax/delBookmark.php',
data: 'url=' + encodeURI($(this).parent().parent().children('.bookmark_url:first').text()), data: 'url=' + encodeURI($(this).parent().parent().children('.bookmark_url:first').text()),
@ -151,7 +131,6 @@ function showBookmark(event) {
$('#bookmark_add_id').val(record.attr('data-id')); $('#bookmark_add_id').val(record.attr('data-id'));
$('#bookmark_add_url').val(record.children('.bookmark_url:first').text()); $('#bookmark_add_url').val(record.children('.bookmark_url:first').text());
$('#bookmark_add_title').val(record.children('.bookmark_title:first').text()); $('#bookmark_add_title').val(record.children('.bookmark_title:first').text());
$('#bookmark_add_description').val(record.children('.bookmark_description:first').text());
$('#bookmark_add_tags').val(record.children('.bookmark_tags:first').text()); $('#bookmark_add_tags').val(record.children('.bookmark_tags:first').text());
if ($('.bookmarks_add').css('display') == 'none') { if ($('.bookmarks_add').css('display') == 'none') {
@ -163,10 +142,6 @@ function showBookmark(event) {
} }
function editBookmark(event) {
}
function updateBookmarksList(bookmark) { function updateBookmarksList(bookmark) {
var tags = encodeEntities(bookmark.tags).split(' '); var tags = encodeEntities(bookmark.tags).split(' ');
var taglist = ''; var taglist = '';
@ -178,9 +153,8 @@ function updateBookmarksList(bookmark) {
} }
$('.bookmarks_list').append( $('.bookmarks_list').append(
'<div class="bookmark_single" data-id="' + bookmark.id +'" >' + '<div class="bookmark_single" data-id="' + bookmark.id +'" >' +
'<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_new" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' + '<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' +
'<p class="bookmark_url">' + encodeEntities(bookmark.url) + '</p>' + '<p class="bookmark_url">' + encodeEntities(bookmark.url) + '</p>' +
'<p class="bookmark_description">' + encodeEntities(bookmark.description) + '</p>' +
'<p class="bookmark_tags">' + taglist + '</p>' + '<p class="bookmark_tags">' + taglist + '</p>' +
'<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' + '<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' +
'</div>' '</div>'

@ -0,0 +1,13 @@
<?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <m.rabe@echtzeitraum.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'bookmarks', 'settings');
OC_Util::addScript('bookmarks','settings');
return $tmpl->fetchPage();

@ -1,7 +1,6 @@
<div class="bookmarks_addBm"> <div class="bookmarks_addBm">
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p> <p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p> <p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<?php echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p> <p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p> <p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p> <p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>

@ -1,27 +1,25 @@
<?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <m.rabe@echtzeitraum.de>
* Copyright (c) 2011 Arthur Schiwon <blizzz@arthur-schiwon.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
?>
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" /> <input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? $l->t('Bookmarks with tag: ') . urldecode($_GET["tag"]) : $l->t('All bookmarks'); ?></h2> <div id="controls">
<div class="bookmarks_menu"> <input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>&nbsp;
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');" title="<?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?>"><?php echo $l->t('Add page to ownCloud'); ?></a>
</div> </div>
<div class="bookmarks_add"> <div class="bookmarks_add">
<input type="hidden" id="bookmark_add_id" value="0" /> <input type="hidden" id="bookmark_add_id" value="0" />
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p> <p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" /> <p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" />
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p> <img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p> <p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p> <p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p> <p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
</div> </div>
<div class="bookmarks_sorting pager">
<ul>
<li class="bookmarks_sorting_recent"><?php echo $l->t('Recent Bookmarks'); ?></li>
<li class="bookmarks_sorting_clicks"><?php echo $l->t('Most clicks'); ?></li>
</ul>
</div>
<div class="clear"></div>
<div class="bookmarks_list"> <div class="bookmarks_list">
<?php echo $l->t('You have no bookmarks'); ?> <?php echo $l->t('You have no bookmarks'); ?>
</div> </div>

@ -0,0 +1,14 @@
<?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <m.rabe@echtzeitraum.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
?>
<form id="bookmarks">
<fieldset class="personalblock">
<span class="bold"><?php echo $l->t('Bookmarklet:');?></span>&nbsp;<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');"><?php echo $l->t('Add page to ownCloud'); ?></a>
<br/><em><?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?></em><br />
</fieldset>
</form>

@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar'); OC_JSON::checkAppEnabled('calendar');
$userid = OC_User::getUser(); $userid = OC_User::getUser();
$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']); $calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, 1); OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid); $calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');

@ -28,9 +28,8 @@ $select_year = $_GET["year"];
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London");
foreach($events as $event) foreach($events as $event)
{ {
if($select_year != substr($event['startdate'], 0, 4) && $event["repeating"] == false) if ($select_year != substr($event['startdate'], 0, 4))
continue; continue;
if($select_year == substr($event['startdate'], 0, 4) && $event["repeating"] == false){
$object = Sabre_VObject_Reader::read($event['calendardata']); $object = Sabre_VObject_Reader::read($event['calendardata']);
$vevent = $object->VEVENT; $vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART; $dtstart = $vevent->DTSTART;
@ -67,635 +66,5 @@ foreach($events as $event)
{ {
$return[$year][$month][$day][$hour] = array(1 => $return_event); $return[$year][$month][$day][$hour] = array(1 => $return_event);
} }
}
if($event["repeating"] == 1){
$object = Sabre_VObject_Reader::read($event['calendardata']);
$vevent = $object->VEVENT;
//echo substr_count($event["calendardata"], "EXDATE");
$numofelements = substr_count($vevent->RRULE, ";");
$properties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
$exruleproperties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
$byday = array("MO"=>"false", "TU"=>"false", "WE"=>"false", "TH"=>"false", "FR"=>"false", "SA"=>"false", "SU"=>"false");
if($numofelements != 0){
$rrule = explode(";", $vevent->RRULE);
for($i = 0;$i <= $numofelements;$i++){
$rule = explode("=", $rrule[$i]);
$property = $rule[0];
$value = $rule[1];
$properties[$property] = $value;
}
if($properties["BYDAY"] != "false"){
$numofdays = substr_count($properties["BYDAY"], ",");
if($numofdays == 0){
if(strlen($properties["BYDAY"]) != 2){
$lenght = strlen($properties["BYDAY"]);
switch($lenght){
case "3":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,1);
$properties["BYDAY"] = substr($properties["BYDAY"],1,2);
break;
case "4":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,2);
$properties["BYDAY"] = substr($properties["BYDAY"],2,2);
break;
case "5":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,3);
$properties["BYDAY"] = substr($properties["BYDAY"],3,2);
break;
case "6":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,4);
$properties["BYDAY"] = substr($properties["BYDAY"],4,2);
break;
}
}
$byday[$properties["BYDAY"]] = true;
}else{
$days = explode(",", $properties["BYDAY"]);
for($i = 0;$i <= $numofdays;$i++){
$day = $days[$i];
$byday[$day] = true;
}
}
}
}else{
$rule = explode("=", $vevent->RRULE);
$properties[$rule[0]] = $rule[1];
}
if($properties["INTERVAL"] == "false"){
$properties["INTERVAL"] = 1;
}
$count = 0; //counts all loops
$countedoutputs = 0; //counts only the outputs
$countchecker = true;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone(new DateTimeZone($user_timezone));
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone(new DateTimeZone($user_timezone));
$firststart_year = $start_dt->format('Y');
$firststart_month = $start_dt->format('n');
$firststart_day = $start_dt->format('j');
$hour = $start_dt->format('G');
$interval = 0;
if($properties["UNTIL"] != "false"){
$until = $properties["UNTIL"];
$until_year = substr($until, 0, 4);
$until_month = substr($until, 4, 2);
$until_day = substr($until, 6, 2);
}
//print_r($properties);
//print_r($byday);
if($properties["FREQ"] == "DAILY"){
if($properties["BYDAY"] == "false"){
$byday = array("MO"=>"1", "TU"=>"1", "WE"=>"1", "TH"=>"1", "FR"=>"1", "SA"=>"1", "SU"=>"1");
}
while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
if($properties["FREQ"] == "WEEKLY"){
if($properties["BYDAY"] == "false"){
$byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)), 0, 2))] = "1";
}
while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
if($properties["FREQ"] == "MONTHLY"){
if(substr_count($properties["BYMONTHDAY"], ",") != 0){
$numofBYMONTHDAY = substr_count($properties["BYMONTHDAY"], ",");
if($numofBYMONTHDAY == 0){
$BYMONTHDAY = array();
$BYMONTHDAY[0] = $properties["BYMONTHDAY"];
}else{
$BYMONTHDAY = explode(",", $properties["BYMONTHDAY"]);
}
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
for($i = 0;$i <= $numofBYMONTHDAY;$i++){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $BYMONTHDAY[$i], $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
//if($properties["BYMONTHDAY"] != "false"){
if($properties["BYSETPOS"] == "false"){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}else{
if(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] >= 1){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
$lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year));
$matches = 0;
$matchedday = "";
for($i = 1;$i <= $lastdayofmonth;$i++){
$thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
$thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
//echo $thisdayname . " " . $thisday . "\n";
if($byday[$thisdayname] == 1){
$matches++;
}
if($matches == $properties["BYSETPOS"]){
$matchedday = $thisday;
$i = 32;
}
}
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = $matchedday;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}elseif(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] <= -1){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
$lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), 1, $firststart_year));
$matches = 0;
$matchedday = "";
for($i = $lastdayofmonth;$i >= 1;$i--){
$thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
$thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
//echo $thisdayname . " " . $thisday . "\n";
if($byday[$thisdayname] == 1){
$matches++;
}
if($matches == $properties["BYSETPOS"]){
$matchedday = $thisday;
$i = 0;
}
}
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = $matchedday;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
//}
}
}
if(strlen($properties["BYDAY"]) == 2){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}else{
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = $month - 1; // return is 0 based
$day = $dateofweekone;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
}
if($properties["FREQ"] == "YEARLY"){
if($properties["BYMONTH"] != "false"){
if($properties["BYMONTHDAY"] == false){
$properties["BYMONTHDAY"] = date("j", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year));
}
if($properties["BYDAY"] == "false"){
while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
if(strlen($properties["BYDAY"]) == 2){
while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}else{
$number = substr($properties["BYDAY"],0,1);
$weekday = substr($properties["BYDAY"],1,2);
$month = $properties["BYMONTH"];
$dateofweekone = "";
for($i = 0; $i <= 7;$i++){
if(strtoupper(substr(date("D", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)), 0, 2)) == $weekday){
$dateofweekone = date("j", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year));
$i = 8;
}
}
if($number != 1){
$dateofweekone = $dateofweekone + (7 * ($number - 1));
}
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = $month - 1; // return is 0 based
$day = $dateofweekone;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
}elseif($properties["BYYEARDAY"] != false){
$numofyeardays = substr_count($properties["BYYEARDAY"], ",");
if($numofyeardays == 0){
$yeardays = array();
$yeardays[0] = $properties["BYYEARDAY"];
}else{
$yeardays = explode(",", $properties["BYYEARDAY"]);
}
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval)) + ($yeardays[$numofyeardays]-1) * 86400) <= $select_year && $countchecker == true){
for($i = 0;$i <= $numofyeardays;$i++){
$newunixtime = mktime(0,0,0, 1, 1, $firststart_year + ($count * $interval)) + ($yeardays[$i] -1) * 86400;
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
}
}
} }
OC_JSON::encodedPrint($return); OC_JSON::encodedPrint($return);

@ -15,7 +15,6 @@ OC_JSON::checkAppEnabled('calendar');
$calendar = array( $calendar = array(
'id' => 'new', 'id' => 'new',
'displayname' => '', 'displayname' => '',
'description' => '',
'calendarcolor' => '', 'calendarcolor' => '',
); );
$tmpl = new OC_Template('calendar', 'part.editcalendar'); $tmpl = new OC_Template('calendar', 'part.editcalendar');

@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar'); OC_JSON::checkAppEnabled('calendar');
$calendarid = $_POST['id']; $calendarid = $_POST['id'];
OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']); OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], null, null, null, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid); $calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');

@ -153,12 +153,6 @@
<length>4</length> <length>4</length>
</field> </field>
<field>
<name>description</name>
<type>clob</type>
<notnull>false</notnull>
</field>
<field> <field>
<name>calendarorder</name> <name>calendarorder</name>
<type>integer</type> <type>integer</type>

@ -5,7 +5,7 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
#view {margin-left: 10px; float: left; font-size: 12px;} #view { float: left; font-size: 12px; height: 100%;}
#datecontrol {text-align: center;} #datecontrol {text-align: center;}
#datecontrol_left{font-size: 12px;} #datecontrol_left{font-size: 12px;}
#datecontrol_right{font-size: 12px;} #datecontrol_right{font-size: 12px;}
@ -17,7 +17,6 @@
#editentry_dialog {display: none;} #editentry_dialog {display: none;}
#parsingfail_dialog{display: none;} #parsingfail_dialog{display: none;}
#view {margin-left: 10px; float: left; font-size: 12px; height: 100%;}
#calendar_holder {height: 100%; width: 100%;} #calendar_holder {height: 100%; width: 100%;}
#onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {display: none; position: absolute;bottom: 0; right: 0; left: 160px; top: 80px;} #onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {display: none; position: absolute;bottom: 0; right: 0; left: 160px; top: 80px;}
#onedayview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} #onedayview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;}
@ -59,5 +58,5 @@ color:#A9A9A9;
select#category{width:140px;} select#category{width:140px;}
button.category{margin:0 3px;} button.category{margin:0 3px;}
.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;} .calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;border:2px solid transparent;}
.calendar-colorpicker-color.active{background-image:url("../../../core/img/jquery-ui/ui-icons_222222_256x240.png");background-position:-62px -143px;} .calendar-colorpicker-color.active{border:2px solid black;}

@ -23,7 +23,7 @@ if($_GET["import"] == "existing"){
$filename = "/" . $_GET["file"]; $filename = "/" . $_GET["file"];
} }
}else{ }else{
$id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']); $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']);
OC_Calendar_Calendar::setCalendarActive($id, 1); OC_Calendar_Calendar::setCalendarActive($id, 1);
$calid = $id; $calid = $id;
if($_POST["path"] != ""){ if($_POST["path"] != ""){

@ -491,8 +491,6 @@ Calendar={
// based on jquery-colorpicker at jquery.webspirited.com // based on jquery-colorpicker at jquery.webspirited.com
var obj = $('.colorpicker', container); var obj = $('.colorpicker', container);
var picker = $('<div class="calendar-colorpicker"></div>'); var picker = $('<div class="calendar-colorpicker"></div>');
var size = 20;
//build an array of colors //build an array of colors
var colors = {}; var colors = {};
$(obj).children('option').each(function(i, elm) { $(obj).children('option').each(function(i, elm) {
@ -501,7 +499,7 @@ Calendar={
colors[i].label = $(elm).text(); colors[i].label = $(elm).text();
}); });
for (var i in colors) { for (var i in colors) {
picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + '; width: ' + size + 'px; height: ' + size + 'px;"></span>'); picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + ';"></span>');
} }
picker.delegate(".calendar-colorpicker-color", "click", function() { picker.delegate(".calendar-colorpicker-color", "click", function() {
$(obj).val($(this).attr('rel')); $(obj).val($(this).attr('rel'));

@ -30,7 +30,6 @@
* uri VARCHAR(100), * uri VARCHAR(100),
* active INTEGER UNSIGNED NOT NULL DEFAULT '0', * active INTEGER UNSIGNED NOT NULL DEFAULT '0',
* ctag INTEGER UNSIGNED NOT NULL DEFAULT '0', * ctag INTEGER UNSIGNED NOT NULL DEFAULT '0',
* description TEXT,
* calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0', * calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0',
* calendarcolor VARCHAR(10), * calendarcolor VARCHAR(10),
* timezone TEXT, * timezone TEXT,
@ -94,14 +93,13 @@ class OC_Calendar_Calendar{
* @brief Creates a new calendar * @brief Creates a new calendar
* @param string $userid * @param string $userid
* @param string $name * @param string $name
* @param string $description
* @param string $components Default: "VEVENT,VTODO,VJOURNAL" * @param string $components Default: "VEVENT,VTODO,VJOURNAL"
* @param string $timezone Default: null * @param string $timezone Default: null
* @param integer $order Default: 1 * @param integer $order Default: 1
* @param string $color Default: null * @param string $color Default: null
* @return insertid * @return insertid
*/ */
public static function addCalendar($userid,$name,$description,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){ public static function addCalendar($userid,$name,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
$all = self::allCalendars($userid); $all = self::allCalendars($userid);
$uris = array(); $uris = array();
foreach($all as $i){ foreach($all as $i){
@ -110,8 +108,8 @@ class OC_Calendar_Calendar{
$uri = self::createURI($name, $uris ); $uri = self::createURI($name, $uris );
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' ); $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components)); $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid(); return OC_DB::insertid();
} }
@ -121,18 +119,17 @@ class OC_Calendar_Calendar{
* @param string $principaluri * @param string $principaluri
* @param string $uri * @param string $uri
* @param string $name * @param string $name
* @param string $description
* @param string $components * @param string $components
* @param string $timezone * @param string $timezone
* @param integer $order * @param integer $order
* @param string $color * @param string $color
* @return insertid * @return insertid
*/ */
public static function addCalendarFromDAVData($principaluri,$uri,$name,$description,$components,$timezone,$order,$color){ public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){
$userid = self::extractUserID($principaluri); $userid = self::extractUserID($principaluri);
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' ); $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components)); $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid(); return OC_DB::insertid();
} }
@ -141,7 +138,6 @@ class OC_Calendar_Calendar{
* @brief Edits a calendar * @brief Edits a calendar
* @param integer $id * @param integer $id
* @param string $name Default: null * @param string $name Default: null
* @param string $description Default: null
* @param string $components Default: null * @param string $components Default: null
* @param string $timezone Default: null * @param string $timezone Default: null
* @param integer $order Default: null * @param integer $order Default: null
@ -150,20 +146,19 @@ class OC_Calendar_Calendar{
* *
* Values not null will be set * Values not null will be set
*/ */
public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){ public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null){
// Need these ones for checking uri // Need these ones for checking uri
$calendar = self::findCalendar($id); $calendar = self::findCalendar($id);
// Keep old stuff // Keep old stuff
if(is_null($name)) $name = $calendar['name']; if(is_null($name)) $name = $calendar['name'];
if(is_null($description)) $description = $calendar['description'];
if(is_null($components)) $components = $calendar['components']; if(is_null($components)) $components = $calendar['components'];
if(is_null($timezone)) $timezone = $calendar['timezone']; if(is_null($timezone)) $timezone = $calendar['timezone'];
if(is_null($order)) $order = $calendar['calendarorder']; if(is_null($order)) $order = $calendar['calendarorder'];
if(is_null($color)) $color = $calendar['color']; if(is_null($color)) $color = $calendar['color'];
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,description=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' ); $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
$result = $stmt->execute(array($name,$description,$order,$color,$timezone,$components,$id)); $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id));
return true; return true;
} }

@ -102,13 +102,12 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
} }
if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed'; if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed';
if(!isset($newValues['description'])) $newValues['description'] = '';
if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO'; if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO';
if(!isset($newValues['timezone'])) $newValues['timezone'] = null; if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0; if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null; if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['description'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
} }
/** /**
@ -191,12 +190,11 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
// Success // Success
if(!isset($newValues['displayname'])) $newValues['displayname'] = null; if(!isset($newValues['displayname'])) $newValues['displayname'] = null;
if(!isset($newValues['description'])) $newValues['description'] = null;
if(!isset($newValues['timezone'])) $newValues['timezone'] = null; if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null; if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null; if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],$newValues['description'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
return true; return true;

@ -25,12 +25,6 @@
</td> </td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<tr>
<th><?php echo $l->t('Description') ?></th>
<td>
<textarea id="description_<?php echo $_['calendar']['id'] ?>"><?php echo $_['calendar']['description'] ?></textarea>
</td>
</tr>
<tr> <tr>
<th><?php echo $l->t('Calendar color') ?></th> <th><?php echo $l->t('Calendar color') ?></th>
<td> <td>

@ -31,11 +31,6 @@ foreach($calendars as $calendar){
<input id="displayname" type="text" value=""> <input id="displayname" type="text" value="">
</td> </td>
</tr> </tr>
<th><?php echo $l->t('Description') ?></th>
<td>
<textarea id="description"></textarea>
</td>
</tr>
</table> </table>
<!-- end of modified part --> <!-- end of modified part -->
<br><br> <br><br>
@ -65,8 +60,7 @@ function importcal(importtype){
} }
if(importtype == "new"){ if(importtype == "new"){
var calname = $("#displayname").val(); var calname = $("#displayname").val();
var description = $("#description").val(); $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'path':path, 'file':file}, function(){
$.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){
$("#importdialog").dialog('destroy').remove(); $("#importdialog").dialog('destroy').remove();
$("#importdialogholder").remove(); $("#importdialogholder").remove();
}); });

@ -6,8 +6,6 @@
* later. * later.
* See the COPYING-README file. * See the COPYING-README file.
*/ */
OC_UTIL::addScript('', 'jquery.multiselect');
OC_UTIL::addStyle('', 'jquery.multiselect');
?> ?>
<form id="calendar"> <form id="calendar">
<fieldset class="personalblock"> <fieldset class="personalblock">
@ -16,16 +14,18 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
<?php <?php
$continent = ''; $continent = '';
foreach($_['timezones'] as $timezone): foreach($_['timezones'] as $timezone):
if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $timezone ) ):
$ex=explode('/', $timezone, 2);//obtain continent,city $ex=explode('/', $timezone, 2);//obtain continent,city
if (!isset($ex[1])) {
$ex[1] = $ex[0];
$ex[0] = "Other";
}
if ($continent!=$ex[0]): if ($continent!=$ex[0]):
if ($continent!="") echo '</optgroup>'; if ($continent!="") echo '</optgroup>';
echo '<optgroup label="'.$ex[0].'">'; echo '<optgroup label="'.$ex[0].'">';
endif; endif;
$city=$ex[1]; $city=strtr($ex[1], '_', ' ');
$continent=$ex[0]; $continent=$ex[0];
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>'; echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endif;
endforeach;?> endforeach;?>
</select></td></tr> </select></td></tr>

@ -37,16 +37,28 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
} }
$fn = $_POST['fn']; $fn = $_POST['fn'];
$values = $_POST['value'];
$parameters = $_POST['parameters'];
$vcard = new Sabre_VObject_Component('VCARD'); $vcard = new Sabre_VObject_Component('VCARD');
$vcard->add(new Sabre_VObject_Property('FN',$fn)); $vcard->add(new Sabre_VObject_Property('FN',$fn));
$vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID())); $vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID()));
foreach(array('ADR', 'TEL', 'EMAIL', 'ORG') as $propname){
$value = $values[$propname];
if (isset($parameters[$propname])){
$prop_parameters = $parameters[$propname];
} else {
$prop_parameters = array();
}
OC_Contacts_VCard::addVCardProperty($vcard, $propname, $value, $prop_parameters);
}
$id = OC_Contacts_VCard::add($aid,$vcard->serialize()); $id = OC_Contacts_VCard::add($aid,$vcard->serialize());
$details = OC_Contacts_VCard::structureContact($vcard); $details = OC_Contacts_VCard::structureContact($vcard);
$name = $details['FN'][0]['value'];
$tmpl = new OC_Template('contacts','part.details'); $tmpl = new OC_Template('contacts','part.details');
$tmpl->assign('details',$details); $tmpl->assign('details',$details);
$tmpl->assign('id',$id); $tmpl->assign('id',$id);
$page = $tmpl->fetchPage(); $page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page ))); OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page )));

@ -53,7 +53,7 @@ $name = $_POST['name'];
$value = $_POST['value']; $value = $_POST['value'];
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array(); $parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters); $property = OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
$line = count($vcard->children) - 1; $line = count($vcard->children) - 1;
$checksum = md5($property->serialize()); $checksum = md5($property->serialize());

@ -1,2 +1,3 @@
.contacts_details_left {text-align:right;vertical-align:top;padding:2px;} .contacts_details_left {text-align:right;vertical-align:top;padding:2px;}
.contacts_details_right {text-align:left;vertical-align:top;padding:2px;} .contacts_details_right {text-align:left;vertical-align:top;padding:2px;}
#contacts_deletecard {position:absolute;top:15px;right:0;}

@ -1,11 +1,4 @@
$(document).ready(function(){ $(document).ready(function(){
/*-------------------------------------------------------------------------
* Actions for startup
*-----------------------------------------------------------------------*/
if( $('#leftcontent li').length > 0 ){
$('#leftcontent li').first().addClass('active');
}
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Event handlers * Event handlers
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
@ -75,7 +68,7 @@ $(document).ready(function(){
$('#contacts_addpropertyform input[type="submit"]').live('click',function(){ $('#contacts_addpropertyform input[type="submit"]').live('click',function(){
$.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){ $.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_cardoptions').before(jsondata.data.page); $('#contacts_details').append(jsondata.data.page);
$('#contacts_addpropertyform').remove(); $('#contacts_addpropertyform').remove();
$('#contacts_addcontactsparts').remove(); $('#contacts_addcontactsparts').remove();
} }
@ -129,7 +122,7 @@ $(document).ready(function(){
}); });
$('#contacts_setpropertyform input[type="submit"]').live('click',function(){ $('#contacts_setpropertyform input[type="submit"]').live('click',function(){
$.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){ $.post('ajax/setproperty.php',$(this).parent('form').serialize(),function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('.contacts_details_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); $('.contacts_details_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
} }

@ -290,6 +290,7 @@ class OC_Contacts_VCard{
} }
$vcard->add($property); $vcard->add($property);
return $property;
} }
/** /**

@ -14,5 +14,5 @@ OC_Util::addStyle('contacts','styles');
</ul> </ul>
</div> </div>
<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>"> <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
<?php echo $this->inc("part.details"); ?> <?php echo $this->inc("part.addcardform"); ?>
</div> </div>

@ -1,5 +1,5 @@
<?php if(array_key_exists('FN',$_['details'])): ?> <?php if(array_key_exists('FN',$_['details'])): ?>
<table> <table id="contacts_details">
<?php if(isset($_['details']['PHOTO'])): // Emails first ?> <?php if(isset($_['details']['PHOTO'])): // Emails first ?>
<tr class="contacts_details_property"> <tr class="contacts_details_property">
<td class="contacts_details_left">&nbsp;</td> <td class="contacts_details_left">&nbsp;</td>
@ -28,7 +28,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<form> <form>
<input type="button" id="contacts_deletecard" value="<?php echo $l->t('Delete');?>"> <img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
<input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>"> <input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>">
</form> </form>
<?php endif; ?> <?php endif; ?>

@ -1,8 +1,8 @@
<tr class="contacts_details_property" data-checksum="<?php echo $_['property']['checksum']; ?>"> <tr class="contacts_details_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
<?php if($_['property']['name'] == 'FN'): ?> <?php if($_['property']['name'] == 'FN'): ?>
<td class="contacts_details_left"><?php echo $l->t('Name'); ?></td> <td class="contacts_details_left"></td>
<td class="contacts_details_right"> <td class="contacts_details_right">
<?php echo $_['property']['value']; ?> <strong><?php echo $_['property']['value']; ?></strong>
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span> <span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
</td> </td>
<?php elseif($_['property']['name'] == 'BDAY'): ?> <?php elseif($_['property']['name'] == 'BDAY'): ?>

@ -30,8 +30,9 @@ if ($source !== false) {
foreach (OC_Files::getdirectorycontent($source) as $i) { foreach (OC_Files::getdirectorycontent($source) as $i) {
$i['date'] = OC_Util::formatDate($i['mtime'] ); $i['date'] = OC_Util::formatDate($i['mtime'] );
if ($i['type'] == 'file') { if ($i['type'] == 'file') {
$i['extention'] = substr($i['name'], strrpos($i['name'], ".")); $fileinfo = pathinfo($i['name']);
$i['basename'] = substr($i['name'], 0, strrpos($i['name'], ".")); $i['basename'] = $fileinfo['filename'];
$i['extention'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
} }
$i['directory'] = substr($i['directory'], $rootLength); $i['directory'] = substr($i['directory'], $rootLength);
if ($i['directory'] == "/") { if ($i['directory'] == "/") {
@ -70,7 +71,7 @@ if ($source !== false) {
header("Expires: 0"); header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public"); header("Pragma: public");
header("Content-Disposition: filename=".basename($source)); header('Content-Disposition: filename="'.basename($source).'"');
header("Content-Type: " . $mimetype); header("Content-Type: " . $mimetype);
header("Content-Length: " . OC_Filesystem::filesize($source)); header("Content-Length: " . OC_Filesystem::filesize($source));
//download the file //download the file

@ -1,5 +1,7 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSrc is a FILE - Returns an image resource. function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSrc is a FILE - Returns an image resource.
//getting the image dimensions //getting the image dimensions
@ -36,11 +38,6 @@ function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSr
return $thumb; return $thumb;
} }
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
exit();
}
$box_size = 200; $box_size = 200;
$album_name = $_GET['album']; $album_name = $_GET['album'];
$x = $_GET['x']; $x = $_GET['x'];

@ -1,14 +1,11 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
if( !OC_User::isLoggedIn()){ OC_JSON::checkAppEnabled('gallery');
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
exit();
}
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES ("'.OC_User::getUser().'", "'.$_GET['album_name'].'")'); $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES ("'.OC_User::getUser().'", "'.$_GET['album_name'].'")');
$stmt->execute(array()); $stmt->execute(array());
echo json_encode(array( 'status' => 'success', 'name' => $_GET['album_name'])); OC_JSON::success(array('name' => $_GET['album_name']));
?> ?>

@ -1,10 +1,7 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
if (!OC_User::IsLoggedIn()) { OC_JSON::checkAppEnabled('gallery');
echo json_encode(array('status' => 'error', 'message' => 'You need to log in'));
exit();
}
$a = array(); $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` = ?');
@ -17,6 +14,6 @@ while ($r = $result->fetchRow()) {
$a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10)); $a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
} }
echo json_encode(array('status'=>'success', 'albums'=>$a)); OC_JSON::success(array('albums'=>$a));
?> ?>

@ -1,5 +1,7 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $shift) { function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $shift) {
//getting the image dimensions //getting the image dimensions
@ -38,11 +40,6 @@ function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $
imagedestroy($myImage); imagedestroy($myImage);
} }
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
exit();
}
$box_size = 200; $box_size = 200;
$album_name= $_GET['album_name']; $album_name= $_GET['album_name'];
@ -61,6 +58,12 @@ while (($i = $result->fetchRow()) && $counter < $numOfItems) {
header('Content-Type: image/png'); header('Content-Type: image/png');
$offset = 3600 * 24;
// calc the string in GMT not localtime and add the offset
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
header('Cache-Control: max-age=3600, must-revalidate');
header('Pragma: public');
imagepng($targetImg); imagepng($targetImg);
imagedestroy($targetImg); imagedestroy($targetImg);
?> ?>

@ -1,14 +1,11 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
require_once('../lib_scanner.php'); require_once('../lib_scanner.php');
if (!OC_User::IsLoggedIn()) { OC_JSON::success(array('albums' => OC_GALLERY_SCANNER::scan('')));
echo json_encode(array('status' => 'error', 'message' => 'You need to log in')); //OC_JSON::success(array('albums' => array(array('name' => 'test', 'imagesCount' => 1, 'images' => array('dupa')))));
exit();
}
echo json_encode(array( 'status' => 'success', 'albums' => OC_GALLERY_SCANNER::scan('')));
//echo json_encode(array('status' => 'success', 'albums' => array(array('name' => 'test', 'imagesCount' => 1, 'images' => array('dupa')))));
?> ?>

@ -1,5 +1,7 @@
<?php <?php
require_once('../../../lib/base.php'); require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSrc is a FILE - Returns an image resource. function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSrc is a FILE - Returns an image resource.
//getting the image dimensions //getting the image dimensions
@ -40,11 +42,6 @@ function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height) { //$imgSr
return $thumb; return $thumb;
} }
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
exit();
}
$box_size = 200; $box_size = 200;
$img = $_GET['img']; $img = $_GET['img'];

@ -8,7 +8,7 @@ OC_App::addNavigationEntry( array(
'id' => 'gallery_index', 'id' => 'gallery_index',
'order' => 20, 'order' => 20,
'href' => OC_Helper::linkTo('gallery', 'index.php'), 'href' => OC_Helper::linkTo('gallery', 'index.php'),
'icon' => OC_Helper::linkTo('', 'core/img/filetypes/image.png'), 'icon' => OC_Helper::imagePath('core', 'places/picture.svg'),
'name' => 'Gallery')); 'name' => 'Gallery'));
class OC_GallerySearchProvider extends OC_Search_Provider{ class OC_GallerySearchProvider extends OC_Search_Provider{
@ -17,7 +17,7 @@ OC_App::addNavigationEntry( array(
$result = $stmt->execute(array(OC_User::getUser(),'%'.$query.'%')); $result = $stmt->execute(array(OC_User::getUser(),'%'.$query.'%'));
$results=array(); $results=array();
while($row=$result->fetchRow()){ while($row=$result->fetchRow()){
$results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo( 'apps/gallery', 'index.php?view='.$row['album_name']),'Galleries'); $results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo('apps/gallery', 'index.php?view='.$row['album_name']),'Galleries');
} }
return $results; return $results;
} }

@ -2,6 +2,7 @@
require_once('../../lib/base.php'); require_once('../../lib/base.php');
OC_Util::checkLoggedIn(); OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('gallery');
OC_App::setActiveNavigationEntry( 'gallery_index' ); OC_App::setActiveNavigationEntry( 'gallery_index' );

@ -29,5 +29,5 @@ OC_APP::registerPersonal('media','settings');
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'core', 'filetypes/audio.svg' ), 'name' => $l->t('Music') )); OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
?> ?>

@ -1,6 +1,6 @@
#controls ul.jp-controls { padding:0; } #controls ul.jp-controls { padding:0; }
#controls ul.jp-controls li { display:inline; } #controls ul.jp-controls li { display:inline; }
#controls ul.jp-controls li a { position:absolute; padding:.8em 1em; } #controls ul.jp-controls li a { position:absolute; padding:.8em 1em .8em 0; }
a.jp-play, a.jp-pause { left:2.5em; } a.jp-play, a.jp-pause { left:2.5em; }
a.jp-pause { display:none; } a.jp-pause { display:none; }
a.jp-next { left:5em; } a.jp-next { left:5em; }
@ -39,7 +39,7 @@ tr.album td.artist { padding-left:1em; }
tr.song td.artist { padding-left:2em; } tr.song td.artist { padding-left:2em; }
.add {margin: 0 0.5em 0 0; } .add {margin: 0 0.5em 0 0; }
#scan { position:absolute; right:13em; top:0em; } #scan { position:absolute; right:13.5em; top:0em; }
#scan .start { position:relative; display:inline; float:right; } #scan .start { position:relative; display:inline; float:right; }
#scan .stop { position:relative; display:inline; float:right; } #scan .stop { position:relative; display:inline; float:right; }
#scan #scanprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; } #scan #scanprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; }

@ -2,6 +2,6 @@
<fieldset class="personalblock"> <fieldset class="personalblock">
<strong>Media</strong><br /> <strong>Media</strong><br />
Ampache address: Ampache address:
<?php echo OC_Helper::linkTo('apps/media', 'tomahawk.php', null, true); ?><br /> <?php echo OC_Helper::linkTo('apps/media', '', null, true); ?><br />
</fieldset> </fieldset>
</form> </form>

@ -7,5 +7,4 @@
<licence>AGPL</licence> <licence>AGPL</licence>
<author>Robin Appelman</author> <author>Robin Appelman</author>
<require>2</require> <require>2</require>
<default_enable/>
</info> </info>

@ -34,6 +34,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
input[type="text"], input[type="password"] { cursor:text; } input[type="text"], input[type="password"] { cursor:text; }
input, select, .button, #quota, div.jp-progress, .pager li a { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; } input, select, .button, #quota, div.jp-progress, .pager li a { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; }
input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; } input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; }
input[type="text"], input[type="password"], input[type="search"] { -webkit-appearance:textfield; -webkit-box-sizing:content-box; }
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus, input[type="search"]:hover, input[type="search"]:focus { background:#fff; color:#333; } input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus, input[type="search"]:hover, input[type="search"]:focus { background:#fff; color:#333; }
input[type="submit"], input[type="button"], .button, #quota, div.jp-progress, .pager li a { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; } input[type="submit"], input[type="button"], .button, #quota, div.jp-progress, .pager li a { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
@ -50,7 +51,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b
input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; } input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
/* CONTENT ------------------------------------------------------------------ */ /* CONTENT ------------------------------------------------------------------ */
#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 { padding: 0 0.5em; 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; } #controls .button { display:inline-block; }
#content { margin:3.5em 0 0 12.5em; } #content { margin:3.5em 0 0 12.5em; }
#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; } #leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; }
@ -117,7 +118,7 @@ tbody tr:hover, tr:active { background-color:#f8f8f8; }
#quotatext {padding: .6em 1em;} #quotatext {padding: .6em 1em;}
div.jp-play-bar, div.jp-seek-bar { padding:0; } div.jp-play-bar, div.jp-seek-bar { padding:0; }
.pager { list-style:none; float:right; display:inline; margin:.7em 12.7em 0 0; } .pager { list-style:none; float:right; display:inline; margin:.7em 13em 0 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; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

@ -0,0 +1,22 @@
Silk icon set 1.3
_________________________________________
Mark James
http://www.famfamfam.com/lab/icons/silk/
_________________________________________
This work is licensed under a
Creative Commons Attribution 2.5 License.
[ http://creativecommons.org/licenses/by/2.5/ ]
This means you may use it for any purpose,
and make any changes you like.
All I ask is that you include a link back
to this page in your credits.
Are you using this icon set? Send me an email
(including a link or picture if available) to
mjames@gmail.com
Any other questions about this icon set please
contact mjames@gmail.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

@ -32,6 +32,6 @@
</div></header> </div></header>
<?php echo $_['content']; ?> <?php echo $_['content']; ?>
</div> </div>
<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a>: <?php echo $l->t( 'web services under your control' ); ?></p></footer> <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; <?php echo $l->t( 'web services under your control' ); ?></p></footer>
</body> </body>
</html> </html>

@ -10,7 +10,7 @@
.file_upload_form, #file_newfolder_form { display:inline; float: left;} .file_upload_form, #file_newfolder_form { display:inline; float: left;}
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; } #fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; } .file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em 1em;} .file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em 1em .1em 0em;}
.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; } .file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; } #file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; }

@ -3,7 +3,7 @@ FileList={
$('#fileList').empty().html(fileListHtml); $('#fileList').empty().html(fileListHtml);
}, },
addFile:function(name,size,lastModified,loading){ addFile:function(name,size,lastModified,loading){
var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file'); var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">'; var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">';
if(name.indexOf('.')!=-1){ if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.lastIndexOf('.')); var basename=name.substr(0,name.lastIndexOf('.'));

@ -200,23 +200,36 @@ class OC_App{
*/ */
public static function getSettingsNavigation(){ public static function getSettingsNavigation(){
$l=new OC_L10N('core'); $l=new OC_L10N('core');
$admin=array(
array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" )), // by default, settings only contain the help menu
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "apps.svg" )), $settings = array(
); array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" ))
$settings=array(
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )),
array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ))
); );
if(count(self::$settingsForms)>0){
// if the user is logged-in
if (OC_User::isLoggedIn()) {
// personal menu
$settings[] = array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ));
// if there're some settings forms
if(!empty(self::$settingsForms))
// settings menu
$settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" )); $settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" ));
// if the user is an admin
if(OC_Group::inGroup( $_SESSION["user_id"], "admin" )) {
// admin users menu
$settings[] = array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" ));
// admin apps menu
$settings[] = array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "apps.svg" ));
// if there're some admin forms
if(!empty(self::$adminForms))
// admins menu
$settings[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" ));
} }
if(count(self::$adminForms)>0){
$admin[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" ));
}
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
$settings=array_merge($admin,$settings);
} }
$navigation = self::proceedNavigation($settings); $navigation = self::proceedNavigation($settings);
return $navigation; return $navigation;
} }

@ -101,20 +101,20 @@ class OC_Helper {
// Is it a dir? // Is it a dir?
if( $mimetype == "dir" ){ if( $mimetype == "dir" ){
return OC::$WEBROOT."/core/img/places/folder.svg"; return OC::$WEBROOT."/core/img/filetypes/folder.png";
} }
// Icon exists? // Icon exists?
if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.svg" )){ if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.png" )){
return OC::$WEBROOT."/core/img/filetypes/$mimetype.svg"; return OC::$WEBROOT."/core/img/filetypes/$mimetype.png";
} }
//try only the first part of the filetype //try only the first part of the filetype
$mimetype=substr($mimetype,0,strpos($mimetype,'-')); $mimetype=substr($mimetype,0,strpos($mimetype,'-'));
if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.svg" )){ if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.png" )){
return OC::$WEBROOT."/core/img/filetypes/$mimetype.svg"; return OC::$WEBROOT."/core/img/filetypes/$mimetype.png";
} }
else{ else{
return OC::$WEBROOT."/core/img/filetypes/file.svg"; return OC::$WEBROOT."/core/img/filetypes/file.png";
} }
} }

@ -123,6 +123,10 @@ $(document).ready(function(){
$('#newuser').submit(function(event){ $('#newuser').submit(function(event){
event.preventDefault(); event.preventDefault();
var username=$('#newusername').val(); var username=$('#newusername').val();
if(username == '') {
alert('Please provide a username!');
return false;
}
var password=$('#newuserpassword').val(); var password=$('#newuserpassword').val();
var groups=$('#newusergroups').prev().children('div').data('settings').checked; var groups=$('#newusergroups').prev().children('div').data('settings').checked;
$.post( $.post(

@ -50,8 +50,7 @@
};?> };?>
<p class="personalblock"> <p class="personalblock">
<strong>ownCloud</strong> <strong>ownCloud</strong> <?php echo(OC_Util::getVersionString()); ?>, <a href="http://gitorious.org/owncloud" target="_blank">source code</a> licensed freely under <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank">AGPL</a>
<?php echo(OC_Util::getVersionString()); ?>
</p> </p>

Loading…
Cancel
Save