aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/forms
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-13 12:03:27 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-13 12:03:27 +0000
commit5dfb9a97cd5d99479610339f1c613f1468b96687 (patch)
tree04000c7a06cbf85506209a93a09ba7e1bbfc65b0 /mod/groups/views/default/forms
parent901f4bebb98a32212c836888ce7ee4bc15452eec (diff)
downloadelgg-5dfb9a97cd5d99479610339f1c613f1468b96687.tar.gz
elgg-5dfb9a97cd5d99479610339f1c613f1468b96687.tar.bz2
discussion topics using new page handler
git-svn-id: http://code.elgg.org/elgg/trunk@7880 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/forms')
-rw-r--r--mod/groups/views/default/forms/discussion/save.php56
-rw-r--r--mod/groups/views/default/forms/forums/addtopic.php103
-rw-r--r--mod/groups/views/default/forms/forums/edittopic.php96
3 files changed, 56 insertions, 199 deletions
diff --git a/mod/groups/views/default/forms/discussion/save.php b/mod/groups/views/default/forms/discussion/save.php
new file mode 100644
index 000000000..39f273f3e
--- /dev/null
+++ b/mod/groups/views/default/forms/discussion/save.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Discussion topic add/edit form body
+ *
+ */
+
+$title = elgg_get_array_value('title', $vars, '');
+$desc = elgg_get_array_value('description', $vars, '');
+$status = elgg_get_array_value('status', $vars, '');
+$tags = elgg_get_array_value('tags', $vars, '');
+$access_id = elgg_get_array_value('access_id', $vars, ACCESS_DEFAULT);
+$container_guid = elgg_get_array_value('container_guid', $vars);
+$guid = elgg_get_array_value('guid', $vars, null);
+
+?>
+<p>
+ <label><?php echo elgg_echo('title'); ?></label><br />
+ <?php echo elgg_view('input/text', array('internalname' => 'title', 'value' => $title)); ?>
+</p>
+<p>
+ <label><?php echo elgg_echo('groups:topicmessage'); ?></label>
+ <?php echo elgg_view('input/longtext', array('internalname' => 'description', 'value' => $desc)); ?>
+</p>
+<p>
+ <label><?php echo elgg_echo('tags'); ?></label>
+ <?php echo elgg_view('input/tags', array('internalname' => 'tags', 'value' => $tags)); ?>
+</p>
+<p>
+ <label><?php echo elgg_echo("groups:topicstatus"); ?></label><br />
+ <?php
+ echo elgg_view('input/pulldown', array(
+ 'internalname' => 'status',
+ 'value' => $status,
+ 'options_values' => array(
+ 'open' => elgg_echo('groups:topicopen'),
+ 'closed' => elgg_echo('groups:topicclosed'),
+ ),
+ ));
+ ?>
+<p>
+ <label><?php echo elgg_echo('access'); ?></label><br />
+ <?php echo elgg_view('input/access', array('internalname' => 'access_id', 'value' => $access_id)); ?>
+</p>
+<p>
+<?php
+
+echo elgg_view('input/hidden', array('internalname' => 'container_guid', 'value' => $container_guid));
+
+if ($guid) {
+ echo elgg_view('input/hidden', array('internalname' => 'topic_guid', 'value' => $guid));
+}
+
+echo elgg_view('input/submit', array('value' => elgg_echo("save")));
+
+?>
+</p>
diff --git a/mod/groups/views/default/forms/forums/addtopic.php b/mod/groups/views/default/forms/forums/addtopic.php
deleted file mode 100644
index cf4921e20..000000000
--- a/mod/groups/views/default/forms/forums/addtopic.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/**
- * Elgg Groups topic edit/add page
- *
- * @package ElggGroups
- *
- * @uses $vars['object'] Optionally, the topic to edit
- */
-
- // Set title, form destination
- $title = elgg_echo("groups:addtopic");
- $action = "groups/addtopic";
- $tags = "";
- $title = "";
- $message = "";
- $message_id = "";
- $status = "";
-
- // get the group guid
- $group_guid = (int) get_input('group_guid');
-
- // set up breadcrumbs
- $group = get_entity($group_guid);
- $access_id = $group->group_acl;
- $options = group_access_options($group);
- elgg_push_breadcrumb(elgg_echo('groups'), elgg_get_site_url()."pg/groups/world/");
- elgg_push_breadcrumb($group->name, $group->getURL());
- elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), elgg_get_site_url()."pg/groups/forum/{$group_guid}/");
- elgg_push_breadcrumb(elgg_echo("groups:addtopic"));
-
- echo elgg_view('navigation/breadcrumbs');
-
- // set the title
- echo elgg_view_title(elgg_echo("groups:addtopic"));
-
-?>
-<!-- display the input form -->
-<form id="group_addtopic" action="<?php echo elgg_get_site_url(); ?>action/<?php echo $action; ?>" method="post" class="margin-top">
-<?php echo elgg_view('input/securitytoken'); ?>
-
- <p>
- <label><?php echo elgg_echo("title"); ?><br />
- <?php
- //display the topic title input
- echo elgg_view("input/text", array(
- "internalname" => "topictitle",
- "value" => $title,
- ));
- ?>
- </label>
- </p>
-
- <!-- display the tag input -->
- <p>
- <label><?php echo elgg_echo("tags"); ?><br />
- <?php
-
- echo elgg_view("input/tags", array(
- "internalname" => "topictags",
- "value" => $tags,
- ));
-
- ?>
- </label>
- </p>
-
- <!-- topic message input -->
- <p class="longtext_inputarea">
- <label><?php echo elgg_echo("groups:topicmessage"); ?></label>
- <?php
-
- echo elgg_view("input/longtext",array(
- "internalname" => "topicmessage",
- "value" => $message,
- ));
- ?>
- </p>
-
- <!-- set the topic status -->
- <p>
- <label><?php echo elgg_echo("groups:topicstatus"); ?><br />
- <select name="status">
- <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option>
- <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option>
- </select>
- </label>
- </p>
-
- <!-- access -->
- <p>
- <label>
- <?php echo elgg_echo('access'); ?><br />
- <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id, 'options' => $options)); ?>
- </label>
- </p>
-
- <!-- required hidden info and submit button -->
- <p>
- <input type="hidden" name="group_guid" value="<?php echo $group_guid; ?>" />
- <?php echo elgg_view('input/submit', array('value' => elgg_echo('post'))); ?>
- </p>
-
-</form>
diff --git a/mod/groups/views/default/forms/forums/edittopic.php b/mod/groups/views/default/forms/forums/edittopic.php
deleted file mode 100644
index d05389218..000000000
--- a/mod/groups/views/default/forms/forums/edittopic.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
- /**
- * Elgg Groups topic edit/add page
- *
- * @package ElggGroups
- *
- * @uses $vars['entity'] Optionally, the topic to edit
- */
-
- //users can edit the access and status for now
- $access_id = $vars['entity']->access_id;
- $status = $vars['entity']->status;
- $tags = $vars['entity']->tags;
- $title = $vars['entity']->title;
- $message = $vars['entity']->description;
-
- // get the group GUID
- $group_guid = get_input("group");
-
- // topic guid
- $topic_guid = $vars['entity']->guid;
-
- // set the title
- echo elgg_view_title(elgg_echo("groups:edittopic"));
-
-?>
-<!-- display the input form -->
- <form id="group_edittopic" action="<?php echo elgg_get_site_url(); ?>action/groups/edittopic" method="post">
- <?php echo elgg_view('input/securitytoken'); ?>
-
- <p>
- <label><?php echo elgg_echo("title"); ?><br />
- <?php
- //display the topic title input
- echo elgg_view("input/text", array(
- "internalname" => "topictitle",
- "value" => $title,
- ));
- ?>
- </label>
- </p>
-
- <!-- display the tag input -->
- <p>
- <label><?php echo elgg_echo("tags"); ?><br />
- <?php
-
- echo elgg_view("input/tags", array(
- "internalname" => "topictags",
- "value" => $tags,
- ));
-
- ?>
- </label>
- </p>
-
- <!-- topic message input -->
- <p class="longtext_inputarea">
- <label><?php echo elgg_echo("groups:topicmessage"); ?></label>
- <?php
-
- echo elgg_view("input/longtext",array(
- "internalname" => "topicmessage",
- "value" => html_entity_decode($message, ENT_COMPAT, 'UTF-8')
- ));
- ?>
- </p>
-
- <!-- set the topic status -->
- <p>
- <label><?php echo elgg_echo("groups:topicstatus"); ?><br />
- <select name="status">
- <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option>
- <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option>
- </select>
- </label>
- </p>
-
- <!-- access -->
- <p>
- <label>
- <?php echo elgg_echo('access'); ?><br />
- <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
- </label>
- </p>
-
- <!-- required hidden info and submit button -->
- <p>
- <input type="hidden" name="group_guid" value="<?php echo $group_guid; ?>" />
- <input type="hidden" name="topic" value="<?php echo $topic_guid; ?>" />
- <input type="hidden" name="message_id" value="<?php echo $message_id; ?>" />
- <?php echo elgg_view('input/submit', array('value' => elgg_echo('save'))); ?>
- </p>
-
- </form> \ No newline at end of file