* @var array of component_action
*/
var $helpicon = null;
+ /**
+ * @var string If set, makes button visible with given name for button
+ */
+ var $showbutton = null;
/**
* Constructor
* @param array $urls list of options
* @param string $selected selected element
* @param array $nothing
* @param string $formid
- */
- public function __construct(array $urls, $selected='', $nothing=array(''=>'choosedots'), $formid=null) {
- $this->urls = $urls;
- $this->selected = $selected;
- $this->nothing = $nothing;
- $this->formid = $formid;
+ * @param string $showbutton Set to text of button if it should be visible
+ * or null if it should be hidden (hidden version always has text 'go')
+ */
+ public function __construct(array $urls, $selected='', $nothing=array(''=>'choosedots'),
+ $formid=null, $showbutton=null) {
+ $this->urls = $urls;
+ $this->selected = $selected;
+ $this->nothing = $nothing;
+ $this->formid = $formid;
+ $this->showbutton = $showbutton;
}
/**
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
$output .= html_writer::select($urls, 'jump', $selected, $select->nothing, $select->attributes);
- $go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
- $output .= html_writer::tag('noscript', html_writer::tag('div', $go), array('style'=>'inline'));
-
- $nothing = empty($select->nothing) ? false : key($select->nothing);
- $output .= $this->page->requires->js_init_call('M.util.init_url_select', array($select->formid, $select->attributes['id'], $nothing));
+ if (!$select->showbutton) {
+ $go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
+ $output .= html_writer::tag('noscript', html_writer::tag('div', $go), array('style'=>'inline'));
+ $nothing = empty($select->nothing) ? false : key($select->nothing);
+ $output .= $this->page->requires->js_init_call('M.util.init_url_select', array($select->formid, $select->attributes['id'], $nothing));
+ } else {
+ $output .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>$select->showbutton));
+ }
// then div wrapper for xhtml strictness
$output = html_writer::tag('div', $output);
}
if (!empty($forummenu)) {
echo '<div class="movediscussionoption">';
- $select = new url_select($forummenu, '', array(''=>get_string("movethisdiscussionto", "forum")), 'forummenu');
+ $select = new url_select($forummenu, '',
+ array(''=>get_string("movethisdiscussionto", "forum")),
+ 'forummenu', get_string('move'));
echo $OUTPUT->render($select);
echo "</div>";
}