Skip to content

Commit

Permalink
Merge pull request #4 from mmiyauchi/add-hide-controller-option
Browse files Browse the repository at this point in the history
@mmiyauchi プルリクありがとうございます。公開作業はあとで行っておきますが、いましばらくお待ち下さい。
  • Loading branch information
fumikito committed Apr 1, 2016
2 parents 6792c2f + f7ec414 commit 2dbf1d4
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 42 deletions.
1 change: 1 addition & 0 deletions app/Admin/Screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function admin_init(){
$new_option = array(
"style" => intval((bool)$this->input->post('afb_style')),
"post_types" => (array)$this->input->post('afb_post_types'),
"hide_default_controller" => (array)$this->input->post('afb_hide_default_controller'),
"comment" => intval((bool)$this->input->post('afb_comment')),
"controller" => (string)$this->input->post('afb_text'),
'ga' => intval((bool)$this->input->post('afb_ga')),
Expand Down
2 changes: 1 addition & 1 deletion app/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function ajax(){
* @return string
*/
function the_content($content){
if( false !== array_search(get_post_type(), $this->option["post_types"]) ){
if( false !== array_search(get_post_type(), $this->option["post_types"]) && false === array_search(get_post_type(), $this->option["hide_default_controller"]) ){
$content .= $this->get_controller_tag(get_the_ID(), get_post_type());
}
return $content;
Expand Down
1 change: 1 addition & 0 deletions app/Pattern/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function __get($key){
$default = array(
"style" => 0,
"post_types" => array(),
"hide_default_controller" => array(),
"comment" => 0,
"controller" => '',
'ga' => false,
Expand Down
Binary file modified language/anyway-feedback-ja.mo
Binary file not shown.
51 changes: 30 additions & 21 deletions language/anyway-feedback-ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Anyway Feedback 0.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-09 16:55+0900\n"
"PO-Revision-Date: 2014-10-09 16:55+0900\n"
"Last-Translator: Takahashi Fumiki <info@takahashifumiki.com>\n"
"POT-Creation-Date: 2016-03-23 14:40+0900\n"
"PO-Revision-Date: 2016-03-23 15:12+0900\n"
"Last-Translator: Minori Miyauchi <miyauchi@ubiregi.com>\n"
"Language-Team: Takahashi Fumiki <[email protected]>\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
Expand All @@ -13,7 +13,7 @@ msgstr ""
"X-Poedit-KeywordsList: _;gettext;gettext_noop;e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 1.6.9\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

Expand Down Expand Up @@ -74,15 +74,15 @@ msgstr "否定的な意見"
msgid "No data"
msgstr "データがありません"

#: ../app/Admin/Screen.php:175
#: ../app/Admin/Screen.php:176
msgid "Option was updated."
msgstr "オプションが更新されました。"

#: ../app/Admin/Screen.php:184
#: ../app/Admin/Screen.php:185
msgid "Database has been updated."
msgstr "データベースが更新されました。"

#: ../app/Admin/Screen.php:227
#: ../app/Admin/Screen.php:228
msgid "Feedback"
msgstr "フィードバック"

Expand Down Expand Up @@ -114,7 +114,7 @@ msgstr "すでに投票済みです。"
msgid "Comment"
msgstr "コメント"

#: ../app/Main.php:71 ../templates/page/setting.php:55
#: ../app/Main.php:71 ../templates/page/setting.php:68
#, php-format
msgid "Is this %s useful?"
msgstr "この%sは役に立ちましたか?"
Expand All @@ -124,11 +124,11 @@ msgstr "この%sは役に立ちましたか?"
msgid "%1$d of %2$d people say this %3$s is useful."
msgstr "%2$d 人中 %1$d 人がこの %3$s は役に立ったと言っています。"

#: ../app/Main.php:73 ../templates/page/setting.php:56
#: ../app/Main.php:73 ../templates/page/setting.php:69
msgid "Useful"
msgstr "役に立った"

#: ../app/Main.php:74 ../templates/page/setting.php:57
#: ../app/Main.php:74 ../templates/page/setting.php:70
msgid "Useless"
msgstr "役に立たなかった"

Expand Down Expand Up @@ -392,7 +392,7 @@ msgstr ""
"&quot;スタイルなし&quot;を選んだ場合、ご自分でスタイリングを行う必要がありま"
"す。スキンのマークアップは<strong>%s</strong>セクションで変更できます。"

#: ../templates/page/setting.php:17 ../templates/page/setting.php:47
#: ../templates/page/setting.php:17 ../templates/page/setting.php:60
msgid "Custom markup"
msgstr "カスタムマークアップ"

Expand All @@ -406,24 +406,33 @@ msgstr ""
"チェックされた投稿タイプは投稿内にフィードバック用コントローラーを含みます。"

#: ../templates/page/setting.php:35
msgid "Hide default feedback controller"
msgstr "コントローラーを非表示"

#: ../templates/page/setting.php:43
msgid "Checked post type if you need to hide default feedback controller."
msgstr ""
"チェックされた投稿タイプのフィードバック用コントローラーを非表示にします。"

#: ../templates/page/setting.php:48
msgid "Comment setting"
msgstr "コメント設定"

#: ../templates/page/setting.php:38
#: ../templates/page/setting.php:51
msgid "Not show"
msgstr "表示しない"

#: ../templates/page/setting.php:39
#: ../templates/page/setting.php:52
msgid "Show in comment loop"
msgstr "コメントループ内での表示"

#: ../templates/page/setting.php:42
#: ../templates/page/setting.php:55
msgid "This option decide to display feedback controller in comment loop."
msgstr ""
"このオプションはフィードバック用コントローラーをコメントループの中に出力する"
"かどうかを決定します。"

#: ../templates/page/setting.php:51
#: ../templates/page/setting.php:64
msgid ""
"You can customize markup of Feedback controller.<br />If you don't want, "
"leave it blank.<br />In case of customization, You can use "
Expand All @@ -438,24 +447,24 @@ msgstr ""
"bad&quot;というクラス名を持ち、href属性が%LINK%である必要があります</"
"strong>。<br />デフォルトのマークアップは下記になります。"

#: ../templates/page/setting.php:58
#: ../templates/page/setting.php:71
#, php-format
msgid "%1$s of %2$s people say this %3$s is useful."
msgstr "%2$s人中%1$s人がこの%3$sは役に立ったと言っています。"

#: ../templates/page/setting.php:71
#: ../templates/page/setting.php:84
msgid "Google Analytics Tracking"
msgstr "Google Analytics トラッキング"

#: ../templates/page/setting.php:73
#: ../templates/page/setting.php:86
msgid "Track"
msgstr "トラックする"

#: ../templates/page/setting.php:74
#: ../templates/page/setting.php:87
msgid "Do not track"
msgstr "トラックしない"

#: ../templates/page/setting.php:77
#: ../templates/page/setting.php:90
#, php-format
msgid ""
"This feature send report as event tracking to Google Analytics. You can get "
Expand All @@ -466,7 +475,7 @@ msgstr ""
"り、時系列のデータを取得できます。詳細は<a href=\"%s\">詳しい使い方</a>をご覧"
"下さい。"

#: ../templates/page/setting.php:83
#: ../templates/page/setting.php:96
msgid "Update"
msgstr "更新"

Expand Down
48 changes: 28 additions & 20 deletions language/anyway-feedback.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ msgid ""
msgstr ""
"Project-Id-Version: Anyway Feedback 0.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-09 16:55+0900\n"
"POT-Creation-Date: 2016-03-23 15:13+0900\n"
"PO-Revision-Date: 2014-10-09 16:55+0900\n"
"Last-Translator: Takahashi Fumiki <info@takahashifumiki.com>\n"
"Last-Translator: Minori Miyauchi <miyauchi@ubiregi.com>\n"
"Language-Team: Takahashi Fumiki <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop;e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 1.6.9\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

Expand Down Expand Up @@ -67,15 +67,15 @@ msgstr ""
msgid "No data"
msgstr ""

#: ../app/Admin/Screen.php:175
#: ../app/Admin/Screen.php:176
msgid "Option was updated."
msgstr ""

#: ../app/Admin/Screen.php:184
#: ../app/Admin/Screen.php:185
msgid "Database has been updated."
msgstr ""

#: ../app/Admin/Screen.php:227
#: ../app/Admin/Screen.php:228
msgid "Feedback"
msgstr ""

Expand Down Expand Up @@ -107,7 +107,7 @@ msgstr ""
msgid "Comment"
msgstr ""

#: ../app/Main.php:71 ../templates/page/setting.php:55
#: ../app/Main.php:71 ../templates/page/setting.php:68
#, php-format
msgid "Is this %s useful?"
msgstr ""
Expand All @@ -117,11 +117,11 @@ msgstr ""
msgid "%1$d of %2$d people say this %3$s is useful."
msgstr ""

#: ../app/Main.php:73 ../templates/page/setting.php:56
#: ../app/Main.php:73 ../templates/page/setting.php:69
msgid "Useful"
msgstr ""

#: ../app/Main.php:74 ../templates/page/setting.php:57
#: ../app/Main.php:74 ../templates/page/setting.php:70
msgid "Useless"
msgstr ""

Expand Down Expand Up @@ -355,7 +355,7 @@ msgid ""
"can be specified at <strong>%s</strong> section"
msgstr ""

#: ../templates/page/setting.php:17 ../templates/page/setting.php:47
#: ../templates/page/setting.php:17 ../templates/page/setting.php:60
msgid "Custom markup"
msgstr ""

Expand All @@ -368,22 +368,30 @@ msgid "Checked post type will have feedback controller inside post content"
msgstr ""

#: ../templates/page/setting.php:35
msgid "Hide default feedback controller"
msgstr ""

#: ../templates/page/setting.php:43
msgid "Checked post type if you need to hide default feedback controller."
msgstr ""

#: ../templates/page/setting.php:48
msgid "Comment setting"
msgstr ""

#: ../templates/page/setting.php:38
#: ../templates/page/setting.php:51
msgid "Not show"
msgstr ""

#: ../templates/page/setting.php:39
#: ../templates/page/setting.php:52
msgid "Show in comment loop"
msgstr ""

#: ../templates/page/setting.php:42
#: ../templates/page/setting.php:55
msgid "This option decide to display feedback controller in comment loop."
msgstr ""

#: ../templates/page/setting.php:51
#: ../templates/page/setting.php:64
msgid ""
"You can customize markup of Feedback controller.<br />If you don't want, "
"leave it blank.<br />In case of customization, You can use "
Expand All @@ -392,32 +400,32 @@ msgid ""
"and %LINK% as href attribute</strong>.<br />Default markup is below."
msgstr ""

#: ../templates/page/setting.php:58
#: ../templates/page/setting.php:71
#, php-format
msgid "%1$s of %2$s people say this %3$s is useful."
msgstr ""

#: ../templates/page/setting.php:71
#: ../templates/page/setting.php:84
msgid "Google Analytics Tracking"
msgstr ""

#: ../templates/page/setting.php:73
#: ../templates/page/setting.php:86
msgid "Track"
msgstr ""

#: ../templates/page/setting.php:74
#: ../templates/page/setting.php:87
msgid "Do not track"
msgstr ""

#: ../templates/page/setting.php:77
#: ../templates/page/setting.php:90
#, php-format
msgid ""
"This feature send report as event tracking to Google Analytics. You can get "
"chronological report there. For detail, see <a href=\"%s\">advanced usage</"
"a>. "
msgstr ""

#: ../templates/page/setting.php:83
#: ../templates/page/setting.php:96
msgid "Update"
msgstr ""

Expand Down
13 changes: 13 additions & 0 deletions templates/page/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
</p>
</td>
</tr>
<tr>
<th><?php $this->i18n->e("Hide default feedback controller"); ?></th>
<td>
<p>
<?php foreach(get_post_types() as $post_type ): $object = get_post_type_object($post_type); if( false === array_search($post_type, array("revision", "nav_menu_item"))): ?>
<label><input type="checkbox" name="afb_hide_default_controller[]" value="<?php echo $post_type?>" <?php checked( false !== array_search($post_type, $this->option["hide_default_controller"])) ?>/><?php echo esc_html($object->labels->name) ?></label>
<?php endif; endforeach; ?>
</p>
<p class="description">
<?php $this->i18n->e("Checked post type if you need to hide default feedback controller."); ?>
</p>
</td>
</tr>
<tr>
<th><?php $this->i18n->e("Comment setting"); ?></th>
<td>
Expand Down

0 comments on commit 2dbf1d4

Please sign in to comment.