24require
'../../main.inc.php';
25require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35$langs->loadLangs(array(
"admin",
"other",
"modulebuilder"));
37$action =
GETPOST(
'action',
'aZ09');
38$backtopage =
GETPOST(
'backtopage',
'alpha');
41if (!$user->admin || !isModEnabled(
'modulebuilder')) {
50if ($action ==
"update") {
51 $res1 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_README',
GETPOST(
'MODULEBUILDER_SPECIFIC_README',
'restricthtml'),
'chaine', 0,
'',
$conf->entity);
53 $res3 =
dolibarr_set_const($db,
'MODULEBUILDER_ASCIIDOCTORPDF',
GETPOST(
'MODULEBUILDER_ASCIIDOCTORPDF',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
54 $res4 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
55 $res5 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
56 $res6 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_FAMILY',
GETPOST(
'MODULEBUILDER_SPECIFIC_FAMILY',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
57 $res7 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_AUTHOR',
GETPOST(
'MODULEBUILDER_SPECIFIC_AUTHOR',
'restricthtml'),
'chaine', 0,
'',
$conf->entity);
58 $res8 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_VERSION',
GETPOST(
'MODULEBUILDER_SPECIFIC_VERSION',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
59 if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) {
69if (preg_match(
'/set_(.*)/', $action, $reg)) {
72 if (is_array($values)) {
73 $values = implode(
',', $values);
77 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
84if (preg_match(
'/del_(.*)/', $action, $reg)) {
87 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
102llxHeader(
'', $langs->trans(
"ModulebuilderSetup"), $help_url);
104$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
106print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
107print
'<input type="hidden" name="token" value="'.newToken().
'">';
108print
'<input type="hidden" name="action" value="update">';
110print
load_fiche_titre($langs->trans(
"ModuleSetup").
' '.$langs->trans(
'Modulebuilder'), $linkback);
112if (
GETPOST(
'withtab',
'alpha')) {
116print
'<span class="opacitymedium">'.$langs->trans(
"ModuleBuilderDesc").
"</span><br>\n";
120print
'<table class="noborder centpercent">';
122print
'<tr class="liste_titre">';
123print
'<td>'.$langs->trans(
"Parameter").
'</td>';
124print
'<td>'.$langs->trans(
"Value").
'</td>';
131 print
'<tr class="oddeven">';
132 print
'<td>'.$langs->trans(
"UseAboutPage").
'</td>';
134 if (
$conf->use_javascript_ajax) {
135 print ajax_constantonoff(
'MODULEBUILDER_USE_ABOUT');
138 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MODULEBUILDER_USE_ABOUT&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
140 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MODULEBUILDER_USE_ABOUT&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
146print
'<tr class="oddeven">';
147print
'<td>'.$langs->trans(
"UseSpecificEditorName").
'</td>';
149print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_NAME" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME').
'">';
153print
'<tr class="oddeven">';
154print
'<td>'.$langs->trans(
"UseSpecificEditorURL").
'</td>';
156print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_EDITOR_URL').
'">';
161 print
'<tr class="oddeven">';
162 print
'<td>'.$langs->trans(
"UseSpecificFamily").
'</td>';
164 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_FAMILY" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_FAMILY').
'">';
168 print
'<tr class="oddeven">';
169 print
'<td>'.$langs->trans(
"UseSpecificAuthor").
'</td>';
171 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_AUTHOR" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_AUTHOR').
'">';
175 print
'<tr class="oddeven">';
176 print
'<td>'.$langs->trans(
"UseSpecificVersion").
'</td>';
178 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_VERSION" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_VERSION').
'">';
183print
'<tr class="oddeven">';
184print
'<td>'.$langs->trans(
"UseSpecificReadme").
'</td>';
186print
'<textarea class="centpercent" rows="20" name="MODULEBUILDER_SPECIFIC_README">'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_README').
'</textarea>';
190print
'<tr class="oddeven">';
191print
'<td>'.$langs->trans(
"AsciiToHtmlConverter").
'</td>';
193print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTOR" value="'.getDolGlobalString(
'MODULEBUILDER_ASCIIDOCTOR').
'">';
194print
' '.$langs->trans(
"Example").
': asciidoc, asciidoctor';
198print
'<tr class="oddeven">';
199print
'<td>'.$langs->trans(
"AsciiToPdfConverter").
'</td>';
201print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTORPDF" value="'.getDolGlobalString(
'MODULEBUILDER_ASCIIDOCTORPDF').
'">';
202print
' '.$langs->trans(
"Example").
': asciidoctor-pdf';
208print $form->buttonsSaveCancel(
"Save",
'');
210if (
GETPOST(
'withtab',
'alpha')) {
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.