2012-03-14 04:46:37 +01:00
|
|
|
<?php
|
|
|
|
|
2017-04-30 06:07:00 +02:00
|
|
|
use Friendica\App;
|
2018-10-29 22:20:46 +01:00
|
|
|
use Friendica\Core\Logger;
|
2017-08-26 08:04:21 +02:00
|
|
|
use Friendica\Core\System;
|
2018-10-30 19:51:45 +01:00
|
|
|
use Friendica\Model\FileTag;
|
2018-11-03 18:08:30 +01:00
|
|
|
use Friendica\Util\XML;
|
2017-04-30 06:07:00 +02:00
|
|
|
|
2018-10-30 19:51:45 +01:00
|
|
|
function filerm_content(App $a)
|
|
|
|
{
|
|
|
|
if (! local_user())
|
|
|
|
{
|
2012-03-14 04:46:37 +01:00
|
|
|
killme();
|
|
|
|
}
|
|
|
|
|
2018-11-03 18:08:30 +01:00
|
|
|
$term = XML::unxmlify(trim($_GET['term']));
|
|
|
|
$cat = XML::unxmlify(trim($_GET['cat']));
|
2012-05-04 15:42:56 +02:00
|
|
|
|
|
|
|
$category = (($cat) ? true : false);
|
2018-10-30 19:51:45 +01:00
|
|
|
|
|
|
|
if ($category)
|
|
|
|
{
|
2012-05-04 15:42:56 +02:00
|
|
|
$term = $cat;
|
2016-12-20 21:15:53 +01:00
|
|
|
}
|
2012-05-04 15:42:56 +02:00
|
|
|
|
2012-04-01 00:25:17 +02:00
|
|
|
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
2012-03-14 04:46:37 +01:00
|
|
|
|
2018-10-29 22:20:46 +01:00
|
|
|
Logger::log('filerm: tag ' . $term . ' item ' . $item_id);
|
2012-03-14 04:46:37 +01:00
|
|
|
|
2018-10-30 19:51:45 +01:00
|
|
|
if ($item_id && strlen($term))
|
|
|
|
{
|
|
|
|
FileTag::unsaveFile(local_user(), $item_id, $term, $category);
|
2016-12-20 21:15:53 +01:00
|
|
|
}
|
2012-03-14 04:46:37 +01:00
|
|
|
|
|
|
|
killme();
|
|
|
|
}
|