summaryrefslogtreecommitdiffstats
path: root/lib/itemmapper.php
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-07-04 16:54:26 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-07-04 16:54:26 -0400
commitfcd843bc0c2ef3163d1ecc6b036e46726a61239a (patch)
treef2ce5d1117be95e2b24a16b59e83238a15ef910b /lib/itemmapper.php
parent69480001986cd83852ee6351fbd5d68718eb829c (diff)
shows articles in accordion view
Diffstat (limited to 'lib/itemmapper.php')
-rw-r--r--lib/itemmapper.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/itemmapper.php b/lib/itemmapper.php
index 81be77e21..b08dcd86b 100644
--- a/lib/itemmapper.php
+++ b/lib/itemmapper.php
@@ -32,7 +32,8 @@ class OC_News_ItemMapper {
$title = $row['title'];
$guid = $row['guid'];
$status = $row['status'];
- $item = new OC_News_Item($url, $title, $guid);
+ $body = $row['body'];
+ $item = new OC_News_Item($url, $title, $guid, $body);
$item->setStatus($status);
$items[] = $item;
}
@@ -62,16 +63,17 @@ class OC_News_ItemMapper {
public function save(OC_News_Item $item, $feedid){
$guid = $item->getGuid();
$status = $item->getStatus();
-
+
$itemid = $this->findIdFromGuid($guid, $feedid);
if ($itemid == null){
$title = $item->getTitle();
-
+ $body = $item->getBody();
+
$stmt = OCP\DB::prepare('
INSERT INTO ' . self::tableName .
- '(url, title, guid, feed_id, status)
- VALUES (?, ?, ?, ?, ?)
+ '(url, title, body, guid, feed_id, status)
+ VALUES (?, ?, ?, ?, ?, ?)
');
if(empty($title)) {
@@ -79,9 +81,15 @@ class OC_News_ItemMapper {
$title = $l->t('no title');
}
+ if(empty($body)) {
+ $l = OC_L10N::get('news');
+ $body = $l->t('no body');
+ }
+
$params=array(
htmlspecialchars_decode($item->getUrl()),
htmlspecialchars_decode($title),
+ $body,
$guid,
$feedid,
$status