mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
file as widget and basic filing implementation for duepuntozero,slackr
much more work needed - this is just for test/evaluation currently
This commit is contained in:
parent
8a789a33d1
commit
be48fff157
11 changed files with 101 additions and 4 deletions
|
@ -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,
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -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')
|
||||
));
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue