contributions/usermanagement.notifications/controller/base/routes/notificationsexcluderoute.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * This routes auto-generates a token if given a notification 00004 * otherwiese takes current user to generate it 00005 */ 00006 class NotificationsExcludeRoute extends ParameterizedRoute { 00007 /** 00008 * Build the URL (except base part) 00009 * 00010 * @param mixed $params Further parameters to use to build URL 00011 * @return string 00012 */ 00013 protected function build_url_path($params) { 00014 $arr = $params; 00015 if ($params instanceof DAONotifications) { 00016 $user = $params->get_user(); 00017 $arr = array( 00018 'source' => $params->source, 00019 'source_id' => $params->source_id, 00020 ); 00021 } 00022 else { 00023 $user = Users::get_current_user(); 00024 } 00025 $token = $user->create_token('exclude', $arr); 00026 $arr['token'] = $token; 00027 $ret = parent::build_url_path($arr); 00028 return $ret; 00029 } 00030 }