$this->output_tag('span', array('class' => 'accesshide'), $target->text));
}
- /**
- * Given a html_textarea object, outputs an <a> tag that uses the object's attributes.
- *
- * @param mixed $link A html_link object or a string URL (text param required in second case)
- * @param string $text A descriptive text for the link. If $link is a html_link, this is not required.
- * @return string HTML fragment
- */
- public function textarea($textarea) {
-
- }
-
/**
* Given a html_link object, outputs an <a> tag that uses the object's attributes.
*
$attributes = array();
if (is_a($link, 'html_link')) {
+ $link = clone($link);
$link->prepare();
$this->prepare_event_handlers($link);
$attributes['href'] = prepare_url($link->url);
*/
public function confirm($message, $continue, $cancel) {
if ($continue instanceof html_form) {
- // ok
+ $continue = clone($continue);
} else if (is_string($continue)) {
$continueform = new html_form();
$continueform->url = new moodle_url($continue);
$continueform->url = $continue;
$continue = $continueform;
} else {
- var_dump($continue);
throw new coding_exception('The continue param to $OUTPUT->confirm must be either a URL (string/moodle_url) or a html_form object.');
-
}
if ($cancel instanceof html_form) {
- //ok
+ $cancel = clone($cancel);
} else if (is_string($cancel)) {
$cancelform = new html_form();
$cancelform->url = new moodle_url($cancel);
if (empty($form->button) or !($form->button instanceof html_button)) {
throw new coding_exception('$OUTPUT->button($form) requires $form to have a button (html_button) value');
}
-
+ $form = clone($form);
$form->button->prepare();
$this->prepare_event_handlers($form->button);
* @return string HTML fragment
*/
public function form($form, $contents=null) {
+ $form = clone($form);
$form->prepare();
-
$this->prepare_event_handlers($form);
if (empty($contents) && !empty($form->button)) {
* @return string HTML fragment
*/
public function action_icon($icon) {
+ $icon = clone($icon);
$icon->prepare();
$imageoutput = $this->image($icon->image);
*/
public function help_icon($icon) {
global $COURSE;
-
+ $icon = clone($icon);
$icon->prepare();
$popup = new popup_action('click', $icon->link->url);
* @return string HTML fragment
*/
public function link_to_popup($link, $image=null) {
+ $link = clone($link);
$link->prepare();
$this->prepare_event_handlers($link);
* @return string HTML fragment
*/
public function spacer($image) {
+ $image = clone($image);
$image->prepare();
$image->add_class('spacer');
return false;
}
+ $image = clone($image);
$image->prepare();
$this->prepare_event_handlers($image);
$userpic = new user_picture();
$userpic->user = $user;
$userpic->courseid = $courseid;
+ } else {
+ $userpic = clone($userpic);
}
$userpic->prepare();
* @return string HTML structure
*/
public function htmllist($list) {
+ $list = clone($list);
$list->prepare();
$this->prepare_event_handlers($list);
} else if (!($option instanceof html_select_option)) {
throw new coding_exception('$OUTPUT->radio($option) only accepts a html_select_option object as param.');
}
-
+ $option = clone($option);
$option->prepare();
$option->label->for = $option->id;
$this->prepare_event_handlers($option);
} else if (!($option instanceof html_select_option)) {
throw new coding_exception('$OUTPUT->checkbox($option) only accepts a html_select_option object as param.');
}
-
+ $option = clone($option);
$option->prepare();
$option->label->for = $option->id;
* @return string the HTML for the <option> or <optgroup>
*/
public function select_option($option) {
+ $option = clone($option);
$option->prepare();
$this->prepare_event_handlers($option);
* @return string the HTML for the <input>
*/
public function textfield($field) {
+ $field = clone($field);
$field->prepare();
$this->prepare_event_handlers($field);
$output = $this->output_start_tag('span', array('class' => "textfield $field->name"));
* @return HTML fragment
*/
public function label($label) {
+ $label = clone($label);
$label->prepare();
$this->prepare_event_handlers($label);
return $this->output_tag('label', array('for' => $label->for, 'class' => $label->get_classes_string()), $label->text);
*/
public function paging_bar($pagingbar) {
$output = '';
-
+ $pagingbar = clone($pagingbar);
$pagingbar->prepare();
if ($pagingbar->totalcount > $pagingbar->perpage) {
* @return string the HTML to output.
*/
public function table(html_table $table) {
+ $table = clone($table);
$table->prepare();
$attributes = array(
'id' => $table->id,