Skip to content

Commit

Permalink
Fix: No alpha here, this breaks ability to submit html content with
Browse files Browse the repository at this point in the history
images or links.
  • Loading branch information
eldy committed Jun 9, 2012
1 parent 2be18e8 commit b8b400a
Showing 1 changed file with 56 additions and 46 deletions.
102 changes: 56 additions & 46 deletions htdocs/admin/fckeditor.php
Expand Up @@ -86,7 +86,9 @@

if (GETPOST('save','alpha'))
{
dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield','alpha'),'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield'),'chaine',0,'',$conf->entity);

if ($res > 0) $mesg=$langs->trans("RecordModifiedSuccessfully");
}


Expand All @@ -103,57 +105,65 @@

$var=true;

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ActivateFCKeditor").'</td>';
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
print "</tr>\n";

// Modules
foreach($modules as $const => $desc)
if (empty($conf->use_javascript_ajax))
{
// Si condition non remplie, on ne propose pas l'option
if (! $conditions[$const]) continue;

$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="16">'.img_object("",$picto[$const]).'</td>';
print '<td>'.$langs->trans($desc).'</td>';
print '<td align="center" width="100">';
$constante = 'FCKEDITOR_ENABLE_'.$const;
$value = $conf->global->$constante;
if($value == 0)
{
print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else if($value == 1)
dol_htmloutput_errors('',array($langs->trans("NotAvailable"),$langs->trans("JavascriptDisabled")),1);
}
else
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ActivateFCKeditor").'</td>';
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
print "</tr>\n";

// Modules
foreach($modules as $const => $desc)
{
print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
// Si condition non remplie, on ne propose pas l'option
if (! $conditions[$const]) continue;

$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="16">'.img_object("",$picto[$const]).'</td>';
print '<td>'.$langs->trans($desc).'</td>';
print '<td align="center" width="100">';
$constante = 'FCKEDITOR_ENABLE_'.$const;
$value = $conf->global->$constante;
if($value == 0)
{
print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else if($value == 1)
{
print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}

print "</td>";
print '</tr>';
}

print "</td>";
print '</tr>';
print '</table>'."\n";

dol_htmloutput_mesg($mesg);

print '<br>'."\n";
print_fiche_titre($langs->trans("TestSubmitForm"),'','');
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
$uselocalbrowser=true;
$editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,'dolibarr_notes','In', true, $uselocalbrowser);
$editor->Create();
print '<center><br><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></center>'."\n";
print '</form>'."\n";

/*
print '<!-- Result -->';
print $_POST["formtestfield"];
print '<!-- Result -->';
print $conf->global->FCKEDITOR_TEST;
*/
}

print '</table>'."\n";


print '<br>'."\n";
print_fiche_titre($langs->trans("TestSubmitForm"),'','');
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
$uselocalbrowser=true;
$editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,'dolibarr_notes','In', true, $uselocalbrowser);
$editor->Create();
print '<center><br><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></center>'."\n";
print '</form>'."\n";

/*
print '<!-- Result -->';
print $_POST["formtestfield"];
print '<!-- Result -->';
print $conf->global->FCKEDITOR_TEST;
*/

$db->close();

llxFooter();
Expand Down

0 comments on commit b8b400a

Please sign in to comment.