ソースを参照

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
bluewhale235 4 年 前
コミット
20ee2a8470
2 ファイル変更2 行追加2 行削除
  1. 1 1
      app/views/subscription/add.phtml
  2. 1 1
      app/views/subscription/index.phtml

+ 1 - 1
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 } ?>

+ 1 - 1
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 } ?>