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"));
33 $action =
GETPOST(
'action',
'aZ09');
34 $backtopage =
GETPOST(
'backtopage',
'alpha');
41 if ($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) {
60 if (preg_match(
'/set_(.*)/', $action, $reg)) {
63 if (is_array($values)) {
64 $values = implode(
',', $values);
68 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
75 if (preg_match(
'/del_(.*)/', $action, $reg)) {
78 Header(
"Location: ".$_SERVER[
"PHP_SELF"]);
95 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
97 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
98 print
'<input type="hidden" name="token" value="'.newToken().
'">';
99 print
'<input type="hidden" name="action" value="update">';
101 print
load_fiche_titre($langs->trans(
"ModuleSetup").
' '.$langs->trans(
'Modulebuilder'), $linkback);
103 if (
GETPOST(
'withtab',
'alpha')) {
107 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleBuilderDesc").
"</span><br>\n";
111 print
'<table class="noborder centpercent">';
113 print
'<tr class="liste_titre">';
114 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
115 print
'<td>'.$langs->trans(
"Value").
'</td>';
119 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
122 print
'<tr class="oddeven">';
123 print
'<td>'.$langs->trans(
"UseAboutPage").
'</td>';
125 if ($conf->use_javascript_ajax) {
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>';
137 print
'<tr class="oddeven">';
138 print
'<td>'.$langs->trans(
"UseSpecificEditorName").
'</td>';
140 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_NAME" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_NAME.
'">';
144 print
'<tr class="oddeven">';
145 print
'<td>'.$langs->trans(
"UseSpecificEditorURL").
'</td>';
147 print
'<input type="text" name="MODULEBUILDER_SPECIFIC_EDITOR_URL" value="'.$conf->global->MODULEBUILDER_SPECIFIC_EDITOR_URL.
'">';
151 if ($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.
'">';
174 print
'<tr class="oddeven">';
175 print
'<td>'.$langs->trans(
"UseSpecificReadme").
'</td>';
177 print
'<textarea class="centpercent" rows="20" name="MODULEBUILDER_SPECIFIC_README">'.$conf->global->MODULEBUILDER_SPECIFIC_README.
'</textarea>';
181 print
'<tr class="oddeven">';
182 print
'<td>'.$langs->trans(
"AsciiToHtmlConverter").
'</td>';
184 print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTOR" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTOR.
'">';
185 print
' '.$langs->trans(
"Example").
': asciidoc, asciidoctor';
189 print
'<tr class="oddeven">';
190 print
'<td>'.$langs->trans(
"AsciiToPdfConverter").
'</td>';
192 print
'<input type="text" name="MODULEBUILDER_ASCIIDOCTORPDF" value="'.$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.
'">';
193 print
' '.$langs->trans(
"Example").
': asciidoctor-pdf';
199 print
$form->buttonsSaveCancel(
"Save",
'');
201 if (
GETPOST(
'withtab',
'alpha')) {
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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='')
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
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.