25require
'../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36$langs->loadLangs(array(
"admin",
"other",
"modulebuilder"));
38$action =
GETPOST(
'action',
'aZ09');
39$backtopage =
GETPOST(
'backtopage',
'alpha');
51if ($action ==
"update") {
55 $res4 =
dolibarr_set_const(
$db,
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
56 $res5 =
dolibarr_set_const(
$db,
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
GETPOST(
'MODULEBUILDER_SPECIFIC_EDITOR_URL',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
60 if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) {
70if (preg_match(
'/set_(.*)/', $action, $reg)) {
73 if (is_array($values)) {
74 $values = implode(
',', $values);
78 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
85if (preg_match(
'/del_(.*)/', $action, $reg)) {
88 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
103llxHeader(
'', $langs->trans(
"ModulebuilderSetup"), $help_url);
105$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
107print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
108print
'<input type="hidden" name="token" value="'.newToken().
'">';
109print
'<input type="hidden" name="action" value="update">';
111print
load_fiche_titre($langs->trans(
"ModuleSetup").
' '.$langs->trans(
'Modulebuilder'), $linkback);
113if (
GETPOST(
'withtab',
'alpha')) {
117print
'<span class="opacitymedium">'.$langs->trans(
"ModuleBuilderDesc").
"</span><br>\n";
121print
'<table class="noborder centpercent">';
123print
'<tr class="liste_titre">';
124print
'<td>'.$langs->trans(
"Parameter").
'</td>';
132 print
'<tr class="oddeven">';
133 print
'<td>'.$langs->trans(
"UseAboutPage").
'</td>';
135 if (
$conf->use_javascript_ajax) {
136 print ajax_constantonoff(
'MODULEBUILDER_USE_ABOUT');
139 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MODULEBUILDER_USE_ABOUT&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
141 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MODULEBUILDER_USE_ABOUT&token='.newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
147print
'<tr class="oddeven">';
148print
'<td><label for="MODULEBUILDER_SPECIFIC_EDITOR_NAME" class="block">'.$langs->trans(
"UseSpecificEditorName").
'</label></td>';
150print
'<input id="MODULEBUILDER_SPECIFIC_EDITOR_NAME" type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_NAME" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_EDITOR_NAME').
'">';
154print
'<tr class="oddeven">';
155print
'<td><label for="MODULEBUILDER_SPECIFIC_EDITOR_URL" class="block">'.$langs->trans(
"UseSpecificEditorURL").
'</label></td>';
157print
'<input id="MODULEBUILDER_SPECIFIC_EDITOR_URL" type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_EDITOR_URL').
'">';
162 print
'<tr class="oddeven">';
163 print
'<td><label for="MODULEBUILDER_SPECIFIC_FAMILY" class="block">'.$langs->trans(
"UseSpecificFamily").
'</label></td>';
165 print
'<input id="MODULEBUILDER_SPECIFIC_FAMILY" type="text" name="MODULEBUILDER_SPECIFIC_FAMILY" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_FAMILY').
'">';
169 print
'<tr class="oddeven">';
170 print
'<td><label for="MODULEBUILDER_SPECIFIC_AUTHOR" class="block">'.$langs->trans(
"UseSpecificAuthor").
'</label></td>';
172 print
'<input id="MODULEBUILDER_SPECIFIC_AUTHOR" type="text" name="MODULEBUILDER_SPECIFIC_AUTHOR" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_AUTHOR').
'">';
176 print
'<tr class="oddeven">';
177 print
'<td><label for="MODULEBUILDER_SPECIFIC_VERSION" class="block">'.$langs->trans(
"UseSpecificVersion").
'</label></td>';
179 print
'<input id="MODULEBUILDER_SPECIFIC_VERSION" type="text" name="MODULEBUILDER_SPECIFIC_VERSION" value="'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_VERSION').
'">';
184print
'<tr class="oddeven">';
185print
'<td><label for="MODULEBUILDER_SPECIFIC_README" class="block">'.$langs->trans(
"UseSpecificReadme").
'</label></td>';
187print
'<textarea id="MODULEBUILDER_SPECIFIC_README" class="centpercent" rows="20" name="MODULEBUILDER_SPECIFIC_README">'.getDolGlobalString(
'MODULEBUILDER_SPECIFIC_README').
'</textarea>';
191print
'<tr class="oddeven">';
192print
'<td><label for="MODULEBUILDER_ASCIIDOCTOR" class="block">'.$langs->trans(
"AsciiToHtmlConverter").
'</label></td>';
194print
'<input id="MODULEBUILDER_ASCIIDOCTOR" type="text" name="MODULEBUILDER_ASCIIDOCTOR" value="'.getDolGlobalString(
'MODULEBUILDER_ASCIIDOCTOR').
'">';
195print
' '.$langs->trans(
"Example").
': asciidoc, asciidoctor';
199print
'<tr class="oddeven">';
200print
'<td><label for="MODULEBUILDER_ASCIIDOCTORPDF" class="block">'.$langs->trans(
"AsciiToPdfConverter").
'</label></td>';
202print
'<input id="MODULEBUILDER_ASCIIDOCTORPDF" type="text" name="MODULEBUILDER_ASCIIDOCTORPDF" value="'.getDolGlobalString(
'MODULEBUILDER_ASCIIDOCTORPDF').
'">';
203print
' '.$langs->trans(
"Example").
': asciidoctor-pdf';
209print $form->buttonsSaveCancel(
"Save",
'');
211if (
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.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
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, $allowothertags=array())
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, $morecssdiv='')
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.
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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.