MDL-19787 Upgraded calls to link_to_popup_window()

This commit is contained in:
nicolasconnault 2009-08-20 13:13:50 +00:00
parent d08472fc5b
commit 04eb4d1ebb
3 changed files with 30 additions and 11 deletions

View File

@ -841,7 +841,9 @@
echo '</form>';
$preview_url = lang_help_preview_url($currentfile, !$uselocal);
if ($preview_url) {
link_to_popup_window($preview_url, 'popup', get_string('preview'));
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
echo $OUTPUT->link($link);
}
echo '</fieldset>';
}
@ -859,7 +861,9 @@
echo "</textarea>\n</div>\n";
$preview_url = lang_help_preview_url($currentfile, $uselocal);
if ($preview_url) {
link_to_popup_window($preview_url, 'popup', get_string('preview'));
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
echo $OUTPUT->link($link);
}
echo '</fieldset>';
}
@ -881,7 +885,9 @@
echo "</textarea>\n</div>\n";
$preview_url = lang_help_preview_url($currentfile, true, 'en_utf8'); // do not display en_utf8_local
if ($preview_url) {
link_to_popup_window($preview_url, 'popup', get_string('preview'));
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
echo $OUTPUT->link($link);
}
echo '</fieldset>';
}

View File

@ -67,10 +67,14 @@ print_tabs(array($tabs), 'mnetthemes');
if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) {
$readme = '<li>'.
link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
$link = html_link::make($CFG->themewww .'/'. $theme .'/README.html', $strinfo);
$link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
echo $OUTPUT->link($link);
} else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) {
$readme = '<li>'.
link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
$link = html_link::make($CFG->themewww .'/'. $theme .'/README.txt', $strinfo);
$link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
echo $OUTPUT->link($link);
}
if (file_exists("$theme/screenshot.png")) {
$screenshotpath = "$theme/screenshot.png";

View File

@ -238,6 +238,7 @@ class explain_capability_table extends capability_table_base {
}
protected function add_row_cells($capability) {
global $OUTPUT;
if ($this->hascap) {
$result = $this->stryes;
$tooltip = 'whydoesuserhavecap';
@ -251,8 +252,12 @@ class explain_capability_table extends capability_table_base {
$a->context = $this->contextname;
echo '<td>' . $result . '</td>';
echo '<td>';
link_to_popup_window($this->baseurl . $capability->name, 'hascapabilityexplanation',
$this->strexplanation, 600, 600, get_string($tooltip, 'role', $a));
$link = html_link::make($this->baseurl . $capability->name, $this->strexplanation);
$link->add_action(new popup_action('click', $link->url, 'hascapabilityexplanation', array('height' => 600, 'width' => 600)));
$link->title = get_string($tooltip, 'role', $a);
echo $OUTPUT->link($link);
echo '</td>';
}
}
@ -417,9 +422,12 @@ abstract class capability_table_with_risks extends capability_table_base {
global $OUTPUT;
if (!isset($this->riskicons[$type])) {
$iconurl = $OUTPUT->old_icon_url('i/' . str_replace('risk', 'risk_', $type));
$this->riskicons[$type] = link_to_popup_window($this->risksurl, 'docspopup',
'<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />',
0, 0, get_string($type, 'admin'), null, true);
$link = html_link::make($this->risksurl, 'docspopup', '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />');
$link->add_action(new popup_action('click', $link->url, 'docspopup'));
$link->title = get_string($type, 'admin');
$this->riskicons[$type] = $OUTPUT->link($link);
}
return $this->riskicons[$type];
}
@ -658,6 +666,7 @@ class define_role_table_advanced extends capability_table_with_risks {
}
protected function print_field($name, $caption, $field) {
global $OUTPUT;
// Attempt to generate HTML like formslib.
echo '<div class="fitem">';
echo '<div class="fitemtitle">';
@ -676,7 +685,7 @@ class define_role_table_advanced extends capability_table_with_risks {
}
echo '<div class="felement' . $extraclass . '">';
if (isset($this->errors[$name])) {
formerr($this->errors[$name]);
echo $OUTPUT->error_text($this->errors[$name]);
}
echo $field;
echo '</div>';