aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-03 18:54:08 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-03 18:54:08 +0000
commitf6ff517215d63d55c47a212a7a3ee477d4def791 (patch)
tree7c4d9d94de806f8313fff8aedfdf9efd94859224 /mod/groups/views/default
parent6147f743b9753f420a824589b8445b2d00e77114 (diff)
downloadelgg-f6ff517215d63d55c47a212a7a3ee477d4def791.tar.gz
elgg-f6ff517215d63d55c47a212a7a3ee477d4def791.tar.bz2
End of day commit of first (semi working) code.
Working: - Join/leave on public groups - Create / edit groups Not working: - Private groups - the skin/display of the group - profile main page - widgets Refs #109 Closes #115 git-svn-id: https://code.elgg.org/elgg/trunk@1279 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r--mod/groups/views/default/forms/groups/edit.php56
-rw-r--r--mod/groups/views/default/group/group.php21
-rw-r--r--mod/groups/views/default/groups/groupgallery.php25
-rw-r--r--mod/groups/views/default/groups/grouplisting.php27
-rw-r--r--mod/groups/views/default/groups/groupprofile.php22
-rw-r--r--mod/groups/views/default/groups/icon.php68
-rw-r--r--mod/groups/views/default/groups/menu/actions.php44
-rw-r--r--mod/groups/views/default/groups/menu/adminlinks.php3
-rw-r--r--mod/groups/views/default/groups/menu/links.php3
-rw-r--r--mod/groups/views/default/groups/menu/ownerlinks.php3
10 files changed, 272 insertions, 0 deletions
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
new file mode 100644
index 000000000..7a3a9c353
--- /dev/null
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -0,0 +1,56 @@
+<?php
+ /**
+ * Elgg groups plugin
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+?>
+<form action="<?php echo $vars['url']; ?>action/groups/edit" method="post">
+
+<?php
+
+ //var_export($vars['profile']);
+ if (is_array($vars['config']->group) && sizeof($vars['config']->group) > 0)
+ foreach($vars['config']->group as $shortname => $valtype) {
+
+?>
+
+ <p>
+ <label>
+ <?php echo elgg_echo("groups:{$shortname}") ?><br />
+ <?php echo elgg_view("input/{$valtype}",array(
+ 'internalname' => $shortname,
+ 'value' => $vars['entity']->$shortname,
+ )); ?>
+ </label>
+ </p>
+
+<?php
+
+ }
+
+?>
+
+ <p>
+ <label>
+ <?php echo elgg_echo('groups:membership'); ?><br />
+ <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id, 'options' => array( 0 => 'Private', 2=>'Public'))); ?>
+ </label>
+ </p>
+
+ <p>
+ <?php
+ if ($vars['entity'])
+ {
+ ?><input type="hidden" name="group_guid" value="<?php //echo $vars['entity']->getGUID(); ?>" /><?php
+ }
+ ?>
+ <input type="hidden" name="user_guid" value="<?php echo page_owner_entity()->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/group/group.php b/mod/groups/views/default/group/group.php
new file mode 100644
index 000000000..c1f6d282f
--- /dev/null
+++ b/mod/groups/views/default/group/group.php
@@ -0,0 +1,21 @@
+<?php
+ /**
+ * Elgg groups profile display
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ if ($vars['full']) {
+ echo elgg_view("groups/groupprofile",$vars);
+ } else {
+ if (get_input('search_viewtype') == "gallery") {
+ echo elgg_view('groups/groupgallery',$vars);
+ } else {
+ echo elgg_view("groups/grouplisting",$vars);
+ }
+ }
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/groupgallery.php b/mod/groups/views/default/groups/groupgallery.php
new file mode 100644
index 000000000..14ca2f95f
--- /dev/null
+++ b/mod/groups/views/default/groups/groupgallery.php
@@ -0,0 +1,25 @@
+<?php
+ /**
+ * Elgg groups plugin gallery view
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $icon = elgg_view(
+ "groups/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'large',
+ )
+ );
+
+ $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->title . "</a></b></p>";
+
+ // num users, last activity, owner etc
+
+
+ echo elgg_view('search/gallery_listing',array('icon' => $icon, 'info' => $info));
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/grouplisting.php b/mod/groups/views/default/groups/grouplisting.php
new file mode 100644
index 000000000..1c86f2279
--- /dev/null
+++ b/mod/groups/views/default/groups/grouplisting.php
@@ -0,0 +1,27 @@
+<?php
+ /**
+ * Elgg user display (small)
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The user entity
+ */
+
+ $icon = elgg_view(
+ "groups/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+ )
+ );
+
+ $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->title . "</a></b></p>";
+
+ // num users, last activity, owner etc
+
+ echo elgg_view_listing($icon, $info);
+
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/groupprofile.php b/mod/groups/views/default/groups/groupprofile.php
new file mode 100644
index 000000000..bf0945c63
--- /dev/null
+++ b/mod/groups/views/default/groups/groupprofile.php
@@ -0,0 +1,22 @@
+<?php
+ /**
+ * Elgg groups plugin full profile view.
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ if ($vars['full'] == true) {
+ $iconsize = "large";
+ } else {
+ $iconsize = "medium";
+ }
+
+
+
+
+ // join / leave (if can join & leave)
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/icon.php b/mod/groups/views/default/groups/icon.php
new file mode 100644
index 000000000..0a3ce74a4
--- /dev/null
+++ b/mod/groups/views/default/groups/icon.php
@@ -0,0 +1,68 @@
+<?php
+
+ /**
+ * Elgg group icon
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The user entity. If none specified, the current user is assumed.
+ * @uses $vars['size'] The size - small, medium or large. If none specified, medium is assumed.
+ */
+
+ $group = $vars['entity'];
+
+ // Get size
+ if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar')))
+ $vars['size'] = "medium";
+
+ // Get any align and js
+ if (!empty($vars['align'])) {
+ $align = " align=\"{$vars['align']}\" ";
+ } else {
+ $align = "";
+ }
+
+ if ($icontime = $vars['entity']->icontime) {
+ $icontime = "{$icontime}";
+ } else {
+ $icontime = "default";
+ }
+
+ $name = htmlentities($vars['entity']->title);
+
+
+
+ $username = $vars['entity']->username; // TODO : How do i do an icon when we have no username?
+?>
+
+<div class="groupicon">
+<div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/avatar_menu_arrow.gif" width="15" height="15" class="arrow" /></div>
+
+ <div class="sub_menu">
+ <a href="<?php echo $vars['entity']->getURL(); ?>"><h3><?php echo $vars['entity']->title; ?></h3></a>
+ <?php
+ if (isloggedin()) {
+ $actions = elgg_view('groups/menu/actions',$vars);
+ if (!empty($actions)) {
+
+ echo "<div class=\"item_line\">{$actions}</div>";
+
+ }
+ if ($vars['entity']->owner_guid == $vars['user']->getGUID()) {
+ echo elgg_view('groups/menu/ownerlinks',$vars);
+ } else {
+ echo elgg_view('groups/menu/links',$vars);
+ }
+ } else {
+ echo elgg_view('groups/menu/links',$vars);
+ }
+
+ ?>
+
+ </div>
+ <a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" ><img src="<?php echo $vars['url']; ?>pg/icon/<?php echo $username; ?>/<?php echo $vars['size']; ?>/<?php echo $icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo $name; ?>" <?php echo $vars['js']; ?> /></a>
+</div> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/menu/actions.php b/mod/groups/views/default/groups/menu/actions.php
new file mode 100644
index 000000000..21101ddb8
--- /dev/null
+++ b/mod/groups/views/default/groups/menu/actions.php
@@ -0,0 +1,44 @@
+<?php
+ /**
+ * Elgg group actions
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ if (isloggedin()) {
+
+ if ($vars['entity']->isMember($_SESSION['user']))
+ {
+?>
+ <p><a href="<?php echo $vars['url']; ?>action/groups/leave?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:leave"); ?></a></p>
+<?php
+ }
+ else
+ {
+ if ($vars['entity']->access_id == 2)
+ {
+?>
+ <p><a href="<?php echo $vars['url']; ?>action/groups/join?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:join"); ?></a></p>
+<?php
+ }
+ else
+ {
+?>
+ <p><a href="<?php echo $vars['url']; ?>action/groups/joinrequest?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:joinrequest"); ?></a></p>
+<?php
+ }
+ }
+
+ // edit
+ if ($_SESSION['user']->getGUID() == $vars['entity']->owner_guid)
+ {
+ ?>
+ <p><a href="<?php echo $vars['url']; ?>mod/groups/edit.php?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a></p>
+ <?php
+ }
+ }
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/menu/adminlinks.php b/mod/groups/views/default/groups/menu/adminlinks.php
new file mode 100644
index 000000000..15c5adc7f
--- /dev/null
+++ b/mod/groups/views/default/groups/menu/adminlinks.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/menu/links.php b/mod/groups/views/default/groups/menu/links.php
new file mode 100644
index 000000000..15c5adc7f
--- /dev/null
+++ b/mod/groups/views/default/groups/menu/links.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/menu/ownerlinks.php b/mod/groups/views/default/groups/menu/ownerlinks.php
new file mode 100644
index 000000000..15c5adc7f
--- /dev/null
+++ b/mod/groups/views/default/groups/menu/ownerlinks.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file