From b8c283a695c8074a57d8c3dfa00934312638931d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:02:53 -0700 Subject: Dropping unecessary php: directive to function definitions in user guide --- user_guide_src/source/helpers/smiley_helper.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 7069b465e..cfb4acb98 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -107,7 +107,7 @@ To map the alias to the field id, pass them both into the get_clickable_smileys() ======================= -.. php:function:: get_clickable_smileys($image_url, $alias = '', $smileys = NULL) +.. function:: get_clickable_smileys($image_url, $alias = '', $smileys = NULL) :param string $image_url: URL path to the smileys directory :param string $alias: Field alias @@ -124,7 +124,7 @@ Example:: smiley_js() =========== -.. php:function:: smiley_js($alias = '', $field_id = '', $inline = TRUE) +.. function:: smiley_js($alias = '', $field_id = '', $inline = TRUE) :param string $alias: Field alias :param string $field_id: Field ID @@ -143,7 +143,7 @@ Example:: parse_smileys() =============== -.. php:function:: parse_smileys($str = '', $image_url = '', $smileys = NULL) +.. function:: parse_smileys($str = '', $image_url = '', $smileys = NULL) :param string $str: Text containing smiley codes :param string $image_url: URL path to the smileys directory -- cgit v1.2.3-24-g4f1b From 123bb20c52e0e9d6a622e14bac33e05b10ffc013 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:37:51 -0700 Subject: Updating user guide :php:func: refs to :func: --- user_guide_src/source/helpers/smiley_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index cfb4acb98..3fad253b2 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -46,7 +46,7 @@ The Controller In your `application/controllers/` folder, create a file called smileys.php and place the code below in it. -.. important:: Change the URL in the :php:func:`get_clickable_smileys()` +.. important:: Change the URL in the :func:`get_clickable_smileys()` function below so that it points to your smiley folder. You'll notice that in addition to the smiley helper, we are also using @@ -100,7 +100,7 @@ links a generic name that will be tied to a specific id in your view. $image_array = get_smiley_links("http://example.com/images/smileys/", "comment_textarea_alias"); To map the alias to the field id, pass them both into the -:php:func:`smiley_js()` function:: +:func:`smiley_js()` function:: $image_array = smiley_js("comment_textarea_alias", "comments"); -- cgit v1.2.3-24-g4f1b From f33091fa39002415f0fe91ffd48ffba0f2395299 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:44:19 -0700 Subject: Update Smiley helper docs --- user_guide_src/source/helpers/smiley_helper.rst | 59 +++++++++++++------------ 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 3fad253b2..a42440f2a 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -5,7 +5,12 @@ Smiley Helper The Smiley Helper file contains functions that let you manage smileys (emoticons). -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + +
Loading this Helper =================== @@ -104,61 +109,57 @@ To map the alias to the field id, pass them both into the $image_array = smiley_js("comment_textarea_alias", "comments"); -get_clickable_smileys() -======================= +Available Functions +=================== -.. function:: get_clickable_smileys($image_url, $alias = '', $smileys = NULL) +.. function:: get_clickable_smileys($image_url[, $alias = ''[, $smileys = NULL]]) :param string $image_url: URL path to the smileys directory :param string $alias: Field alias :returns: array -Returns an array containing your smiley images wrapped in a clickable -link. You must supply the URL to your smiley folder and a field id or -field alias. + Returns an array containing your smiley images wrapped in a clickable + link. You must supply the URL to your smiley folder and a field id or + field alias. -Example:: + Example:: - $image_array = get_smiley_links("http://example.com/images/smileys/", "comment"); + $image_array = get_smiley_links("http://example.com/images/smileys/", "comment"); -smiley_js() -=========== -.. function:: smiley_js($alias = '', $field_id = '', $inline = TRUE) +.. function:: smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]]) :param string $alias: Field alias :param string $field_id: Field ID :param bool $inline: Whether we're inserting an inline smiley -Generates the JavaScript that allows the images to be clicked and -inserted into a form field. If you supplied an alias instead of an id -when generating your smiley links, you need to pass the alias and -corresponding form id into the function. This function is designed to be -placed into the area of your web page. + Generates the JavaScript that allows the images to be clicked and + inserted into a form field. If you supplied an alias instead of an id + when generating your smiley links, you need to pass the alias and + corresponding form id into the function. This function is designed to be + placed into the area of your web page. -Example:: + Example:: - + -parse_smileys() -=============== -.. function:: parse_smileys($str = '', $image_url = '', $smileys = NULL) +.. function:: parse_smileys([$str = ''[, $image_url = ''[, $smileys = NULL]]]) :param string $str: Text containing smiley codes :param string $image_url: URL path to the smileys directory :param array $smileys: An array of smileys :returns: string -Takes a string of text as input and replaces any contained plain text -smileys into the image equivalent. The first parameter must contain your -string, the second must contain the URL to your smiley folder + Takes a string of text as input and replaces any contained plain text + smileys into the image equivalent. The first parameter must contain your + string, the second must contain the URL to your smiley folder -Example:: + Example:: - $str = 'Here are some simileys: :-) ;-)'; - $str = parse_smileys($str, "http://example.com/images/smileys/"); - echo $str; + $str = 'Here are some simileys: :-) ;-)'; + $str = parse_smileys($str, "http://example.com/images/smileys/"); + echo $str; .. |smile!| image:: ../images/smile.gif \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 2efd1f25ce59b917fdd8eebf1bd959f4eca7d904 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 6 Aug 2013 17:31:48 +0200 Subject: Fix various typos --- user_guide_src/source/helpers/smiley_helper.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index a42440f2a..7ac91c345 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -22,7 +22,7 @@ This helper is loaded using the following code:: Overview ======== -The Smiley helper has a renderer that takes plain text simileys, like +The Smiley helper has a renderer that takes plain text smileys, like :-) and turns them into a image representation, like |smile!| It also lets you display a set of smiley images that when clicked will @@ -49,7 +49,7 @@ The Controller -------------- In your `application/controllers/` folder, create a file called -smileys.php and place the code below in it. +Smileys.php and place the code below in it. .. important:: Change the URL in the :func:`get_clickable_smileys()` function below so that it points to your smiley folder. @@ -157,7 +157,7 @@ Available Functions Example:: - $str = 'Here are some simileys: :-) ;-)'; + $str = 'Here are some smileys: :-) ;-)'; $str = parse_smileys($str, "http://example.com/images/smileys/"); echo $str; -- cgit v1.2.3-24-g4f1b From 1c75780da904b2a56c30c693fc3e03d2145614c2 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 6 Aug 2013 20:25:14 +0200 Subject: Fix a few more merge conflicts --- user_guide_src/source/helpers/smiley_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 7ac91c345..0601f0244 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -48,7 +48,7 @@ View as described. The Controller -------------- -In your `application/controllers/` folder, create a file called +In your **application/controllers/** directory, create a file called Smileys.php and place the code below in it. .. important:: Change the URL in the :func:`get_clickable_smileys()` @@ -75,7 +75,7 @@ the :doc:`Table Class <../libraries/table>`:: } -In your `application/views/` folder, create a file called `smiley_view.php` +In your **application/views/** folder, create a file called **smiley_view.php** and place this code in it:: -- cgit v1.2.3-24-g4f1b From 3de130c2da3b93a3404f264e92d7b65354de3548 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Feb 2014 23:31:49 +0200 Subject: [ci skip] Add return types to helper docs (+ some other formatting) --- user_guide_src/source/helpers/smiley_helper.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'user_guide_src/source/helpers/smiley_helper.rst') diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 077c56a17..b98084089 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -116,7 +116,8 @@ Available Functions :param string $image_url: URL path to the smileys directory :param string $alias: Field alias - :returns: array + :returns: An array of ready to use smileys + :rtype: array Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder and a field id or @@ -124,14 +125,15 @@ Available Functions Example:: - $image_array = get_smiley_links("http://example.com/images/smileys/", "comment"); - + $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comment'); .. function:: smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]]) :param string $alias: Field alias :param string $field_id: Field ID :param bool $inline: Whether we're inserting an inline smiley + :returns: Smiley-enabling JavaScript code + :rtype: string Generates the JavaScript that allows the images to be clicked and inserted into a form field. If you supplied an alias instead of an id @@ -143,13 +145,13 @@ Available Functions - .. function:: parse_smileys([$str = ''[, $image_url = ''[, $smileys = NULL]]]) :param string $str: Text containing smiley codes :param string $image_url: URL path to the smileys directory :param array $smileys: An array of smileys - :returns: string + :returns: Parsed smileys + :rtype: string Takes a string of text as input and replaces any contained plain text smileys into the image equivalent. The first parameter must contain your -- cgit v1.2.3-24-g4f1b