PHP Class KnowbaseItemTranslation, glpi

Inheritance: extends CommonDBChild
Show file Open project: glpi-project/glpi Class Usage Examples

Public Properties

Property Type Description
$dohistory
$items_id
$itemtype
$rightname

Public Methods

Method Description
canBeTranslated ( CommonGLPI $item ) : true Check if an item can be translated It be translated if translation if globally on and item is an instance of CommonDropdown or CommonTreeDropdown and if translation is enabled for this class
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
getAlreadyTranslatedForItem ( $item ) : array Get already translated languages for item
getForbiddenStandardMassiveAction ( )
getNumberOfTranslationsForItem ( $item ) : the Return the number of translations for an item
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTranslatedValue ( KnowbaseItem $item, $field = "name" ) : the Get a translation for a value
getTypeName ( $nb )
isKbTranslationActive ( ) : true Is kb item translation functionnality active
showForm ( $ID, $options = [] ) Display translation form
showTranslations ( KnowbaseItem $item ) : true; Display all translated field for an KnowbaseItem

Method Details

canBeTranslated() static public method

Check if an item can be translated It be translated if translation if globally on and item is an instance of CommonDropdown or CommonTreeDropdown and if translation is enabled for this class
static public canBeTranslated ( CommonGLPI $item ) : true
$item CommonGLPI
return true if item can be translated, false otherwise

displayTabContentForItem() static public method

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI CommonGLPI object
$tabnum (default 1)
$withtemplate (default 0)

getAlreadyTranslatedForItem() static public method

Get already translated languages for item
static public getAlreadyTranslatedForItem ( $item ) : array
return array of already translated languages

getForbiddenStandardMassiveAction() public method

getNumberOfTranslationsForItem() static public method

Return the number of translations for an item
static public getNumberOfTranslationsForItem ( $item ) : the
return the number of translations for this item

getTabNameForItem() public method

See also: CommonGLPI::getTabNameForItem()
public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTranslatedValue() static public method

Get a translation for a value
static public getTranslatedValue ( KnowbaseItem $item, $field = "name" ) : the
$item KnowbaseItem item to translate
$field field to return (default 'name')
return the field translated if a translation is available, or the original field if not

getTypeName() static public method

static public getTypeName ( $nb )

isKbTranslationActive() static public method

Is kb item translation functionnality active
static public isKbTranslationActive ( ) : true
return true if active, false if not

showForm() public method

Display translation form
public showForm ( $ID, $options = [] )
$ID field (default -1)
$options array

showTranslations() static public method

Display all translated field for an KnowbaseItem
static public showTranslations ( KnowbaseItem $item ) : true;
$item KnowbaseItem a KnowbaseItem item
return true;

Property Details

$dohistory public property

public $dohistory

$items_id public static property

public static $items_id

$itemtype public static property

public static $itemtype

$rightname static public property

static public $rightname