31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34 $action =
GETPOST(
'action',
'aZ09');
35 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
38 $langs->loadLangs(array(
'admin',
'companies'));
46 $hookmanager->initHooks(array(
'adminsocialnetworkscompany',
'globaladmin'));
52 $parameters = array();
53 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
57 if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))) {
58 foreach ($listofnetworks as $key => $value) {
59 if (!empty($value[
'active'])) {
60 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
61 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
66 if (!empty($listofnetworks[$key][
'url'])) {
67 $url = str_replace(
'{socialid}',
GETPOST($key,
'alpha'), $listofnetworks[$key][
'url']);
84 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
93 print '<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
101 print '<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
102 print '<input type="hidden" name="token" value="'.newToken().
'">';
103 print '<input type="hidden" name="action" value="update">';
107 print '<table class="noborder centpercent editmode">';
108 print '<tr class="liste_titre">';
109 print '<td class="titlefield">'.$langs->trans(
"SocialNetworksInformation").
'</td><td>'.$langs->trans(
"Url").
'</td><td>'.$langs->trans(
"SocialNetworkId").
'</td><td></td>';
113 foreach ($listofnetworks as $key => $value) {
114 if (!empty($value[
'active'])) {
115 print '<tr class="oddeven">';
116 print '<td><label for="'.$key.
'url">'.$langs->trans(ucfirst($key)).
'</label></td>';
117 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
118 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
119 print '<td><span class="fa paddingright '.($value[
'icon'] ? $value[
'icon'] :
'fa-link').
'"></span>';
120 print '<input name="'.$key.
'url" id="'.$key.
'url" class="minwidth300" value="'.
dol_escape_htmltag($conf->global->$networkconstname).
'">';
122 print '<input name="'.$key.
'" id="'.$key.
'" class="minwidth300" value="'.
dol_escape_htmltag($conf->global->$networkconstid).
'">';
124 print '<td>'.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).
'</td>';
133 print '<br><div class="center">';
134 print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getArrayOfSocialNetworks()
Get array of social network dictionary.
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).
company_admin_prepare_head()
Return array head with list of tabs to view object informations.
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)) $wikihelp
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
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.
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 ...
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...