summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-06-21 09:08:38 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-06-21 09:08:38 +0200
commit4d312f78497d0134ad2315863db69747be5dd108 (patch)
tree95b0ef1b2e31cd322992cb45d51e87163511ea86 /apps
parent69d7c763a9955151df08f96a25239fa7bfb450c6 (diff)
parentcc3835d65711a6db3472d2ef7f84a59b112dbe7c (diff)
downloadnextcloud-server-4d312f78497d0134ad2315863db69747be5dd108.tar.gz
nextcloud-server-4d312f78497d0134ad2315863db69747be5dd108.zip
Merge branch 'master' into oc_error
Diffstat (limited to 'apps')
-rw-r--r--apps/calendar/lib/object.php2
-rw-r--r--apps/contacts/ajax/addcontact.php2
-rw-r--r--apps/contacts/ajax/contacts.php27
-rw-r--r--apps/contacts/js/contacts.js32
-rw-r--r--apps/contacts/lib/addressbook.php23
-rw-r--r--apps/contacts/lib/vcard.php2
-rw-r--r--apps/gallery/css/styles.css8
-rw-r--r--apps/gallery/index.php64
-rw-r--r--apps/gallery/js/pictures.js33
-rw-r--r--apps/gallery/templates/index.php116
10 files changed, 158 insertions, 151 deletions
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index a6ae6590080..7f3322b1ab5 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -814,7 +814,7 @@ class OC_Calendar_Object{
if($allday){
$return['start'] = $start_dt->format('Y-m-d');
$end_dt->modify('-1 minute');
- while($start_dt->format('U') >= $end_dt->format('U')){
+ while($start_dt >= $end_dt){
$end_dt->modify('+1 day');
}
$return['end'] = $end_dt->format('Y-m-d');
diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php
index e45072c9542..12f7bb9db96 100644
--- a/apps/contacts/ajax/addcontact.php
+++ b/apps/contacts/ajax/addcontact.php
@@ -47,4 +47,4 @@ if(!$id) {
exit();
}
-OCP\JSON::success(array('data' => array( 'id' => $id )));
+OCP\JSON::success(array('data' => array( 'id' => $id, 'aid' => $aid )));
diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php
index bf4d5deb2e0..16730ec9474 100644
--- a/apps/contacts/ajax/contacts.php
+++ b/apps/contacts/ajax/contacts.php
@@ -17,14 +17,25 @@ function cmp($a, $b)
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
-$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
-$contacts_alphabet = OC_Contacts_VCard::all($ids);
$active_addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
+error_log('active_addressbooks: '.print_r($active_addressbooks, true));
-// Our new array for the contacts sorted by addressbook
$contacts_addressbook = array();
+$ids = array();
+foreach($active_addressbooks as $addressbook) {
+ $ids[] = $addressbook['id'];
+ if(!isset($contacts_addressbook[$addressbook['id']])) {
+ $contacts_addressbook[$addressbook['id']] = array('contacts' => array());
+ $contacts_addressbook[$addressbook['id']]['displayname'] = $addressbook['displayname'];
+ }
+}
+error_log('ids: '.print_r($ids, true));
+$contacts_alphabet = OC_Contacts_VCard::all($ids);
+error_log('contacts_alphabet: '.print_r($contacts_alphabet, true));
+
+// Our new array for the contacts sorted by addressbook
foreach($contacts_alphabet as $contact) {
- if(!isset($contacts_addressbook[$contact['addressbookid']])) {
+ if(!isset($contacts_addressbook[$contact['addressbookid']])) { // It should never execute.
$contacts_addressbook[$contact['addressbookid']] = array('contacts' => array());
}
$display = trim($contact['fullname']);
@@ -38,14 +49,6 @@ foreach($contacts_alphabet as $contact) {
$contacts_addressbook[$contact['addressbookid']]['contacts'][] = array('id' => $contact['id'], 'addressbookid' => $contact['addressbookid'], 'displayname' => htmlspecialchars($display));
}
-foreach($contacts_addressbook as $addressbook_id => $contacts) {
- foreach($active_addressbooks as $addressbook) {
- if($addressbook_id == $addressbook['id']) {
- $contacts_addressbook[$addressbook_id]['displayname'] = $addressbook['displayname'];
- }
- }
-}
-
uasort($contacts_addressbook, 'cmp');
$tmpl = new OCP\Template("contacts", "part.contacts");
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 2319334c58b..8ab2a3fbb88 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -174,7 +174,7 @@ Contacts={
// TODO: Take addressbook into account
$('#fn').change(function(){
var name = $('#fn').val().strip_tags();
- var item = $('.contacts [data-id="'+Contacts.UI.Card.id+'"]');
+ var item = $('.contacts li[data-id="'+Contacts.UI.Card.id+'"]');
$(item).find('a').html(name);
Contacts.UI.Card.fn = name;
var added = false;
@@ -186,7 +186,7 @@ Contacts={
}
});
if(!added) {
- $('#leftcontent ul[data-id="'+Contacts.UI.Card.bookid+'"]').append(item);
+ $('#contacts ul[data-id="'+Contacts.UI.Card.bookid+'"]').append(item);
}
Contacts.UI.Contacts.scrollTo(Contacts.UI.Card.id);
});
@@ -250,8 +250,10 @@ Contacts={
var newid, firstitem;
if(!id) {
firstitem = $('#contacts:first-child li:first-child');
- newid = firstitem.data('id');
- bookid = firstitem.data('bookid');
+ if(firstitem.length > 0) {
+ newid = firstitem.data('id');
+ bookid = firstitem.data('bookid');
+ }
} else {
newid = id;
}
@@ -269,7 +271,7 @@ Contacts={
}
// Make sure proper DOM is loaded.
- if(!$('#card')[0]) {
+ if(!$('#card')[0] && newid) {
$.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){
if(jsondata.status == 'success'){
$('#rightcontent').html(jsondata.data.page).ready(function() {
@@ -281,7 +283,7 @@ Contacts={
}
});
}
- else if($('.contacts li').length == 0) {
+ else if(!newid) {
// load intro page
$.getJSON(OC.filePath('contacts', 'ajax', 'loadintro.php'),{},function(jsondata){
if(jsondata.status == 'success'){
@@ -316,13 +318,14 @@ Contacts={
if (jsondata.status == 'success'){
$('#rightcontent').data('id',jsondata.data.id);
var id = jsondata.data.id;
+ var aid = jsondata.data.aid;
$.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){
if(jsondata.status == 'success'){
Contacts.UI.Card.loadContact(jsondata.data, aid);
- $('#leftcontent .active').removeClass('active');
+ $('#contacts .active').removeClass('active');
var item = $('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'" style="background: url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+jsondata.data.id+') no-repeat scroll 0% 0% transparent;">'+Contacts.UI.Card.fn+'</a></li>');
var added = false;
- $('#leftcontent ul li').each(function(){
+ $('#contacts ul[data-id="'+aid+'"] li').each(function(){
if ($(this).text().toLowerCase() > Contacts.UI.Card.fn.toLowerCase()) {
$(this).before(item).fadeIn('fast');
added = true;
@@ -330,7 +333,7 @@ Contacts={
}
});
if(!added) {
- $('#leftcontent ul').append(item);
+ $('#contacts ul[data-id="'+aid+'"]').append(item);
}
if(isnew) { // add some default properties
Contacts.UI.Card.addProperty('EMAIL');
@@ -374,7 +377,7 @@ Contacts={
$.post(OC.filePath('contacts', 'ajax', 'deletecard.php'),{'id':Contacts.UI.Card.id},function(jsondata){
if(jsondata.status == 'success'){
var newid = '', bookid;
- var curlistitem = $('#leftcontent [data-id="'+jsondata.data.id+'"]');
+ var curlistitem = $('#contacts li[data-id="'+jsondata.data.id+'"]');
var newlistitem = curlistitem.prev();
if(newlistitem == undefined) {
newlistitem = curlistitem.next();
@@ -1541,13 +1544,16 @@ Contacts={
});
},
refreshThumbnail:function(id){
- var item = $('.contacts [data-id="'+id+'"]').find('a');
+ var item = $('.contacts li[data-id="'+id+'"]').find('a');
item.html(Contacts.UI.Card.fn);
item.css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+id+'&refresh=1'+Math.random()+') no-repeat');
},
scrollTo:function(id){
- $('.contacts').animate({
- scrollTop: $('#leftcontent li[data-id="'+id+'"]').offset().top-20}, 'slow','swing');
+ var item = $('#contacts li[data-id="'+id+'"]');
+ if(item) {
+ $('.contacts').animate({
+ scrollTop: $('#contacts li[data-id="'+id+'"]').offset().top-20}, 'slow','swing');
+ }
}
}
}
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 79445ceeee1..878d8835f94 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -172,12 +172,11 @@ class OC_Contacts_Addressbook{
if(!$prefbooks){
$addressbooks = OC_Contacts_Addressbook::all($uid);
if(count($addressbooks) == 0){
- OC_Contacts_Addressbook::add($uid,'default','Default Address Book');
- $addressbooks = OC_Contacts_Addressbook::all($uid);
+ $id = OC_Contacts_Addressbook::add($uid,'default','Default Address Book');
+ self::setActive($id, true);
}
- $prefbooks = $addressbooks[0]['id'];
- OCP\Config::setUserValue($uid,'contacts','openaddressbooks',$prefbooks);
}
+ $prefbooks = OCP\Config::getUserValue($uid,'contacts','openaddressbooks',null);
return explode(';',$prefbooks);
}
@@ -195,7 +194,7 @@ class OC_Contacts_Addressbook{
$stmt = OCP\DB::prepare( $prep );
$result = $stmt->execute($active);
} catch(Exception $e) {
- OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:active:, exception: '.$e->getMessage(),OCP\Util::DEBUG);
+ OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:active:, exception: '.$e->getMessage(),OCP\Util::ERROR);
OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:active, ids: '.join(',', $active),OCP\Util::DEBUG);
OCP\Util::writeLog('contacts','OC_Contacts_Addressbook::active, SQL:'.$prep,OCP\Util::DEBUG);
}
@@ -210,7 +209,7 @@ class OC_Contacts_Addressbook{
/**
* @brief Activates an addressbook
* @param integer $id
- * @param integer $name
+ * @param boolean $active
* @return boolean
*/
public static function setActive($id,$active){
@@ -256,11 +255,15 @@ class OC_Contacts_Addressbook{
* @return boolean
*/
public static function delete($id){
- // FIXME: There's no error checking at all.
self::setActive($id, false);
- $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' );
- $stmt->execute(array($id));
-
+ try {
+ $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' );
+ $stmt->execute(array($id));
+ } catch(Exception $e) {
+ OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:delete:, exception for '.$id.': '.$e->getMessage(),OCP\Util::ERROR);
+ return false;
+ }
+
$cards = OC_Contacts_VCard::all($id);
foreach($cards as $card){
OC_Contacts_VCard::delete($card['id']);
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 71a874d783b..110d721ace0 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -56,7 +56,7 @@ class OC_Contacts_VCard{
$stmt = OCP\DB::prepare( $prep );
$result = $stmt->execute($id);
} catch(Exception $e) {
- OCP\Util::writeLog('contacts','OC_Contacts_VCard:all:, exception: '.$e->getMessage(),OCP\Util::DEBUG);
+ OCP\Util::writeLog('contacts','OC_Contacts_VCard:all:, exception: '.$e->getMessage(),OCP\Util::ERROR);
OCP\Util::writeLog('contacts','OC_Contacts_VCard:all, ids: '.join(',', $id),OCP\Util::DEBUG);
OCP\Util::writeLog('contacts','SQL:'.$prep,OCP\Util::DEBUG);
}
diff --git a/apps/gallery/css/styles.css b/apps/gallery/css/styles.css
index 98d36515493..dcef1f08c6d 100644
--- a/apps/gallery/css/styles.css
+++ b/apps/gallery/css/styles.css
@@ -4,3 +4,11 @@ div#controls input[type=button] { -webkit-transition: opacity 0.5s ease-in-out;
input[type=button]:disabled { opacity: 0.5 }
.ui-dialog tr {background-color: #eee;}
.ui-dialog input {width: 90%;}
+
+div.gallery_div {position:relative; display: inline-block; height: 152px; width: 150px; margin: 5px;}
+div.miniature_border {position:absolute; height: 150px; -moz-transition-duration: 0.2s; -o-transition-duration:0.2s; -webkit-transition-duration: .2s; background-position: 50%;}
+div.line {display:inline-block; border: 0; width: auto; height: 160px}
+div.gallery_div img{position:absolute; top: 1; left: 0; -moz-transition-duration: 0.3s; -o-transition-duration:0.3s; -webkit-transition-duration: 0.3s; height:150px; width: auto;}
+div.gallery_div img.shrinker {width:80px !important;}
+div.title { opacity: 0; text-align: center; vertical-align: middle; font-family: Arial; font-size: 12px; border: 0; position: absolute; text-overflow: ellipsis; bottom: 20px; right:-5px; height:auto; padding: 5px; width: 140px; background-color: black; color: white; -webkit-transition: opacity 0.5s; z-index:1000; border-radius: 7px}
+div.visible { opacity: 0.8;}
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index b87d99bb6cc..c08305bff9e 100644
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -31,6 +31,70 @@ OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('gallery', 'styles');
OCP\Util::addScript('gallery', 'pictures');
+include('apps/gallery/lib/tiles.php');
+
+$root = !empty($_GET['root']) ? $_GET['root'] : '/';
+$images = \OC_FileCache::searchByMime('image', null, '/'.\OCP\USER::getUser().'/files'.$root);
+sort($images);
+
+$tl = new \OC\Pictures\TilesLine();
+$ts = new \OC\Pictures\TileStack(array(), '');
+$previous_element = @$images[0];
+
+$root_images = array();
+$second_level_images = array();
+
+$fallback_images = array(); // if the folder only cotains subfolders with images -> these are taken for the stack preview
+
+for($i = 0; $i < count($images); $i++) {
+ $prev_dir_arr = explode('/', $previous_element);
+ $dir_arr = explode('/', $images[$i]);
+
+ if(count($dir_arr) == 1) { // getting the images in this directory
+ $root_images[] = $root.$images[$i];
+ } else {
+ if(strcmp($prev_dir_arr[0], $dir_arr[0]) != 0) { // if we entered a new directory
+ if(count($second_level_images) == 0) { // if we don't have images in this directory
+ if(count($fallback_images) != 0) { // but have fallback_images
+ $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0]));
+ $fallback_images = array();
+ }
+ } else { // if we collected images for this directory
+ $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0]));
+ $fallback_images = array();
+ $second_level_images = array();
+ }
+ }
+ if (count($dir_arr) == 2) { // These are the pics in our current subdir
+ $second_level_images[] = $root.$images[$i];
+ $fallback_images = array();
+ } else { // These are images from the deeper directories
+ if(count($second_level_images) == 0) {
+ $fallback_images[] = $root.$images[$i];
+ }
+ }
+ // have us a little something to compare against
+ $previous_element = $images[$i];
+ }
+}
+
+// if last element in the directory was a directory we don't want to miss it :)
+if(count($second_level_images)>0) {
+ $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0]));
+}
+
+// if last element in the directory was a directory with no second_level_images we also don't want to miss it ...
+if(count($fallback_images)>0) {
+ $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0]));
+}
+
+// and finally our images actually stored in the root folder
+for($i = 0; $i<count($root_images); $i++) {
+ $tl->addTile(new \OC\Pictures\TileSingle($root_images[$i]));
+}
+
$tmpl = new OCP\Template( 'gallery', 'index', 'user' );
+$tmpl->assign('root', $root);
+$tmpl->assign('tl', $tl, false);
$tmpl->printPage();
?>
diff --git a/apps/gallery/js/pictures.js b/apps/gallery/js/pictures.js
index 678c9bcbf55..3a797889688 100644
--- a/apps/gallery/js/pictures.js
+++ b/apps/gallery/js/pictures.js
@@ -1,4 +1,3 @@
-
function constructSharingPath() {
return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token;
}
@@ -35,3 +34,35 @@ function shareGallery() {
});
});
}
+
+function explode(element) {
+ $('div', element).each(function(index, elem) {
+ if ($(elem).hasClass('title')) {
+ $(elem).addClass('visible');
+ } else {
+ $(elem).css('margin-top', Math.floor(30-(Math.random()*60)) + 'px')
+ .css('margin-left', Math.floor(30-(Math.random()*60))+ 'px')
+ .css('z-index', '999');
+ }
+ });
+}
+
+function deplode(element) {
+ $('div', element).each(function(index, elem) {
+ if ($(elem).hasClass('title')) {
+ $(elem).removeClass('visible');
+ } else {
+ $(elem).css('margin-top', Math.floor(5-(Math.random()*10)) + 'px')
+ .css('margin-left', Math.floor(5-(Math.random()*10))+ 'px')
+ .css('z-index', '3');
+ }
+ });
+}
+
+function openNewGal(album_name) {
+ root = root + album_name + "/";
+ var url = window.location.toString().replace(window.location.search, '');
+ url = url + "?app=gallery&root="+encodeURIComponent(root);
+
+ window.location = url;
+}
diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php
index bf4f117c7de..1890552fc0c 100644
--- a/apps/gallery/templates/index.php
+++ b/apps/gallery/templates/index.php
@@ -1,52 +1,6 @@
-<?php
-
-$l = OC_L10N::get('gallery');
-$root = !empty($_GET['root']) ? $_GET['root'] : '/';
-?>
-<style>
-div.gallery_div {position:relative; display: inline-block; height: 152px; width: 150px; margin: 5px;}
-div.miniature_border {position:absolute; height: 150px; -moz-transition-duration: 0.2s; -o-transition-duration:0.2s; -webkit-transition-duration: .2s; background-position: 50%;}
-div.line {display:inline-block; border: 0; width: auto; height: 160px}
-div.gallery_div img{position:absolute; top: 1; left: 0; -moz-transition-duration: 0.3s; -o-transition-duration:0.3s; -webkit-transition-duration: 0.3s; height:150px; width: auto;}
-div.gallery_div img.shrinker {width:80px !important;}
-div.title { opacity: 0; text-align: center; vertical-align: middle; font-family: Arial; font-size: 12px; border: 0; position: absolute; text-overflow: ellipsis; bottom: 20px; right:-5px; height:auto; padding: 5px; width: 140px; background-color: black; color: white; -webkit-transition: opacity 0.5s; z-index:1000; border-radius: 7px}
-div.visible { opacity: 0.8;}
-</style>
<script type="text/javascript">
-var root = "<?php echo htmlentities($root); ?>";
-
-function explode(element) {
- $('div', element).each(function(index, elem) {
- if ($(elem).hasClass('title')) {
- $(elem).addClass('visible');
- } else {
- $(elem).css('margin-top', Math.floor(30-(Math.random()*60)) + 'px')
- .css('margin-left', Math.floor(30-(Math.random()*60))+ 'px')
- .css('z-index', '999');
- }
- });
-}
-
-function deplode(element) {
- $('div', element).each(function(index, elem) {
- if ($(elem).hasClass('title')) {
- $(elem).removeClass('visible');
- } else {
- $(elem).css('margin-top', Math.floor(5-(Math.random()*10)) + 'px')
- .css('margin-left', Math.floor(5-(Math.random()*10))+ 'px')
- .css('z-index', '3');
- }
- });
-}
-
-function openNewGal(album_name) {
- root = root + album_name + "/";
- var url = window.location.toString().replace(window.location.search, '');
- url = url + "?app=gallery&root="+encodeURIComponent(root);
-
- window.location = url;
-}
+var root = "<?php echo $_['root']; ?>";
$(document).ready(function() {
$("a[rel=images]").fancybox({
@@ -57,7 +11,7 @@ $(document).ready(function() {
</script>
<div id="controls"><?php
- $sr = trim($root, '/');
+ $sr = trim($_['root'], '/');
if (!empty($sr)) {
$paths = explode('/', $sr);
$path = '/';
@@ -68,74 +22,12 @@ $(document).ready(function() {
}
}
-?> <!--<a href="javascript:shareGallery();"><input type="button" value="<?php echo $l->t('Share');?>" /></a>--><br/>
+?><br/>
</div>
<div id="gallerycontent">
<?php
-include('apps/gallery/lib/tiles.php');
-$root = empty($_GET['root'])?'/':$_GET['root'];
-
-$images = \OC_FileCache::searchByMime('image', null, '/'.\OCP\USER::getUser().'/files'.$root);
-sort($images);
-
-$tl = new \OC\Pictures\TilesLine();
-$ts = new \OC\Pictures\TileStack(array(), '');
-$previous_element = @$images[0];
-
-$root_images = array();
-$second_level_images = array();
-
-$fallback_images = array(); // if the folder only cotains subfolders with images -> these are taken for the stack preview
-
-for($i = 0; $i < count($images); $i++) {
- $prev_dir_arr = explode('/', $previous_element);
- $dir_arr = explode('/', $images[$i]);
-
- if(count($dir_arr) == 1) { // getting the images in this directory
- $root_images[] = $root.$images[$i];
- } else {
- if(strcmp($prev_dir_arr[0], $dir_arr[0]) != 0) { // if we entered a new directory
- if(count($second_level_images) == 0) { // if we don't have images in this directory
- if(count($fallback_images) != 0) { // but have fallback_images
- $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0]));
- $fallback_images = array();
- }
- } else { // if we collected images for this directory
- $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0]));
- $fallback_images = array();
- $second_level_images = array();
- }
- }
- if (count($dir_arr) == 2) { // These are the pics in our current subdir
- $second_level_images[] = $root.$images[$i];
- $fallback_images = array();
- } else { // These are images from the deeper directories
- if(count($second_level_images) == 0) {
- $fallback_images[] = $root.$images[$i];
- }
- }
- // have us a little something to compare against
- $previous_element = $images[$i];
- }
-}
-
-// if last element in the directory was a directory we don't want to miss it :)
-if(count($second_level_images)>0) {
- $tl->addTile(new \OC\Pictures\TileStack($second_level_images, $prev_dir_arr[0]));
-}
-
-// if last element in the directory was a directory with no second_level_images we also don't want to miss it ...
-if(count($fallback_images)>0) {
- $tl->addTile(new \OC\Pictures\TileStack($fallback_images, $prev_dir_arr[0]));
-}
-
-// and finally our images actually stored in the root folder
-for($i = 0; $i<count($root_images); $i++) {
- $tl->addTile(new \OC\Pictures\TileSingle($root_images[$i]));
-}
-
-echo $tl->get();
+echo $_['tl']->get();
?>
</div>