diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-05-17 15:54:35 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-05-17 15:54:35 +0200 |
commit | 76c5185c6ed8c44cb0f249afd72677627d54ff3c (patch) | |
tree | db10cc2cc30f731ac8625117f08ad8855efdf816 /system/helpers/smiley_helper.php | |
parent | 714252bf88306839484579059e3a447dd93d55c1 (diff) | |
parent | e30b3f7afafa2c016cf78cc8bb8a457c2dbcda8c (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/helpers/smiley_helper.php')
-rw-r--r-- | system/helpers/smiley_helper.php | 103 |
1 files changed, 40 insertions, 63 deletions
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 638100e9c..5e6de08af 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -37,18 +37,19 @@ // ------------------------------------------------------------------------ -/** - * Smiley Javascript - * - * Returns the javascript required for the smiley insertion. Optionally takes - * an array of aliases to loosely couple the smiley array to the view. - * - * @param mixed alias name or array of alias->field_id pairs - * @param string field_id if alias name was passed in - * @return array - */ if ( ! function_exists('smiley_js')) { + /** + * Smiley Javascript + * + * Returns the javascript required for the smiley insertion. Optionally takes + * an array of aliases to loosely couple the smiley array to the view. + * + * @param mixed alias name or array of alias->field_id pairs + * @param string field_id if alias name was passed in + * @param bool + * @return array + */ function smiley_js($alias = '', $field_id = '', $inline = TRUE) { static $do_setup = TRUE; @@ -118,17 +119,20 @@ EOF; // ------------------------------------------------------------------------ -/** - * Get Clickable Smileys - * - * Returns an array of image tag links that can be clicked to be inserted - * into a form field. - * - * @param string the URL to the folder containing the smiley images - * @return array - */ + if ( ! function_exists('get_clickable_smileys')) { + /** + * Get Clickable Smileys + * + * Returns an array of image tag links that can be clicked to be inserted + * into a form field. + * + * @param string the URL to the folder containing the smiley images + * @param array + * @param array + * @return array + */ function get_clickable_smileys($image_url, $alias = '', $smileys = NULL) { // For backward compatibility with js_insert_smiley @@ -166,17 +170,18 @@ if ( ! function_exists('get_clickable_smileys')) // ------------------------------------------------------------------------ -/** - * Parse Smileys - * - * Takes a string as input and swaps any contained smileys for the actual image - * - * @param string the text to be parsed - * @param string the URL to the folder containing the smiley images - * @return string - */ if ( ! function_exists('parse_smileys')) { + /** + * Parse Smileys + * + * Takes a string as input and swaps any contained smileys for the actual image + * + * @param string the text to be parsed + * @param string the URL to the folder containing the smiley images + * @param array + * @return string + */ function parse_smileys($str = '', $image_url = '', $smileys = NULL) { if ($image_url == '' OR ( ! is_array($smileys) && FALSE === ($smileys = _get_smiley_array()))) @@ -198,15 +203,15 @@ if ( ! function_exists('parse_smileys')) // ------------------------------------------------------------------------ -/** - * Get Smiley Array - * - * Fetches the config/smiley.php file - * - * @return mixed - */ if ( ! function_exists('_get_smiley_array')) { + /** + * Get Smiley Array + * + * Fetches the config/smiley.php file + * + * @return mixed + */ function _get_smiley_array() { if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) @@ -222,33 +227,5 @@ if ( ! function_exists('_get_smiley_array')) } } -// ------------------------------------------------------------------------ - -/** - * JS Insert Smiley - * - * Generates the javascript function needed to insert smileys into a form field - * - * DEPRECATED as of version 1.7.2, use smiley_js instead - * - * @param string form name - * @param string field name - * @return string - */ -if ( ! function_exists('js_insert_smiley')) -{ - function js_insert_smiley($form_name = '', $form_field = '') - { - return <<<EOF -<script type="text/javascript"> - function insert_smiley(smiley) - { - document.{$form_name}.{$form_field}.value += " " + smiley; - } -</script> -EOF; - } -} - /* End of file smiley_helper.php */ /* Location: ./system/helpers/smiley_helper.php */
\ No newline at end of file |