diff options
author | mrjive <mrjive@mrjive.it> | 2018-04-19 09:51:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 09:51:58 +0200 |
commit | c8ff773b9609f723217712f0faf451238d41327d (patch) | |
tree | 4127afeee7d8a3b710863d9ad022fed2b82a8ebc /include/text.php | |
parent | 283e5d3a5c9557195a640de5f0acefc884e904bb (diff) | |
parent | 92b08f1f07a25976342dc885331ecb1531e256aa (diff) | |
download | volse-hubzilla-c8ff773b9609f723217712f0faf451238d41327d.tar.gz volse-hubzilla-c8ff773b9609f723217712f0faf451238d41327d.tar.bz2 volse-hubzilla-c8ff773b9609f723217712f0faf451238d41327d.zip |
Merge pull request #9 from redmatrix/dev
Dev
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php index 13c4bb819..55fc49560 100644 --- a/include/text.php +++ b/include/text.php @@ -531,7 +531,7 @@ function paginate(&$a) { } -function alt_pager(&$a, $i, $more = '', $less = '') { +function alt_pager($i, $more = '', $less = '') { if(! $more) $more = t('older'); @@ -2324,6 +2324,23 @@ function stringify_array_elms(&$arr, $escape = false) { $arr[$x] = "'" . (($escape) ? dbesc($arr[$x]) : $arr[$x]) . "'"; } + +/** + * @brief Similar to stringify_array_elms but returns a string. If $escape is true, dbesc() each element before adding quotes. + * + * @param array $arr + * @param boolean $escape (optional) default false + * @return string + */ +function stringify_array($arr, $escape = false) { + if($arr) { + stringify_array_elms($arr); + return(implode(',',$arr)); + } + return EMPTY_STR; +} + + /** * @brief Indents a flat JSON string to make it more human-readable. * @@ -2387,7 +2404,7 @@ function jindent($json) { */ function design_tools() { - $channel = App::get_channel(); + $channel = channelx_by_n(App::$profile['profile_uid']); $sys = false; if(App::$is_sys && is_site_admin()) { |