diff options
Diffstat (limited to 'mod/messageboard')
7 files changed, 44 insertions, 78 deletions
diff --git a/mod/messageboard/languages/en.php b/mod/messageboard/languages/en.php index 2ae6f3a49..d8ccbdeee 100644 --- a/mod/messageboard/languages/en.php +++ b/mod/messageboard/languages/en.php @@ -25,12 +25,9 @@ $english = array( /** * Message board widget river - **/ - - 'messageboard:river:annotate' => "%s has had a new comment posted on their message board.", - 'messageboard:river:create' => "%s added the message board widget.", - 'messageboard:river:update' => "%s updated their message board widget.", - 'messageboard:river:added' => "%s posted on", + */ + 'messageboard:river:added' => "posted on", + 'messageboard:river:user' => "%s's", 'messageboard:river:messageboard' => "message board", diff --git a/mod/messageboard/views/default/annotation/messageboard.php b/mod/messageboard/views/default/annotation/messageboard.php index fa4b43ff3..595cc6db4 100644 --- a/mod/messageboard/views/default/annotation/messageboard.php +++ b/mod/messageboard/views/default/annotation/messageboard.php @@ -8,4 +8,4 @@ $vars['delete_action'] = 'action/messageboard/delete'; -echo elgg_view('annotation/generic_comment', $vars);
\ No newline at end of file +echo elgg_view('annotation/default', $vars);
\ No newline at end of file diff --git a/mod/messageboard/views/default/forms/messageboard/add.php b/mod/messageboard/views/default/forms/messageboard/add.php index 4698abf28..2bca4e1dc 100644 --- a/mod/messageboard/views/default/forms/messageboard/add.php +++ b/mod/messageboard/views/default/forms/messageboard/add.php @@ -1,21 +1,19 @@ <?php /** - * Elgg Message board add form + * Elgg Message board add form body * * @package ElggMessageBoard */ -$textarea = elgg_view('input/plaintext', array( +echo elgg_view('input/plaintext', array( 'name' => 'message_content' )); -$owner_input = elgg_view('input/hidden', array( +echo elgg_view('input/hidden', array( 'name' => 'owner_guid', 'value' => elgg_get_page_owner_guid() )); -$submit = elgg_view('input/submit', array( +echo elgg_view('input/submit', array( 'value' => elgg_echo('post') )); - -echo $textarea . $owner_input . $submit;
\ No newline at end of file diff --git a/mod/messageboard/views/default/messageboard/messageboard.php b/mod/messageboard/views/default/messageboard/messageboard.php deleted file mode 100644 index f78451c84..000000000 --- a/mod/messageboard/views/default/messageboard/messageboard.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/** - * Elgg Message board display page - * - * @package ElggMessageBoard - */ - - -// 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>"; - -} diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php index 3bdf595d1..0268930bf 100644 --- a/mod/messageboard/views/default/river/object/messageboard/create.php +++ b/mod/messageboard/views/default/river/object/messageboard/create.php @@ -1,10 +1,24 @@ <?php +/** + * Messageboard river view + */ -$performed_by = get_entity($vars['item']->subject_guid); -$performed_on = get_entity($vars['item']->object_guid); +$performed_by = $vars['item']->getSubjectEntity(); +$performed_on = $vars['item']->getObjectEntity(); -$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; -$string = elgg_echo("messageboard:river:added", array($url)) . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard"); +$comment = $vars['item']->getAnnotation(); +$link = elgg_view('output/url', array( + 'href' => $performed_on->getURL(), + 'text' => elgg_echo('messageboard:river:user', array($performed_on->name)), +)); -echo $string; +echo elgg_echo("messageboard:river:added"); +echo " $link "; +echo elgg_echo("messageboard:river:messageboard"); + +if ($comment) { + echo '<div class="elgg-river-content">'; + echo elgg_get_excerpt($comment->value); + echo '</div>'; +} diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php index 7ec3e5d4e..04dbb00d2 100644 --- a/mod/messageboard/views/default/widgets/messageboard/content.php +++ b/mod/messageboard/views/default/widgets/messageboard/content.php @@ -2,16 +2,11 @@ /** * Elgg messageboard widget view * - * - * @package ElggMessageBoard */ $owner = elgg_get_page_owner_entity(); -$num_display = 5; -if (isset($vars['entity']->num_display)) { - $num_display = $vars['entity']->num_display; -} +$num_display = $vars['entity']->num_display; if (elgg_is_logged_in()) { echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard')); @@ -22,7 +17,7 @@ $options = array( 'guid' => $owner->getGUID(), 'limit' => $num_display, 'pagination' => false, - 'reverse_order_by' => true + 'reverse_order_by' => true, ); echo elgg_list_annotations($options); @@ -35,5 +30,5 @@ if ($owner instanceof ElggGroup) { echo elgg_view('output/url', array( 'href' => $url, - 'text' => elgg_echo('messageboard:viewall') + 'text' => elgg_echo('messageboard:viewall'), ));
\ 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 index 2157da6c4..74848f832 100644 --- a/mod/messageboard/views/default/widgets/messageboard/edit.php +++ b/mod/messageboard/views/default/widgets/messageboard/edit.php @@ -1,30 +1,22 @@ <?php /** - * Elgg message board widget edit view - * - * @package ElggMessageBoard + * Messageboard widget edit view */ -$num_display = 5; - -if (isset($vars['entity']->num_display)) { - $num_display = $vars['entity']->num_display; +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 5; } -?> -<p> - <?php echo elgg_echo("messageboard:num_display"); ?>: - <select name="params[num_display]"> -<?php -$options = array(1,2,3,4,5,6,7,8,9,10); -foreach ($options as $option) { - $selected = ''; - if ($num_display == $option) { - $selected = "selected='selected'"; - } +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), +); +$dropdown = elgg_view('input/dropdown', $params); - echo " <option value='{$option}' $selected >{$option}</option>\n"; -} ?> - </select> -</p>
\ No newline at end of file +<div> + <?php echo elgg_echo('messageboard:num_display'); ?>: + <?php echo $dropdown; ?> +</div> |