cn=$p_cn;
$this->data=new Tag_SQL($p_cn);
}
/**
* Show the list of available tag
* @return HTML
*/
function show_list()
{
$ret=$this->data->seek(' order by t_tag');
if ( $this->cn->count($ret) == 0) return "";
require_once 'template/tag_list.php';
}
/**
* let select a tag to add
*/
function select()
{
$ret=$this->data->seek(' order by t_tag');
require_once 'template/tag_select.php';
}
/**
* Display a inner window with the detail of a tag
*/
function form_add()
{
$data=$this->data;
require_once 'template/tag_detail.php';
}
/**
* Show the tag you can add to a document
*/
function show_form_add()
{
echo '
'.' Ajout d\'un dossier (ou tag)'.'
';
$this->form_add();
}
function save($p_array)
{
if ( trim($p_array['t_tag'])=="" ) return ;
$this->data->t_id=$p_array['t_id'];
$this->data->t_tag= strip_tags($p_array['t_tag']);
$this->data->t_description=strip_tags($p_array['t_description']);
$this->data->save();
}
function remove($p_array)
{
$this->data->t_id=$p_array['t_id'];
$this->data->delete();
}
/**
* Show a button to select tag for Search
* @return HTML
*/
function choose()
{
$r="";
$r.=HtmlInput::button("choose_tag", "Etiquette", 'onclick="choose_tag('.Dossier::id().')"', "smallbutton");
return $r;
}
/**
* let select a tag to add to the search
*/
function select_search()
{
$ret=$this->data->seek(' order by t_tag');
require_once 'template/tag_select.php';
}
}
?>