aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms
diff options
context:
space:
mode:
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