]> git.mxchange.org Git - friendica.git/blob - mod/filer.php
filer: replace "file as" prompt with combobox opened in fancybox
[friendica.git] / mod / filer.php
1 <?php
2
3 require_once('include/security.php');
4 require_once('include/bbcode.php');
5 require_once('include/items.php');
6
7
8 function filer_content(&$a) {
9
10         if(! local_user()) {
11                 killme();
12         }
13
14         $term = notags(trim($_GET['term']));
15         $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
16
17         logger('filer: tag ' . $term . ' item ' . $item_id);
18
19         if($item_id && strlen($term)){
20                 // file item
21                 file_tag_save_file(local_user(),$item_id,$term);
22         } else {
23                 // return filer dialog
24                 $filetags = get_pconfig(local_user(),'system','filetags');
25                 $filetags = explode("][", trim($filetags,"[]"));
26                 $tpl = get_markup_template("filer_dialog.tpl");
27                 $o = replace_macros($tpl, array(
28                         '$field' => array('term', t("File as:"), '', '', $filetags, t('- select -')),
29                         '$submit' => t('Save'),
30                 ));
31                 
32                 echo $o;
33         }
34         killme();
35 }