/** * API-Function get the provided Menus. It is possible to overwrite existing menuentries * by redefining them with the same path, title and weight. * * @return array fully descripted new menuitems with menupath, title, url, etc. */ public static function menu_items() { $menuExtensions = array(); // Templates if (PluginArtefactMultirecipientnotification::is_active()) { // search for path $searchFor = 'lib/activity.php'; if (!(strpos($_SERVER['REQUEST_URI'], $searchFor) === false)) { // set new path $redirTarget = get_config('wwwroot') . 'artefact/multirecipientnotification/lib/activity.php'; if (!empty($_SERVER['QUERY_STRING'])) { // change path $redirTarget .= '?' . $_SERVER['QUERY_STRING']; } redirect($redirTarget); exit; } // search for path $searchFor = '/account\\/activity\\/($|index.php)/'; if (preg_match($searchFor, $_SERVER['REQUEST_URI']) == 1) { // set new path $redirTarget = get_config('wwwroot') . 'artefact/multirecipientnotification/inbox.php'; if (!empty($_SERVER['QUERY_STRING'])) { // change path $redirTarget .= '?' . $_SERVER['QUERY_STRING']; } redirect($redirTarget); exit; } // search for path $searchFor = '/user\\/sendmessage.php/'; if (preg_match($searchFor, $_SERVER['REQUEST_URI']) == 1) { // set new path $redirTarget = get_config('wwwroot') . 'artefact/multirecipientnotification/sendmessage.php'; if (!empty($_SERVER['QUERY_STRING'])) { // change path $redirTarget .= '?' . $_SERVER['QUERY_STRING']; } redirect($redirTarget); exit; } } return $menuExtensions; }