summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-05-31 21:14:27 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-05-31 21:14:27 +0000
commita597354bcb48536f2c7633d53c78fa931b186c20 (patch)
tree34e16a5b178faf3047963cddfdec084bfeceb8cb /includes
parent025bca28aa1717459c811744704e0c1b514d1e1e (diff)
downloadbrdo-a597354bcb48536f2c7633d53c78fa931b186c20.tar.gz
brdo-a597354bcb48536f2c7633d53c78fa931b186c20.tar.bz2
- Code cleanup: improve format_plural usage, add some missing placeholder/check calls, and introduce API for <link> tags.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc9
-rw-r--r--includes/theme.inc2
2 files changed, 9 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index b7210f668..bae9c2554 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1613,7 +1613,6 @@ function drupal_attributes($attributes = array()) {
foreach ($attributes as $key => $value) {
$t[] = $key .'="'. check_plain($value) .'"';
}
-
return ' '. implode($t, ' ');
}
}
@@ -1974,6 +1973,14 @@ if (version_compare(phpversion(), '5.0') < 0) {
}
/**
+ * Add a <link> tag to the page's HEAD.
+ */
+function drupal_add_link($attributes) {
+ drupal_set_html_head('<link'. drupal_attributes($attributes) .">\n");
+}
+
+
+/**
* Add a JavaScript file to the output.
*
* The first time this function is invoked per page request,
diff --git a/includes/theme.inc b/includes/theme.inc
index 6f90399d7..fa3a646aa 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -501,7 +501,7 @@ function theme_links($links, $delimiter = ' | ') {
function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
if (!$getsize || (file_exists($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
$attributes = drupal_attributes($attributes);
- return "<img src=\"$path\" alt=\"$alt\" title=\"$title\" $image_attributes $attributes />";
+ return '<img src="'. check_url($path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .'/>';
}
}