/** * Returns the url used to access the rss for a specific user. * Note that the url is protected by token * * @return string */ public function get_secret_url($action = 'display', $format = 'rss') { $user_id = $this->get_user_id(); $token = $this->ensure_user_token(); $params = array('user_id' => $user_id, 'token' => $token, 'format' => $format, 'action' => $action); return Uri::url('main/course_notice/index.php', $params); }
protected function format_calendar_event($result, $item) { $params = Uri::course_params($item->code, $item->session_id, $item->to_group_id); // . 'calendar/agenda.php?cidReq=' . $item->code . '#' . $item->id; $result->link = Uri::url('main/calendar/agenda.php', $params); //$result->description .= '<br/><i>' . $course->title . ' > ' . get_lang('Agenda') . ' > ' . $item->title . '</i>'; }
/** * Returns a full url from local/absolute path and parameters. * Append the root as required for relative urls. * * @param string $path * @param array $params * @return string */ public static function url($path = '', $params = array(), $html = true) { return Uri::url($path, $params, $html); }
/** * Returns a temporary url to download files and/or folders. * * @param string|array $ids * @return string */ public static function download_url($ids, $tool) { $ids = is_array($ids) ? implode(',', $ids) : $ids; $params = Uri::course_params(); $params['id'] = $ids; $params[KeyAuth::PARAM_ACCESS_TOKEN] = KeyAuth::create_temp_token(); $result = Uri::url("/main/$tool/file.php", $params, false); return $result; }