]> git.mxchange.org Git - friendica.git/blob - mod/filer.php
Implement Smarty3
[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 = unxmlify(trim($_GET['term']));
15         $item_id = (($a->argc > 1) ? intval($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 = file_tag_file_to_list($filetags,'file');
26                 $filetags = explode(",", $filetags);
27                 $tpl = get_markup_template("filer_dialog.tpl");
28
29                 $includes = array(
30                         '$field_combobox' => 'field_combobox.tpl',
31                 );
32                 $includes = set_template_includes($a->theme['template_engine'], $includes);
33
34                 $o = replace_macros($tpl, array(
35                         '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
36                         '$submit' => t('Save'),
37                 ));
38                 
39                 echo $o;
40         }
41         killme();
42 }