85 changed files with 516 additions and 575 deletions
@ -1,25 +1,24 @@
|
||||
<?php |
||||
|
||||
function apps_content(App $a) { |
||||
$privateaddons = get_config('config','private_addons'); |
||||
if ($privateaddons === "1") { |
||||
if((! (local_user()))) { |
||||
info( t("You must be logged in to use addons. ")); |
||||
return;}; |
||||
} |
||||
|
||||
$title = t('Applications'); |
||||
function apps_content(App $a) { |
||||
$privateaddons = get_config('config', 'private_addons'); |
||||
if ($privateaddons === "1") { |
||||
if ((!(local_user()))) { |
||||
info(t("You must be logged in to use addons. ")); |
||||
return; |
||||
}; |
||||
} |
||||
|
||||
if(count($a->apps)==0) |
||||
notice( t('No installed applications.') . EOL); |
||||
$title = t('Applications'); |
||||
|
||||
if (count($a->apps) == 0) { |
||||
notice(t('No installed applications.') . EOL); |
||||
} |
||||
|
||||
$tpl = get_markup_template("apps.tpl"); |
||||
return replace_macros($tpl, array( |
||||
'$title' => $title, |
||||
'$apps' => $a->apps, |
||||
)); |
||||
|
||||
|
||||
|
||||
} |
||||
|
@ -1,20 +1,22 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* Show a credits page for all the developers who helped with the project |
||||
* (only contributors to the git repositories for friendica core and the |
||||
* addons repository will be listed though ATM) |
||||
*/ |
||||
|
||||
function credits_content (App $a) { |
||||
/* fill the page with credits */ |
||||
$f = fopen('util/credits.txt','r'); |
||||
$names = fread($f, filesize('util/credits.txt')); |
||||
$arr = explode("\n", htmlspecialchars($names)); |
||||
fclose($f); |
||||
$tpl = get_markup_template('credits.tpl'); |
||||
return replace_macros( $tpl, array( |
||||
'$title' => t('Credits'), |
||||
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'), |
||||
'$names' => $arr, |
||||
)); |
||||
|
||||
function credits_content(App $a) { |
||||
/* fill the page with credits */ |
||||
$f = fopen('util/credits.txt', 'r'); |
||||
$names = fread($f, filesize('util/credits.txt')); |
||||
$arr = explode("\n", htmlspecialchars($names)); |
||||
fclose($f); |
||||
$tpl = get_markup_template('credits.tpl'); |
||||
return replace_macros($tpl, array( |
||||
'$title' => t('Credits'), |
||||
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'), |
||||
'$names' => $arr, |
||||
)); |
||||
} |
||||
|
@ -1,13 +1,16 @@
|
||||
<?php |
||||
|
||||
function login_content(App $a) { |
||||
if(x($_SESSION,'theme')) |
||||
if (x($_SESSION, 'theme')) { |
||||
unset($_SESSION['theme']); |
||||
if(x($_SESSION,'mobile-theme')) |
||||
} |
||||
if (x($_SESSION, 'mobile-theme')) { |
||||
unset($_SESSION['mobile-theme']); |
||||
} |
||||
|
||||
if(local_user()) |
||||
if (local_user()) { |
||||
goaway(z_root()); |
||||
} |
||||
|
||||
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); |
||||
|
||||
} |
||||
|
@ -1,26 +1,25 @@
|
||||
<?php |
||||
use Friendica\Core\Config; |
||||
|
||||
function manifest_content(App $a) { |
||||
use Friendica\Core\Config; |
||||
|
||||
$tpl = get_markup_template('manifest.tpl'); |
||||
function manifest_content(App $a) { |
||||
|
||||
header('Content-type: application/manifest+json'); |
||||
$tpl = get_markup_template('manifest.tpl'); |
||||
|
||||
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png'); |
||||
if ($touch_icon == '') { |
||||
$touch_icon = 'images/friendica-128.png'; |
||||
} |
||||
header('Content-type: application/manifest+json'); |
||||
|
||||
$o = replace_macros($tpl, array( |
||||
'$baseurl' => App::get_baseurl(), |
||||
'$touch_icon' => $touch_icon, |
||||
'$title' => Config::get('config', 'sitename', 'Friendica'), |
||||
)); |
||||
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png'); |
||||
if ($touch_icon == '') { |
||||
$touch_icon = 'images/friendica-128.png'; |
||||
} |
||||
|
||||
echo $o; |
||||
$o = replace_macros($tpl, array( |
||||
'$baseurl' => App::get_baseurl(), |
||||
'$touch_icon' => $touch_icon, |
||||
'$title' => Config::get('config', 'sitename', 'Friendica'), |
||||
)); |
||||
|
||||
killme(); |
||||
echo $o; |
||||
|
||||
} |
||||
?> |
||||
killme(); |
||||
} |
||||
|
@ -1,20 +1,20 @@
|
||||
<?php |
||||
/* identi.ca -> friendica items permanent-url compatibility */ |
||||
|
||||
function notice_init(App $a) { |
||||
$id = $a->argv[1]; |
||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d", |
||||
intval($id) |
||||
); |
||||
if (dbm::is_result($r)){ |
||||
$nick = $r[0]['nickname']; |
||||
$url = App::get_baseurl()."/display/$nick/$id"; |
||||
goaway($url); |
||||
} else { |
||||
$a->error = 404; |
||||
notice( t('Item not found.') . EOL); |
||||
/* identi.ca -> friendica items permanent-url compatibility */ |
||||
|
||||
} |
||||
return; |
||||
|
||||
function notice_init(App $a) { |
||||
|
||||
$id = $a->argv[1]; |
||||
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id)); |
||||
if (dbm::is_result($r)) { |
||||
$nick = $r[0]['nickname']; |
||||
$url = App::get_baseurl() . "/display/$nick/$id"; |
||||
goaway($url); |
||||
} else { |
||||
$a->error = 404; |
||||
notice(t('Item not found.') . EOL); |
||||
} |
||||
|
||||
return; |
||||
} |
||||
|
@ -1,18 +1,18 @@
|
||||
<?php |
||||
function opensearch_content(App $a) { |
||||
|
||||
$tpl = get_markup_template('opensearch.tpl'); |
||||
|
||||
header("Content-type: application/opensearchdescription+xml"); |
||||
function opensearch_content(App $a) { |
||||
|
||||
$o = replace_macros($tpl, array( |
||||
'$baseurl' => App::get_baseurl(), |
||||
'$nodename' => $a->get_hostname(), |
||||
)); |
||||
$tpl = get_markup_template('opensearch.tpl'); |
||||
|
||||
echo $o; |
||||
header("Content-type: application/opensearchdescription+xml"); |
||||
|
||||
killme(); |
||||
$o = replace_macros($tpl, array( |
||||
'$baseurl' => App::get_baseurl(), |
||||
'$nodename' => $a->get_hostname(), |
||||
)); |
||||
|
||||
} |
||||
?> |
||||
echo $o; |
||||
|
||||
killme(); |
||||
} |
||||
|