29if (!defined(
'NOSCANPOSTFORINJECTION')) {
30 define(
'NOSCANPOSTFORINJECTION',
'1');
34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43$langs->loadLangs(array(
'admin',
'other',
'externalsite'));
45$action =
GETPOST(
'action',
'aZ09');
53if ($action ==
'update') {
58 $label =
GETPOST(
'EXTERNALSITE_LABEL',
'alphanohtml');
61 $exturl =
GETPOST(
'EXTERNALSITE_URL',
'restricthtml');
65 $i +=
dolibarr_set_const($db,
'EXTERNALSITE_LABEL', trim($label),
'chaine', 0,
'', $conf->entity);
66 $i +=
dolibarr_set_const($db,
'EXTERNALSITE_URL', trim($exturl),
'chaine', 0,
'', $conf->entity);
82llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-externalsite page-index');
84$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
85print
load_fiche_titre($langs->trans(
"ExternalSiteSetup"), $linkback,
'title_setup');
88print
'<span class="opacitymedium">'.$langs->trans(
"Module100Desc").
"</span><br>\n";
91print
'<form name="externalsiteconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
92print
'<input type="hidden" name="token" value="'.newToken().
'">';
93print
'<input type="hidden" name="action" value="update">';
94print
"<table class=\"noborder\" width=\"100%\">";
96print
"<tr class=\"liste_titre\">";
97print
"<td width=\"30%\">".$langs->trans(
"Parameter").
"</td>";
98print
"<td>".$langs->trans(
"Value").
"</td>";
99print
"<td>".$langs->trans(
"Examples").
"</td>";
103print
'<tr class="oddeven">';
104print
'<td class="fieldrequired">'.$langs->trans(
"Label").
"</td>";
105print
"<td><input type=\"text\" class=\"flat\" name=\"EXTERNALSITE_LABEL\" value=\"".(GETPOST(
'EXTERNALSITE_LABEL',
'alpha') ?
GETPOST(
'EXTERNALSITE_LABEL',
'alpha') : ((!
getDolGlobalString(
'EXTERNALSITE_LABEL') ||
getDolGlobalString(
'EXTERNALSITE_LABEL') ==
'ExternalSite') ?
'' : $conf->global->EXTERNALSITE_LABEL)).
"\" size=\"12\"></td>";
106print
"<td>".$langs->trans(
"ExampleMyMenuEntry").
"</td>";
110print
'<tr class="oddeven">';
111print
'<td class="fieldrequired">'.$langs->trans(
"ExternalSiteURL").
"</td>";
112print
'<td><textarea class="flat minwidth500" name="EXTERNALSITE_URL">';
114$exturl =
GETPOST(
'EXTERNALSITE_URL',
'restricthtml');
118print(GETPOSTISSET(
'EXTERNALSITE_URL') ? $exturl : (!
getDolGlobalString(
'EXTERNALSITE_URL') ?
'' : $conf->global->EXTERNALSITE_URL));
119print
'</textarea></td>';
120print
"<td>http://localhost/myurl/";
121print
"<br>https://wikipedia.org/";
122print
"<br><iframe>...</iframe>";
129print $form->buttonsSaveCancel(
"Save",
'');
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).
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.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0)
Clean a string to keep only desirable HTML tags.
dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes=null)
Clean a string from some undesirable HTML tags.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.