]> git.mxchange.org Git - friendica.git/blob - mod/filer.php
Improve Console/Config display for array values
[friendica.git] / mod / filer.php
1 <?php
2 /**
3  * @file mod/filer.php
4  */
5 use Friendica\App;
6 use Friendica\Core\L10n;
7 use Friendica\Core\PConfig;
8
9 require_once 'include/security.php';
10 require_once 'include/items.php';
11
12 function filer_content(App $a)
13 {
14         if (! local_user()) {
15                 killme();
16         }
17
18         $term = unxmlify(trim($_GET['term']));
19         $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
20
21         logger('filer: tag ' . $term . ' item ' . $item_id);
22
23         if ($item_id && strlen($term)) {
24                 // file item
25                 file_tag_save_file(local_user(), $item_id, $term);
26         } else {
27                 // return filer dialog
28                 $filetags = PConfig::get(local_user(), 'system', 'filetags');
29                 $filetags = file_tag_file_to_list($filetags, 'file');
30                 $filetags = explode(",", $filetags);
31
32                 $tpl = get_markup_template("filer_dialog.tpl");
33                 $o = replace_macros($tpl, [
34                         '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')],
35                         '$submit' => L10n::t('Save'),
36                 ]);
37
38                 echo $o;
39         }
40         killme();
41 }