diff options
author | Greg Aker <greg.aker@ellislab.com> | 2010-04-20 19:45:14 +0200 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2010-04-20 19:45:14 +0200 |
commit | 60e78c75f9cb332dcd5a387bf4262c1566f32b8e (patch) | |
tree | a0c35a0d9e48e7e97394b46bc901136154321544 | |
parent | ff3ecaede7e7154d1897307a390919b655b15096 (diff) |
Modifying smiley_js() in the smiley helper to add optional third parameter to return only the javascript with no script tags.
-rw-r--r-- | system/helpers/smiley_helper.php | 11 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 775cc1b99..b9eb0a23e 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -40,7 +40,7 @@ */ if ( ! function_exists('smiley_js')) { - function smiley_js($alias = '', $field_id = '') + function smiley_js($alias = '', $field_id = '', $inline = TRUE) { static $do_setup = TRUE; @@ -108,7 +108,14 @@ EOF; } } - return '<script type="text/javascript" charset="utf-8">/*<![CDATA[ */'.$r.'// ]]></script>'; + if ($inline) + { + return '<script type="text/javascript" charset="utf-8">/*<![CDATA[ */'.$r.'// ]]></script>'; + } + else + { + return $r; + } } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 25b3b1744..53bf395df 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -120,6 +120,7 @@ Hg Tag: </p> <li>Added alpha, and sha1 string types to <kbd>random_string()</kbd> in the <a href="helpers/string_helper.html">String Helper</a>.</li> <li>Modified <kbd>prep_url()</kbd> so as to not prepend http:// if the supplied string already has a scheme.</li> <li>Modified <kbd>get_file_info</kbd> in the file helper, changing filectime() to filemtime() for dates.</li> + <li>Modified <kbd>smiley_js()</kbd> to add optional third parameter to return only the javascript with no script tags.</li> </ul> </li> <li>Other Changes |