}
if ($viewurl = $child_info->get_url()) {
- $viewurl = " ".link_to_popup_window ($viewurl, "display",
- "<img src=\"" . $OUTPUT->old_icon_url('t/preview') . "\" class=\"iconsmall\" alt=\"$strfile\" /> ",
- 480, 640, get_string('viewfileinpopup'), null, true);
+ $link = html_link::make($viewurl, "display", "<img src=\"" . $OUTPUT->old_icon_url('t/preview') . "\" class=\"iconsmall\" alt=\"$strfile\" /> ");
+ $link->add_action(new popup_action('click', $link->url, 'display', array('height' => 480, 'width' => 640)));
+ $viewurl = " ".$OUTPUT->link($link);
} else {
$viewurl = '';
}
* @param string $error The text to be displayed in red
*/
function formerr($error) {
+ debugging('formerr() has been deprecated. Please change your code to use $OUTPUT->error_text($string).');
global $OUTPUT;
echo $OUTPUT->error_text($error);
}
$options=null, $return=false) {
global $OUTPUT;
- // debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link().');
+ debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link().');
if ($options == 'none') {
$options = null;
$id=null, $class=null) {
global $OUTPUT;
- debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link_to_popup().');
+ debugging('button_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->button().');
if ($options == 'none') {
$options = null;
}
function _createElements() {
- global $CFG;
+ global $CFG, $OUTPUT;
$this->_elements = array();
// Official tags.
// If the user can manage official tags, give them a link to manage them.
$label = get_string('otags', 'tag');
if (has_capability('moodle/tag:manage', get_context_instance(CONTEXT_SYSTEM))) {
- $label .= ' (' . link_to_popup_window($CFG->wwwroot .'/tag/manage.php',
- 'managetags', get_string('manageofficialtags', 'tag'), '', '', get_string('newwindow'), null, true) . ')';
+ $link = html_link::make($CFG->wwwroot .'/tag/manage.php', get_string('manageofficialtags', 'tag'));
+ $link->add_action(new popup_action('click', $link->url, 'managetags'));
+ $link->title = get_string('newwindow');
+
+ $label .= ' (' . $OUTPUT->link($link) . ')';
}
// Get the list of official tags.
return array($this->getName() => $tags);
}
}
-?>
\ No newline at end of file
+?>
*/
public static function clean_classes($classes) {
if (empty($classes)) {
- return '';
+ return array();
} else if (is_array($classes)) {
return $classes;
} else {
/**
* The options used when popping up a question preview window in Javascript.
*/
-define('QUESTION_PREVIEW_POPUP_OPTIONS', 'scrollbars=yes,resizable=yes,width=700,height=540');
+define('QUESTION_PREVIEW_POPUP_OPTIONS', 'scrollbars=true&resizable=true&width=700&height=540');
/**#@+
* Option flags for ->optionflags
$output .= $OUTPUT->select(html_select::make($grades, $name, $current, false));
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
- $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&list=true', 'ratingscales',
- $linkobject, 400, 500, $strscales, 'none', true);
+ $link = html_link::make('/course/scales.php?id='. $courseid .'&list=true', $linkobject);
+ $link->add_action(new popup_action('click', $link->url, 'ratingscales', array('height' => 400, 'width' => 500)));
+ $link->title = $strscales;
+ $output .= $OUTPUT->link($link);
if ($return) {
return $output;
$paramstring = join('&', $urlparams);
$linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->old_icon_url('help') . '" />';
- return link_to_popup_window(s('/lib/form/editorhelp.php?'.$paramstring), 'popup', $linkobject, 400, 500, $alttag, 'none', true);
+ $link = html_link::make(s('/lib/form/editorhelp.php?'.$paramstring), $linkobject);
+ $link->add_action(new popup_action('click', $link->url, 'popup', array('height' => 400, 'width' => 500)));
+ $link->title = $alttag;
+ return $OUTPUT->link($link);
}
/**