aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-26 14:23:32 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-26 14:23:32 +0000
commitc1411ffc81908882edaace315c46e500419d2aba (patch)
tree73ea8aa0a8a10c2a2a85977409f5ff4ae8968115 /views/default/forms
parent1ab250f2a8e90c4aa24ada873f98c81dbdd4ae93 (diff)
downloadelgg-c1411ffc81908882edaace315c46e500419d2aba.tar.gz
elgg-c1411ffc81908882edaace315c46e500419d2aba.tar.bz2
Refs #2982 adding and deleting friend collections works - editing does not
git-svn-id: http://code.elgg.org/elgg/trunk@8490 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/forms')
-rw-r--r--views/default/forms/friends/collectionfields.php15
-rw-r--r--views/default/forms/friends/collections/edit.php53
-rw-r--r--views/default/forms/friends/edit.php53
3 files changed, 53 insertions, 68 deletions
diff --git a/views/default/forms/friends/collectionfields.php b/views/default/forms/friends/collectionfields.php
deleted file mode 100644
index 35db3a962..000000000
--- a/views/default/forms/friends/collectionfields.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Elgg friend collections required hidden fields for js friends picker form
- *
- * @package Elgg
- * @subpackage Core
- */
-
-if (isset($vars['collection'])) {
-?>
-
- <input type="hidden" name="collection_id" value="<?php echo $vars['collection']->id; ?>" />
-
-<?php
-} \ No newline at end of file
diff --git a/views/default/forms/friends/collections/edit.php b/views/default/forms/friends/collections/edit.php
new file mode 100644
index 000000000..975307085
--- /dev/null
+++ b/views/default/forms/friends/collections/edit.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Form body for editing or adding a friend collection
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['collection'] Optionally, the collection to edit
+ */
+
+// Set title, form destination
+if (isset($vars['collection'])) {
+ $title = $vars['collection']->name;
+ $highlight = 'default';
+} else {
+ $title = "";
+ $highlight = 'all';
+}
+
+echo "<div><label>" . elgg_echo("friends:collectionname") . "<br/>";
+echo elgg_view("input/text", array(
+ "name" => "collection_name",
+ "value" => $title,
+ ));
+echo "</label></div>";
+
+echo "<div>";
+if ($vars['collection_members']) {
+ echo elgg_echo("friends:collectionfriends") . "<br />";
+ foreach ($vars['collection_members'] as $mem) {
+ echo elgg_view_entity_icon($mem, 'tiny');
+ echo $mem->name;
+ }
+}
+echo "</div>";
+
+echo "<div><label>" . elgg_echo("friends:addfriends") . "</label>";
+echo elgg_view('input/friendspicker', array(
+ 'entities' => $vars['friends'],
+ 'name' => 'friends_collection',
+ 'highlight' => $highlight,
+));
+echo "</div>";
+
+echo "<div>";
+if (isset($vars['collection'])) {
+ echo elgg_view('input/hidden', array(
+ 'name' => 'collection_id',
+ 'value' => $vars['collection']->id,
+ ));
+}
+echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
+echo "</div>";
diff --git a/views/default/forms/friends/edit.php b/views/default/forms/friends/edit.php
deleted file mode 100644
index 902113c9c..000000000
--- a/views/default/forms/friends/edit.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * Elgg friend collections add/edit
- *
- * @package Elgg
- * @subpackage Core
- *
- * @uses $vars['object'] Optionally, the collection edit
- */
-
-// var_export($vars['collection'][0]->id);
-
-// Set title, form destination
-if (isset($vars['collection'])) {
- $action = "friends/editcollection";
- $title = $vars['collection'][0]->name;
- $highlight = 'default';
-} else {
- $action = "friends/addcollection";
- $title = "";
- $highlight = 'all';
-}
-
-
-$form_body = "<div class='contentWrapper'><div><label>" . elgg_echo("friends:collectionname") . "<br />" .
- elgg_view("input/text", array(
- "name" => "collection_name",
- "value" => $title,
- )) . "</label></div>";
-
-$form_body .= "<div>";
-
-if($vars['collection_members']){
- $form_body .= elgg_echo("friends:collectionfriends") . "<br />";
- foreach($vars['collection_members'] as $mem){
- $form_body .= elgg_view_entity_icon($mem, 'tiny');
- $form_body .= $mem->name;
- }
-}
-
-$form_body .= "</div>";
-
-$form_body .= "<div><label>" . elgg_echo("friends:addfriends") . "</label>".
- elgg_view('input/friendspicker',array('entities' => $vars['friends'], 'name' => 'friends_collection', 'highlight' => $highlight)) . "</div>";
-
-$form_body .= "<div>";
-if (isset($vars['collection'])) {
- $form_body .= elgg_view('input/hidden', array('name' => 'collection_id', 'value' => "{$vars['collection'][0]->id}"));
-}
-$form_body .= elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
-$form_body .= "</div></div>";
-
-echo $form_body; \ No newline at end of file