From 4b066e04f619c2c6f8d383daee9ceab49f39acdc Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Jul 2012 22:08:25 -0700 Subject: making tags work --- mod/filer.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'mod/filer.php') diff --git a/mod/filer.php b/mod/filer.php index c0cca9e6d..adc6245e1 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -18,12 +18,18 @@ function filer_content(&$a) { if($item_id && strlen($term)){ // file item - file_tag_save_file(local_user(),$item_id,$term); - } else { - // return filer dialog - $filetags = get_pconfig(local_user(),'system','filetags'); - $filetags = file_tag_file_to_list($filetags,'file'); - $filetags = explode(",", $filetags); + store_item_tag(local_user(),$item_id,TERM_OBJ_POST,TERM_FILE,$term,''); + } + else { + $filetags = array(); + $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", + intval(local_user()), + intval(TERM_FILE) + ); + if(count($r)) { + foreach($r as $rr) + $filetags[] = $rr['term']; + } $tpl = get_markup_template("filer_dialog.tpl"); $o = replace_macros($tpl, array( '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')), -- cgit v1.2.3