Commit 95e3e5e4 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add function to get the base url for a view


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 6a79d610
......@@ -3137,6 +3137,18 @@ class View {
);
}
/**
* Makes a URL for a view page
*/
public function get_url() {
if ($this->type == 'profile') {
$url = 'user/view.php?id=' . (int) $this->owner;
}
else {
$url = 'view/view.php?id=' . (int) $this->id;
}
return get_config('wwwroot') . $url;
}
}
......
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