23 require
'../../main.inc.php';
24 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
26 global $conf, $langs, $user, $db;
27 $langs->loadLangs(array(
"admin",
"other",
"modulebuilder"));
29 if (!$user->admin || empty($conf->modulebuilder->enabled))
32 $action =
GETPOST(
'action',
'aZ09');
33 $backtopage =
GETPOST(
'backtopage',
'alpha');
38 if ($action ==
"update")
40 $res1 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_README',
GETPOST(
'MODULEBUILDER_SPECIFIC_README',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
41 $res2 =
dolibarr_set_const($db,
'MODULEBUILDER_ASCIIDOCTOR',
GETPOST(
'MODULEBUILDER_ASCIIDOCTOR',
'nohtml'),
'chaine', 0,
'', $conf->entity);
42 $res3 =
dolibarr_set_const($db,
'MODULEBUILDER_ASCIIDOCTORPDF',
GETPOST(
'MODULEBUILDER_ASCIIDOCTORPDF',
'nohtml'),
'chaine', 0,
'', $conf->entity);
43 $res4 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
'nohtml'),
'chaine', 0,
'', $conf->entity);
44 $res5 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
'nohtml'),
'chaine', 0,
'', $conf->entity);
45 $res6 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_FAMILY',
GETPOST(
'MODULEBUILDER_SPECIFIC_FAMILY',
'nohtml'),
'chaine', 0,
'', $conf->entity);
46 $res7 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_AUTHOR',
GETPOST(
'MODULEBUILDER_SPECIFIC_AUTHOR',
'html'),
'chaine', 0,
'', $conf->entity);
47 $res8 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_VERSION',
GETPOST(
'MODULEBUILDER_SPECIFIC_VERSION',
'nohtml'),
'chaine', 0,
'', $conf->entity);
48 if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) {
58 if (preg_match(
'/set_(.*)/', $action, $reg)) {
61 if (is_array($values))
62 $values = implode(
',', $values);
65 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
72 if (preg_match(
'/del_(.*)/', $action, $reg)) {
75 Header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
87 $form =
new Form($db);
89 llxHeader(
'', $langs->trans(
"ModulebuilderSetup"));
91 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
93 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
94 print '<input type="hidden" name="token" value="'.newToken().
'">';
95 print '<input type="hidden" name="action" value="update">';
99 if (
GETPOST(
'withtab',
'alpha')) {
103 print '<span class="opacitymedium">'.$langs->trans(
"ModuleBuilderDesc").
"</span><br>\n";
107 print '<table class="noborder centpercent">';
109 print '<tr class="liste_titre">';
110 print '<td style="width: 30%">'.$langs->trans(
"Key").
'</td>';
111 print '<td>'.$langs->trans(
"Value").
'</td>';
115 if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
119 print '<tr class="oddeven">';
120 print '<td>'.$langs->trans(
"UseAboutPage").
'</td>';
121 print '<td class="center">';
122 if ($conf->use_javascript_ajax) {
125 if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) {
126 print '<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MODULEBUILDER_USE_ABOUT&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
128 print '<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MODULEBUILDER_USE_ABOUT&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
133 print '<tr class="oddeven">';
134 print '<td class="tdtop">'.$langs->trans(
"UseSpecificEditorName").
'</td>';
136 print '<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_NAME" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_NAME.
'">';
140 print '<tr class="oddeven">';
141 print '<td class="tdtop">'.$langs->trans(
"UseSpecificEditorURL").
'</td>';
143 print '<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_URL.
'">';
147 print '<tr class="oddeven">';
148 print '<td class="tdtop">'.$langs->trans(
"UseSpecificFamily").
'</td>';
150 print '<input type="text" name="MODULEBUILDER_SPECIFIC_FAMILY" value="'.$conf->global->MODULEBUILDER_SPECIFIC_FAMILY.
'">';
154 print '<tr class="oddeven">';
155 print '<td class="tdtop">'.$langs->trans(
"UseSpecificAuthor").
'</td>';
157 print '<input type="text" name="MODULEBUILDER_SPECIFIC_AUTHOR" value="'.$conf->global->MODULEBUILDER_SPECIFIC_AUTHOR.
'">';
161 print '<tr class="oddeven">';
162 print '<td class="tdtop">'.$langs->trans(
"UseSpecificVersion").
'</td>';
164 print '<input type="text" name="MODULEBUILDER_SPECIFIC_VERSION" value="'.$conf->global->MODULEBUILDER_SPECIFIC_VERSION.
'">';
169 print '<tr class="oddeven">';
170 print '<td class="tdtop">'.$langs->trans(
"UseSpecificReadme").
'</td>';
172 print '<textarea class="centpercent" rows="20" name="MODULEBUILDER_SPECIFIC_README">'.$conf->global->MODULEBUILDER_SPECIFIC_README.
'</textarea>';
176 print '<tr class="oddeven">';
177 print '<td class="tdtop">'.$langs->trans(
"AsciiToHtmlConverter").
'</td>';
179 print '<input type="text" name="MODULEBUILDER_ASCIIDOCTOR" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTOR.
'">';
180 print ' '.$langs->trans(
"Example").
': asciidoc, asciidoctor';
184 print '<tr class="oddeven">';
185 print '<td class="tdtop">'.$langs->trans(
"AsciiToPdfConverter").
'</td>';
187 print '<input type="text" name="MODULEBUILDER_ASCIIDOCTORPDF" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.
'">';
188 print ' '.$langs->trans(
"Example").
': asciidoctor-pdf';
194 print '<center><input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'" name="Button"></center>';
196 if (
GETPOST(
'withtab',
'alpha')) {
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.