Changeset 011e805 in github for program/include/html.php
- Timestamp:
- Dec 26, 2011 10:40:37 AM (17 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
- Children:
- fe1bd5f
- Parents:
- 5e8c772
- File:
-
- 1 edited
-
program/include/html.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/html.php
rf230739 r011e805 6 6 | | 7 7 | This file is part of the Roundcube Webmail client | 8 | Copyright (C) 2005-201 0, The Roundcube Dev Team |8 | Copyright (C) 2005-2011, The Roundcube Dev Team | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 81 81 $tagname = self::$lc_tags ? strtolower($tagname) : $tagname; 82 82 if (isset($content) || in_array($tagname, self::$containers)) { 83 $ templ = $attrib['noclose'] ? "<%s%s>%s" : "<%s%s>%s</%s>%s";84 unset($attrib['noclose'] );85 return sprintf($templ, $tagname, self::attrib_string($attrib, $allowed_attrib), $content, $tagname, $suffix);83 $suffix = $attrib['noclose'] ? $suffix : '</' . $tagname . '>' . $suffix; 84 unset($attrib['noclose'], $attrib['nl']); 85 return '<' . $tagname . self::attrib_string($attrib, $allowed_attrib) . '>' . $content . $suffix; 86 86 } 87 87 else { 88 return sprintf("<%s%s />%s", $tagname, self::attrib_string($attrib, $allowed_attrib), $suffix);88 return '<' . $tagname . self::attrib_string($attrib, $allowed_attrib) . '>' . $suffix; 89 89 } 90 90 } … … 220 220 } 221 221 return self::tag('iframe', $attr, $cont, array_merge(self::$common_attrib, 222 array('src','name','width','height','border','frameborder'))); 222 array('src','name','width','height','border','frameborder'))); 223 } 224 225 /** 226 * Derrived method to create <script> tags 227 * 228 * @param mixed $attr Hash array with tag attributes or string with script source (src) 229 * @return string HTML code 230 * @see html::tag() 231 */ 232 public static function script($attr, $cont = null) 233 { 234 if (is_string($attr)) { 235 $attr = array('src' => $attr); 236 } 237 if ($cont) { 238 if (self::$doctype == 'xhtml') 239 $cont = "\n/* <![CDATA[ */\n" . $cont . "\n/* ]]> */\n"; 240 else 241 $cont = "\n" . $cont . "\n"; 242 } 243 244 return self::tag('script', $attr + array('type' => 'text/javascript', 'nl' => true), 245 $cont, array_merge(self::$common_attrib, array('src','type','charset'))); 223 246 } 224 247 … … 268 291 if (in_array($key, array('checked', 'multiple', 'disabled', 'selected'))) { 269 292 if ($value) { 270 $attrib_arr[] = sprintf('%s="%s"', $key, $key);293 $attrib_arr[] = $key . '="' . $key . '"'; 271 294 } 272 295 } 273 296 else if ($key=='value') { 274 $attrib_arr[] = sprintf('%s="%s"', $key, Q($value, 'strict', false));297 $attrib_arr[] = $key . '="' . Q($value, 'strict', false) . '"'; 275 298 } 276 299 else { 277 $attrib_arr[] = sprintf('%s="%s"', $key, Q($value));300 $attrib_arr[] = $key . '="' . Q($value) . '"'; 278 301 } 279 302 }
Note: See TracChangeset
for help on using the changeset viewer.
