diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-04 14:51:47 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-04 14:51:47 -0400 |
commit | 69480001986cd83852ee6351fbd5d68718eb829c (patch) | |
tree | 42ecf232740c84238727665fb198135a4e1fb989 | |
parent | 41115284bf6c1023a542be0d6f2fab77febad36b (diff) |
everything is there but the fancyness
-rw-r--r-- | ajax/createfolder.php | 8 | ||||
-rw-r--r-- | ajax/newfeed.php | 4 | ||||
-rw-r--r-- | js/news.js | 6 | ||||
-rw-r--r-- | lib/foldermapper.php | 2 | ||||
-rw-r--r-- | templates/main.php | 4 | ||||
-rw-r--r-- | templates/part.feeds.php | 4 |
6 files changed, 14 insertions, 14 deletions
diff --git a/ajax/createfolder.php b/ajax/createfolder.php index a53b60d92..cbb3d89aa 100644 --- a/ajax/createfolder.php +++ b/ajax/createfolder.php @@ -27,8 +27,8 @@ $l = OC_L10N::get('news'); if(!$folderid) { OCP\JSON::error(array('data' => array('message' => $l->t('Error adding folder.')))); OCP\Util::writeLog('news','ajax/createfolder.php: Error adding folder: '.$_POST['name'], OCP\Util::ERROR); - exit(); } - -//TODO: replace the following with the success case. see contact/ajax/createaddressbook.php for inspirations -OCP\JSON::error(array('data' => array('message' => $l->t('Error adding folder.')))); +else { + //TODO: replace the following with a real success case. see contact/ajax/createaddressbook.php for inspirations + OCP\JSON::success(array('data' => array('message' => $l->t('Folder added!')))); +}
\ No newline at end of file diff --git a/ajax/newfeed.php b/ajax/newfeed.php index d75af0e8e..2d85bcdc8 100644 --- a/ajax/newfeed.php +++ b/ajax/newfeed.php @@ -31,6 +31,6 @@ if(!$feedid) { exit(); } -//TODO: replace the following with the success case. see contact/ajax/createaddressbook.php for inspirations -OCP\JSON::error(array('data' => array('message' => $l->t('Error adding feed.')))); +//TODO: replace the following with a real success case. see contact/ajax/createaddressbook.php for inspirations +OCP\JSON::success(array('data' => array('message' => $l->t('Feed added!')))); diff --git a/js/news.js b/js/news.js index 4014aca6e..71000fdda 100644 --- a/js/news.js +++ b/js/news.js @@ -35,7 +35,8 @@ News={ $.post(url, { name: displayname }, function(jsondata){ if(jsondata.status == 'success'){ - $(button).closest('tr').prev().html(jsondata.page).show().next().remove(); + //$(button).closest('tr').prev().html(jsondata.page).show().next().remove(); + OC.dialogs.alert(jsondata.data.message, t('news', 'Success!')); } else { OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); } @@ -57,7 +58,8 @@ News={ $.post(url, { feedurl: feedurl }, function(jsondata){ if(jsondata.status == 'success'){ - $(button).closest('tr').prev().html(jsondata.page).show().next().remove(); + //$(button).closest('tr').prev().html(jsondata.page).show().next().remove(); + OC.dialogs.alert(jsondata.data.message, t('news', 'Success!')); } else { OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); } diff --git a/lib/foldermapper.php b/lib/foldermapper.php index 5a37fe20a..48c4b18ad 100644 --- a/lib/foldermapper.php +++ b/lib/foldermapper.php @@ -113,7 +113,7 @@ class OC_News_FolderMapper { $folderid = OCP\DB::insertid(self::tableName); $folder->setId($folderid); - + return $folderid; } //TODO: replace it with a DELETE INNER JOIN operation diff --git a/templates/main.php b/templates/main.php index 775dd46bf..faae31809 100644 --- a/templates/main.php +++ b/templates/main.php @@ -17,10 +17,10 @@ <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['feedid']; ?>"> <?php if ($_['feedid']){ - echo $this->inc('part.items'); + echo $this->inc("part.items"); } else { - echo $this->inc('part.nofeeds'); + echo $this->inc("part.nofeeds"); } ?> </div> diff --git a/templates/part.feeds.php b/templates/part.feeds.php index 7b9b72126..52716c804 100644 --- a/templates/part.feeds.php +++ b/templates/part.feeds.php @@ -10,9 +10,7 @@ print_folder($child, $depth+1); } elseif ($child instanceOf OC_News_Feed) { -?> - <li><a href="index.php?feedid=<?php echo $child->getId(); ?>"><?php echo $child->getTitle(); ?></a></li> -<?php + echo '<li><a href="' . OCP\Util::linkTo('news', 'index.php'). '?feedid=' . $child->getId() . '">' . $child->getTitle() .'</a></li>'; } else { //TODO:handle error in this case |