aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/forms/forums
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-07 15:02:05 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-07 15:02:05 +0000
commit69a750eb7b2a3c7a09369a3714bfaa9ef028f086 (patch)
tree97f02895ed0fc737e82b4806cc793e2fb31dcf15 /mod/groups/views/default/forms/forums
parentd7a0d5be049d9f5870bc09022929c628cfabaa23 (diff)
downloadelgg-69a750eb7b2a3c7a09369a3714bfaa9ef028f086.tar.gz
elgg-69a750eb7b2a3c7a09369a3714bfaa9ef028f086.tar.bz2
groups now have forums
git-svn-id: https://code.elgg.org/elgg/trunk@1761 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/forms/forums')
-rw-r--r--mod/groups/views/default/forms/forums/addpost.php36
-rw-r--r--mod/groups/views/default/forms/forums/addtopic.php98
-rw-r--r--mod/groups/views/default/forms/forums/edittopic.php107
3 files changed, 241 insertions, 0 deletions
diff --git a/mod/groups/views/default/forms/forums/addpost.php b/mod/groups/views/default/forms/forums/addpost.php
new file mode 100644
index 000000000..be34d04fd
--- /dev/null
+++ b/mod/groups/views/default/forms/forums/addpost.php
@@ -0,0 +1,36 @@
+<?php
+
+ /**
+ * Elgg group forum post edit/add page
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] Optionally, the post to edit
+ */
+
+?>
+ <form action="<?php echo $vars['url']; ?>action/groups/addpost" method="post">
+ <p>
+ <label><?php echo elgg_echo("groups:reply"); ?><br />
+ <?php
+
+ echo elgg_view("input/longtext",array(
+ "internalname" => "topic_post",
+ "value" => $body,
+ ));
+ ?>
+ </label>
+ </p>
+ <p>
+ <!-- pass across the topic guid -->
+ <input type="hidden" name="topic_guid" value="<?php echo $vars['entity']->guid; ?>" />
+ <input type="hidden" name="group_guid" value="<?php echo $vars['entity']->container_guid; ?>" />
+ <!-- display the save button -->
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
+ </p>
+
+ </form> \ No newline at end of file
diff --git a/mod/groups/views/default/forms/forums/addtopic.php b/mod/groups/views/default/forms/forums/addtopic.php
new file mode 100644
index 000000000..17ef1cab9
--- /dev/null
+++ b/mod/groups/views/default/forms/forums/addtopic.php
@@ -0,0 +1,98 @@
+<?php
+
+ /**
+ * Elgg Groups topic edit/add page
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @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 the title
+ echo elgg_view_title(elgg_echo("groups:addtopic"));
+
+?>
+ <!-- display the input form -->
+ <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
+
+ <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,
+ ));
+
+ ?>
+ </p>
+
+ <!-- topic message input -->
+ <p>
+ <label><?php echo elgg_echo("groups:topicmessage"); ?><br />
+ <?php
+
+ echo elgg_view("input/longtext",array(
+ "internalname" => "topicmessage",
+ "value" => $message,
+ ));
+ ?>
+ </label>
+ </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="sticky" <?php if($status == "sticky") echo "SELECTED";?>><?php echo elgg_echo('groups:topicsticky'); ?></option>
+ <option value="resolved" <?php if($status == "resolved") echo "SELECTED";?>><?php echo elgg_echo('groups:topicresolved'); ?></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="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
+ </p>
+
+ </form> \ No newline at end of file
diff --git a/mod/groups/views/default/forms/forums/edittopic.php b/mod/groups/views/default/forms/forums/edittopic.php
new file mode 100644
index 000000000..dc5891280
--- /dev/null
+++ b/mod/groups/views/default/forms/forums/edittopic.php
@@ -0,0 +1,107 @@
+<?php
+
+ /**
+ * Elgg Groups topic edit/add page
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @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']->getAnnotations('group_topic_post', 1, 0, "asc");
+
+ foreach($message as $mes){
+ $messsage_content = $mes->value;
+ $message_id = $mes->id;
+ }
+
+ // 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 action="<?php echo $vars['url']; ?>action/groups/edittopic" method="post">
+
+ <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,
+ ));
+
+ ?>
+ </p>
+
+ <!-- topic message input -->
+ <p>
+ <label><?php echo elgg_echo("groups:topicmessage"); ?><br />
+ <?php
+
+ echo elgg_view("input/longtext",array(
+ "internalname" => "topicmessage",
+ "value" => $messsage_content,
+ ));
+ ?>
+ </label>
+ </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="sticky" <?php if($status == "sticky") echo "SELECTED";?>><?php echo elgg_echo('groups:topicsticky'); ?></option>
+ <option value="resolved" <?php if($status == "resolved") echo "SELECTED";?>><?php echo elgg_echo('groups:topicresolved'); ?></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; ?>" />
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
+ </p>
+
+ </form> \ No newline at end of file