コード例 #1
0
ファイル: lib.php プロジェクト: vohung96/mahara
 /**
  * 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;
 }
コード例 #2
0
ファイル: outbox.php プロジェクト: vohung96/mahara
            db_begin();
            delete_messages_mr($msgids, $userid);
            db_commit();
        }
        $count = count($msgids);
    }
    $SESSION->add_ok_msg(get_string('deletednotifications1', 'artefact.multirecipientnotification', $count));
    redirect(get_config('wwwroot') . 'artefact/multirecipientnotification/outbox.php?type=' . $type);
}
$extrastylesheets = $THEME->get_url('style.css', false, 'artefact/multirecipientnotification');
$smarty = smarty(array('paginator'), array('<link rel="stylesheet" type="text/css" href="' . $extrastylesheets . '">'));
$smarty->assign('options', $options);
$smarty->assign('type', $type);
$smarty->assign('INLINEJAVASCRIPT', $javascript);
// Adding the links to out- and inbox
$smarty->assign('PAGEHEADING', TITLE);
// show urls and titles
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'));
    $smarty->assign('all_count', $searchresults['ALL_data']['count']);
    $smarty->assign('usr_count', $searchresults['User']['count']);
    $smarty->assign('sub_count', $searchresults['Subject']['count']);
    $smarty->assign('mes_count', $searchresults['Message']['count']);
}
$smarty->assign('deleteall', $deleteall);
$smarty->assign('activitylist', $activitylist);
// Changed to new tpl
$smarty->display('artefact:multirecipientnotification:indexout.tpl');