Removed deprecated code
This commit is contained in:
parent
f5a2918fbc
commit
6296c2ab22
@ -613,7 +613,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value="'.$_POST['sujet'].'"></td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
$htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing');
|
||||
$htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
@ -986,7 +986,7 @@ else
|
||||
//}
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
$htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing');
|
||||
$htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing',0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
|
||||
@ -258,6 +258,7 @@ class FormAdmin
|
||||
* \param selected Color pre-selected
|
||||
* \param htmlname Name of html select zone
|
||||
*/
|
||||
/*
|
||||
function select_colors($selected='', $htmlname, $arrayofcolors='', $showcolorbox=1)
|
||||
{
|
||||
global $langs,$conf;
|
||||
@ -287,6 +288,7 @@ class FormAdmin
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -346,33 +346,76 @@ class FormOther
|
||||
|
||||
|
||||
/**
|
||||
* Affiche zone de selection de couleur
|
||||
* @param set_color Couleur de pre-selection
|
||||
* @param prefix Prefix pour nom champ
|
||||
* @param form_name Nom du formulaire de provenance.
|
||||
* Output a HTML code to select a color
|
||||
* @param set_color Pre-selected color
|
||||
* @param prefix Name of HTML field
|
||||
* @param form_name Name of form
|
||||
* @param showcolorbox 1=Show color code and color box, 0=Show only color code
|
||||
* @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
|
||||
*/
|
||||
function select_color($set_color='', $prefix='f_color', $form_name='objForm')
|
||||
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')
|
||||
{
|
||||
print "\n".'<table class="nobordernopadding"><tr><td valign="middle">';
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_colorpicker.js"></script>'."\n";
|
||||
print '<script type="text/javascript">
|
||||
window.onload = function()
|
||||
{
|
||||
fctLoad();
|
||||
}
|
||||
window.onscroll = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
window.onresize = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
</script>'."\n";
|
||||
print '<input type="text" size="10" name="'.$prefix.'" value="'.$set_color.'" maxlength="7" class="flat">'."\n";
|
||||
print '</td><td valign="middle">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/theme/common/colorpicker.png" width="21" height="20" border="0" onClick="fctShow(document.'.$form_name.'.'.$prefix.');" style="cursor:pointer;">'."\n";
|
||||
print '</td></tr></table>';
|
||||
if (! is_array($arrayofcolors) || sizeof($arrayofcolors) < 1)
|
||||
{
|
||||
// No list of colors forced, we can suggest any color
|
||||
print "\n".'<table class="nobordernopadding"><tr><td valign="middle">';
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_colorpicker.js"></script>'."\n";
|
||||
print '<script type="text/javascript">
|
||||
window.onload = function()
|
||||
{
|
||||
fctLoad();
|
||||
}
|
||||
window.onscroll = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
window.onresize = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
</script>'."\n";
|
||||
print '<input type="text" size="10" name="'.$prefix.'" value="'.$set_color.'" maxlength="7" class="flat">'."\n";
|
||||
print '</td><td valign="middle">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/theme/common/colorpicker.png" width="21" height="18" border="0" onClick="fctShow(document.'.$form_name.'.'.$prefix.');" style="cursor:pointer;">'."\n";
|
||||
print '</td>';
|
||||
|
||||
if ($showcolorbox)
|
||||
{
|
||||
print '<td style="padding-left: 4px" nowrap="nowrap">';
|
||||
print '<!-- Box color '.$set_color.' -->';
|
||||
print '<table style="border-collapse: collapse; margin:0px; padding: 0px; border: 1px solid #888888; background: #'.(preg_replace('/#/','',$set_color)).';" width="12" height="10">';
|
||||
print '<tr class="nocellnopadd"><td></td></tr>';
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// List of colors is forced
|
||||
if ($showcolorbox) print '<table class="nobordernopadding"><tr valign="middle" class="nobordernopadding"><td class="nobordernopadding">';
|
||||
|
||||
print '<select class="flat" name="'.$prefix.'">';
|
||||
print '<option value="-1"> </option>';
|
||||
foreach ($arrayofcolors as $val)
|
||||
{
|
||||
print '<option value="'.$val.'"';
|
||||
if ($set_color == $val) print ' selected="true"';
|
||||
print '>'.$val.'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
|
||||
if ($showcolorbox)
|
||||
{
|
||||
print '</td><td style="padding-left: 4px" nowrap="nowrap">';
|
||||
print '<!-- Box color '.$set_color.' -->';
|
||||
print '<table style="border-collapse: collapse; margin:0px; padding: 0px; border: 1px solid #888888; background: #'.(preg_replace('/#/','',$set_color)).';" width="12" height="10">';
|
||||
print '<tr class="nocellnopadd"><td></td></tr>';
|
||||
print '</table>';
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
// \file htdocs/lib/lib_colorpicker.js
|
||||
// \brief File with javascript function to output a color picker
|
||||
// \version $Revision$
|
||||
|
||||
StringBuilder = function()
|
||||
{
|
||||
this.arrStr = new Array();
|
||||
@ -122,7 +126,7 @@ fctShow = function(objForm)
|
||||
} else {
|
||||
fctReset();
|
||||
}
|
||||
fctSelect('Name', 'Named');
|
||||
fctSelect('Safe', 'Safety');
|
||||
}
|
||||
if (objCurrent) {
|
||||
var w = h = t = l = 0;
|
||||
@ -173,10 +177,10 @@ fctLoad = function()
|
||||
}
|
||||
|
||||
objSB.Append('<table id="tblGlobal" class="tblGlobal" border="0" cellpadding="0" cellspacing="0"><tr><td class="tdContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>');
|
||||
objSB.Append('<td width="24%" align="center"><input type="button" value="Named" class="btnPalette" onClick="fctSelect(\'Name\', \'Named\');"></td>');
|
||||
objSB.Append('<td width="23%" align="center"><input type="button" value="Safety" class="btnPalette" onClick="fctSelect(\'Safe\', \'Safety\');"></td>');
|
||||
objSB.Append('<td width="23%" align="center"><input type="button" value="System" class="btnPalette" onClick="fctSelect(\'Sys\', \'System\');"></td>');
|
||||
objSB.Append('<td width="30%" align="center"><input type="button" value="Grayscale" class="btnPalette" onClick="fctSelect(\'Gray\', \'Grayscale\');"></td>');
|
||||
//objSB.Append('<td width="24%" align="center"><input type="button" value="Named" class="btnPalette" onClick="fctSelect(\'Name\', \'Named\');"></td>');
|
||||
objSB.Append('<td width="33%" align="center"><input type="button" value="Safety" class="btnPalette" onClick="fctSelect(\'Safe\', \'Safety\');"></td>');
|
||||
objSB.Append('<td width="34%" align="center"><input type="button" value="System" class="btnPalette" onClick="fctSelect(\'Sys\', \'System\');"></td>');
|
||||
objSB.Append('<td width="33%" align="center"><input type="button" value="Grayscale" class="btnPalette" onClick="fctSelect(\'Gray\', \'Grayscale\');"></td>');
|
||||
objSB.Append('</tr></table></td></tr><tr><td class="tdContainer"><fieldset><legend align="top" id="objLegend"></legend><table id="tblContainer" class="tblContainer" border="0" cellpadding="0" cellspacing="0"><tr><td class="tdContainer">');
|
||||
|
||||
objSB.Append('<table id="tblGray" class="tblColor" border="0" cellpadding="0" cellspacing="0"><tr>');
|
||||
@ -254,7 +258,7 @@ objSB.Append('<tr><td class="tdDisplay" id="objPreview"> </td><td class="td
|
||||
objSB.Append('<tr><td class="tdDisplayTxt" id="objPreviewTxt" valign="top"> </td><td class="tdDisplayTxt" id="objSelectedTxt" valign="top"> </td></tr>');
|
||||
objSB.Append('</table></td></tr><tr><td class="tdContainer">');
|
||||
objSB.Append('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>');
|
||||
objSB.Append('<td width="33%" align="center"><input type="button" value="Cancel" class="btnColor" onClick="fctHide();"></td>');
|
||||
objSB.Append('<td width="34%" align="center"><input type="button" value="Reset" class="btnColor" onClick="fctReset();"></td>');
|
||||
objSB.Append('<td width="33%" align="center"><input type="button" value="Ok" class="btnColor" onClick="fctOk();"></td>');
|
||||
objSB.Append('<td width="50%" align="center"><input type="button" value="Cancel" class="btnColor" onClick="fctHide();"></td>');
|
||||
//objSB.Append('<td width="34%" align="center"><input type="button" value="Reset" class="btnColor" onClick="fctReset();"></td>');
|
||||
objSB.Append('<td width="50%" align="center"><input type="button" value="Ok" class="btnColor" onClick="fctOk();"></td>');
|
||||
objSB.Append('</tr></table></td></tr></table>');
|
||||
Loading…
Reference in New Issue
Block a user