2012-03-13 23:46:37 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function filerm_content(&$a) {
|
|
|
|
|
2016-12-20 05:56:34 -05:00
|
|
|
if (! local_user()) {
|
2012-03-13 23:46:37 -04:00
|
|
|
killme();
|
|
|
|
}
|
|
|
|
|
2012-03-31 18:25:17 -04:00
|
|
|
$term = unxmlify(trim($_GET['term']));
|
2012-05-04 09:42:56 -04:00
|
|
|
$cat = unxmlify(trim($_GET['cat']));
|
|
|
|
|
|
|
|
$category = (($cat) ? true : false);
|
2016-12-20 15:15:53 -05:00
|
|
|
if ($category) {
|
2012-05-04 09:42:56 -04:00
|
|
|
$term = $cat;
|
2016-12-20 15:15:53 -05:00
|
|
|
}
|
2012-05-04 09:42:56 -04:00
|
|
|
|
2012-03-31 18:25:17 -04:00
|
|
|
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
2012-03-13 23:46:37 -04:00
|
|
|
|
|
|
|
logger('filerm: tag ' . $term . ' item ' . $item_id);
|
|
|
|
|
2016-12-20 15:15:53 -05:00
|
|
|
if ($item_id && strlen($term)) {
|
2012-05-04 09:42:56 -04:00
|
|
|
file_tag_unsave_file(local_user(),$item_id,$term, $category);
|
2016-12-20 15:15:53 -05:00
|
|
|
}
|
2012-03-13 23:46:37 -04:00
|
|
|
|
2016-12-20 15:15:53 -05:00
|
|
|
if (x($_SESSION,'return_url')) {
|
2016-12-20 06:45:16 -05:00
|
|
|
goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
|
2016-12-20 15:15:53 -05:00
|
|
|
}
|
2014-03-16 12:16:01 -04:00
|
|
|
|
2012-03-13 23:46:37 -04:00
|
|
|
killme();
|
|
|
|
}
|