Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
763 views
in Q2A Core by
Where can I get access to the following code, I'm trying to add a / at the end of the inputs for validation.
<input name="" value="" title="" type="" class="" *HERE*>
 
Thanks in advance
 
<div class="qa-q-view-buttons">
<input name="q_doedit" value="edit" title="Edit this question" type="submit" class="qa-form-light-button qa-form-light-button-edit">
<input name="q_doclose" value="close" title="Close this question to any new answers" type="submit" class="qa-form-light-button qa-form-light-button-close">
<input name="q_dohide" onclick="qa_show_waiting_after(this, false);" value="hide" title="Hide this question" type="submit" class="qa-form-light-button qa-form-light-button-hide">
<input name="q_doanswer" id="q_doanswer" onclick="return qa_toggle_element('anew')" value="answer" title="Answer this question" type="submit" class="qa-form-light-button qa-form-light-button-answer">
<input name="q_docomment" onclick="return qa_toggle_element('c2231')" value="comment" title="Add a comment on this question" type="submit" class="qa-form-light-button qa-form-light-button-comment">
<input name="dosomethingq" value="-" title="Hi! This is a custom button created by a plugin." type="submit" class="qa-form-light-button qa-form-light-button-custombtn">
<input name="custom_postid" type="hidden" value="2231" title="" class="qa-form-light-button qa-form-light-button-hidden_id">
</div>

1 Answer

+1 vote
by
You won't find this as a single block of code as shown.

If you look in qa-theme-base.php you will find a number of functions that are used to build the code you are looking for.

for example the start of the code you are looking for begins at

        function q_view_buttons($q_view)
        {
            if (!empty($q_view['form'])) {
                $this->output('<div class="qa-q-view-buttons">');
                $this->form($q_view['form']);
                $this->output('</div>');
            }
        }

The rest you can find by tracking through the other functions.

To make any changes you can modify any of the functions in qa-theme-base.php by including them - with your changes -in your theme qa-theme.php file.

This way you can modify Q2A without making changes to the core files.

Montyand Bex
by
Thanks, I saw that but, it's the  $this->form($q_view['form']); I'm having issue with. I guess this generates the inputs but, I cannot find the code so, I can edit it to include the /
by
function form_button_data($button, $key, $style)
        {
            $baseclass='qa-form-'.$style.'-button qa-form-'.$style.'-button-'.$key;
           
            $this->output('<input'.rtrim(' '.@$button['tags']).' value="'.@$button['label'].'" title="'.@$button['popup'].'" type="submit"'.
                (isset($style) ? (' class="'.$baseclass.'"') : '').'/>');
        }

Look at the final '/>' in this function

Monty and Bex
by
Perfect thanks!
...