We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 4d29ca0b authored by Evan Prodromou's avatar Evan Prodromou

static method for getting best URL shortening service

parent a9c6a3ba
...@@ -75,6 +75,23 @@ class User_urlshortener_prefs extends Memcached_DataObject ...@@ -75,6 +75,23 @@ class User_urlshortener_prefs extends Memcached_DataObject
} }
} }
static function urlShorteningService($user)
{
$def = common_config('url', 'shortener');
$prefs = self::getPrefs($user);
if (empty($prefs)) {
if (!empty($user)) {
return $user->urlshorteningservice;
} else {
return $def;
}
} else {
return $prefs->urlshorteningservice;
}
}
static function getPrefs($user) static function getPrefs($user)
{ {
if (empty($user)) { if (empty($user)) {
......
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