diff options
| author | 2022-04-27 04:45:33 +0800 | |
|---|---|---|
| committer | 2022-04-26 22:45:33 +0200 | |
| commit | 20ee2a84705b179571b784e9948992e2a2576160 (patch) | |
| tree | adce64263d8e667c4aaa1de11a4ce25e2c1d9120 /app/views/subscription | |
| parent | 347290aae6513d127258c49f239aa36d090a5542 (diff) | |
add category automatically (#4333)
* Update index.phtml
Added "cat_id" query string to the "Add an RSS feed" link (in div: box)
* Update add.phtml
Function: Select category by query string 'cat_id'
* Update index.phtml
add query string "cat_id"
* Update index.phtml
Diffstat (limited to 'app/views/subscription')
| -rw-r--r-- | app/views/subscription/add.phtml | 2 | ||||
| -rw-r--r-- | app/views/subscription/index.phtml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/subscription/add.phtml b/app/views/subscription/add.phtml index 4de4e35ba..9e5b2a399 100644 --- a/app/views/subscription/add.phtml +++ b/app/views/subscription/add.phtml @@ -46,7 +46,7 @@ <div class="group-controls"> <select name="category" id="category"> <?php foreach ($this->categories as $cat) { ?> - <option value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>> + <option value="<?= $cat->id() ?>"<?= $cat->id() == ( Minz_Request::param('cat_id') ?: 1 ) ? ' selected="selected"' : '' ?>> <?= $cat->name() ?> </option> <?php } ?> diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 446d64bff..e85cd8392 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -60,7 +60,7 @@ ?> <li class="item feed disabled"><div class="alert-warn"><?= _t('sub.category.empty') ?></div></li> <?php } ?> - <li class="item feed">✚ <a href="<?= _url('subscription', 'add') ?>"><?= _t('sub.feed.add') ?></a></li> + <li class="item feed">✚ <a href="<?= _url('subscription', 'add', 'cat_id', $cat->id()) ?>"><?= _t('sub.feed.add') ?></a></li> </ul> </div> <?php } ?> |
