6 use Friendica\Core\L10n;
7 use Friendica\Core\Logger;
8 use Friendica\Core\PConfig;
9 use Friendica\Core\Renderer;
10 use Friendica\Model\FileTag;
11 use Friendica\Util\XML;
13 function filer_content(App $a)
19 $term = XML::unescape(trim(defaults($_GET, 'term', '')));
20 $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
22 Logger::log('filer: tag ' . $term . ' item ' . $item_id);
24 if ($item_id && strlen($term)) {
26 FileTag::saveFile(local_user(), $item_id, $term);
28 // return filer dialog
29 $filetags = PConfig::get(local_user(), 'system', 'filetags');
30 $filetags = FileTag::fileToList($filetags, 'file');
31 $filetags = explode(",", $filetags);
33 $tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
34 $o = Renderer::replaceMacros($tpl, [
35 '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')],
36 '$submit' => L10n::t('Save'),