summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-09 08:40:15 -0700
committerBrion Vibber <brion@pobox.com>2010-04-09 08:40:15 -0700
commit1f8451f4aa9128e55d4b274faf7f0cd19d56e2b8 (patch)
tree3b3d27baa6a9fce818e858073a37ba7f88524718 /lib/util.php
parent857db1fabe8dc1d4420abad74d574c536b120ad5 (diff)
parent2be04e2a631ea9f373386bed792e7233418e2ee2 (diff)
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index ec1f86703..c120fa376 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -862,7 +862,14 @@ function common_xml_safe_str($str)
function common_tag_link($tag)
{
$canonical = common_canonical_tag($tag);
- $url = common_local_url('tag', array('tag' => $canonical));
+ if (common_config('singleuser', 'enabled')) {
+ // regular TagAction isn't set up in 1user mode
+ $url = common_local_url('showstream',
+ array('nickname' => common_config('singleuser', 'nickname'),
+ 'tag' => $canonical));
+ } else {
+ $url = common_local_url('tag', array('tag' => $canonical));
+ }
$xs = new XMLStringer();
$xs->elementStart('span', 'tag');
$xs->element('a', array('href' => $url,
@@ -1272,12 +1279,38 @@ function common_mtrand($bytes)
return $enc;
}
+/**
+ * Record the given URL as the return destination for a future
+ * form submission, to be read by common_get_returnto().
+ *
+ * @param string $url
+ *
+ * @fixme as a session-global setting, this can allow multiple forms
+ * to conflict and overwrite each others' returnto destinations if
+ * the user has multiple tabs or windows open.
+ *
+ * Should refactor to index with a token or otherwise only pass the
+ * data along its intended path.
+ */
function common_set_returnto($url)
{
common_ensure_session();
$_SESSION['returnto'] = $url;
}
+/**
+ * Fetch a return-destination URL previously recorded by
+ * common_set_returnto().
+ *
+ * @return mixed URL string or null
+ *
+ * @fixme as a session-global setting, this can allow multiple forms
+ * to conflict and overwrite each others' returnto destinations if
+ * the user has multiple tabs or windows open.
+ *
+ * Should refactor to index with a token or otherwise only pass the
+ * data along its intended path.
+ */
function common_get_returnto()
{
common_ensure_session();