DropdownTranslation::isDropdownTranslationActive PHP Method

isDropdownTranslationActive() static public method

Is dropdown item translation functionnality active
static public isDropdownTranslationActive ( ) : true
return true if active, false if not
    static function isDropdownTranslationActive()
    {
        global $CFG_GLPI;
        return $CFG_GLPI['translate_dropdowns'];
    }

Usage Example

 /**
  * Clean translations associated to a dropdown
  *
  * @since version 0.85
  **/
 function cleanTranslations()
 {
     //Do not try to clean is dropdown translation is globally off
     if (DropdownTranslation::isDropdownTranslationActive()) {
         $translation = new DropdownTranslation();
         $translation->deleteByCriteria(array('itemtype' => get_class($this), 'items_id' => $this->getID()));
     }
 }