mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-06-28 15:08:42 +02:00
gettext for plugin example + tools
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@179 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
@ -38,9 +38,8 @@ class PluginExampleDropdown extends CommonDropdown {
|
||||
|
||||
|
||||
static function getTypeName() {
|
||||
global $LANG;
|
||||
|
||||
return "Plugin Example Dropdown";
|
||||
return __('Plugin Example Dropdown');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -63,28 +63,27 @@ class PluginExampleExample extends CommonDBTM {
|
||||
|
||||
|
||||
function getSearchOptions() {
|
||||
global $LANG;
|
||||
|
||||
$tab = array();
|
||||
$tab['common'] = "Header Needed";
|
||||
|
||||
$tab[1]['table'] = 'glpi_plugin_example_examples';
|
||||
$tab[1]['field'] = 'name';
|
||||
$tab[1]['name'] = $LANG['plugin_example']["name"];
|
||||
$tab[1]['name'] = __('Name');
|
||||
|
||||
$tab[2]['table'] = 'glpi_plugin_example_dropdowns';
|
||||
$tab[2]['field'] = 'name';
|
||||
$tab[2]['name'] = 'Dropdown';
|
||||
$tab[2]['name'] = __('Dropdown');
|
||||
|
||||
$tab[3]['table'] = 'glpi_plugin_example_examples';
|
||||
$tab[3]['field'] = 'serial';
|
||||
$tab[3]['name'] = 'Serial';
|
||||
$tab[3]['name'] = __('Serial number');
|
||||
$tab[3]['usehaving'] = true;
|
||||
$tab[3]['searchtype'] = 'equals';
|
||||
|
||||
$tab[30]['table'] = 'glpi_plugin_example_examples';
|
||||
$tab[30]['field'] = 'id';
|
||||
$tab[30]['name'] = $LANG["common"][2];
|
||||
$tab[30]['name'] = __('ID');
|
||||
|
||||
return $tab;
|
||||
}
|
||||
@ -98,12 +97,11 @@ class PluginExampleExample extends CommonDBTM {
|
||||
* @return array of strings
|
||||
*/
|
||||
static function cronInfo($name) {
|
||||
global $LANG;
|
||||
|
||||
switch ($name) {
|
||||
case 'Sample' :
|
||||
return array('description' => $LANG['plugin_example']['test']." (class)",
|
||||
'parameter' => $LANG['plugin_example']['test']);
|
||||
return array('description' => __('Cron description for example'),
|
||||
'parameter' => __('Cron parameter for example'));
|
||||
}
|
||||
return array();
|
||||
}
|
||||
@ -148,16 +146,15 @@ class PluginExampleExample extends CommonDBTM {
|
||||
|
||||
|
||||
function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
|
||||
global $LANG;
|
||||
|
||||
if (!$withtemplate) {
|
||||
switch ($item->getType()) {
|
||||
case 'Phone' :
|
||||
if ($_SESSION['glpishow_count_on_tabs']) {
|
||||
return self::createTabEntry('Example',
|
||||
return self::createTabEntry(__('Example'),
|
||||
countElementsInTable($this->getTable()));
|
||||
}
|
||||
return 'Example';
|
||||
return __('Example');
|
||||
}
|
||||
}
|
||||
return '';
|
||||
@ -173,7 +170,6 @@ class PluginExampleExample extends CommonDBTM {
|
||||
}
|
||||
|
||||
static function getSpecificValueToDisplay($field, $values, $options=array()) {
|
||||
global $LANG;
|
||||
|
||||
if (!is_array($values)) {
|
||||
$values = array($field => $values);
|
||||
|
@ -40,9 +40,9 @@ class PluginExampleNotificationTargetExample extends NotificationTarget {
|
||||
}
|
||||
|
||||
function getDatasForTemplate($event, $options=array()) {
|
||||
global $DB, $LANG, $CFG_GLPI;
|
||||
global $DB, $CFG_GLPI;
|
||||
|
||||
$this->datas['##example.name##'] = 'Example';
|
||||
$this->datas['##example.name##'] = __('Example');
|
||||
}
|
||||
}
|
||||
?>
|
@ -62,11 +62,10 @@ class PluginExampleRuleTest extends Rule {
|
||||
|
||||
|
||||
function getCriterias() {
|
||||
global $LANG;
|
||||
|
||||
$criterias = array();
|
||||
$criterias['name']['field'] = 'name';
|
||||
$criterias['name']['name'] = $LANG['help'][31];
|
||||
$criterias['name']['name'] = __('Software');
|
||||
$criterias['name']['table'] = 'glpi_softwares';
|
||||
|
||||
return $criterias;
|
||||
@ -74,10 +73,9 @@ class PluginExampleRuleTest extends Rule {
|
||||
|
||||
|
||||
function getActions() {
|
||||
global $LANG;
|
||||
|
||||
$actions = array();
|
||||
$actions['softwarecategories_id']['name'] = $LANG['common'][36];
|
||||
$actions['softwarecategories_id']['name'] = __('Category (class)');
|
||||
$actions['softwarecategories_id']['type'] = 'dropdown';
|
||||
$actions['softwarecategories_id']['table'] = 'glpi_softwarecategories';
|
||||
return $actions;
|
||||
|
Reference in New Issue
Block a user