noalyss  Version-6.7.2
Public Member Functions | Static Public Member Functions
Tag Class Reference

Public Member Functions

 __construct ($p_cn, $id=-1)
 form_add ()
 Display a inner window with the detail of a tag.
 remove ($p_array)
 save ($p_array)
 select ()
 let select a tag to add
 select_search ($p_prefix)
 let select a tag to add to the search
 show_form_add ()
 Show the tag you can add to a document.
 show_list ()
 Show the list of available tag.
 update_search_cell ($p_prefix)
 In the screen search add this data to the cell.

Static Public Member Functions

static add_clear_button ($p_prefix)
 clear the search cell
static button_search ($p_prefix)
 Show a button to select tag for Search.

Detailed Description

Definition at line 22 of file class_tag.php.


Constructor & Destructor Documentation

Tag::__construct ( p_cn,
id = -1 
)

Definition at line 24 of file class_tag.php.

References $id, and cn.

    {
        $this->cn=$p_cn;
        $this->data=new Tag_SQL($p_cn,$id);
    }

Member Function Documentation

static Tag::add_clear_button ( p_prefix) [static]

clear the search cell

Definition at line 111 of file class_tag.php.

References HtmlInput\button(), and Dossier\id().

                                                {
        $clear=HtmlInput::button('clear', 'X', 'onclick="search_clear_tag('.Dossier::id().',\''.$p_prefix.'\');"', 'smallbutton');
        return $clear;
    }
static Tag::button_search ( p_prefix) [static]

Show a button to select tag for Search.

Returns:
HTML

Definition at line 81 of file class_tag.php.

References $r, HtmlInput\button(), and Dossier\id().

    {
        $r="";
        $r.=HtmlInput::button("choose_tag", "Etiquette", 'onclick="search_display_tag('.Dossier::id().',\''.$p_prefix.'\')"', "smallbutton");
        return $r;
    }

Display a inner window with the detail of a tag.

Definition at line 50 of file class_tag.php.

References $data.

Referenced by show_form_add().

    {
        $data=$this->data;
        require_once 'template/tag_detail.php';
    }
Tag::remove ( p_array)

Definition at line 72 of file class_tag.php.

References $p_array.

    {
        $this->data->t_id=$p_array['t_id'];
        $this->data->delete();
    }
Tag::save ( p_array)

Definition at line 64 of file class_tag.php.

References $p_array, and trim().

    {
        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();
    }

let select a tag to add

Definition at line 42 of file class_tag.php.

References $ret.

    {
        $ret=$this->data->seek(' order by t_tag');
        require_once 'template/tag_select.php';
    }
Tag::select_search ( p_prefix)

let select a tag to add to the search

Definition at line 90 of file class_tag.php.

    {
        $ret=$this->data->seek(' order by t_tag');
        require_once 'template/tag_search_select.php';
    }

Show the tag you can add to a document.

Definition at line 58 of file class_tag.php.

References echo, and form_add().

    {
        echo '<h2>'.' Ajout d\'un dossier (ou  tag)'.'</h2>';
       
        $this->form_add();
    }

Show the list of available tag.

Returns:
HTML

Definition at line 33 of file class_tag.php.

References $ret, and cn.

    {
        $ret=$this->data->seek(' order by t_tag');
        if ( $this->cn->count($ret) == 0) return "";
        require_once 'template/tag_list.php';
    }
Tag::update_search_cell ( p_prefix)

In the screen search add this data to the cell.

Definition at line 98 of file class_tag.php.

                                           {
        echo '<span id="sp_'.$p_prefix.$this->data->t_id.'" style="border:1px solid black;margin-right:5px;">';
        echo h($this->data->t_tag);
        echo HtmlInput::hidden($p_prefix.'tag[]', $this->data->t_id);
        $js=sprintf("$('sp_".$p_prefix.$this->data->t_id."').remove();");
        echo '<span style="background-color:red;text-align:center;border-top:1px solid black; border-right:1px solid black;border-bottom:1px solid black;">';
        echo HtmlInput::anchor('X', "javascript:void(0)", "onclick=\"$js\"");
        echo '</span>';
        echo '</span>';
    }

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations