update function calls to new class.
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendcia\Model\FileTag;
use Friendica\Model\Item;
use Friendica\Database\DBA;
'$jotnets' => $jotnets,
'$title' => htmlspecialchars($item['title']),
'$placeholdertitle' => L10n::t('Set title'),
- '$category' => file_tag_file_to_list($item['file'], 'category'),
+ '$category' => FileTag::fileToList($item['file'], 'category'),
'$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t("Categories \x28comma-separated list\x29") : ''),
'$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Model\FileTag;
require_once 'include/items.php';
if ($item_id && strlen($term)) {
// file item
- file_tag_save_file(local_user(), $item_id, $term);
+ FileTag::saveFile(local_user(), $item_id, $term);
} else {
// return filer dialog
$filetags = PConfig::get(local_user(), 'system', 'filetags');
- $filetags = file_tag_file_to_list($filetags, 'file');
+ $filetags = FileTag::fileToList($filetags, 'file');
$filetags = explode(",", $filetags);
$tpl = get_markup_template("filer_dialog.tpl");
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\System;
+use Friendica\Model\FileTag;
-function filerm_content(App $a) {
-
- if (! local_user()) {
+function filerm_content(App $a)
+{
+ if (! local_user())
+ {
killme();
}
$cat = unxmlify(trim($_GET['cat']));
$category = (($cat) ? true : false);
- if ($category) {
+
+ if ($category)
+ {
$term = $cat;
}
Logger::log('filerm: tag ' . $term . ' item ' . $item_id);
- if ($item_id && strlen($term)) {
- file_tag_unsave_file(local_user(),$item_id,$term, $category);
+ if ($item_id && strlen($term))
+ {
+ FileTag::unsaveFile(local_user(), $item_id, $term, $category);
}
- //$a->internalRedirect('network');
-
killme();
}
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
+use Friendica\Model\FileTag;
use Friendica\Model\Item;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\Email;
}
}
- if (!empty($categories)) {
+ if (!empty($categories))
+ {
// get the "fileas" tags for this post
- $filedas = file_tag_file_to_list($categories, 'file');
+ $filedas = FileTag::fileToList($categories, 'file');
}
+
// save old and new categories, so we can determine what needs to be deleted from pconfig
$categories_old = $categories;
- $categories = file_tag_list_to_file(trim(defaults($_REQUEST, 'category', '')), 'category');
+ $categories = FileTag::listToFile(trim(defaults($_REQUEST, 'category', '')), 'category');
$categories_new = $categories;
- if (!empty($filedas)) {
+
+ if (!empty($filedas))
+ {
// append the fileas stuff to the new categories list
- $categories .= file_tag_list_to_file($filedas, 'file');
+ $categories .= FileTag::listToFile($filedas, 'file');
}
// get contact info for poster
Item::update($fields, ['id' => $post_id]);
// update filetags in pconfig
- file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
+ FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
if (!empty($_REQUEST['return']) && strlen($return_path)) {
Logger::log('return: ' . $return_path);
}
// update filetags in pconfig
- file_tag_update_pconfig($uid, $categories_old, $categories_new, 'category');
+ FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
// These notifications are sent if someone else is commenting other your wall
if ($parent) {
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
+use Friendica\Model\FileTag;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
$terms = array();
$cnt = preg_match_all('/\[(.*?)\]/', $saved, $matches, PREG_SET_ORDER);
if ($cnt) {
- foreach ($matches as $mtch) {
- $unescaped = xmlify(file_tag_decode($mtch[1]));
+ foreach ($matches as $mtch)
+ {
+ $unescaped = xmlify(FileTag::decode($mtch[1]));
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
if ($cnt) {
foreach ($matches as $mtch) {
- $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $unescaped = xmlify(FileTag::decode($mtch[1]));
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
+use Friendica\Model\FileTag;
use Friendica\Model\PermissionSet;
use Friendica\Model\ItemURI;
use Friendica\Object\Image;
$matches = false;
$cnt = preg_match_all('/<(.*?)>/', $item['file'], $matches, PREG_SET_ORDER);
- if ($cnt) {
- foreach ($matches as $mtch) {
- file_tag_unsave_file($item['uid'], $item['id'], $mtch[1],true);
+
+ if ($cnt)
+ {
+ foreach ($matches as $mtch)
+ {
+ FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],true);
}
}
$matches = false;
$cnt = preg_match_all('/\[(.*?)\]/', $item['file'], $matches, PREG_SET_ORDER);
- if ($cnt) {
- foreach ($matches as $mtch) {
- file_tag_unsave_file($item['uid'], $item['id'], $mtch[1],false);
+
+ if ($cnt)
+ {
+ foreach ($matches as $mtch)
+ {
+ FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],false);
}
}
intval(TERM_CATEGORY),
intval($owner_id)
);
- //$sql_extra .= file_tag_file_query('item',$category,'category');
+ //$sql_extra .= FileTag::fileQuery('item',$category,'category');
}
if ($public_feed && ! $converse) {