aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_url.inc.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index d290e3da1..c395f3541 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -660,6 +660,40 @@ function parse_well_known_params_url($tokens, &$i)
return $page;
}
+
+/**
+ * @param id image id
+ * @param what_part string one of 'e' (element), 'r' (representative)
+ */
+function get_action_url($id, $what_part, $download)
+{
+ $params = array(
+ 'id' => $id,
+ 'part' => $what_part,
+ );
+ if ($download)
+ {
+ $params['download'] = null;
+ }
+
+ return add_url_params(get_root_url().'action.php', $params);
+}
+
+/*
+ * @param element_info array containing element information from db;
+ * at least 'id', 'path' should be present
+ */
+function get_element_url($element_info)
+{
+ $url = $element_info['path'];
+ if ( !url_is_remote($url) )
+ {
+ $url = embellish_url(get_root_url().$url);
+ }
+ return $url;
+}
+
+
/**
* Indicate to build url with full path
*