23require
'../../main.inc.php';
24require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
26global $conf, $langs, $user, $db;
27$langs->loadLangs(array(
"admin",
"other",
"modulebuilder"));
29if (!$user->admin || !isModEnabled(
'modulebuilder')) {
33$action =
GETPOST(
'action',
'aZ09');
34$backtopage =
GETPOST(
'backtopage',
'alpha');
41if ($action ==
"update") {
42 $res1 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_README',
GETPOST(
'MODULEBUILDER_SPECIFIC_README',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
43 $res2 =
dolibarr_set_const($db,
'MODULEBUILDER_ASCIIDOCTOR',
GETPOST(
'MODULEBUILDER_ASCIIDOCTOR',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
44 $res3 =
dolibarr_set_const($db,
'MODULEBUILDER_ASCIIDOCTORPDF',
GETPOST(
'MODULEBUILDER_ASCIIDOCTORPDF',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
45 $res4 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
46 $res5 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
47 $res6 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_FAMILY',
GETPOST(
'MODULEBUILDER_SPECIFIC_FAMILY',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
48 $res7 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_AUTHOR',
GETPOST(
'MODULEBUILDER_SPECIFIC_AUTHOR',
'html'),
'chaine', 0,
'', $conf->entity);
49 $res8 =
dolibarr_set_const($db,
'MODULEBUILDER_SPECIFIC_VERSION',
GETPOST(
'MODULEBUILDER_SPECIFIC_VERSION',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
50 if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) {
60if (preg_match(
'/set_(.*)/', $action, $reg)) {
63 if (is_array($values)) {
64 $values = implode(
',', $values);
68 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
75if (preg_match(
'/del_(.*)/', $action, $reg)) {
78 Header(
"Location: ".$_SERVER[
"PHP_SELF"]);
93llxHeader(
'', $langs->trans(
"ModulebuilderSetup"), $help_url);
95$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
97print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
98print
'<input type="hidden" name="token" value="'.newToken().
'">';
99print
'<input type="hidden" name="action" value="update">';
101print
load_fiche_titre($langs->trans(
"ModuleSetup").
' '.$langs->trans(
'Modulebuilder'), $linkback);
103if (
GETPOST(
'withtab',
'alpha')) {
107print
'<span class="opacitymedium">'.$langs->trans(
"ModuleBuilderDesc").
"</span><br>\n";
111print
'<table class="noborder centpercent">';
113print
'<tr class="liste_titre">';
114print
'<td>'.$langs->trans(
"Parameter").
'</td>';
115print
'<td>'.$langs->trans(
"Value").
'</td>';
119if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
122 print
'<tr class="oddeven">';
123 print
'<td>'.$langs->trans(
"UseAboutPage").
'</td>';
125 if ($conf->use_javascript_ajax) {
126 print ajax_constantonoff(
'MODULEBUILDER_USE_ABOUT');
128 if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) {
129 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MODULEBUILDER_USE_ABOUT&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
131 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MODULEBUILDER_USE_ABOUT&token='.newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
137print
'<tr class="oddeven">';
138print
'<td>'.$langs->trans(
"UseSpecificEditorName").
'</td>';
140print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_NAME" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_NAME.
'">';
144print
'<tr class="oddeven">';
145print
'<td>'.$langs->trans(
"UseSpecificEditorURL").
'</td>';
147print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_URL.
'">';
151if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
152 print
'<tr class="oddeven">';
153 print
'<td>'.$langs->trans(
"UseSpecificFamily").
'</td>';
155 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_FAMILY" value="'.$conf->global->MODULEBUILDER_SPECIFIC_FAMILY.
'">';
159 print
'<tr class="oddeven">';
160 print
'<td>'.$langs->trans(
"UseSpecificAuthor").
'</td>';
162 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_AUTHOR" value="'.$conf->global->MODULEBUILDER_SPECIFIC_AUTHOR.
'">';
166 print
'<tr class="oddeven">';
167 print
'<td>'.$langs->trans(
"UseSpecificVersion").
'</td>';
169 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_VERSION" value="'.$conf->global->MODULEBUILDER_SPECIFIC_VERSION.
'">';
174print
'<tr class="oddeven">';
175print
'<td>'.$langs->trans(
"UseSpecificReadme").
'</td>';
177print
'<textarea class="centpercent" rows="20" name="MODULEBUILDER_SPECIFIC_README">'.$conf->global->MODULEBUILDER_SPECIFIC_README.
'</textarea>';
181print
'<tr class="oddeven">';
182print
'<td>'.$langs->trans(
"AsciiToHtmlConverter").
'</td>';
184print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTOR" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTOR.
'">';
185print
' '.$langs->trans(
"Example").
': asciidoc, asciidoctor';
189print
'<tr class="oddeven">';
190print
'<td>'.$langs->trans(
"AsciiToPdfConverter").
'</td>';
192print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTORPDF" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.
'">';
193print
' '.$langs->trans(
"Example").
': asciidoctor-pdf';
199print $form->buttonsSaveCancel(
"Save",
'');
201if (
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()
Empty header.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.