-function RemoveSlashes(&$array) {
- foreach ($array as $k => $v) {
- global $$k;
- if (is_array($$k)) {
- foreach ($$k as $k2 => $v2) {
- $newArray[stripslashes($k2)] = stripslashes($v2);
- }
- $$k = $newArray;
- } else {
- $$k = stripslashes($v);
- }
-
- /* Re-assign back to the array. */
- $array[$k] = $$k;
+function makeComposeLink($url, $text = null, $target='')
+{
+ global $compose_new_win,$javascript_on;
+
+ if(!$text) {
+ $text = _("Compose");
+ }
+
+
+ // if not using "compose in new window", make
+ // regular link and be done with it
+ if($compose_new_win != '1') {
+ return makeInternalLink($url, $text, $target);
+ }
+
+
+ // build the compose in new window link...
+
+
+ // if javascript is on, use onClick event to handle it
+ if($javascript_on) {
+ sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
+ return '<a href="javascript:void(0)" onclick="comp_in_new(\''.$base_uri.$url.'\')">'. $text.'</a>';
+ }
+
+
+ // otherwise, just open new window using regular HTML
+ return makeInternalLink($url, $text, '_blank');
+
+}
+
+/**
+ * sm_print_r($some_variable, [$some_other_variable [, ...]]);
+ * Debugging function - does the same as print_r, but makes sure special
+ * characters are converted to htmlentities first. This will allow
+ * values like <some@email.address> to be displayed.
+ * The output is wrapped in <pre> and </pre> tags.
+ *
+ * @return void
+ */
+function sm_print_r() {
+ ob_start(); // Buffer output
+ foreach(func_get_args() as $var) {
+ print_r($var);
+ echo "\n";