freetag_apply.php 1.35 KB
Newer Older
1
<?php 
2
// $Id: /cvsroot/tikiwiki/tiki/freetag_apply.php,v 1.7.2.2 2008-02-18 15:21:25 lphuberdeau Exp $
3

4
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
5 6 7 8 9 10
// 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.

//this script may only be included - so its better to err & die if called directly.
//smarty is not there - we need setup
require_once('tiki-setup.php');  
11
global $access; require_once("lib/tikiaccesslib.php");
12 13
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));

14
global $prefs;
15
global $tiki_p_freetags_tag;
16

17
if ($prefs['feature_freetags'] == 'y' and $tiki_p_freetags_tag == 'y') {
18 19 20 21 22 23

    global $freetaglib;
    if (!is_object($freetaglib)) {
	include_once('lib/freetag/freetaglib.php');
    }

24 25 26 27 28
	if (isset($_REQUEST['freetag_string'])) {    	    
		$tag_string = $_REQUEST['freetag_string'];
	} else {
		$tag_string = '';
	}    
29 30

    global $user;
31

lfagundes's avatar
lfagundes committed
32 33 34
    if (!isset($cat_desc)) $cat_desc = '';
    if (!isset($cat_name)) $cat_name = '';
    if (!isset($cat_href)) $cat_href = '';
35
    if (!isset($cat_lang)) $cat_lang = null;
lfagundes's avatar
lfagundes committed
36

37
    $freetaglib->add_object($cat_type, $cat_objid, $cat_desc, $cat_name, $cat_href);	
38
    $freetaglib->update_tags($user, $cat_objid, $cat_type, $tag_string, false, $cat_lang);
39 40

}