summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-10 09:46:00 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-10 09:46:00 +0100
commit5c2daf58a877fb79a047bcac1d6ece0e0cc6ef0e (patch)
treec0fca002909eeae204e6a61b5a334bf5b65d71ad /app
parentc3cac60b319189017c38b7d5e1d09f51ded96d0e (diff)
parent3083af6288f23ba6986232798fde67b91517f287 (diff)
Merge pull request #451 from aledeg/category
Enhance feed adding popup
Diffstat (limited to 'app')
-rwxr-xr-xapp/Controllers/feedController.php8
-rw-r--r--app/layout/aside_feed.phtml5
2 files changed, 13 insertions, 0 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index c718fcd5c..9996725e4 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -30,6 +30,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$url = Minz_Request::param ('url_rss');
$cat = Minz_Request::param ('category', false);
+ if ($cat === 'nc') {
+ $new_cat = Minz_Request::param ('new_category');
+ if (empty($new_cat['name'])) {
+ $cat = false;
+ } else {
+ $cat = $this->catDAO->addCategory($new_cat);
+ }
+ }
if ($cat === false) {
$def_cat = $this->catDAO->getDefault ();
$cat = $def_cat->id ();
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index e324b15bd..6f3cdafb2 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -20,9 +20,14 @@
<?php echo $cat->name (); ?>
</option>
<?php } ?>
+ <option value="nc"><?php echo Minz_Translate::t ('new_category'); ?></option>
</select>
</li>
+ <li class="input" style="display:none">
+ <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" />
+ </li>
+
<li class="separator"></li>
<li class="dropdown-header"><?php echo Minz_Translate::t ('http_authentication'); ?></li>