aboutsummaryrefslogtreecommitdiff
path: root/views/default/output
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-06-18 19:56:33 -0400
committerBrett Profitt <brett.profitt@gmail.com>2011-06-18 19:56:33 -0400
commitec7b94a64aef23b85866ecdac8e8acc712d29bb6 (patch)
treea108205c3fa0b694d8ce0ebaafd259480d6b530a /views/default/output
parentc80ba5aa03264dd64c20ed8ae222e87f9371a44d (diff)
parent2b68a4d217c35a5587c462620789493cf2804ba2 (diff)
downloadelgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.gz
elgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.bz2
Merge branch 'master' of github.com:Elgg/Elgg
Diffstat (limited to 'views/default/output')
-rw-r--r--views/default/output/confirmlink.php4
-rw-r--r--views/default/output/location.php14
-rw-r--r--views/default/output/tag.php30
-rw-r--r--views/default/output/tags.php18
4 files changed, 58 insertions, 8 deletions
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php
index 967094113..5059a656e 100644
--- a/views/default/output/confirmlink.php
+++ b/views/default/output/confirmlink.php
@@ -13,7 +13,8 @@
* @uses $vars['text_encode'] Encode special characters? (false)
*/
-$confirm = elgg_extract('confirm', $vars, elgg_echo('question:areyousure'));
+$vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure'));
+$vars['rel'] = addslashes($vars['rel']);
$encode = elgg_extract('text_encode', $vars, false);
// always generate missing action tokens
@@ -36,7 +37,6 @@ if (isset($vars['class'])) {
} else {
$vars['class'] = 'elgg-requires-confirmation';
}
-//$vars['onclick'] = "return confirm('" . addslashes($confirm) . "')";
unset($vars['encode_text']);
unset($vars['text']);
diff --git a/views/default/output/location.php b/views/default/output/location.php
new file mode 100644
index 000000000..e3619d2e1
--- /dev/null
+++ b/views/default/output/location.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Display a location
+ *
+ * @uses $vars['entity'] The ElggEntity that has a location
+ * @uses $vars['value'] The location string if the entity is not passed
+ */
+
+if (isset($vars['entity'])) {
+ $vars['value'] = $vars['entity']->location;
+ unset($vars['entity']);
+}
+
+echo elgg_view('output/tag', $vars);
diff --git a/views/default/output/tag.php b/views/default/output/tag.php
new file mode 100644
index 000000000..abae9c4b2
--- /dev/null
+++ b/views/default/output/tag.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Elgg single tag output
+ *
+ * @uses $vars['value'] String
+ * @uses $vars['type'] The entity type, optional
+ * @uses $vars['subtype'] The entity subtype, optional
+ *
+ */
+
+if (!empty($vars['subtype'])) {
+ $subtype = "&subtype=" . urlencode($vars['subtype']);
+} else {
+ $subtype = "";
+}
+if (!empty($vars['object'])) {
+ $object = "&object=" . urlencode($vars['object']);
+} else {
+ $object = "";
+}
+
+if (isset($vars['value'])) {
+ if (!empty($vars['type'])) {
+ $type = "&type={$vars['type']}";
+ } else {
+ $type = "";
+ }
+ $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
+ echo elgg_view('output/url', array('href' => $url, 'text' => $vars['value'], 'rel' => 'tag'));
+}
diff --git a/views/default/output/tags.php b/views/default/output/tags.php
index 345b256c4..6dedfacc7 100644
--- a/views/default/output/tags.php
+++ b/views/default/output/tags.php
@@ -1,17 +1,19 @@
<?php
/**
* Elgg tags
- *
* Tags can be a single string (for one tag) or an array of strings
*
- * @package Elgg
- * @subpackage Core
- *
- * @uses $vars['tags'] The tags to display
- * @uses $vars['type'] The entity type, optional
+ * @uses $vars['value'] Array of tags or a string
+ * @uses $vars['type'] The entity type, optional
* @uses $vars['subtype'] The entity subtype, optional
+ * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags)
*/
+if (isset($vars['entity'])) {
+ $vars['tags'] = $vars['entity']->tags;
+ unset($vars['entity']);
+}
+
if (!empty($vars['subtype'])) {
$subtype = "&subtype=" . urlencode($vars['subtype']);
} else {
@@ -27,6 +29,10 @@ if (empty($vars['tags']) && !empty($vars['value'])) {
$vars['tags'] = $vars['value'];
}
+if (empty($vars['tags']) && isset($vars['entity'])) {
+ $vars['tags'] = $vars['entity']->tags;
+}
+
if (!empty($vars['tags'])) {
if (!is_array($vars['tags'])) {
$vars['tags'] = array($vars['tags']);