* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. */ /** * \file metallzuschlag/lib/metallzuschlag.lib.php * \ingroup metallzuschlag * \brief Hilfsfunktionen fuer Metallzuschlag-Modul */ /** * Admin-Navigation vorbereiten * * @return array */ function metallzuschlagAdminPrepareHead() { global $langs, $conf; $langs->load("metallzuschlag@metallzuschlag"); $h = 0; $head = array(); $head[$h][0] = dol_buildpath("/metallzuschlag/admin/setup.php", 1); $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; $head[$h][0] = dol_buildpath("/metallzuschlag/admin/about.php", 1); $head[$h][1] = $langs->trans("About"); $head[$h][2] = 'about'; $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'metallzuschlag@metallzuschlag'); complete_head_from_modules($conf, $langs, null, $head, $h, 'metallzuschlag@metallzuschlag', 'remove'); return $head; } /** * Metallname fuer Anzeige * * @param string $metal Metall-Kuerzel (CU/AL) * @return string Anzeigename */ function metallzuschlagGetMetalLabel($metal) { $labels = array( 'CU' => 'Kupfer (CU)', 'AL' => 'Aluminium (AL)', ); return isset($labels[$metal]) ? $labels[$metal] : $metal; } /** * Wert als Preis formatieren * * @param float $value Wert * @return string Formatierter Preis mit Einheit */ function metallzuschlagFormatPrice($value) { if (empty($value)) { return '-'; } return price($value, 0, '', 1, -1, 2).' €/100kg'; }