Commit e06397a8 by Félicie

checkbox option and unanswered added

parent 4bb9b67c
......@@ -1871,23 +1871,21 @@ function qa_set_up_name_field(&$qa_content, &$fields, $inname, $fieldprefix = ''
/**
* Set up $qa_content and add to $fields to allow user to set if they want to be notified regarding their post.
* $basetype is 'Q', 'A' or 'C' for question, answer or comment. $login_email is the email of logged in user,
* or null if this is an anonymous post. $innotify, $inemail and $errors_email are from previous submission/validation.
* or null if this is an anonymous post. $inemail and $errors_email are from previous submission/validation.
* Pass $fieldprefix to add a prefix to the form field names and IDs used.
* @param array $qa_content
* @param array $fields
* @param string $basetype
* @param string|null $login_email
* @param string $innotify
* @param string $inemail
* @param string $errors_email
* @param string $fieldprefix
*/
function qa_set_up_notify_fields(&$qa_content, &$fields, $basetype, $login_email, $innotify, $inemail, $errors_email, $fieldprefix = '')
function qa_set_up_notify_fields(&$qa_content, &$fields, $basetype, $login_email, $inemail, $errors_email, $fieldprefix = '')
{
$fields['notify'] = array(
'tags' => 'name="' . $fieldprefix . 'notify"',
'type' => 'checkbox',
'value' => qa_html($innotify),
);
switch ($basetype) {
......
......@@ -550,12 +550,12 @@ function qa_content_prepare($voting = false, $categoryids = array())
// );
// }
if (qa_opt('nav_unanswered')) {
$qa_content['navigation']['main']['unanswered'] = array(
'url' => qa_path_html('unanswered'),
'label' => qa_lang_html('main/nav_unanswered'),
);
}
// if (qa_opt('nav_unanswered')) {
// $qa_content['navigation']['main']['unanswered'] = array(
// 'url' => qa_path_html('unanswered'),
// 'label' => qa_lang_html('main/nav_unanswered'),
// );
// }
if (qa_using_tags() && qa_opt('nav_tags')) {
$qa_content['navigation']['main']['tag'] = array(
......
......@@ -298,7 +298,7 @@ if (!isset($userid) && qa_opt('allow_anonymous_naming')) {
}
qa_set_up_notify_fields($qa_content, $qa_content['form']['fields'], 'Q', qa_get_logged_in_email(),
isset($in['notify']) ? $in['notify'] : qa_opt('notify_users_default'), @$in['email'], @$errors['email']);
qa_opt('notify_users_default'), @$in['email'], @$errors['email']);
if ($captchareason) {
require_once QA_INCLUDE_DIR.'app/captcha.php';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment