Commit b5702824 authored by Robert Lyon's avatar Robert Lyon
Browse files

Using the submenu_items() syntax to display inbox/outbox tabs (Bug #1387365)



And add some 'title' text for the tab links

Change-Id: Icb01da77acbca605ad863bd7860e5af9f9b9ae91
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 7b0a1960
......@@ -285,15 +285,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);
......
......@@ -33,7 +33,9 @@ $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'] = '';
......
......@@ -122,6 +122,30 @@ 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'),
),
);
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
......
......@@ -241,15 +241,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'));
......
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