function form_button_data($button, $key, $style) { if ($this->forbid_new_tag() && $key === 'ask') { $baseclass = 'qa-form-' . $style . '-button qa-form-' . $style . '-button-' . $key; $hoverclass = 'qa-form-' . $style . '-hover qa-form-' . $style . '-hover-' . $key; $this->output('<INPUT' . rtrim(' ' . @$button['tags']) . ' onclick="qa_tag_verify();" VALUE="' . @$button['label'] . '" TITLE="' . @$button['popup'] . '" TYPE="button" CLASS="' . $baseclass . '" onmouseover="this.className=\'' . $hoverclass . '\';" onmouseout="this.className=\'' . $baseclass . '\';"/>'); } else { qa_html_theme_base::form_button_data($button, $key, $style); } }
function form_button_data($button, $key, $style) { if (qa_opt('ajax_comment_enable') && !$this->qa_state && $this->can_comment) { if ($key === 'comment') { // insert username $handle = ''; if (qa_opt('ajax_comment_username') && isset($button['comment_username']) && $button['comment_username'] != qa_get_logged_in_handle()) { $handle = ",'" . $button['comment_username'] . "'"; } // flash star if we are the questioner commenting on an answer $star = ''; $ourid = qa_get_logged_in_userid(); if (qa_opt('ajax_comment_flash_star') && !$this->content['q_view']['raw']['selchildid'] && $this->idx > 0 && @$button['popup'] == qa_lang_html('question/comment_a_popup') && $this->content['q_view']['raw']['userid'] == $ourid && @$this->content['a_list']['as'][$this->idx - 1]['raw']['userid'] != $ourid) { $star = ',' . $this->idx; } $toggle_opts = $handle ? $handle . $star : ',null' . $star; $baseclass = 'qa-form-' . $style . '-button qa-form-' . $style . '-button-' . $key; $hoverclass = 'qa-form-' . $style . '-hover qa-form-' . $style . '-hover-' . $key; if (isset($button['ajax_comment'])) { $this->output('<INPUT' . rtrim(' ' . @$button['tags']) . ' VALUE="' . @$button['label'] . '" TITLE="' . @$button['popup'] . '" TYPE="button" CLASS="' . $baseclass . '" onmouseover="this.className=\'' . $hoverclass . '\';" onmouseout="this.className=\'' . $baseclass . '\';"/>'); } else { $this->output('<INPUT' . rtrim(' ' . @$button['tags']) . ' onclick="toggleComment(' . (isset($_POST['ajax_id']) ? $_POST['ajax_id'] : $this->idx) . $toggle_opts . ');" VALUE="' . @$button['label'] . '" TITLE="' . @$button['popup'] . '" TYPE="button" CLASS="' . $baseclass . '" onmouseover="this.className=\'' . $hoverclass . '\';" onmouseout="this.className=\'' . $baseclass . '\';"/>'); } } else { if ($key === 'cancel' && isset($button['ajax_comment'])) { $baseclass = 'qa-form-' . $style . '-button qa-form-' . $style . '-button-' . $key; $hoverclass = 'qa-form-' . $style . '-hover qa-form-' . $style . '-hover-' . $key; $this->output('<INPUT' . rtrim(' ' . @$button['tags']) . ' onclick="toggleComment(false);" VALUE="' . @$button['label'] . '" TITLE="' . @$button['popup'] . '" TYPE="button" CLASS="' . $baseclass . '" onmouseover="this.className=\'' . $hoverclass . '\';" onmouseout="this.className=\'' . $baseclass . '\';"/>'); } else { qa_html_theme_base::form_button_data($button, $key, $style); } } } else { qa_html_theme_base::form_button_data($button, $key, $style); } }