summaryrefslogtreecommitdiffstats
path: root/templates/part.feeds.php
diff options
context:
space:
mode:
authorGregor Tätzner <gregor@freenet.de>2012-08-02 18:52:33 +0200
committerGregor Tätzner <gregor@freenet.de>2012-08-02 18:52:33 +0200
commitbdc51593245f6495bbd7e198c5dcda8072497e12 (patch)
treeb9fb41b454d647b49ff4af41294232c7152a4f8a /templates/part.feeds.php
parent1cc2f0c7f0317fc5b1a0f19a147538f51927984e (diff)
Add feed to feed list instantly on feed adding
Reload is no longer necessary. There are still some issues - especially the order of the feeds: atm the feed is just inserted at the beginning
Diffstat (limited to 'templates/part.feeds.php')
-rw-r--r--templates/part.feeds.php25
1 files changed, 5 insertions, 20 deletions
diff --git a/templates/part.feeds.php b/templates/part.feeds.php
index dd6a93c5f..fbf702387 100644
--- a/templates/part.feeds.php
+++ b/templates/part.feeds.php
@@ -1,38 +1,23 @@
<?php
function print_folder(OC_News_Folder $folder, $depth){
$l = new OC_l10n('news');
+ include("part.listfolder.php");
- echo '<ul class="folders"' . (($depth == 0) ? 'style="margin-left: 0px !important;"' : '') .'> <li class="folder_list" >' .
- '<div class="collapsable_container">' .
- '<div class="collapsable" >' . strtoupper($folder->getName()) .
- ( ($depth != 0) ? '<button class="svg action" id="feeds_delete" onClick="(News.Folder.delete(' . $folder->getId(). '))" title="' . $l->t('Delete folder') . '"></button>' .
- '<button class="svg action" id="feeds_edit" title="' . $l->t('Rename folder') . '"></button>': '' ) .
- '</div>' .
- '</div>';
- echo '<ul>';
$children = $folder->getChildren();
foreach($children as $child) {
if ($child instanceOf OC_News_Folder){
print_folder($child, $depth+1);
}
elseif ($child instanceOf OC_News_Feed) { //onhover $(element).attr('id', 'newID');
- $favicon = $child->getFavicon();
- if ($favicon == null) {
- $favicon = OCP\Util::imagePath('news', 'rss.svg');
- }
- echo '<li class="feeds_list" data-id="' . $child->getId() . '"><a href="' . OCP\Util::linkTo('news', 'index.php'). '?feedid=' . $child->getId() . '" style="background: url(' . $favicon . ') left center no-repeat; background-size:16px 16px;">' . $child->getTitle() .'</a>';
- countUnreadItems($child->getId());
- echo '<button class="svg action" id="feeds_delete" onClick="(News.Feed.delete(' . $child->getId(). '))" title="' . $l->t('Delete feed') . '"></button>';
- echo '<button class="svg action" id="feeds_edit" title="' . $l->t('Edit feed') . '"></button>';
- echo '</li>';
+ $tmpl = new OCP\Template("news", "part.listfeed");
+ $tmpl->assign('child', $child);
+ $tmpl->printpage();
}
else {
//TODO:handle error in this case
}
}
- echo '</ul></li></ul>';
+ echo '</ul></div></li></ul>';
}
-
- include("part.itemcounter.php");
print_folder($_['allfeeds'], 0);
?> \ No newline at end of file