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>';
}
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>';
}
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>';
}
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";
}
protected function add_row_cells($capability) {
+ global $OUTPUT;
if ($this->hascap) {
$result = $this->stryes;
$tooltip = 'whydoesuserhavecap';
$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>';
}
}
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];
}
}
protected function print_field($name, $caption, $field) {
+ global $OUTPUT;
// Attempt to generate HTML like formslib.
echo '<div class="fitem">';
echo '<div class="fitemtitle">';
}
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>';