Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
820 B

  1. <?php
  2. require_once('include/security.php');
  3. require_once('include/bbcode.php');
  4. require_once('include/items.php');
  5. function filer_content(&$a) {
  6. if(! local_user()) {
  7. killme();
  8. }
  9. $term = unxmlify(trim($_GET['term']));
  10. $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
  11. logger('filer: tag ' . $term . ' item ' . $item_id);
  12. if($item_id && strlen($term)){
  13. // file item
  14. file_tag_save_file(local_user(),$item_id,$term);
  15. } else {
  16. // return filer dialog
  17. $filetags = get_pconfig(local_user(),'system','filetags');
  18. $filetags = explode("][", trim($filetags,"[]"));
  19. $tpl = get_markup_template("filer_dialog.tpl");
  20. $o = replace_macros($tpl, array(
  21. '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
  22. '$submit' => t('Save'),
  23. ));
  24. echo $o;
  25. }
  26. killme();
  27. }