forked from tikiorg/tiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
freetag_apply.php
50 lines (41 loc) · 1.21 KB
/
freetag_apply.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
//smarty is not there - we need setup
if (basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)) {
die('This script may only be included.');
}
require_once('tiki-setup.php');
global $prefs;
global $tiki_p_freetags_tag;
if ($prefs['feature_freetags'] == 'y' and $tiki_p_freetags_tag == 'y') {
$freetaglib = TikiLib::lib('freetag');
if (isset($_REQUEST['freetag_string'])) {
$tag_string = $_REQUEST['freetag_string'];
} else {
$tag_string = '';
}
global $user;
if (! isset($cat_desc)) {
$cat_desc = '';
}
if (! isset($cat_name)) {
$cat_name = '';
}
if (! isset($cat_href)) {
$cat_href = '';
}
if (! isset($cat_lang)) {
$cat_lang = null;
}
$freetaglib->add_object($cat_type, $cat_objid, false, $cat_desc, $cat_name, $cat_href);
$freetaglib->update_tags($user, $cat_objid, $cat_type, $tag_string, false, $cat_lang);
require_once 'lib/search/refresh-functions.php';
refresh_index($cat_type, $cat_objid);
}