aboutsummaryrefslogtreecommitdiff
path: root/mod/messageboard/views/default
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
commit4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch)
tree969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/messageboard/views/default
parent57a217fd6b708844407486046a1faa23b46cac08 (diff)
downloadelgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz
elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/messageboard/views/default')
-rw-r--r--mod/messageboard/views/default/messageboard/css.php95
-rw-r--r--mod/messageboard/views/default/messageboard/forms/add.php32
-rw-r--r--mod/messageboard/views/default/messageboard/group_messageboard.php96
-rw-r--r--mod/messageboard/views/default/messageboard/messageboard.php37
-rw-r--r--mod/messageboard/views/default/messageboard/messageboard_content.php65
-rw-r--r--mod/messageboard/views/default/river/object/messageboard/create.php12
-rw-r--r--mod/messageboard/views/default/widgets/messageboard/edit.php28
-rw-r--r--mod/messageboard/views/default/widgets/messageboard/view.php93
8 files changed, 458 insertions, 0 deletions
diff --git a/mod/messageboard/views/default/messageboard/css.php b/mod/messageboard/views/default/messageboard/css.php
new file mode 100644
index 000000000..0bf150bc2
--- /dev/null
+++ b/mod/messageboard/views/default/messageboard/css.php
@@ -0,0 +1,95 @@
+<?php
+
+ /**
+ * Elgg Messageboard CSS extender
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+
+/* input msg area */
+#mb_input_wrapper {
+ margin:0 10px 5px 10px;
+ padding:5px;
+ background: white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+}
+
+#mb_input_wrapper .input_textarea {
+ width:675px;
+}
+.collapsable_box_content #mb_input_wrapper .input_textarea {
+ width:259px;
+}
+.message_item_timestamp {
+ font-size:90%;
+ padding:10px 0 0 0;
+}
+p.message_item_timestamp {
+ margin-bottom: 10px;
+}
+/* wraps each message */
+.messageboard {
+ margin:0 10px 5px 10px;
+ padding:0;
+ background: white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+}
+.messageboard .message_sender {
+ float:left;
+ margin: 5px 10px 0 5px;
+}
+/* IE6 */
+* html .messageboard { width: 280px; }
+* html #two_column_left_sidebar_maincontent .messageboard { width: 667px; }
+* html .messageboard .message_sender { margin: 5px 10px 0 2px; }
+* html #mb_input_wrapper .input_textarea { width:645px; }
+/* IE7 */
+*:first-child+html .messageboard { width: 280px; }
+*:first-child+html #two_column_left_sidebar_maincontent .messageboard { width: 698px; }
+*:first-child+html .messageboard .message_sender { margin: 5px 10px 0 2px; }
+
+.messageboard .message p {
+ line-height: 1.2em;
+ background:#dedede;
+ margin:0 6px 4px 6px;
+ padding:4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ overflow-y:hidden;
+ overflow-x:auto;
+ color:#333333;
+}
+
+.message_buttons {
+ padding:0 0 3px 4px;
+ margin:0;
+ font-size: 90%;
+ color:#666666;
+}
+
+.messageboard .delete_message a {
+ display:block;
+ float:right;
+ cursor: pointer;
+ width:14px;
+ height:14px;
+ margin:0 3px 3px 0;
+ background: url("<?php echo $vars['url']; ?>_graphics/icon_customise_remove.png") no-repeat 0 0;
+ text-indent: -9000px;
+}
+.messageboard .delete_message a:hover {
+ background-position: 0 -16px;
+}
+
+
+
+
+
diff --git a/mod/messageboard/views/default/messageboard/forms/add.php b/mod/messageboard/views/default/messageboard/forms/add.php
new file mode 100644
index 000000000..91337fdc9
--- /dev/null
+++ b/mod/messageboard/views/default/messageboard/forms/add.php
@@ -0,0 +1,32 @@
+<?php
+
+ /**
+ * Elgg Message board add form
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+<div id="mb_input_wrapper">
+<form action="<?php echo $vars['url']; ?>action/messageboard/add" method="post" name="messageboardForm">
+
+ <!-- textarea for the contents -->
+ <textarea name="message_content" value="" class="input_textarea"></textarea><br />
+
+ <!-- the person posting an item on the message board -->
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" />
+
+ <!-- the page owner, this will be the profile owner -->
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" />
+
+ <?php echo elgg_view('input/securitytoken'); ?>
+
+ <!-- submit messages input -->
+ <input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
+
+</form>
+</div>
diff --git a/mod/messageboard/views/default/messageboard/group_messageboard.php b/mod/messageboard/views/default/messageboard/group_messageboard.php
new file mode 100644
index 000000000..8662d45ac
--- /dev/null
+++ b/mod/messageboard/views/default/messageboard/group_messageboard.php
@@ -0,0 +1,96 @@
+<?php
+
+ /**
+ * Elgg messageboard group profile view
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ // get the groups passed over here
+
+ //get the full page owner entity
+ $entity = $vars['entity'];
+
+ $num_display = 10;
+
+?>
+<script type="text/JavaScript">
+$(document).ready(function(){
+
+ $("#postit").click(function(){
+
+ //display the ajax loading gif at the start of the function call
+ //$('#loader').html('<img src="<?php echo $vars['url']; ?>_graphics/ajax_loader.gif" />');
+ $('#loader').html('<?php echo elgg_view('ajax/loader',array('slashes' => true)); ?>');
+
+
+ //load the results back into the message board contents and remove the loading gif
+ //remember that the actual div being populated is determined on views/default/messageboard/messageboard.php
+ $("#messageboard_wrapper").load("<?php echo $vars['url']; ?>mod/messageboard/ajax_endpoint/load.php", {messageboard_content:$("[name=message_content]").val(), pageOwner:$("[name=pageOwner]").val(), numToDisplay:<?php echo $num_display; ?>}, function(){
+ $('#loader').empty(); // remove the loading gif
+ $('[name=message_content]').val(''); // clear the input textarea
+ }); //end
+
+ }); // end of the main click function
+
+}); //end of the document .ready function
+</script>
+
+<div id="mb_input_wrapper"><!-- start of mb_input_wrapper div -->
+
+ <h2><?php echo elgg_echo("messageboard:board"); ?></h2>
+
+<?php
+ //if not a member don't display the add comment to messageboard
+ if(is_group_member($entity->guid, $_SESSION['guid'])){
+?>
+
+ <!-- message textarea -->
+ <textarea name="message_content" id="testing" value="" class="input_textarea"></textarea>
+
+ <!-- the person posting an item on the message board -->
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" class="guid" />
+
+ <!-- the page owner, this will be the profile owner -->
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" class="pageOwner" />
+
+ <!-- submit button -->
+ <input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
+
+ <!-- menu options -->
+ <div id="messageboard_widget_menu">
+ <a href="<?php echo $vars['url']; ?>pg/messageboard/<?php echo get_entity(page_owner())->username; ?>"><?php echo elgg_echo("messageboard:viewall"); ?></a>
+ </div>
+
+ <!-- loading graphic -->
+ <div id="loader" class="loading"> </div>
+
+<?php
+ }
+?>
+
+</div><!-- end of mb_input_wrapper div -->
+
+
+ <?php
+
+ //this for the first time the page loads, grab the latest 5 messages.
+ $contents = $entity->getAnnotations('messageboard', $num_display, 0, 'desc');
+
+ //as long as there is some content to display, display it
+ if (!empty($contents)) {
+
+ echo elgg_view('messageboard/messageboard',array('annotation' => $contents));
+
+ } else {
+
+ //put the required div on the page for the first message
+ echo "<div id=\"messageboard_wrapper\" /></div>";
+
+ }
+
+ ?>
diff --git a/mod/messageboard/views/default/messageboard/messageboard.php b/mod/messageboard/views/default/messageboard/messageboard.php
new file mode 100644
index 000000000..bb563d7fb
--- /dev/null
+++ b/mod/messageboard/views/default/messageboard/messageboard.php
@@ -0,0 +1,37 @@
+<?php
+
+ /**
+ * Elgg Message board display page
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+
+ // If there is any content to view, view it
+ if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) {
+
+ //start the div which will wrap all the message board contents
+ echo "<div id=\"messageboard_wrapper\">";
+
+ //loop through all annotations and display
+ foreach($vars['annotation'] as $content) {
+
+ echo elgg_view("messageboard/messageboard_content", array('annotation' => $content));
+
+ }
+
+ //close the wrapper div
+ echo "</div>";
+
+ } else {
+
+ echo "<div class='contentWrapper'>" . elgg_echo("messageboard:none") . "</div>";
+
+ }
+
+
+?> \ No newline at end of file
diff --git a/mod/messageboard/views/default/messageboard/messageboard_content.php b/mod/messageboard/views/default/messageboard/messageboard_content.php
new file mode 100644
index 000000000..86240e910
--- /dev/null
+++ b/mod/messageboard/views/default/messageboard/messageboard_content.php
@@ -0,0 +1,65 @@
+<?php
+
+ /**
+ * Elgg Message board individual item display page
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+
+<div class="messageboard"><!-- start of messageboard div -->
+
+ <!-- display the user icon of the user that posted the message -->
+ <div class="message_sender">
+ <?php
+ echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
+ ?>
+ </div>
+
+ <!-- display the user's name who posted and the date/time -->
+ <p class="message_item_timestamp">
+ <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?>
+ </p>
+
+ <!-- output the actual comment -->
+ <div class="message"><?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?></div>
+ <div class="message_buttons">
+
+ <?php
+
+ // if the user looking at the comment can edit, show the delete link
+ if ($vars['annotation']->canEdit()) {
+
+
+ echo "<div class='delete_message'>" . elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/messageboard/delete?annotation_id=" . $vars['annotation']->id,
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</div>";
+
+ } //end of can edit if statement
+ ?>
+<?php
+ // If the message being looked at is owned by the current user, don't show the reply
+ // Also do not show if the user is not logged in
+ if (isloggedin() && $vars['annotation']->owner_guid != get_loggedin_userid()){
+
+ //get the message owner
+ $msg_owner = get_entity($vars['annotation']->owner_guid);
+ //create the url to their messageboard
+ $user_mb = "pg/messageboard/" . $msg_owner->username;
+
+ echo "<a href=\"" . $vars['url'] . $user_mb . "\">".elgg_echo('messageboard:replyon')." " . $msg_owner->name . "'s " . elgg_echo('messageboard:messageboard') . "</a> | ";
+
+ echo "<a href=\"" . $vars['url'] . "mod/messageboard/history.php?user=" . $msg_owner->guid ."\">" . elgg_echo('messageboard:history') . "</a>";
+ }
+?>
+
+ </div>
+ <div class="clearfloat"></div>
+</div><!-- end of messageboard div -->
diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php
new file mode 100644
index 000000000..9f65122d0
--- /dev/null
+++ b/mod/messageboard/views/default/river/object/messageboard/create.php
@@ -0,0 +1,12 @@
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+ $performed_on = get_entity($vars['item']->object_guid);
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("messageboard:river:added"),$url) . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");
+
+
+ echo $string;
+
+?> \ No newline at end of file
diff --git a/mod/messageboard/views/default/widgets/messageboard/edit.php b/mod/messageboard/views/default/widgets/messageboard/edit.php
new file mode 100644
index 000000000..cf0741a36
--- /dev/null
+++ b/mod/messageboard/views/default/widgets/messageboard/edit.php
@@ -0,0 +1,28 @@
+<?php
+
+ /**
+ * Elgg message board edit page
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+<p>
+ <?php echo elgg_echo("messageboard:num_display"); ?>:
+ <select name="params[num_display]">
+ <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
+ <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
+ <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
+ <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
+ <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
+ <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
+ <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
+ <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
+ <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
+ <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
+ </select>
+</p> \ No newline at end of file
diff --git a/mod/messageboard/views/default/widgets/messageboard/view.php b/mod/messageboard/views/default/widgets/messageboard/view.php
new file mode 100644
index 000000000..9a0d8e251
--- /dev/null
+++ b/mod/messageboard/views/default/widgets/messageboard/view.php
@@ -0,0 +1,93 @@
+<?php
+
+ /**
+ * Elgg messageboard plugin view page
+ *
+ * @todo let users choose how many messages they want displayed
+ *
+ * @package ElggMessageBoard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ // a couple of required variables
+
+ //get the full page owner entity
+ $entity = get_entity(page_owner());
+
+ //the number of message to display
+ $num_display = $vars['entity']->num_display;
+
+ //if no num set, set to one
+ if(!$num_display)
+ $num_display = 5;
+
+//Just the loggedin user can send messages
+if(isloggedin()){
+?>
+ <script type="text/JavaScript">
+ $(document).ready(function(){
+
+ $("#postit").click(function(){
+
+ //display the ajax loading gif at the start of the function call
+ //$('#loader').html('<img src="<?php echo $vars['url']; ?>_graphics/ajax_loader.gif" />');
+ $('#loader').html('<?php echo elgg_view('ajax/loader',array('slashes' => true)); ?>');
+
+ //load the results back into the message board contents and remove the loading gif
+ //remember that the actual div being populated is determined on views/default/messageboard/messageboard.php
+ $("#messageboard_wrapper").load("<?php echo $vars['url']; ?>mod/messageboard/ajax_endpoint/load.php", {messageboard_content:$("[name=message_content]").val(), pageOwner:$("[name=pageOwner]").val(), numToDisplay:<?php echo $num_display; ?>}, function(){
+ $('#loader').empty(); // remove the loading gif
+ $('[name=message_content]').val(''); // clear the input textarea
+ }); //end
+
+ }); // end of the main click function
+
+ }); //end of the document .ready function
+ </script>
+
+ <div id="mb_input_wrapper"><!-- start of mb_input_wrapper div -->
+
+ <!-- message textarea -->
+ <textarea name="message_content" id="testing" value="" class="input_textarea"></textarea>
+
+ <!-- the person posting an item on the message board -->
+ <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" class="guid" />
+
+ <!-- the page owner, this will be the profile owner -->
+ <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" class="pageOwner" />
+
+ <!-- submit button -->
+ <input type="submit" id="postit" value="<?php echo elgg_echo('messageboard:postit'); ?>">
+
+ <!-- menu options -->
+ <div id="messageboard_widget_menu">
+ <a href="<?php echo $vars['url']; ?>pg/messageboard/<?php echo get_entity(page_owner())->username; ?>"><?php echo elgg_echo("messageboard:viewall"); ?></a>
+ </div>
+
+ <!-- loading graphic -->
+ <div id="loader" class="loading"> </div>
+
+ </div><!-- end of mb_input_wrapper div -->
+
+<?php
+} // if(isloggedin())
+
+ //this for the first time the page loads, grab the latest 5 messages.
+ $contents = $entity->getAnnotations('messageboard', $num_display, 0, 'desc');
+
+ //as long as there is some content to display, display it
+ if (!empty($contents)) {
+
+ echo elgg_view('messageboard/messageboard',array('annotation' => $contents));
+
+ } else {
+
+ //put the required div on the page for the first message
+ echo "<div id=\"messageboard_wrapper\"></div>";
+
+ }
+
+?> \ No newline at end of file