From 6fbacea7340b0739c23be0a7d073782c64eee78d Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 22:15:56 +0000 Subject: Fixes #3489 added input/output views for tag and location git-svn-id: http://code.elgg.org/elgg/trunk@9163 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 4 ++-- views/default/input/location.php | 21 +++++++++++++++++++++ views/default/input/tag.php | 17 +++++++++++++++++ views/default/output/location.php | 14 ++++++++++++++ views/default/output/tag.php | 30 ++++++++++++++++++++++++++++++ views/default/output/tags.php | 2 +- 6 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 views/default/input/location.php create mode 100644 views/default/input/tag.php create mode 100644 views/default/output/location.php create mode 100644 views/default/output/tag.php diff --git a/engine/lib/users.php b/engine/lib/users.php index a7765a5e5..832bcd529 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1345,7 +1345,7 @@ function elgg_profile_fields_setup() { $profile_defaults = array ( 'description' => 'longtext', 'briefdescription' => 'text', - 'location' => 'tags', + 'location' => 'location', 'interests' => 'tags', 'skills' => 'tags', 'contactemail' => 'email', @@ -1379,7 +1379,7 @@ function elgg_profile_fields_setup() { // register any tag metadata names foreach ($CONFIG->profile_fields as $name => $type) { - if ($type == 'tags') { + if ($type == 'tags' || $type == 'location' || $type == 'tag') { elgg_register_tag_metadata_name($name); // register a tag name translation add_translation(get_current_language(), array("tag_names:$name" => elgg_echo("profile:$name"))); diff --git a/views/default/input/location.php b/views/default/input/location.php new file mode 100644 index 000000000..d7ae2bbbd --- /dev/null +++ b/views/default/input/location.php @@ -0,0 +1,21 @@ + 'elgg-input-location', + 'disabled' => FALSE, +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->location; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/tag', $vars); diff --git a/views/default/input/tag.php b/views/default/input/tag.php new file mode 100644 index 000000000..a78ec3163 --- /dev/null +++ b/views/default/input/tag.php @@ -0,0 +1,17 @@ + 'elgg-input-tag', + 'disabled' => FALSE, +); + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/text', $vars); \ No newline at end of file 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 @@ +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 @@ + $url, 'text' => $vars['value'], 'rel' => 'tag')); +} diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 57cb21ea7..6dedfacc7 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -10,7 +10,7 @@ */ if (isset($vars['entity'])) { - $defaults['value'] = $vars['entity']->tags; + $vars['tags'] = $vars['entity']->tags; unset($vars['entity']); } -- cgit v1.2.3