dolibarr  13.0.2
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2015 RaphaĆ«l Doursenaud <rdoursenaud@gpcsolutions.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 if (!defined('NOLOGIN')) define('NOLOGIN', '1');
28 if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
29 if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', 1);
30 if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
31 
32 require '../../main.inc.php';
33 require_once '../../core/lib/functions2.lib.php';
34 
35 $langs->loadLangs(array("main", "install", "other"));
36 
37 $conf->dol_hide_topmenu = GETPOST('dol_hide_topmenu', 'int');
38 $conf->dol_hide_leftmenu = GETPOST('dol_hide_leftmenu', 'int');
39 $conf->dol_optimize_smallscreen = GETPOST('dol_optimize_smallscreen', 'int');
40 $conf->dol_no_mouse_hover = GETPOST('dol_no_mouse_hover', 'int');
41 $conf->dol_use_jmobile = GETPOST('dol_use_jmobile', 'int');
42 
43 // Security check
44 global $dolibarr_main_demo;
45 if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page', 0, 0, 1);
46 
47 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
48 $res = $hookmanager->initHooks(array('demo'));
49 
50 $demoprofiles = array();
51 $alwayscheckedmodules = array();
52 $alwaysuncheckedmodules = array();
53 $alwayshiddencheckedmodules = array();
54 $alwayshiddenuncheckedmodules = array();
55 
56 $url = '';
57 $url .= ($url ? '&' : '').($conf->dol_hide_topmenu ? 'dol_hide_topmenu='.$conf->dol_hide_topmenu : '');
58 $url .= ($url ? '&' : '').($conf->dol_hide_leftmenu ? 'dol_hide_leftmenu='.$conf->dol_hide_leftmenu : '');
59 $url .= ($url ? '&' : '').($conf->dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$conf->dol_optimize_smallscreen : '');
60 $url .= ($url ? '&' : '').($conf->dol_no_mouse_hover ? 'dol_no_mouse_hover='.$conf->dol_no_mouse_hover : '');
61 $url .= ($url ? '&' : '').($conf->dol_use_jmobile ? 'dol_use_jmobile='.$conf->dol_use_jmobile : '');
62 $url = DOL_URL_ROOT.'/index.php'.($url ? '?'.$url : '');
63 
64 $tmpaction = 'view';
65 $parameters = array();
66 $object = new stdClass();
67 $reshook = $hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks
68 $error = $hookmanager->error; $errors = $hookmanager->errors;
69 if (empty($reshook))
70 {
71  $demoprofiles = array(
72  array('default'=>'1', 'key'=>'profdemoservonly', 'label'=>'DemoCompanyServiceOnly',
73  'disablemodules'=>'adherent,barcode,bom,cashdesk,don,expedition,externalsite,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,stock,takepos',
74  //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png',
75  'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-service.jpg',
76  'url'=>$url
77  ),
78  array('default'=>'0', 'key'=>'profmanufacture', 'label'=>'DemoCompanyManufacturing',
79  'disablemodules'=>'adherent,contrat,don,externalsite,ficheinter,ftp,mailmanspip,prelevement,service',
80  'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-manufacturing.jpg',
81  'url'=>$url
82  ),
83  array('default'=>'0', 'key'=>'profdemoprodstock', 'label'=>'DemoCompanyProductAndStocks',
84  'disablemodules'=>'adherent,bom,contrat,don,externalsite,ficheinter,ftp,mailmanspip,mrp,prelevement,service',
85  //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png',
86  'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-product.jpg',
87  'url'=>$url
88  ),
89  array('default'=>'0', 'key'=>'profdemofun2', 'label'=>'DemoFundation2',
90  'disablemodules'=>'barcode,cashdesk,bom,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,ficheinter,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,projet,propal,propale,service,societe,stock,tax,takepos',
91  //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png',
92  'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-foundation.jpg',
93  'url'=>$url
94  ),
95  // All demo profile
96  array('default'=>'0', 'key'=>'profdemoall', 'label'=>'ChooseYourDemoProfilMore',
97  'disablemodules'=>'adherent,cashdesk,don,externalsite,mailmanspip',
98  //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'
99  'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg'
100  )
101  );
102 
103 
104  // Visible
105  $alwayscheckedmodules = array('barcode', 'bookmark', 'categorie', 'externalrss', 'fckeditor', 'geoipmaxmind', 'gravatar', 'memcached', 'syslog', 'user', 'webservices'); // Technical module we always want
106  $alwaysuncheckedmodules = array('dav', 'dynamicprices', 'incoterm', 'loan', 'multicurrency', 'paybox', 'paypal', 'stripe', 'google', 'printing', 'scanner', 'skype', 'website'); // Module we dont want by default
107  // Not visible
108  $alwayshiddencheckedmodules = array('accounting', 'api', 'barcode', 'blockedlog', 'bookmark', 'clicktodial', 'comptabilite', 'cron', 'document', 'domain', 'externalrss', 'externalsite', 'fckeditor', 'geoipmaxmind', 'gravatar', 'label', 'ldap',
109  'mailmanspip', 'notification', 'oauth', 'syslog', 'user', 'webservices', 'workflow',
110  // Extended modules
111  'memcached', 'numberwords', 'zipautofillfr');
112  $alwayshiddenuncheckedmodules = array('collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier',
113  // Extended modules
114  'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'datapolicy', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap',
115  'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'dynamicprices', 'receiptprinter', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail');
116 }
117 
118 // Search modules
119 $dirlist = $conf->file->dol_document_root;
120 
121 
122 // Search modules dirs
123 $modulesdir = dolGetModulesDirs();
124 
125 
126 $filename = array();
127 $modules = array();
128 $orders = array();
129 $categ = array();
130 $dirmod = array();
131 $i = 0; // is a sequencer of modules found
132 $j = 0; // j is module number. Automatically affected if module number not defined.
133 
134 foreach ($modulesdir as $dir)
135 {
136  // Charge tableaux modules, nom, numero, orders depuis repertoire dir
137  $handle = @opendir($dir);
138  if (is_resource($handle))
139  {
140  while (($file = readdir($handle)) !== false)
141  {
142  //print "$i ".$file."\n<br>";
143  if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
144  {
145  $modName = substr($file, 0, dol_strlen($file) - 10);
146 
147  if ($modName)
148  {
149  try {
150  include_once $dir.$file;
151  $objMod = new $modName($db);
152 
153  if ($objMod->numero > 0)
154  {
155  $j = $objMod->numero;
156  } else {
157  $j = 1000 + $i;
158  }
159 
160  $modulequalified = 1;
161 
162  // We discard modules according to features level (PS: if module is activated we always show it)
163  $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
164  if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) $modulequalified = 0;
165  if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) $modulequalified = 0;
166 
167  if ($modulequalified)
168  {
169  $modules[$i] = $objMod;
170  $filename[$i] = $modName;
171  $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
172  //print "x".$modName." ".$orders[$i]."\n<br>";
173  $dirmod[$i] = $dirroot;
174  $j++;
175  $i++;
176  }
177  } catch (Exception $e)
178  {
179  dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
180  }
181  }
182  }
183  }
184  }
185 }
186 
187 asort($orders);
188 //var_dump($orders);
189 
190 
191 /*
192  * Actions
193  */
194 
195 if (GETPOST('action', 'aZ09') == 'gotodemo') // Action run when we click on "Start" after selection modules
196 {
197  //print 'ee'.GETPOST("demochoice");
198  $disablestring = '';
199  // If we disable modules using a profile choice
200  if (GETPOST("demochoice"))
201  {
202  foreach ($demoprofiles as $profilearray)
203  {
204  if ($profilearray['key'] == GETPOST("demochoice"))
205  {
206  $disablestring = $profilearray['disablemodules'];
207  break;
208  }
209  }
210  }
211  // If we disable modules using personalized list
212  foreach ($modules as $val)
213  {
214  $modulekeyname = strtolower($val->name);
215  if (empty($_POST[$modulekeyname]) && empty($val->always_enabled) && !in_array($modulekeyname, $alwayscheckedmodules))
216  {
217  $disablestring .= $modulekeyname.',';
218  if ($modulekeyname == 'propale') $disablestring .= 'propal,';
219  }
220  }
221 
222  // Do redirect to login page
223  if ($disablestring)
224  {
225  if (GETPOST('urlfrom')) $url .= (preg_match('/\?/', $url) ? '&amp;' : '?').'urlfrom='.urlencode(GETPOST('urlfrom', 'alpha'));
226  $url .= (preg_match('/\?/', $url) ? '&amp;' : '?').'disablemodules='.$disablestring;
227  //var_dump($url);exit;
228  header("Location: ".$url);
229  exit;
230  }
231 }
232 
233 
234 /*
235  * View
236  */
237 
238 $head = '';
239 $head .= '<meta name="keywords" content="demo,online,demonstration,example,test,erp,crm,demos,web">'."\n";
240 $head .= '<meta name="description" content="Dolibarr ERP and CRM demo. You can test here several profiles for Dolibarr ERP and CRM demonstration.">'."\n";
241 
242 $head .= '
243 <script type="text/javascript">
244 var openedId="";
245 jQuery(document).ready(function () {
246  jQuery("tr.moduleline").hide();
247  // Enable this to allow personalized setup
248  jQuery(".modulelineshow").attr("href","#a1profdemoall");
249  jQuery(".cursorpointer").css("cursor","pointer");
250  jQuery(".modulelineshow").click(function() {
251  var idstring=$(this).attr("id");
252  if (typeof idstring != "undefined")
253  {
254  var currentId = idstring.substring(2);
255  jQuery("tr.moduleline").hide();
256  if (currentId != openedId)
257  {
258  openedId=currentId;
259  jQuery("#tr1"+currentId).show();
260  jQuery("#tr2"+currentId).show();
261  }
262  else openedId = "";
263  }
264  });
265 });
266 </script>';
267 
268 llxHeaderVierge($langs->trans("DolibarrDemo"), $head);
269 
270 
271 print "\n";
272 
273 print '<div class="demoban demobackground">';
274 print '<div class="right" style="padding-right: 30px; padding-top: 30px;">';
275 print '<a alt="Official portal of your ERP CRM application" targe="_blank" href="https://www.dolibarr.org?utm_medium=website&utm_source=demo"><img class="demologo" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" alt="Dolibarr logo"></a>';
276 print '</div>';
277 print '</div>';
278 
279 print '<div class="demobantext" style="max-width: 1024px;">';
280 print '<div style="font-size: 20px; padding: 40px;">';
281 print '<div class="hideonsmartphone" style="text-align: justify;">'.$langs->trans("DemoDesc").'</div><br>';
282 print '<div class="titre"><font style="font-size: 20px">'.$langs->trans("ChooseYourDemoProfil").'</font></div>';
283 print '</div>';
284 print '</div>';
285 
286 
287 print '<div class="clearboth"></div>';
288 print '<div class="demobanbox">';
289 
290 $i = 0;
291 foreach ($demoprofiles as $profilearray)
292 {
293  if ($profilearray['default'] >= 0)
294  {
295  //print $profilearray['lang'];
296  if (!empty($profilearray['lang'])) $langs->load($profilearray['lang']);
297 
298  $url = $_SERVER["PHP_SELF"].'?action=gotodemo';
299  $urlwithmod = $url.'&amp;demochoice='.$profilearray['key'];
300  // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
301  //print "xx".$_SERVER["PHP_SELF"].' '.DOL_URL_ROOT.'<br>';
302 
303  $urlfrom = preg_replace('/^'.preg_quote(DOL_URL_ROOT, '/').'/i', '', $_SERVER["PHP_SELF"]);
304  //print $urlfrom;
305 
306  if (!empty($profilearray['url']))
307  {
308  $urlwithmod = $profilearray['url'];
309  $urlwithmod = $urlwithmod.(preg_match('/\?/', $urlwithmod) ? '&amp;' : '?').'urlfrom='.urlencode($urlfrom);
310  if (!empty($profilearray['disablemodules']))
311  {
312  $urlwithmod = $urlwithmod.(preg_match('/\?/', $urlwithmod) ? '&amp;' : '?').'disablemodules='.$profilearray['disablemodules'];
313  }
314  }
315 
316  if (empty($profilearray['url']))
317  {
318  print '<div class="clearboth"></div>';
319  }
320 
321  print '<form method="POST" class="valigntop inline-block" name="form'.$profilearray['key'].'" id="form'.$profilearray['key'].'" action="'.$_SERVER["PHP_SELF"].'#a1'.$profilearray['key'].'">'."\n";
322  print '<input type="hidden" name="action" value="gotodemo">'."\n";
323  print '<input type="hidden" name="urlfrom" value="'.dol_escape_htmltag($urlfrom).'">'."\n";
324  print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
325  print '<input type="hidden" name="username" value="demo">'."\n";
326  print '<input type="hidden" name="dol_hide_topmenu" value="'.$conf->dol_hide_topmenu.'">'."\n";
327  print '<input type="hidden" name="dol_hide_leftmenu" value="'.$conf->dol_hide_leftmenu.'">'."\n";
328  print '<input type="hidden" name="dol_optimize_smallscreen" value="'.$conf->dol_optimize_smallscreen.'">'."\n";
329  print '<input type="hidden" name="dol_no_mouse_hover" value="'.$conf->dol_no_mouse_hover.'">'."\n";
330  print '<input type="hidden" name="dol_use_jmobile" value="'.$conf->dol_use_jmobile.'">'."\n";
331 
332  print '<div id="div'.$profilearray['key'].'" summary="Dolibarr online demonstration for profile '.$profilearray['label'].'" class="center inline-block CTable CTableRow'.($i % 2 == 0 ? '1' : '0').'">'."\n";
333 
334 
335  print '<div id="a1'.$profilearray['key'].'" class="demobox '.(empty($profilearray['url']) ? 'modulelineshow cursorpointer' : 'nomodulelines').'">';
336 
337  print '<a href="'.$urlwithmod.'" class="'.(empty($profilearray['url']) ? 'modulelineshow' : 'nomodulelines').'">';
338  print '<div style="padding: 10px;">';
339 
340  print '<img class="demothumb" src="'.$profilearray['icon'].'" alt="Demo '.$profilearray['label'].'">';
341 
342  print '<div class="clearboth"></div>';
343 
344  print '<div class="demothumbtext">';
345  print $langs->trans($profilearray['label']);
346  print '</div>';
347 
348  print '</div>';
349  print '</a>';
350 
351 
352  // Modules (a profile you must choose modules)
353  if (empty($profilearray['url']))
354  {
355  print '<div id="tr1'.$profilearray['key'].'" class="moduleline hidden" style="margin-left: 8px; margin-right: 8px; text-align: justify; font-size:14px; line-height: 130%; padding-bottom: 8px">';
356 
357  print $langs->trans("ThisIsListOfModules").'<br><br>';
358 
359  print '<div class="csscolumns">';
360 
361  $listofdisabledmodules = explode(',', $profilearray['disablemodules']);
362  $j = 0;
363  $nbcolsmod = empty($conf->dol_optimize_smallscreen) ? 4 : 3;
364  //var_dump($modules);
365  foreach ($orders as $index => $key) // Loop on qualified (enabled) modules
366  {
367  //print $index.' '.$key;
368  $val = $modules[$index];
369  $modulekeyname = strtolower($val->name);
370 
371  $modulequalified = 1;
372  if (!empty($val->always_enabled) || in_array($modulekeyname, $alwayshiddenuncheckedmodules)) $modulequalified = 0;
373  if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !$conf->global->$const_name) $modulequalified = 0;
374  if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !$conf->global->$const_name) $modulequalified = 0;
375  if (!$modulequalified) continue;
376 
377  if (in_array($modulekeyname, $alwayshiddencheckedmodules))
378  {
379  print "\n".'<!-- Module '.$modulekeyname.' hidden and always checked -->';
380  print '<input type="hidden" name="'.$modulekeyname.'" value="1">';
381  } else {
382  $modulo = ($j % $nbcolsmod);
383  //if ($modulo == 0) print '<tr>';
384  print '<!-- id='.$val->numero.' -->';
385  print '<div class="nowrap">';
386  print '<input type="checkbox" class="checkbox" id="id'.$modulekeyname.'" name="'.$modulekeyname.'" value="1" title="'.dol_escape_htmltag($val->getName()).'"';
387  if (in_array($modulekeyname, $alwaysuncheckedmodules)) print ' disabled';
388  if (!in_array($modulekeyname, $alwaysuncheckedmodules) && (!in_array($modulekeyname, $listofdisabledmodules) || in_array($modulekeyname, $alwayscheckedmodules))) print ' checked';
389  print '> <label for="id'.$modulekeyname.'" class="inline-block demomaxoveflow" title="'.dol_escape_htmltag($val->getName()).'">'.$val->getName().'</label><br>';
390  print '</div>';
391  //if ($modulo == ($nbcolsmod - 1)) print '</tr>';
392  $j++;
393  }
394  }
395 
396  print '</div>';
397 
398  print '<br><div class="center">';
399  print '<input type="submit" value=" &nbsp; &nbsp; '.$langs->trans("Start").' &nbsp; &nbsp; " class="button">';
400  print '</div>';
401 
402  print '</div>';
403  }
404 
405  print '</div></div>';
406  print '</form>'."\n";
407 
408  $i++;
409  }
410 }
411 
412 print '</div>';
413 
414 
415 // TODO Replace this with a hook
416 // Google Adsense (need Google module)
417 if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT))
418 {
419  if (empty($conf->dol_use_jmobile))
420  {
421  print '<div align="center">'."\n";
422  print '<script><!--'."\n";
423  print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n";
424  print 'google_ad_slot = "'.$conf->global->MAIN_GOOGLE_AD_SLOT.'";'."\n";
425  print 'google_ad_width = '.$conf->global->MAIN_GOOGLE_AD_WIDTH.';'."\n";
426  print 'google_ad_height = '.$conf->global->MAIN_GOOGLE_AD_HEIGHT.';'."\n";
427  print '//-->'."\n";
428  print '</script>'."\n";
429  print '<script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>'."\n";
430  print '</div>'."\n";
431  } else {
432  print '<!-- google js advert tag disabled with jmobile -->'."\n";
433  }
434 }
435 
437 
438 $db->close();
439 
440 
448 function llxHeaderVierge($title, $head = "")
449 {
450  top_httphead();
451 
452  top_htmlhead($head, $title, 0, 0, array(), array('public/demo/demo.css'), 0, 1);
453 
454  print '<body class="demobody"><div class="demobackgrounddiv">'."\n";
455 }
456 
462 function llxFooterVierge()
463 {
464  printCommonFooter('public');
465 
466  print "\n";
467  print "</div></body>\n";
468  print "</html>\n";
469 }
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolGetModulesDirs($subdir= '')
Return list of modules directories.
printCommonFooter($zone= 'private')
Print common footer : conf-&gt;global-&gt;MAIN_HTML_FOOTER js for switch of menu hider js for conf-&gt;global-...
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1280
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1214
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
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 ...
print $_SERVER["PHP_SELF"]
Edit parameters.
llxHeaderVierge()
Header function.
print
Draft customers invoices.
Definition: index.php:89
llxFooterVierge()
Footer function.
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...