Commit 28790fc5 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge changes I3fa49caf,Icb01da77,I4e34a48e,If9097fdb,Ie0d5e030

* changes:
  Add "Send Message" button to multirecipient inbox
  Using the submenu_items() syntax to display inbox/outbox tabs (Bug #1387365)
  Adding 'title' attribute to tab link (Bug #1387341)
  Add copy of accepting message in acceptee's outbox (Bug #1389913)
  Getting the accept friend to email requestor (Bug #1389906)
parents e7d46cfc eaa6af2a
......@@ -287,15 +287,10 @@ $smarty->assign('INLINEJAVASCRIPT', $javascript);
// Adding the links to out- and inbox
$smarty->assign('PAGEHEADING', TITLE);
// Add urls and titles
$pages = array();
$pages[0]["url"] = "artefact/multirecipientnotification/inbox.php";
$pages[0]["title"] = get_string('labelinbox', 'artefact.multirecipientnotification');
$pages[0]["selected"] = 1;
$pages[1]["url"] = "artefact/multirecipientnotification/outbox.php";
$pages[1]["title"] = get_string('labeloutbox1', 'artefact.multirecipientnotification');
// show urls and titles
$smarty->assign('SUBPAGENAV', $pages);
define('NOTIFICATION_SUBPAGE', 'inbox');
$smarty->assign('SUBPAGENAV', PluginArtefactMultirecipientnotification::submenu_items());
$smarty->assign('deleteall', $deleteall);
$smarty->assign('activitylist', $activitylist);
......
......@@ -12,6 +12,8 @@
defined('INTERNAL') || die();
$string['sendmessageto'] = 'Send message';
$string['composemessage'] = 'Compose';
$string['composemessagedesc'] = 'Create a new message';
$string['titlesubject'] = 'Subject';
$string['titlerecipient'] = 'Recipients';
$string['replysubjectprefix'] = 'Re:';
......@@ -33,10 +35,12 @@ $string['replyurltext'] = 'Reply all';
$string['linkindicator'] = '»';
$string['labeloutbox1'] = 'Sent';
$string['outboxdesc'] = 'Messages sent to other users';
$string['labelinbox'] = 'Inbox';
$string['inboxdesc'] = 'Messages received from Mahara system and other users';
$string['nothingtorender'] = '';
$string['selectallread'] = 'All unread notifications';
$string['selectalldelete'] = 'All notifications for deletion';
$string['clickformore'] = '(Press \'Enter\' to display more information)';
\ No newline at end of file
$string['clickformore'] = '(Press \'Enter\' to display more information)';
......@@ -122,6 +122,35 @@ class PluginArtefactMultirecipientnotification extends PluginArtefact {
return $menuExtensions;
}
/**
* API-Function get the provided submenu tabs.
*
* @return array fully described new SUBPAGENAV tab items with title, url, etc.
*/
public static function submenu_items() {
$tabs = array(
'inbox' => array(
'url' => 'artefact/multirecipientnotification/inbox.php',
'title' => get_string('labelinbox', 'artefact.multirecipientnotification'),
'tooltip' => get_string('inboxdesc', 'artefact.multirecipientnotification'),
),
'outbox' => array(
'url' => 'artefact/multirecipientnotification/outbox.php',
'title' => get_string('labeloutbox1', 'artefact.multirecipientnotification'),
'tooltip' => get_string('outboxdesc', 'artefact.multirecipientnotification'),
),
'compose' => array(
'url' => 'artefact/multirecipientnotification/sendmessage.php',
'title' => get_string('composemessage', 'artefact.multirecipientnotification'),
'tooltip' => get_string('composemessagedesc', 'artefact.multirecipientnotification'),
),
);
if (defined('NOTIFICATION_SUBPAGE') && isset($tabs[NOTIFICATION_SUBPAGE])) {
$tabs[NOTIFICATION_SUBPAGE]['selected'] = true;
}
return $tabs;
}
public static function postinst($prevversion) {
if ($prevversion < 20131010) {
// Add triggers to update user unread message count when updating
......@@ -196,4 +225,4 @@ class PluginArtefactMultirecipientnotification extends PluginArtefact {
} // PluginArtefactNotficationmultirecipientnotification
// Class ArtefactTypeNotficationmultirecipientnotification
require('artefacttypemultirecipientnotification.php');
\ No newline at end of file
require('artefacttypemultirecipientnotification.php');
......@@ -246,15 +246,11 @@ $smarty->assign('INLINEJAVASCRIPT', $javascript);
// Adding the links to out- and inbox
$smarty->assign('PAGEHEADING', TITLE);
// Add urls and titles
$pages = array();
$pages[0]["url"] = "artefact/multirecipientnotification/inbox.php";
$pages[0]["title"] = get_string('labelinbox', 'artefact.multirecipientnotification');
$pages[1]["url"]="artefact/multirecipientnotification/outbox.php";
$pages[1]["title"] = get_string('labeloutbox1', 'artefact.multirecipientnotification');
$pages[1]["selected"] = 1;
// show urls and titles
$smarty->assign('SUBPAGENAV', $pages);
define('NOTIFICATION_SUBPAGE', 'outbox');
$smarty->assign('SUBPAGENAV', PluginArtefactMultirecipientnotification::submenu_items());
if (param_variable('search', null)!==null) {
$smarty->assign('searchtext', param_variable('search'));
$searchresults = get_message_search(param_variable('search'), null, $type, 0, 9999999, "outbox.php", $USER->get('id'));
......
......@@ -2140,6 +2140,7 @@ function acceptfriend_submit(Pieform $form, $values) {
$n = new StdClass;
$n->url = profile_url($USER);
$n->users = array($user->id);
$n->fromuser = $USER->get('id');
$lang = get_user_language($user->id);
$displayname = display_name($USER, $user);
$n->message = get_string_from_language($lang, 'friendrequestacceptedmessage', 'group', $displayname, $displayname);
......@@ -2151,6 +2152,9 @@ function acceptfriend_submit(Pieform $form, $values) {
db_commit();
require_once('activity.php');
activity_occurred('maharamessage', $n);
handle_event('addfriend', array('user' => $f->usr2, 'friend' => $f->usr1));
$SESSION->add_ok_msg(get_string('friendformacceptsuccess', 'group'));
......
......@@ -37,7 +37,7 @@
<h3 class="rd-tab-title"><a href="#">{str tag=tabs}<span class="rd-tab"></span></a></h3>
<ul class="in-page-tabs">
{foreach from=$SUBPAGENAV item=item}
<li {if $item.selected}class="current-tab"{/if}><a {if $item.selected}class="current-tab" {/if}href="{$WWWROOT}{$item.url}">{$item.title}<span class="accessible-hidden">({str tag=tab}{if $item.selected} {str tag=selected}{/if})</span></a></li>
<li {if $item.selected}class="current-tab"{/if}><a {if $item.tooltip}title="{$item.tooltip}"{/if}{if $item.selected}class="current-tab" {/if}href="{$WWWROOT}{$item.url}">{$item.title}<span class="accessible-hidden">({str tag=tab}{if $item.selected} {str tag=selected}{/if})</span></a></li>
{/foreach}
</ul>
</div>
......
......@@ -38,7 +38,7 @@
<div class="tabswrap">
<ul class="in-page-tabs">
{foreach from=$SUBPAGENAV item=item}
<li {if $item.selected}class="current-tab"{/if}><a {if $item.selected}class="current-tab" {/if}href="{$WWWROOT}{$item.url}">{$item.title}<span class="accessible-hidden">({str tag=tab}{if $item.selected} {str tag=selected}{/if})</span></a></li>
<li {if $item.selected}class="current-tab"{/if}><a {if $item.tooltip}title="{$item.tooltip}"{/if}{if $item.selected}class="current-tab" {/if}href="{$WWWROOT}{$item.url}">{$item.title}<span class="accessible-hidden">({str tag=tab}{if $item.selected} {str tag=selected}{/if})</span></a></li>
{/foreach}
</ul>
</div>
......
......@@ -79,6 +79,7 @@ function denyrequest_submit(Pieform $form, $values) {
$n = new StdClass;
$n->url = profile_url($USER, false);
$n->users = array($user->id);
$n->fromuser = $USER->get('id');
$lang = get_user_language($user->id);
$displayname = display_name($USER, $user);
$n->urltext = $displayname;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment