New: Ajout selecteur de couleurs

This commit is contained in:
Laurent Destailleur 2008-01-26 17:40:42 +00:00
parent dccf9a2cc2
commit 7077d668a0
4 changed files with 39 additions and 2 deletions

View File

@ -202,6 +202,41 @@ class FormAdmin
} }
print '</select>'; print '</select>';
} }
/**
* \brief Return colors list selector
* \param selected Color pre-selected
* \param htmlname Name of html select zone
*/
function select_colors($selected='', $htmlname, $arrayofcolors='', $showcolorbox=1)
{
global $langs,$conf;
if (! is_array($arrayofcolors)) $arrayofcolors=array('29527A','5229A3','A32929','7A367A','B1365F','0D7813');
//$selected='';
if ($selected) print '<table class="nobordernopadding"><tr valign="middle" class="nobordernopadding"><td class="nobordernopadding">';
print '<select class="flat" name="'.$htmlname.'">';
print '<option value="-1">&nbsp;</option>';
foreach ($arrayofcolors as $val)
{
print '<option value="'.$val.'"';
if ($selected == $val) print ' selected="true"';
print '>'.$val.'</option>';
}
print '</select>';
if ($showcolorbox)
{
print '</td><td style="padding-left: 4px" nowrap="nowrap">';
print '<!-- Box color '.$selected.' -->';
print '<table style="border-collapse: collapse; margin:0px; padding: 0px; border: 1px solid #888888; background: #'.$selected.';" width="12" height="10">';
print '<tr class="nocellnopadd"><td></td></tr>';
print '</table>';
print '</td></tr></table>';
}
}
} }
?> ?>

View File

@ -410,6 +410,7 @@ PartialMan=Partial
TotalWoman=Total TotalWoman=Total
TotalMan=Total TotalMan=Total
YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary
Color=Color
# Week day # Week day
Monday=Monday Monday=Monday
Tuesday=Tuesday Tuesday=Tuesday

View File

@ -412,6 +412,7 @@ PartialMan=Partiel
TotalWoman=Totale TotalWoman=Totale
TotalMan=Total TotalMan=Total
YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires
Color=Couleur
# Week day # Week day
Monday=Lundi Monday=Lundi
Tuesday=Mardi Tuesday=Mardi

View File

@ -779,8 +779,8 @@ a.butActionDelete:hover { font-size: 12px; font-family: helvetica, verdana, ar
.nocellnopadd { .nocellnopadd {
list-style-type:none; list-style-type:none;
margin:0px; margin: 0px;
padding:0px; padding: 0px;
} }
.notopnoleft { .notopnoleft {