gehe zur Dokumentation dieser Datei
41 require_once(SMARTY_PLUGINS_DIR .
'shared.escape_special_chars.php');
51 $basedir = isset($_SERVER[
'DOCUMENT_ROOT']) ? $_SERVER[
'DOCUMENT_ROOT'] :
'';
52 foreach ($params as $_key => $_val) {
64 if (!is_array($_val)) {
65 $$_key = smarty_function_escape_special_chars($_val);
67 throw new SmartyException (
"html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
73 $prefix =
'<a href="' . $_val .
'">';
78 if (!is_array($_val)) {
79 $extra .=
' ' . $_key .
'="' . smarty_function_escape_special_chars($_val) .
'"';
81 throw new SmartyException (
"html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
88 trigger_error(
"html_image: missing 'file' parameter", E_USER_NOTICE);
93 if ($file[0] ==
'/') {
94 $_image_path = $basedir . $file;
100 if (stripos($params[
'file'],
'file://') === 0) {
101 $params[
'file'] = substr($params[
'file'], 7);
104 $protocol = strpos($params[
'file'],
'://');
105 if ($protocol !==
false) {
106 $protocol = strtolower(substr($params[
'file'], 0, $protocol));
109 if (isset($template->smarty->security_policy)) {
112 if (!$template->smarty->security_policy->isTrustedUri($params[
'file'])) {
117 if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) {
123 if (!isset($params[
'width']) || !isset($params[
'height'])) {
125 if (!$_image_data = @getimagesize($_image_path)) {
126 if (!file_exists($_image_path)) {
127 trigger_error(
"html_image: unable to find '$_image_path'", E_USER_NOTICE);
130 } elseif (!is_readable($_image_path)) {
131 trigger_error(
"html_image: unable to read '$_image_path'", E_USER_NOTICE);
135 trigger_error(
"html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
141 if (!isset($params[
'width'])) {
142 $width = $_image_data[0];
144 if (!isset($params[
'height'])) {
145 $height = $_image_data[1];
149 if (isset($params[
'dpi'])) {
150 if (strstr($_SERVER[
'HTTP_USER_AGENT'],
'Mac')) {
157 $_resize = $dpi_default / $params[
'dpi'];
158 $width = round($width * $_resize);
159 $height = round($height * $_resize);
162 return $prefix .
'<img src="' . $path_prefix . $file .
'" alt="' . $alt .
'" width="' . $width .
'" height="' . $height .
'"' . $extra .
' />' . $suffix;
Sie sind hier: Home » MyOOS Benutzerhandbuch » Smarty
Korrekturen, Hinweise und Ergänzungen
Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag
Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.