diff options
author | friendica <info@friendica.com> | 2012-03-13 18:13:03 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-03-13 18:13:03 -0700 |
commit | be48fff1570aa1d04e049a6fd1665f4fc9634a62 (patch) | |
tree | 27b3a9afc78391ece8bfd2ce13ac74b77bc18898 /include | |
parent | 8a789a33d1168359ae23300bc3169b37fb02facc (diff) | |
download | volse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.tar.gz volse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.tar.bz2 volse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.zip |
file as widget and basic filing implementation for duepuntozero,slackr
much more work needed - this is just for test/evaluation currently
Diffstat (limited to 'include')
-rwxr-xr-x | include/contact_widgets.php | 29 | ||||
-rwxr-xr-x | include/conversation.php | 2 | ||||
-rw-r--r-- | include/text.php | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php index caa0572d2..605a3eb78 100755 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -75,4 +75,33 @@ function networks_widget($baseurl,$selected = '') { )); } +function fileas_widget($baseurl,$selected = '') { + $a = get_app(); + if(! local_user()) + return ''; + + $saved = get_pconfig(local_user(),'system','filetags'); + if(! strlen($saved)) + return; + + $matches = false; + $terms = array(); + $cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $unescaped = file_tag_decode($mtch[1]); + $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : '')); + } + } + + return replace_macros(get_markup_template('fileas_widget.tpl'),array( + '$title' => t('File Selections'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $baseurl, + + )); +} diff --git a/include/conversation.php b/include/conversation.php index 4b2ca316b..a420e9923 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -572,6 +572,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'classundo' => (($item['starred']) ? "" : "hidden"), 'starred' => t('starred'), 'tagger' => t("add tag"), + 'filer' => t("file as"), 'classtagger' => "", ); } @@ -874,6 +875,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$vidurl' => t("Please enter a video link/URL:"), '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), + '$fileas' => t('File as:'), '$whereareu' => t('Where are you right now?'), '$title' => t('Enter a title for this item') )); diff --git a/include/text.php b/include/text.php index 2663bdeba..c44b4d178 100644 --- a/include/text.php +++ b/include/text.php @@ -1294,7 +1294,7 @@ function file_tag_save_file($uid,$item,$file) { if(count($r)) { if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']')) q("update item set file = '%s' where id = %d and uid = %d limit 1", - dbesc($r[0]['file'] . '[' . $file_tag_encode($file) . ']'), + dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'), intval($item), intval($uid) ); |