* @author Fabio Comuni <fabrixxm@kirgroup.com>
*/
+use Friendica\App;
+use Friendica\Core\System;
+
require_once('include/Photo.php');
/**
* @param App $a
*/
-/// @TODO & is missing or App ?
-function fbrowser_content($a){
+function fbrowser_content(App $a) {
- if (!local_user())
+ if (!local_user()) {
killme();
+ }
- if ($a->argc==1)
+ if ($a->argc == 1) {
killme();
+ }
$template_file = "filebrowser.tpl";
$mode = "";
if (x($_GET,'mode')) {
- $template_file = "filebrowser_plain.tpl";
$mode = "?mode=".$_GET['mode'];
}
- //echo "<pre>"; var_dump($a->argv); killme();
-
- switch($a->argv[1]){
+ switch ($a->argv[1]) {
case "image":
- $path = array( array("", t("Photos")));
+ $path = array(array("", t("Photos")));
$albums = false;
$sql_extra = "";
$sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
$scale = $rr['loq'];
return array(
- App::get_baseurl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
+ System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
$filename_e,
- App::get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
+ System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
);
}
$files = array_map("_map_files1", $r);
$o = replace_macros($tpl, array(
'$type' => 'image',
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
'$path' => $path,
'$folders' => $albums,
'$files' => $files,
$filename_e = $rr['filename'];
}
- return array( App::get_baseurl() . '/attach/' . $rr['id'], $filename_e, App::get_baseurl() . '/images/icons/16/' . $filetype . '.png');
+ return array( System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png');
}
$files = array_map("_map_files2", $files);
$tpl = get_markup_template($template_file);
$o = replace_macros($tpl, array(
'$type' => 'file',
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
'$path' => array( array( "", t("Files")) ),
'$folders' => false,
'$files' =>$files,