MDL-19799 Upgraded calls to link_to_popup_window()

This commit is contained in:
nicolasconnault
2009-08-20 13:18:08 +00:00
parent 5a142c8221
commit 3bd6b994fc
6 changed files with 23 additions and 14 deletions
+3 -3
View File
@@ -300,9 +300,9 @@ function displaydir($file_info) {
}
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\" />&nbsp;",
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\" />&nbsp;");
$link->add_action(new popup_action('click', $link->url, 'display', array('height' => 480, 'width' => 640)));
$viewurl = "&nbsp;".$OUTPUT->link($link);
} else {
$viewurl = '';
}
+3 -2
View File
@@ -1836,6 +1836,7 @@ function page_id_and_class(&$getid, &$getclass) {
* @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);
}
@@ -2447,7 +2448,7 @@ function link_to_popup_window ($url, $name=null, $linkname=null,
$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;
@@ -2515,7 +2516,7 @@ function button_to_popup_window ($url, $name=null, $linkname=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;
+7 -4
View File
@@ -101,7 +101,7 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group {
}
function _createElements() {
global $CFG;
global $CFG, $OUTPUT;
$this->_elements = array();
// Official tags.
@@ -112,8 +112,11 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group {
// 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.
@@ -246,4 +249,4 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group {
return array($this->getName() => $tags);
}
}
?>
?>
+1 -1
View File
@@ -75,7 +75,7 @@ class moodle_html_component {
*/
public static function clean_classes($classes) {
if (empty($classes)) {
return '';
return array();
} else if (is_array($classes)) {
return $classes;
} else {
+1 -1
View File
@@ -104,7 +104,7 @@ define("QUESTION_NUMANS_ADD", 3);
/**
* 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
+8 -3
View File
@@ -2971,8 +2971,10 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
$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 .'&amp;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;
@@ -3060,7 +3062,10 @@ function editorhelpbutton(){
$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);
}
/**