function getFormButton($name, $attributes = array()) { if (is_array($this->form_buttons[$name]['attributes'])) { $attributes = array_merge((array) $attributes, (array) $this->form_buttons[$name]['attributes']); } if (!$this->form_buttons[$name]['is_picture']) { if (isset($this->form_buttons[$name]['info']) && !isset($attributes['title'])) { $attributes['title'] = $this->form_buttons[$name]['info']; } $caption = $this->form_buttons[$name]['caption'] ? $this->form_buttons[$name]['caption'] : $this->form_buttons[$name]['type']; if (in_array($this->form_buttons[$name]['type'], words('cancel accept'))) { $create = 'create' . $this->form_buttons[$name]['type']; } else { $create = 'create'; } $ret = Button::$create($caption, $this->form_name . "_" . $name, $attributes); } else { // Yes, this is kinda ugly $ret = Assets::input($this->form_buttons[$name]['type'], tooltip2($this->form_buttons[$name]['info']) + (array) $attributes + array('name' => $this->form_name . '_' . $name)); } return $ret; }
function testAssetsInput() { $this->assertEquals('<input type="image" title="Datei hochladen" class="text-bottom icon-role-clickable icon-shape-upload" width="20" height="20" src="images/icons/blue/upload.svg" alt="Datei hochladen">', Assets::input('icons/20/blue/upload', array('title' => _("Datei hochladen"), 'class' => "text-bottom"))); }
?> <input type="hidden" name="to_copy[lecturers][<?php echo $i; ?> ][]" value="<?php echo $lecturer; ?> "> <?php echo Assets::input('icons/16/black/trash.png', array('name' => 'delete_lecturer[' . $i . '][' . $lecturer . ']')); ?> <br> <? endforeach;?> <div style="float:left"> <?php echo Assets::input('icons/16/yellow/arr_2up.png', array('name' => 'add_lecturer[' . $i . ']')); ?> </div> <? echo QuickSearch::get("add_doz_" . $i, $to_copy['search_lecturer'][$i]) ->withButton(array('search_button_name' => 'search_doz', 'reset_button_name' => 'reset_search')) ->render(); ?> </div> </li> <?endfor;?> </ol> <div style="text-align:center"> <?php echo Studip\Button::createAccept(_('Kopieren'), 'do_copy'); ?>