From d4ab3f4710176af54637457ebca3212aca53dbe5 Mon Sep 17 00:00:00 2001 From: voltan Date: Mon, 30 Mar 2015 11:11:29 +0430 Subject: [PATCH] Work on ask module --- config/config.php | 16 + config/module.php | 2 +- config/permission.php | 43 +-- locale/fa/admin.mo | Bin 4951 -> 2281 bytes locale/fa/admin.po | 375 +++++++++----------- locale/fa/default.mo | Bin 4951 -> 4603 bytes locale/fa/default.po | 368 ++++++++++--------- sql/mysql.sql | 2 +- src/Api/Breadcrumbs.php | 20 +- src/Api/Question.php | 16 +- src/Controller/Admin/QuestionController.php | 20 +- src/Controller/Front/AnswerController.php | 9 +- src/Controller/Front/IndexController.php | 35 +- src/Controller/Front/SubmitController.php | 20 +- src/Controller/Front/TagController.php | 128 ++++--- src/Form/AskForm.php | 7 +- src/Form/UpdateForm.php | 15 +- src/Model/Question.php | 2 +- src/Route/Ask.php | 18 +- template/admin/question_index.phtml | 2 +- template/front/question_index.phtml | 38 +- template/front/question_list.phtml | 9 +- template/front/tag_list.phtml | 21 ++ 23 files changed, 641 insertions(+), 525 deletions(-) create mode 100644 template/front/tag_list.phtml diff --git a/config/config.php b/config/config.php index ececb56..345a806 100644 --- a/config/config.php +++ b/config/config.php @@ -52,6 +52,14 @@ 'filter' => 'number_int', 'value' => 10 ), + 'show_info' => array( + 'category' => 'show', + 'title' => _a('Show information'), + 'description' => '', + 'edit' => 'checkbox', + 'filter' => 'number_int', + 'value' => 1 + ), 'show_tags' => array( 'category' => 'show', 'title' => _a('Tags'), @@ -69,6 +77,14 @@ 'value' => 1 ), // Question + 'question_ask' => array( + 'category' => 'question', + 'title' => _a('Can ask'), + 'description' => '', + 'edit' => 'checkbox', + 'filter' => 'number_int', + 'value' => 1 + ), 'question_answer' => array( 'category' => 'question', 'title' => _a('Can answer'), diff --git a/config/module.php b/config/module.php index 7d190aa..1f0583f 100644 --- a/config/module.php +++ b/config/module.php @@ -14,7 +14,7 @@ 'meta' => array( 'title' => _a('Ask'), 'description' => _a('Ask and Answer'), - 'version' => '0.1.0', + 'version' => '0.1.3', 'license' => 'New BSD', 'logo' => 'image/logo.png', 'readme' => 'docs/readme.txt', diff --git a/config/permission.php b/config/permission.php index 7c13039..36667d2 100755 --- a/config/permission.php +++ b/config/permission.php @@ -20,15 +20,14 @@ 'member', ), ), - 'author' => array( - 'title' => _a('Authors'), + 'submit' => array( + 'title' => _a('Submit'), 'access' => array( - 'guest', 'member', ), ), - 'favourite' => array( - 'title' => _a('Favourite'), + 'answer' => array( + 'title' => _a('Answer'), 'access' => array( 'member', ), @@ -36,38 +35,8 @@ ), // Admin section 'admin' => array( - 'attach' => array( - 'title' => _a('Attach'), - 'access' => array( - //'admin', - ), - ), - 'author' => array( - 'title' => _a('Authors'), - 'access' => array( - //'admin', - ), - ), - 'extra' => array( - 'title' => _a('Extra'), - 'access' => array( - //'admin', - ), - ), - 'spotlight' => array( - 'title' => _a('Spotlight'), - 'access' => array( - //'admin', - ), - ), - 'story' => array( - 'title' => _a('Story'), - 'access' => array( - //'admin', - ), - ), - 'topic' => array( - 'title' => _a('Topic'), + 'question' => array( + 'title' => _a('List of Questions'), 'access' => array( //'admin', ), diff --git a/locale/fa/admin.mo b/locale/fa/admin.mo index a148f79ede2ab988e1850ee2e118ca4c32b3ec8c..790b0c8b5106af1717c3896ba84a6fbbb83db5de 100644 GIT binary patch literal 2281 zcmZ{i%WoS+9LEP*UM5foZ%WZ1Q6wJgN7IPNrHEjfC?cgUajOammGOFPFJ14N-F2KC zQ#Edca)h2K7dIA-kf*kxN;!TkJe+3@}Z-Er&ckn6jPmuEe8?DE1Ncs+e z2f)`s9I>MyeryVVbf4oOo#&$c1@LR!`5ZWg{oi0@fq#RP_cH{27Bs;OxCFiccEAt7 zU%=PEeGtpR!yw&j27C@Y4N{FOAmwd=21D==_zy^V$MHvT4uWL=21s$< z2VVj|kItLmGgx1Y)>lBvb2VD`z{6Po1VSpi4dS{C?b3EHg5)26R0GmMIbo``0s5o* zJrT`G8}*H1Qhi7peFrh9?)0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7ZpoEE7yNB}iN)+&S!9p$L2DrCSR(WhdCh dG$k8d?wxC^H$NjkY{+`^R_~1$r6l5c^&het&awai diff --git a/locale/fa/admin.po b/locale/fa/admin.po index 317c54f..b25f5cc 100644 --- a/locale/fa/admin.po +++ b/locale/fa/admin.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2014-02-27 12:00+0330\n" +"POT-Creation-Date: 2015-03-30 11:04+0330\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -15,257 +15,230 @@ msgstr "" "X-Poedit-Basepath: .\n" "X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-2.5.0/usr/module/ask\n" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AnswerForm.php:48 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:31 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/front/question_index.phtml:28 -msgid "Answer" -msgstr "پاسخ" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AnswerForm.php:62 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:80 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:80 -msgid "Submit" -msgstr "ارسال" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:16 +msgid "Admin" +msgstr "مدیریت" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:42 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:42 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:14 -msgid "Title" -msgstr "عنوان" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:20 +msgid "Show" +msgstr "نمایش" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:53 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:53 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:28 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:24 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:42 msgid "Question" msgstr "سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:67 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:67 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:54 -msgid "Tags" -msgstr "برچسب ها" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:28 +msgid "Feed" +msgstr "خوراک" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Feed/IndexController.php:25 -msgid "Ask feed" -msgstr "خوراک سوالات" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:32 +msgid "Vote" +msgstr "رای" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Feed/IndexController.php:26 -msgid "Recent Questions." -msgstr "آخرین سوالات ارسال شده" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:40 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:49 +msgid "Perpage" +msgstr "تعداد هر هر صفحه" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:102 -#, php-format -msgid "%s question accept successfully" -msgstr "%s با موفقیت تایید شد" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:50 +msgid "Number of questions in each page" +msgstr "تعداد سوالات در هر صفحه" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:107 -#, php-format -msgid "Error in accept %s question" -msgstr "خطا در تایید %s" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:57 +msgid "Show information" +msgstr "نمایش اطلاعات" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:113 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:176 -msgid "Please select question" -msgstr "لطفا یک سوال انتخاب کنید" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:65 +msgid "Tags" +msgstr "برچسب ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:153 -msgid "Your selected item edit successfully" -msgstr "آیتم انتخابی شما با موفقیت ویرایش شد" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:66 +msgid "Number of tags in tag controller" +msgstr "تعداد برچسب ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:174 -msgid "Your selected question deleted" -msgstr "سوال انتخابی شما حذف شد" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:73 +msgid "Show breadcrumbs" +msgstr "نمایش ناوبری" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:69 -msgid "Ask index seo title" -msgstr "فهرست پرسش و پاسخ های ارسالی" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:82 +msgid "Can ask" +msgstr "امکان پرسیدن سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:70 -msgid "ask index seo description" -msgstr "فهرست پرسش و پاسخ های ارسالی" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:90 +msgid "Can answer" +msgstr "امکان پاسخ به سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:71 -msgid "ask index seo keywords" -msgstr "فهرست,پرسش,پاسخ,سوال,جواب" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:97 +msgid "Automatic approval" +msgstr "تایید خودکار" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:64 -msgid "Your ask new question successfully, Other users can view and answer it" -msgstr "" -"پرسش شما با موفقیت ارسال شد، کاربران دیگر می توانند آن را بخوانند و پاسخ دهند" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:103 +msgid "All questions and answers need admin review before publish" +msgstr "تمام سوالات و پاسخ خا به تایید مدیر برای انتشار نیاز دارند" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:66 -msgid "" -"Your ask new question successfully, But it need review and publish by " -"website admin" -msgstr "" -"پرسش شما با موفقیت ارسال شد، بعد از بررسی و تایید مدیر در وب سایت منتشر می " -"شود" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:73 -msgid "Ask a new Question" -msgstr "پرسیدن سوال جدید" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:37 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:54 -msgid "The tag not found." -msgstr "برچسب یافت نشد" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:96 -msgid "Back to question list" -msgstr "برگشت به فهرست سوالات" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/QuestionController.php:33 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:42 -msgid "The question not found." -msgstr "سوال یافت نشد" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:65 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:95 -#, php-format -msgid "Answer to %s" -msgstr "پاسخ به %s" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:83 -msgid "" -"Your new answer to this question save successfully, and show under question" -msgstr "پاسخ شما به این پرسش با موفقیت ثبت شد، و در زیر سوال نمایش داده می شود" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:104 +msgid "Automatic approval all questions and answers" +msgstr "تایید خودکار پرسش و پاسخ های ارسالی" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:85 -msgid "" -"Your new answer to this question save successfully, But it need review and " -"publish by website admin" -msgstr "" -"پاسخ شما به این پرسش با موفقیت ثبت شد، بعد از بررسی و تایید مدیر نمایش داده " -"می شود" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:115 +msgid "Show feed icon" +msgstr "نمایش آیکن خوارک" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/navigation.php:16 -msgid "List of Question" -msgstr "فهرست سوالات" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:123 +msgid "Feed number" +msgstr "تعداد خوراک" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/navigation.php:23 -msgid "Tools" -msgstr "ابزار" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/config.php:132 +msgid "Use vote system" +msgstr "استفاده از سیستم رای" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/module.php:15 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/module.php:15 msgid "Ask" msgstr "پرسش و پاسخ" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/module.php:16 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/module.php:16 msgid "Ask and Answer" msgstr "سیستم ارسال پرسش و درج پاسخ" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:17 -msgid "Admin" -msgstr "مدیریت" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/navigation.php:16 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:17 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:39 +msgid "List of Questions" +msgstr "فهرست سوالات" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:21 -msgid "Front" -msgstr "کاربر" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/navigation.php:26 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:22 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:45 +msgid "Tools" +msgstr "ابزار" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:25 -msgid "Feed" -msgstr "خوراک" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:30 +msgid "Index page" +msgstr "صفحه اول" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:29 -msgid "Vote" -msgstr "رای" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:36 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:30 +msgid "Answer" +msgstr "پاسخ" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:37 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:46 -msgid "Perpage" -msgstr "تعداد هر هر صفحه" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:48 +msgid "Submit question" +msgstr "ارسال سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:47 -msgid "Number of questions in each page" -msgstr "تعداد سوالات در هر صفحه" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/page.php:54 +msgid "Tag" +msgstr "برچسب" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:55 -msgid "Number of tags in tag controller" -msgstr "تعداد برچسب ها" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:17 +msgid "Global public resource" +msgstr "دسترسی های عمومی" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:61 -msgid "Automatic approval" -msgstr "تایید خودکار" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/config/permission.php:24 +msgid "Submit" +msgstr "ارسال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:67 -msgid "All questions and answers need admin review before publish" -msgstr "تمام سوالات و پاسخ خا به تایید مدیر برای انتشار نیاز دارند" +#~ msgid "Title" +#~ msgstr "عنوان" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:68 -msgid "Automatic approval all questions and answers" -msgstr "تایید خودکار پرسش و پاسخ های ارسالی" +#~ msgid "Ask feed" +#~ msgstr "خوراک سوالات" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:79 -msgid "Show feed icon" -msgstr "نمایش آیکن خوارک" +#~ msgid "Recent Questions." +#~ msgstr "آخرین سوالات ارسال شده" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:87 -msgid "Feed number" -msgstr "تعداد خوراک" +#~ msgid "%s question accept successfully" +#~ msgstr "%s با موفقیت تایید شد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:96 -msgid "Use vote system" -msgstr "استفاده از سیستم رای" +#~ msgid "Error in accept %s question" +#~ msgstr "خطا در تایید %s" + +#~ msgid "Please select question" +#~ msgstr "لطفا یک سوال انتخاب کنید" + +#~ msgid "Your selected item edit successfully" +#~ msgstr "آیتم انتخابی شما با موفقیت ویرایش شد" + +#~ msgid "Your selected question deleted" +#~ msgstr "سوال انتخابی شما حذف شد" + +#~ msgid "Ask index seo title" +#~ msgstr "فهرست پرسش و پاسخ های ارسالی" + +#~ msgid "ask index seo description" +#~ msgstr "فهرست پرسش و پاسخ های ارسالی" + +#~ msgid "ask index seo keywords" +#~ msgstr "فهرست,پرسش,پاسخ,سوال,جواب" + +#~ msgid "Your ask new question successfully, Other users can view and answer it" +#~ msgstr "پرسش شما با موفقیت ارسال شد، کاربران دیگر می توانند آن را بخوانند و پاسخ دهند" + +#~ msgid "Your ask new question successfully, But it need review and publish by website admin" +#~ msgstr "پرسش شما با موفقیت ارسال شد، بعد از بررسی و تایید مدیر در وب سایت منتشر می شود" + +#~ msgid "Ask a new Question" +#~ msgstr "پرسیدن سوال جدید" + +#~ msgid "The tag not found." +#~ msgstr "برچسب یافت نشد" + +#~ msgid "Back to question list" +#~ msgstr "برگشت به فهرست سوالات" + +#~ msgid "The question not found." +#~ msgstr "سوال یافت نشد" + +#~ msgid "Answer to %s" +#~ msgstr "پاسخ به %s" + +#~ msgid "Your new answer to this question save successfully, and show under question" +#~ msgstr "پاسخ شما به این پرسش با موفقیت ثبت شد، و در زیر سوال نمایش داده می شود" + +#~ msgid "Your new answer to this question save successfully, But it need review and publish by website admin" +#~ msgstr "پاسخ شما به این پرسش با موفقیت ثبت شد، بعد از بررسی و تایید مدیر نمایش داده می شود" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:4 -msgid "Content" -msgstr "متن" +#~ msgid "Front" +#~ msgstr "کاربر" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:5 -msgid "Slug" -msgstr "اسلاگ" +#~ msgid "Content" +#~ msgstr "متن" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:6 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:16 -msgid "Create" -msgstr "ایجاد" +#~ msgid "Slug" +#~ msgstr "اسلاگ" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:10 -msgid "List of questions and answers" -msgstr "فهرست سوالات و پاسخ ها" +#~ msgid "Create" +#~ msgstr "ایجاد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:13 -msgid "ID" -msgstr "شناسه" +#~ msgid "List of questions and answers" +#~ msgstr "فهرست سوالات و پاسخ ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:15 -msgid "Type" -msgstr "نوع" +#~ msgid "ID" +#~ msgstr "شناسه" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:17 -msgid "Action" -msgstr "عملکرد" +#~ msgid "Type" +#~ msgstr "نوع" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:49 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:74 -msgid "Reject" -msgstr "رد کردن" +#~ msgid "Action" +#~ msgstr "عملکرد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:51 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:79 -msgid "Accept" -msgstr "تایید" +#~ msgid "Reject" +#~ msgstr "رد کردن" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:53 -msgid "Edit" -msgstr "ویرایش" +#~ msgid "Accept" +#~ msgstr "تایید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:54 -msgid "Delete" -msgstr "حذف" +#~ msgid "Edit" +#~ msgstr "ویرایش" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:61 -msgid "Published" -msgstr "منتشر شده" +#~ msgid "Delete" +#~ msgstr "حذف" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:62 -msgid "Pending review" -msgstr "در انتظار تایید" +#~ msgid "Published" +#~ msgstr "منتشر شده" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:68 -msgid "Accept in process" -msgstr "تایید در حال انجام است" +#~ msgid "Pending review" +#~ msgstr "در انتظار تایید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/front/question_list.phtml:3 -msgid "Ask question" -msgstr "پرسیدن سوال" +#~ msgid "Accept in process" +#~ msgstr "تایید در حال انجام است" diff --git a/locale/fa/default.mo b/locale/fa/default.mo index a148f79ede2ab988e1850ee2e118ca4c32b3ec8c..ac708da8b3667e2d04c07de2e63b47005e9b6dba 100644 GIT binary patch literal 4603 zcmbuBTWlOx8OKi{1!4*sIFwMv_&PV81iqDsfR$KGkyGiGKs z#!>(UVtZ+WiXtKP*{b9VO@bX)!9pqzh`hE>WyX<^sCeKBDdL3(RPp=H%fy5PsaUx1$hf0d0F!2205 zXX8JBUtoL#ybJs*crW;m4DYy8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kyPln&NQPZLY7ma6Us8%WuRkm-hu(5QM+eMCL`+5#LVN@Cph`HxPet@*Y zPIIhHUzCQ8GhP^1^{CVH_`%2bcQyC-ReG}aE=kQ*b!1LP<(B8T&Bt`D;RKS>YXEQ)bs7qH%!w6sS$&|4P}4dj=o1&Nr$B&innI=redo) zmD^c8l*LGHgQ`Au?6G5}dvp(-+H#^sRrhr#hl~@{8iP!iDpg&caDwvWgmn+fCjt#UgI%Hw{$?U^#^DU)$LjS5-{0{gE+U>MXkG;ZKJWO1F0x??@^ zk1L*!=X5fi%qFLj7q6U&7j(Q3&s{mg&t)C2#>=WZF8tK-a=fDB^YL8rlIAlLFY=w{ zXM8bUQ1K;1zO;5OUO_-I9WNtpMWiEwq1|~gnU&L=SkTF=PJU_6F6np)i{km@bkUMr zhS<9z_N7V}uy77Tk{N{0#TUdZ#+ZZJOkn3nDwKbXtgK+>YEf-ADQ+h-I?jyKxFxm| zg^K{!QXl2GcwUqw5s4RNN@B32;w2o!*0pmTajYyT0)5)*$L$Ra(X6Ka*-dD?zn6F8MRB<84im8=rk&@v#wm4r*vyJXLWyLbI zCMIM@$8RL3;`8V#+9gq$A-D6H6zh=G{zCi=`W9^)+YUv+4yDAE3NHHoiTE%DCOk)*Fma}9HYqAo}kI;#TWSaU`$&7R%Ia<~6 zS+PL`NZ2{Ic20qd(wS={v?EE`swn!OHwkj)@P>Mx5pBhd|Fv`p)zbG;H3+;Q^2MCl z_>xsiK@k`6QUe;g(08_=R9aVAONaxj;)_Pu)fZXEbQ`yrJ7ZpoEE7yNB}iN)+&S!9p$L2DrCSR(WhdCh dG$k8d?wxC^H$NjkY{+`^R_~1$r6l5c^&het&awai diff --git a/locale/fa/default.po b/locale/fa/default.po index 4ce6f6f..91cb987 100644 --- a/locale/fa/default.po +++ b/locale/fa/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2014-02-27 12:00+0330\n" +"POT-Creation-Date: 2015-03-30 11:09+0330\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -15,122 +15,73 @@ msgstr "" "X-Poedit-Basepath: .\n" "X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-2.5.0/usr/module/ask\n" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AnswerForm.php:48 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:31 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/front/question_index.phtml:28 -msgid "Answer" -msgstr "پاسخ" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AnswerForm.php:62 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:80 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:80 -msgid "Submit" -msgstr "ارسال" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:42 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:42 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:14 -msgid "Title" -msgstr "عنوان" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:53 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:53 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:28 -msgid "Question" -msgstr "سوال" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/AskForm.php:67 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Form/UpdateForm.php:67 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:54 -msgid "Tags" -msgstr "برچسب ها" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Api/Breadcrumbs.php:55 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Api/Breadcrumbs.php:66 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/tag_list.phtml:4 +msgid "Tag list" +msgstr "فهرست برچسب ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Feed/IndexController.php:25 -msgid "Ask feed" -msgstr "خوراک سوالات" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Api/Breadcrumbs.php:93 +msgid "Answer to question" +msgstr "پاسخ به سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Feed/IndexController.php:26 -msgid "Recent Questions." -msgstr "آخرین سوالات ارسال شده" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Api/Breadcrumbs.php:103 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:91 +msgid "Ask a new Question" +msgstr "پرسیدن سوال جدید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:102 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:86 #, php-format msgid "%s question accept successfully" msgstr "%s با موفقیت تایید شد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:107 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:91 #, php-format msgid "Error in accept %s question" msgstr "خطا در تایید %s" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:113 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:176 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:97 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:186 msgid "Please select question" msgstr "لطفا یک سوال انتخاب کنید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:153 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:155 msgid "Your selected item edit successfully" msgstr "آیتم انتخابی شما با موفقیت ویرایش شد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Admin/QuestionController.php:174 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Admin/QuestionController.php:184 msgid "Your selected question deleted" msgstr "سوال انتخابی شما حذف شد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:69 -msgid "Ask index seo title" -msgstr "فهرست پرسش و پاسخ های ارسالی" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:70 -msgid "ask index seo description" -msgstr "فهرست پرسش و پاسخ های ارسالی" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/IndexController.php:71 -msgid "ask index seo keywords" -msgstr "فهرست,پرسش,پاسخ,سوال,جواب" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:64 -msgid "Your ask new question successfully, Other users can view and answer it" -msgstr "" -"پرسش شما با موفقیت ارسال شد، کاربران دیگر می توانند آن را بخوانند و پاسخ دهند" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:66 -msgid "" -"Your ask new question successfully, But it need review and publish by " -"website admin" -msgstr "" -"پرسش شما با موفقیت ارسال شد، بعد از بررسی و تایید مدیر در وب سایت منتشر می " -"شود" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/SubmitController.php:73 -msgid "Ask a new Question" -msgstr "پرسیدن سوال جدید" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Feed/IndexController.php:25 +msgid "Ask feed" +msgstr "خوراک سوالات" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:37 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:54 -msgid "The tag not found." -msgstr "برچسب یافت نشد" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Feed/IndexController.php:26 +msgid "Recent Questions." +msgstr "آخرین سوالات ارسال شده" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/TagController.php:96 -msgid "Back to question list" -msgstr "برگشت به فهرست سوالات" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:33 +msgid "Answer question not active" +msgstr "امکان پاسخ به سوال فعال نیست" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/QuestionController.php:33 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:42 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:41 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/QuestionController.php:33 msgid "The question not found." msgstr "سوال یافت نشد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:65 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:95 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:54 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:97 #, php-format msgid "Answer to %s" msgstr "پاسخ به %s" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:83 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:85 msgid "" "Your new answer to this question save successfully, and show under question" msgstr "پاسخ شما به این پرسش با موفقیت ثبت شد، و در زیر سوال نمایش داده می شود" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/src/Controller/Front/AnswerController.php:85 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/AnswerController.php:87 msgid "" "Your new answer to this question save successfully, But it need review and " "publish by website admin" @@ -138,134 +89,223 @@ msgstr "" "پاسخ شما به این پرسش با موفقیت ثبت شد، بعد از بررسی و تایید مدیر نمایش داده " "می شود" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/navigation.php:16 -msgid "List of Question" -msgstr "فهرست سوالات" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/IndexController.php:44 +msgid "List of all questions" +msgstr "فهرست تمام سوالات" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/navigation.php:23 -msgid "Tools" -msgstr "ابزار" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:33 +msgid "Ask question not active" +msgstr "امکان پرسیدن سوال فعال نیست" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/module.php:15 -msgid "Ask" -msgstr "پرسش و پاسخ" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/module.php:16 -msgid "Ask and Answer" -msgstr "سیستم ارسال پرسش و درج پاسخ" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:17 -msgid "Admin" -msgstr "مدیریت" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:21 -msgid "Front" -msgstr "کاربر" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:25 -msgid "Feed" -msgstr "خوراک" - -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:29 -msgid "Vote" -msgstr "رای" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:82 +msgid "Your ask new question successfully, Other users can view and answer it" +msgstr "" +"پرسش شما با موفقیت ارسال شد، کاربران دیگر می توانند آن را بخوانند و پاسخ دهند" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:37 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:46 -msgid "Perpage" -msgstr "تعداد هر هر صفحه" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/SubmitController.php:84 +msgid "" +"Your ask new question successfully, But it need review and publish by " +"website admin" +msgstr "" +"پرسش شما با موفقیت ارسال شد، بعد از بررسی و تایید مدیر در وب سایت منتشر می " +"شود" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:47 -msgid "Number of questions in each page" -msgstr "تعداد سوالات در هر صفحه" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:29 +msgid "Tag module not installed." +msgstr "ماژول برچسب نصب نشده است" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:55 -msgid "Number of tags in tag controller" -msgstr "تعداد برچسب ها" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:36 +msgid "The tag not set." +msgstr "برچسب یافت نشد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:61 -msgid "Automatic approval" -msgstr "تایید خودکار" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:47 +msgid "The tag not found." +msgstr "برچسب یافت نشد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:67 -msgid "All questions and answers need admin review before publish" -msgstr "تمام سوالات و پاسخ خا به تایید مدیر برای انتشار نیاز دارند" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:61 +#, php-format +msgid "All questions from %s" +msgstr "همه سوالات در مورد %s" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:68 -msgid "Automatic approval all questions and answers" -msgstr "تایید خودکار پرسش و پاسخ های ارسالی" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Controller/Front/TagController.php:102 +msgid "List of all used tags" +msgstr "فهرست تمام برچسب های استفاده شده" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:79 -msgid "Show feed icon" -msgstr "نمایش آیکن خوارک" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AnswerForm.php:48 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:32 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_index.phtml:44 +msgid "Answer" +msgstr "پاسخ" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:87 -msgid "Feed number" -msgstr "تعداد خوراک" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AnswerForm.php:62 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:81 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:81 +msgid "Submit" +msgstr "ارسال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/config/config.php:96 -msgid "Use vote system" -msgstr "استفاده از سیستم رای" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:42 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:42 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:15 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:3 +msgid "Title" +msgstr "عنوان" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:4 -msgid "Content" -msgstr "متن" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:53 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:53 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:29 +msgid "Question" +msgstr "سوال" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:5 -msgid "Slug" -msgstr "اسلاگ" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:68 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:68 +msgid "Tags" +msgstr "برچسب ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_update.phtml:6 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:16 -msgid "Create" -msgstr "ایجاد" +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/AskForm.php:72 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/src/Form/UpdateForm.php:72 +msgid "Use `|` as delimiter to separate tag terms" +msgstr "با استفاده از `|` کلمات را از هم جدا کنید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:10 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:11 msgid "List of questions and answers" msgstr "فهرست سوالات و پاسخ ها" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:13 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:14 msgid "ID" msgstr "شناسه" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:15 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:16 msgid "Type" msgstr "نوع" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:17 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:17 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:6 +msgid "Create" +msgstr "ایجاد" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:18 msgid "Action" msgstr "عملکرد" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:49 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:74 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:50 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:78 msgid "Reject" msgstr "رد کردن" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:51 -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:79 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:52 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:83 msgid "Accept" msgstr "تایید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:53 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:54 msgid "Edit" msgstr "ویرایش" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:54 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:55 msgid "Delete" msgstr "حذف" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:61 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:62 msgid "Published" msgstr "منتشر شده" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:62 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:63 msgid "Pending review" msgstr "در انتظار تایید" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/admin/question_index.phtml:68 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:66 +msgid "No question submit yet" +msgstr "هنوز هیچ سوالی ارسال نشده است" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_index.phtml:72 msgid "Accept in process" msgstr "تایید در حال انجام است" -#: /var/www/html/local/pi/pi-develop/usr/module/ask/template/front/question_list.phtml:3 +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:4 +msgid "Slug" +msgstr "اسلاگ" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/admin/question_update.phtml:5 +msgid "Content" +msgstr "متن" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_index.phtml:10 +msgid "Time" +msgstr "زمان ارسال" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_index.phtml:11 +msgid "Read" +msgstr "نمایش" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_index.phtml:11 +msgid "Times" +msgstr "بار" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/question_list.phtml:7 msgid "Ask question" msgstr "پرسیدن سوال" + +#: /var/www/html/local/pi/pi-2.5.0/usr/module/ask/template/front/tag_list.phtml:18 +msgid "" +"No keyword has been used as tag on this part yet. please check this page " +"later" +msgstr "" +"هیچ اطلاعاتی از کلمات کلیدی به عنوان برچسب هنوز در سیستم درج نشده است. لطفا " +"بعدا از این صفحه را بررسی فرمایید. " + +#~ msgid "Ask index seo title" +#~ msgstr "فهرست پرسش و پاسخ های ارسالی" + +#~ msgid "ask index seo description" +#~ msgstr "فهرست پرسش و پاسخ های ارسالی" + +#~ msgid "ask index seo keywords" +#~ msgstr "فهرست,پرسش,پاسخ,سوال,جواب" + +#~ msgid "Tools" +#~ msgstr "ابزار" + +#~ msgid "Ask" +#~ msgstr "پرسش و پاسخ" + +#~ msgid "Ask and Answer" +#~ msgstr "سیستم ارسال پرسش و درج پاسخ" + +#~ msgid "Admin" +#~ msgstr "مدیریت" + +#~ msgid "Front" +#~ msgstr "کاربر" + +#~ msgid "Feed" +#~ msgstr "خوراک" + +#~ msgid "Vote" +#~ msgstr "رای" + +#~ msgid "Perpage" +#~ msgstr "تعداد هر هر صفحه" + +#~ msgid "Number of questions in each page" +#~ msgstr "تعداد سوالات در هر صفحه" + +#~ msgid "Number of tags in tag controller" +#~ msgstr "تعداد برچسب ها" + +#~ msgid "Automatic approval" +#~ msgstr "تایید خودکار" + +#~ msgid "All questions and answers need admin review before publish" +#~ msgstr "تمام سوالات و پاسخ خا به تایید مدیر برای انتشار نیاز دارند" + +#~ msgid "Automatic approval all questions and answers" +#~ msgstr "تایید خودکار پرسش و پاسخ های ارسالی" + +#~ msgid "Show feed icon" +#~ msgstr "نمایش آیکن خوارک" + +#~ msgid "Feed number" +#~ msgstr "تعداد خوراک" + +#~ msgid "Use vote system" +#~ msgstr "استفاده از سیستم رای" diff --git a/sql/mysql.sql b/sql/mysql.sql index 00b9def..d38f08e 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -14,7 +14,7 @@ CREATE TABLE `{question}` ( `title` varchar(255) NOT NULL default '', `slug` varchar(255) NOT NULL default '', `content` text, - `tags` varchar(255) NOT NULL default '', + `tag` varchar(255) NOT NULL default '', `seo_title` varchar(255) NOT NULL default '', `seo_keywords` varchar(255) NOT NULL default '', `seo_description` varchar(255) NOT NULL default '', diff --git a/src/Api/Breadcrumbs.php b/src/Api/Breadcrumbs.php index 17077d0..295e382 100644 --- a/src/Api/Breadcrumbs.php +++ b/src/Api/Breadcrumbs.php @@ -49,9 +49,23 @@ public function load() 'href' => $moduleData['moduleUrl'], 'label' => $moduleData['title'], ); - $result[] = array( - 'label' => $params['slug'], - ); + + if (!empty($params['slug'])) { + $result[] = array( + 'label' => __('Tag list'), + 'href' => Pi::url(Pi::service('url')->assemble('ask', array( + 'controller' => 'tag', + 'action' => 'list', + ))), + ); + $result[] = array( + 'label' => $params['slug'], + ); + } else { + $result[] = array( + 'label' => __('Tag list'), + ); + } break; case 'question': diff --git a/src/Api/Question.php b/src/Api/Question.php index 8776e81..69e67f1 100644 --- a/src/Api/Question.php +++ b/src/Api/Question.php @@ -58,7 +58,21 @@ public function canonizeQuestion($question) $question['time_create_view'] = _date($question['time_create']); $question['time_update_view'] = _date($question['time_update']); // Set tags - $question['tags'] = Json::decode($question['tags']); + if (!empty($question['tag'])) { + $tags = Json::decode($question['tag']); + foreach ($tags as $tag) { + $tagList[] = array( + 'term' => $tag, + 'url' => Pi::url(Pi::service('url')->assemble('ask', array( + 'module' => $this->getModule(), + 'controller' => 'tag', + 'action' => 'term', + 'slug' => urlencode($tag), + ))), + ); + } + $question['tag'] = $tagList; + } // Set info for Q and A switch ($question['type']) { case 'Q': diff --git a/src/Controller/Admin/QuestionController.php b/src/Controller/Admin/QuestionController.php index 9d6219e..9b114e4 100644 --- a/src/Controller/Admin/QuestionController.php +++ b/src/Controller/Admin/QuestionController.php @@ -108,8 +108,7 @@ public function updateAction() $id = $this->params('id'); $module = $this->params('module'); // find item - $question = $this->getModel('question')->find($id)->toArray(); - $question['time_create'] = _date($question['time_create']); + $question = Pi::api('question', 'ask')->getQuestion($id); $form = new UpdateForm('question'); if ($this->request->isPost()) { $data = $this->request->getPost(); @@ -117,6 +116,11 @@ public function updateAction() $form->setData($data); if ($form->isValid()) { $values = $form->getData(); + // Tag + if (!empty($values['tag'])) { + $tag = explode('|', $values['tag']); + $values['tag'] = json::encode($tag); + } // Set slug $slug = ($values['slug']) ? $values['slug'] : $values['title']; $slug = $slug . ' ' . $question['time_create']; @@ -143,12 +147,24 @@ public function updateAction() $row = $this->getModel('question')->find($values['id']); $row->assign($values); $row->save(); + // Tag + if (isset($tag) && is_array($tag) && Pi::service('module')->isActive('tag')) { + Pi::service('tag')->update($module, $row->id, '', $tag); + } // Check it save or not $message = __('Your selected item edit successfully'); $url = array('', 'module' => $module, 'controller' => 'question', 'action' => 'index'); $this->jump($url, $message); } } else { + // Get tag list + if (Pi::service('module')->isActive('tag')) { + $tag = Pi::service('tag')->get($module, $question['id'], ''); + if (is_array($tag)) { + $question['tag'] = implode('|', $tag); + } + } + // Set to form $form->setData($question); } // Set view diff --git a/src/Controller/Front/AnswerController.php b/src/Controller/Front/AnswerController.php index bc55351..c4b1e9d 100644 --- a/src/Controller/Front/AnswerController.php +++ b/src/Controller/Front/AnswerController.php @@ -22,13 +22,18 @@ class AnswerController extends ActionController { public function indexAction() { - // Check user is login or not - Pi::service('authentication')->requireLogin(); // Get info from url $slug = $this->params('slug'); $module = $this->params('module'); // Get config $config = Pi::service('registry')->config->read($module); + // Check ask + if (!$config['question_answer']) { + $url = array('', 'module' => $module, 'controller' => 'index', 'action' => 'index'); + $this->jump($url, __('Answer question not active'), 'error'); + } + // Check user is login or not + Pi::service('authentication')->requireLogin(); // Find story $question = Pi::api('question', 'ask')->getQuestion($slug, 'slug'); // Check page diff --git a/src/Controller/Front/IndexController.php b/src/Controller/Front/IndexController.php index 4552997..9a3d5e6 100644 --- a/src/Controller/Front/IndexController.php +++ b/src/Controller/Front/IndexController.php @@ -25,50 +25,23 @@ public function indexAction() $module = $this->params('module'); // Get config $config = Pi::service('registry')->config->read($module); - // Set product info + // Set question info $where = array('status' => 1, 'type' => 'Q'); // Set paginator info $template = array( 'controller' => 'index', 'action' => 'index', ); - // Get product List + // Get question List $questions = $this->askList($where); // Get paginator $paginator = $this->askPaginator($template, $where); - // Set order link - $orderLink = array(); - $orderLink['answer'] = $this->url('', array( - 'module' => $module, - 'controller' => 'index', - 'action' => 'index', - 'order' => 'answer' - )); - $orderLink['hits'] = $this->url('', array( - 'module' => $module, - 'controller' => 'index', - 'action' => 'index', - 'order' => 'hits' - )); - $orderLink['point'] = $this->url('', array( - 'module' => $module, - 'controller' => 'index', - 'action' => 'index', - 'order' => 'point' - )); - $orderLink['create'] = $this->url('', array( - 'module' => $module, - 'controller' => 'index', - 'action' => 'index', - 'order' => 'create' - )); - $orderLink['active'] = $this->params('order', 'create'); // Set view $this->view()->setTemplate('question_list'); $this->view()->assign('questions', $questions); $this->view()->assign('paginator', $paginator); $this->view()->assign('config', $config); - $this->view()->assign('orderLink', $orderLink); + $this->view()->assign('title', __('List of all questions')); } public function askList($where) @@ -87,7 +60,7 @@ public function askList($where) foreach ($rowset as $row) { $question[$row->id] = Pi::api('question', 'ask')->canonizeQuestion($row); } - // return product + // return question return $question; } diff --git a/src/Controller/Front/SubmitController.php b/src/Controller/Front/SubmitController.php index 3fd9528..336485d 100644 --- a/src/Controller/Front/SubmitController.php +++ b/src/Controller/Front/SubmitController.php @@ -23,6 +23,15 @@ class SubmitController extends ActionController { public function indexAction() { + // Get info from url + $module = $this->params('module'); + // Get config + $config = Pi::service('registry')->config->read($module); + // Check ask + if (!$config['question_ask']) { + $url = array('', 'module' => $module, 'controller' => 'index', 'action' => 'index'); + $this->jump($url, __('Ask question not active'), 'error'); + } // Check user is login or not Pi::service('authentication')->requireLogin(); // Set form @@ -33,6 +42,11 @@ public function indexAction() $form->setData($data); if ($form->isValid()) { $values = $form->getData(); + // Tag + if (!empty($values['tag'])) { + $tag = explode('|', $values['tag']); + $values['tag'] = json::encode($tag); + } // Set time $values['time_create'] = time(); $values['time_update'] = time(); @@ -59,6 +73,10 @@ public function indexAction() $row = $this->getModel('question')->createRow(); $row->assign($values); $row->save(); + // Tag + if (isset($tag) && is_array($tag) && Pi::service('module')->isActive('tag')) { + Pi::service('tag')->add($this->params('module'), $row->id, '', $tag); + } // Check it save or not if ($this->config('auto_approval')) { $message = __('Your ask new question successfully, Other users can view and answer it'); @@ -84,8 +102,6 @@ public function indexAction() $this->view()->setTemplate('submit_index'); $this->view()->assign('form', $form); $this->view()->assign('title', $title); - $this->view()->assign('message', $message); - $this->view()->assign('class', $class); } public function searchAction() diff --git a/src/Controller/Front/TagController.php b/src/Controller/Front/TagController.php index 87cbb9f..4914609 100644 --- a/src/Controller/Front/TagController.php +++ b/src/Controller/Front/TagController.php @@ -30,72 +30,88 @@ public function termAction() } // Get config $config = Pi::service('registry')->config->read($module); - // Get order - $selectOrder = $this->params('order', 'create'); - if (!in_array($selectOrder, array('create', 'hits', 'point', 'answer'))) { - $selectOrder = 'create'; - } - // Set offset - $offset = (int)($page - 1) * $config['show_perpage']; - // Get photo Id from tag module - $tags = Pi::service('tag')->getList($module, $slug, null, $config['show_tags'], $offset); // Check slug - if (empty($tags)) { - $this->jump(array('', 'module' => $module, 'controller' => 'index'), __('The tag not found.')); + if (!isset($slug) || empty($slug)) { + $url = array('', 'module' => $module, 'controller' => 'index', 'action' => 'index'); + $this->jump($url, __('The tag not set.'), 'error'); } + // Get id from tag module + $tagId = array(); + $tags = Pi::service('tag')->getList($slug, $module); foreach ($tags as $tag) { $tagId[] = $tag['item']; } - // Set info - $order = array($selectOrder . ' DESC', 'id DESC'); - $columns = array('id', 'answer', 'author', 'point', 'count', 'hits', 'create', 'title', 'slug', 'tags'); - $where = array('status' => 1, 'type' => 'Q', 'id' => $tagId); - $limit = intval($config['show_index']); - // Get list of story - $select = $this->getModel('question')->select()->columns($columns)->where($where)->order($order)->offset($offset)->limit($limit); - $rowset = $this->getModel('question')->selectWith($select); - foreach ($rowset as $row) { - $question[$row->id] = $row->toArray(); - $question[$row->id]['create'] = date('Y/m/d', $question[$row->id]['create']); - $question[$row->id]['tags'] = Json::decode($question[$row->id]['tags']); - $question[$row->id]['url'] = $this->url('.ask', array('module' => $module, 'controller' => 'question', 'slug' => $question[$row->id]['slug'])); - $writer = Pi::model('user_account')->find($question[$row->id]['author'])->toArray(); - $question[$row->id]['identity'] = $writer['identity']; - $question[$row->id]['labelpoint'] = HtmlClass::TabLabel($question[$row->id]['point']); - $question[$row->id]['labelanswer'] = HtmlClass::TabLabel($question[$row->id]['answer']); - $question[$row->id]['labelhits'] = HtmlClass::TabLabel($question[$row->id]['hits']); + // Check slug + if (empty($tagId)) { + $url = array('', 'module' => $module, 'controller' => 'index', 'action' => 'index'); + $this->jump($url, __('The tag not found.'), 'error'); } - // Set paginator - $select = $this->getModel('question')->select()->columns(array('count' => new \Zend\Db\Sql\Predicate\Expression('count(*)')))->where($where); - $count = $this->getModel('question')->selectWith($select)->current()->count; - $paginator = \Pi\Paginator\Paginator::factory(intval($count)); - $paginator->setItemCountPerPage($config['show_perpage']); - $paginator->setCurrentPageNumber($page); - $paginator->setUrlOptions(array( - 'template' => $this->url('.ask', array('module' => $module, 'controller' => 'tag', 'slug' => urlencode($slug), 'order' => $selectOrder, 'page' => '%page%')), - )); - // Tab urls - $url = array( - 'create' => $this->url('.ask', array('module' => $module, 'controller' => 'tag', 'slug' => urlencode($slug), 'order' => 'create')), - 'vote' => $this->url('.ask', array('module' => $module, 'controller' => 'tag', 'slug' => urlencode($slug), 'order' => 'point')), - 'hits' => $this->url('.ask', array('module' => $module, 'controller' => 'tag', 'slug' => urlencode($slug), 'order' => 'hits')), - 'answer' => $this->url('.ask', array('module' => $module, 'controller' => 'tag', 'slug' => urlencode($slug), 'order' => 'answer')), - ); - // Main url - $mainurl = array( - 'title' => __('Back to question list'), - 'url' => $this->url('.ask', array('module' => $module, 'controller' => 'index')), + // Set question info + $where = array('status' => 1, 'type' => 'Q', 'id' => $tagId); + // Set paginator info + $template = array( + 'controller' => 'tag', + 'action' => 'term', ); + // Get question List + $questions = $this->askList($where); + // Get paginator + $paginator = $this->askPaginator($template, $where); + // Set header and title + $title = sprintf(__('All questions from %s'), $slug); + // Set seo_keywords + $filter = new Filter\HeadKeywords; + $filter->setOptions(array( + 'force_replace_space' => true + )); + $seoKeywords = $filter($title); // Set view - $this->view()->headTitle($slug); - $this->view()->headDescription($slug, 'set'); - $this->view()->headKeywords($slug, 'set'); + $this->view()->headTitle($title); + $this->view()->headDescription($title, 'set'); + $this->view()->headKeywords($seoKeywords, 'set'); $this->view()->setTemplate('question_list'); - $this->view()->assign('questions', $question); + $this->view()->assign('questions', $questions); $this->view()->assign('paginator', $paginator); $this->view()->assign('config', $config); - $this->view()->assign('url', $url); - $this->view()->assign('mainurl', $mainurl); - $this->view()->assign('tabclass', HtmlClass::TabClass($selectOrder)); + $this->view()->assign('title', $title); + } + + public function listAction() + { + // Get info from url + $module = $this->params('module'); + $tagList = array(); + // Check tag module install or not + if (Pi::service('module')->isActive('tag')) { + $where = array('module' => $module); + $order = array('count DESC', 'id DESC'); + $select = Pi::model('stats', 'tag')->select()->where($where)->order($order); + $rowset = Pi::model('stats', 'tag')->selectWith($select); + foreach ($rowset as $row) { + $tag = Pi::model('tag', 'tag')->find($row->term, 'term'); + $tagList[$row->id] = $row->toArray(); + $tagList[$row->id]['term'] = $tag['term']; + $tagList[$row->id]['url'] = Pi::url($this->url('', array( + 'controller' => 'tag', + 'action' => 'term', + 'slug' => urldecode($tag['term']) + ))); + } + } + // Set header and title + $title = __('List of all used tags'); + // Set seo_keywords + $filter = new Filter\HeadKeywords; + $filter->setOptions(array( + 'force_replace_space' => true + )); + $seoKeywords = $filter($title); + // Set view + $this->view()->headTitle($title); + $this->view()->headDescription($title, 'set'); + $this->view()->headKeywords($seoKeywords, 'set'); + $this->view()->setTemplate('tag_list'); + $this->view()->assign('title', $title); + $this->view()->assign('tagList', $tagList); } } \ No newline at end of file diff --git a/src/Form/AskForm.php b/src/Form/AskForm.php index 1837d02..f109649 100644 --- a/src/Form/AskForm.php +++ b/src/Form/AskForm.php @@ -46,7 +46,7 @@ public function init() 'description' => '', ) )); - // text_description + // content $this->add(array( 'name' => 'content', 'options' => array( @@ -63,12 +63,13 @@ public function init() if (Pi::service('module')->isActive('tag')) { $this->add(array( 'name' => 'tag', + 'type' => 'tag', 'options' => array( 'label' => __('Tags'), ), 'attributes' => array( - 'type' => 'text', - 'description' => '', + 'id' => 'tag', + 'description' => __('Use `|` as delimiter to separate tag terms'), ) )); } diff --git a/src/Form/UpdateForm.php b/src/Form/UpdateForm.php index 6a8f7a7..6a4d378 100644 --- a/src/Form/UpdateForm.php +++ b/src/Form/UpdateForm.php @@ -46,16 +46,16 @@ public function init() 'description' => '', ) )); - // content + // content $this->add(array( 'name' => 'content', 'options' => array( - 'label' => __('Content'), + 'label' => __('Question'), + 'editor' => 'html', + 'set' => '', ), 'attributes' => array( - 'type' => 'textarea', - 'rows' => '5', - 'cols' => '40', + 'type' => 'editor', 'description' => '', ) )); @@ -63,12 +63,13 @@ public function init() if (Pi::service('module')->isActive('tag')) { $this->add(array( 'name' => 'tag', + 'type' => 'tag', 'options' => array( 'label' => __('Tags'), ), 'attributes' => array( - 'type' => 'text', - 'description' => '', + 'id' => 'tag', + 'description' => __('Use `|` as delimiter to separate tag terms'), ) )); } diff --git a/src/Model/Question.php b/src/Model/Question.php index 43dd29d..0f0bd6f 100644 --- a/src/Model/Question.php +++ b/src/Model/Question.php @@ -22,7 +22,7 @@ class Question extends Model */ protected $columns = array( 'id', 'type', 'pid', 'answer', 'uid', 'point', 'count', 'favorite', 'hits', 'status', - 'time_create', 'time_update', 'title', 'slug', 'content', 'tags', 'seo_title', + 'time_create', 'time_update', 'title', 'slug', 'content', 'tag', 'seo_title', 'seo_keywords','seo_description' ); } diff --git a/src/Route/Ask.php b/src/Route/Ask.php index a9f9aac..c96e3a6 100644 --- a/src/Route/Ask.php +++ b/src/Route/Ask.php @@ -28,7 +28,7 @@ class Ask extends Standard ); protected $controllerList = array( - 'answer', 'index', 'question', 'submit' + 'answer', 'index', 'question', 'submit', 'tag' ); /** @@ -70,6 +70,22 @@ protected function parse($path) $matches['slug'] = $this->decode($parts[1]); } break; + + case 'tag': + switch ($parts[1]) { + case 'term': + $matches['action'] = 'term'; + if (!empty($parts[2])) { + $matches['slug'] = urldecode($parts[2]); + } + break; + + case 'list': + $matches['action'] = 'list'; + break; + } + + break; } } diff --git a/template/admin/question_index.phtml b/template/admin/question_index.phtml index afcc9e5..5cb9f85 100644 --- a/template/admin/question_index.phtml +++ b/template/admin/question_index.phtml @@ -44,7 +44,7 @@ - escape($question['time_create']); ?> + escape($question['time_create_view']); ?> diff --git a/template/front/question_index.phtml b/template/front/question_index.phtml index e1a8c31..e5f2ab3 100644 --- a/template/front/question_index.phtml +++ b/template/front/question_index.phtml @@ -1,14 +1,28 @@
-
-
-

escape($question['title']); ?>

+ +
+
+ +
+
    +
  • : escape($question['time_create_view']); ?>
  • +
  • : escape($question['hits'])); ?>
  • +
-
- -
-
escape($question['time_create_view']); ?>
-
+ + + +
@@ -18,12 +32,16 @@
-
escape($answer['time_create_view']); ?>
+
escape($answer['time_create_view']); ?>
-

+ +

+ +

+
\ No newline at end of file diff --git a/template/front/question_list.phtml b/template/front/question_list.phtml index 9ca7db2..0fc0268 100644 --- a/template/front/question_list.phtml +++ b/template/front/question_list.phtml @@ -1,6 +1,13 @@
+ + +

+ +

+
-

escape($question['title']); ?> diff --git a/template/front/tag_list.phtml b/template/front/tag_list.phtml new file mode 100644 index 0000000..826a3d4 --- /dev/null +++ b/template/front/tag_list.phtml @@ -0,0 +1,21 @@ +css($this->assetModule('css/front.css')); ?> + \ No newline at end of file