Changeset 5653 in subversion
- Timestamp:
- Dec 26, 2011 10:40:37 AM (17 months ago)
- Location:
- trunk/roundcubemail/program/include
- Files:
-
- 2 edited
-
html.php (modified) (4 diffs)
-
rcube_html_page.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/html.php
r5532 r5653 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 } -
trunk/roundcubemail/program/include/rcube_html_page.php
r5135 r5653 32 32 protected $scripts = array(); 33 33 protected $charset = RCMAIL_CHARSET; 34 35 protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s\"></script>\n";36 protected $script_tag = "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>\n";37 protected $link_css_file = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n";38 34 protected $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>"; 39 35 … … 196 192 if (is_array($this->script_files['head'])) { 197 193 foreach ($this->script_files['head'] as $file) { 198 $page_header .= sprintf($this->script_tag_file,$file);194 $page_header .= html::script($file); 199 195 } 200 196 } … … 202 198 $head_script = $this->scripts['head_top'] . $this->scripts['head']; 203 199 if (!empty($head_script)) { 204 $page_header .= sprintf($this->script_tag, $head_script);200 $page_header .= html::script(array(), $head_script); 205 201 } 206 202 … … 216 212 if (is_array($this->script_files['foot'])) { 217 213 foreach ($this->script_files['foot'] as $file) { 218 $page_footer .= sprintf($this->script_tag_file,$file);214 $page_footer .= html::script($file); 219 215 } 220 216 } … … 225 221 226 222 if (!empty($this->scripts['foot'])) { 227 $page_footer .= sprintf($this->script_tag, $this->scripts['foot']);223 $page_footer .= html::script(array(), $this->scripts['foot']); 228 224 } 229 225 … … 267 263 $css = ''; 268 264 foreach ($this->css_files as $file) { 269 $css .= sprintf($this->link_css_file, $file);265 $css .= html::tag('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $file, 'nl' => true)); 270 266 } 271 267 $output = substr_replace($output, $css, $pos, 0);
Note: See TracChangeset
for help on using the changeset viewer.
