aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
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
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')
-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
-rw-r--r--mod/groups/views/default/forum/maintopic.php2
-rw-r--r--mod/groups/views/default/forum/viewposts.php5
-rw-r--r--mod/groups/views/default/groups/group_sort_menu.php2
-rw-r--r--mod/groups/views/default/groups/profile/forum_widget.php4
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php2
8 files changed, 63 insertions, 207 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
diff --git a/mod/groups/views/default/forum/maintopic.php b/mod/groups/views/default/forum/maintopic.php
index 2c75c0a77..7031c7418 100644
--- a/mod/groups/views/default/forum/maintopic.php
+++ b/mod/groups/views/default/forum/maintopic.php
@@ -30,7 +30,7 @@
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm')
))."</span>";
- echo "<span class='entity-edit'><a class='link' href=\"".elgg_get_site_url()."pg/groups/edittopic/{$group_guid}/{$topic}/\">".elgg_echo('edit')."</a></span>";
+ echo "<span class='entity-edit'><a class='link' href=\"".elgg_get_site_url()."pg/discussion/edit/{$vars['entity']->guid}\">".elgg_echo('edit')."</a></span>";
echo "</div>";
}
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
index f12a3f306..3c9da1258 100644
--- a/mod/groups/views/default/forum/viewposts.php
+++ b/mod/groups/views/default/forum/viewposts.php
@@ -2,7 +2,7 @@
/**
* Elgg groups plugin display topic posts
*/
-
+/*
// set up breadcrumbs
$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
@@ -12,6 +12,7 @@ elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), elgg_get_site_url
elgg_push_breadcrumb($vars['entity']->title);
echo elgg_view('navigation/breadcrumbs');
+*/
//display follow up comments
$count = $vars['entity']->countAnnotations('group_topic_post');
@@ -26,8 +27,6 @@ echo elgg_view('navigation/pagination',array(
));
?>
-<!-- grab the topic title -->
-<h2><?php echo $vars['entity']->title; ?></h2>
<?php
//display the topic
echo elgg_view("forum/maintopic",array('entity' => $vars['entity']));
diff --git a/mod/groups/views/default/groups/group_sort_menu.php b/mod/groups/views/default/groups/group_sort_menu.php
index 958c4084d..7018b614f 100644
--- a/mod/groups/views/default/groups/group_sort_menu.php
+++ b/mod/groups/views/default/groups/group_sort_menu.php
@@ -8,7 +8,7 @@ $group_count = (int)elgg_get_entities(array('types' => 'group', 'count' => true)
$selected = elgg_get_array_value('selected', $vars);
//url
- $url = elgg_get_site_url() . "pg/groups/world/";
+ $url = elgg_get_site_url() . "pg/groups/all/";
?>
<div class="elgg-tabs margin-top">
diff --git a/mod/groups/views/default/groups/profile/forum_widget.php b/mod/groups/views/default/groups/profile/forum_widget.php
index 265926fb5..969eb0559 100644
--- a/mod/groups/views/default/groups/profile/forum_widget.php
+++ b/mod/groups/views/default/groups/profile/forum_widget.php
@@ -13,7 +13,7 @@ $group = $vars['entity'];
$all_link = elgg_view('output/url', array(
- 'href' => "pg/groups/forum/$group->guid",
+ 'href' => "pg/discussion/owner/$group->guid",
'text' => elgg_echo('link:view:all'),
));
@@ -38,7 +38,7 @@ if (!$content) {
}
$new_link = elgg_view('output/url', array(
- 'href' => "mod/groups/addtopic.php?group_guid=" . $group->getGUID(),
+ 'href' => "pg/discussion/add/" . $group->getGUID(),
'text' => elgg_echo('groups:addtopic'),
));
$content .= "<span class='elgg-widget-more'>$new_link</span>";
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index e569bff77..a89419931 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -43,7 +43,7 @@ if ($num_comments != 0) {
$metadata = elgg_view('layout/objects/list/metadata', array(
'entity' => $topic,
- 'handler' => 'forum',
+ 'handler' => 'discussion',
));
$subtitle = "$poster_text $date $comments_link <span class=\"groups-latest-comment\">$comments_text</span>";