6 public function getIconUrl($email, $size = 32)
8 if ($email == 'anonymous@phorkie'
9 || !$GLOBALS['phorkie']['cfg']['avatars']
11 return 'phorkie/anonymous.png';
14 $s = new \Services_Libravatar();
20 'default' => Tools::fullUrl('phorkie/anonymous.png')
25 public function getLanguageOptions(File $file = null)
27 $html = '<option value="_auto_">* automatic *</option>';
30 $fileExt = $file->getExt();
32 foreach ($GLOBALS['phorkie']['languages'] as $ext => $arLang) {
33 if (isset($arLang['show']) && !$arLang['show']) {
37 '<option value="%s"%s>%s</option>',
39 $fileExt == $ext ? ' selected="selected"' : '',
46 public function getDomain($url)
48 return parse_url($url, PHP_URL_HOST);
51 public function fullUrl($path = '')
53 return Tools::fullUrl($path);
56 public function mayWriteLocally()
58 if ($GLOBALS['phorkie']['auth']['securityLevel'] == 0) {
59 //everyone may do everything
64 if (!isset($_SESSION['identity'])) {
66 } else if ($GLOBALS['phorkie']['auth']['listedUsersOnly']) {
67 if (in_array($_SESSION['identity'], $GLOBALS['phorkie']['auth']['users'])) {
71 //session identity exists, no special checks required
78 public function getRepositoryEmbedCode(Repository $repo)
80 return '<script src="' . $repo->getLink('embed', null, true) . '"'
81 . ' id="phork-script-' . $repo->id . '"'
82 . ' type="text/javascript"></script>';