noalyss Version-9
ajax_search_add_tag.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21if (!defined('ALLOWED'))
22 die('Appel direct ne sont pas permis');
23/**
24 * @file
25 * @brief add tag , used for follow up
26 * @see Tag
27 */
28//Single Tag
29ob_start();
30if ($_GET['clear']==1)
31{
32 /* Add a clear button */
34}
35if ($http->request("obj")=='t')
36{
37
38 $tag=new Tag_Action($cn, $http->get("id", "number"));
39 $tag->update_search_cell($http->get("pref"));
40}
41elseif ($http->request("obj")=="g")
42{
43 // Add all the tag from the group
44 $aTag=$cn->get_array("select t_id,t_tag from jnt_tag_group_tag jtgt join tags on (tag_id=t_id) where tag_group_id=$1 order by 2 ",[$http->get("id", "number")]);
45 $nb_atag=count($aTag);
46 $pref=$http->get("pref");
47 if ( $nb_atag > 0) {
48 for ($i=0;$i<$nb_atag;$i++){
49 $tag=new Tag_Action($cn,$aTag[$i]['t_id']);
50 $tag->update_search_cell($pref);
51 }
52 }
53
54}
55$response=ob_get_clean();
57header('Content-type: text/xml; charset=UTF-8');
58echo <<<EOF
59<?xml version="1.0" encoding="UTF-8"?>
60<data>
61<ctl></ctl>
62<html>$html</html>
63</data>
64EOF;
65exit();
66?>
67
if($_GET['clear']==1) if( $http->request("obj")=='t') elseif($http->request("obj")=="g") $response
$_GET['qcode']
concerns the tags linked to an action
static add_clear_button($p_prefix)
clear the search cell
for($e=0; $e< count($afiche); $e++) exit
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...
if( $delta< 0) elseif( $delta==0)