dolibarr 19.0.3
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24// Load Dolibarr environment
25require '../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
27
28// Load translation files required by the page
29$langs->loadLangs(array('bookmarks', 'admin'));
30
31// Get Parameters
32$action = GETPOST('action', 'aZ09');
33$massaction = GETPOST('massaction', 'alpha');
34$show_files = GETPOST('show_files', 'int');
35$confirm = GETPOST('confirm', 'alpha');
36$cancel = GETPOST('cancel', 'alpha');
37$toselect = GETPOST('toselect', 'array');
38$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
39$backtopage = GETPOST('backtopage', 'alpha');
40$optioncss = GETPOST('optioncss', 'alpha');
41$mode = GETPOST('mode', 'aZ');
42
43$id = GETPOST("id", 'int');
44$search_title = GETPOST('search_title', 'alpha');
45
46// Load variable for pagination
47$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
48$sortfield = GETPOST('sortfield', 'aZ09comma');
49$sortorder = GETPOST('sortorder', 'aZ09comma');
50$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
51if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
52 // If $page is not defined, or '' or -1 or if we click on clear filters
53 $page = 0;
54}
55$offset = $limit * $page;
56$pageprev = $page - 1;
57$pagenext = $page + 1;
58if (!$sortfield) {
59 $sortfield = 'b.position';
60}
61if (!$sortorder) {
62 $sortorder = 'ASC';
63}
64
65// Initialize Objects
66$object = new Bookmark($db);
67$extrafields = new ExtraFields($db);
68$arrayfields = array();
69$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
70
71if ($id > 0) {
72 $object->fetch($id);
73}
74
75$object->fields = dol_sort_array($object->fields, 'position');
76$arrayfields = dol_sort_array($arrayfields, 'position');
77
78// Security check
79restrictedArea($user, 'bookmark', $object);
80
81// Permissions
82$permissiontoread = $user->hasRight('bookmark', 'lire');
83$permissiontoadd = $user->hasRight('bookmark', 'creer');
84$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id));
85
86
87/*
88 * Actions
89 */
90
91if (GETPOST('cancel', 'alpha')) {
92 $action = 'list';
93 $massaction = '';
94}
95if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
96 $massaction = '';
97}
98
99$parameters = array();
100$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
101if ($reshook < 0) {
102 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
103}
104
105if (empty($reshook)) {
106 // Selection of new fields
107 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
108
109 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
110 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
111 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
112 }
113
114 // Mass actions
115 $objectclass = 'Bookmark';
116 $objectlabel = 'Bookmark';
117 $uploaddir = $conf->bookmark->dir_output;
118 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
119
120 if ($action == 'delete' && $permissiontodelete) {
121 $object->fetch($id);
122 $res = $object->delete($user);
123 if ($res > 0) {
124 header("Location: ".$_SERVER["PHP_SELF"]);
125 exit;
126 } else {
127 setEventMessages($object->error, $object->errors, 'errors');
128 $action = '';
129 }
130 }
131}
132
133
134/*
135 * View
136 */
137
138$form = new Form($db);
139
140$now = dol_now();
141
142//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
143$help_url = '';
144$title = $langs->trans("Bookmarks");
145$morejs = array();
146$morecss = array();
147
148
149// Build and execute select
150// --------------------------------------------------------------------
151$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
152$sql .= " u.login, u.lastname, u.firstname";
153// Add fields from extrafields
154if (!empty($extrafields->attributes[$object->table_element]['label'])) {
155 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
156 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
157 }
158}
159// Add fields from hooks
160$parameters = array();
161$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
162$sql .= $hookmanager->resPrint;
163$sql = preg_replace('/,\s*$/', '', $sql);
164
165$sqlfields = $sql; // $sql fields to remove for count total
166
167$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
168$sql .= " WHERE 1=1";
169if ($search_title) {
170 $sql .= natural_search('title', $search_title);
171}
172$sql .= " AND b.entity IN (".getEntity('bookmark').")";
173if (!$user->admin) {
174 $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
175}
176
177// Count total nb of records
178$nbtotalofrecords = '';
179if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
180 /* The fast and low memory method to get and count full list converts the sql into a sql count */
181 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
182 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
183 $resql = $db->query($sqlforcount);
184 if ($resql) {
185 $objforcount = $db->fetch_object($resql);
186 $nbtotalofrecords = $objforcount->nbtotalofrecords;
187 } else {
188 dol_print_error($db);
189 }
190
191 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
192 $page = 0;
193 $offset = 0;
194 }
195 $db->free($resql);
196}
197
198// Complete request and execute it with limit
199$sql .= $db->order($sortfield.", position", $sortorder);
200if ($limit) {
201 $sql .= $db->plimit($limit + 1, $offset);
202}
203
204$resql = $db->query($sql);
205if (!$resql) {
206 dol_print_error($db);
207 exit;
208}
209
210$num = $db->num_rows($resql);
211
212
213// Output page
214// --------------------------------------------------------------------
215
216llxHeader('', $title);
217
218$arrayofselected = is_array($toselect) ? $toselect : array();
219
220$param = '';
221if (!empty($mode)) {
222 $param .= '&mode='.urlencode($mode);
223}
224if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
225 $param .= '&contextpage='.urlencode($contextpage);
226}
227if ($limit > 0 && $limit != $conf->liste_limit) {
228 $param .= '&limit='.((int) $limit);
229}
230if ($optioncss != '') {
231 $param .= '&optioncss='.urlencode($optioncss);
232}
233// Add $param from extra fields
234include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
235// Add $param from hooks
236$parameters = array('param' => &$param);
237$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
238$param .= $hookmanager->resPrint;
239
240// List of mass actions available
241$arrayofmassactions = array(
242 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
243 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
244 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
245 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
246);
247if (!empty($permissiontodelete)) {
248 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
249}
250if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
251 $arrayofmassactions = array();
252}
253$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
254
255print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
256if ($optioncss != '') {
257 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
258}
259print '<input type="hidden" name="token" value="'.newToken().'">';
260print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
261print '<input type="hidden" name="action" value="list">';
262print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
263print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
264print '<input type="hidden" name="page" value="'.$page.'">';
265print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
266print '<input type="hidden" name="page_y" value="">';
267print '<input type="hidden" name="mode" value="'.$mode.'">';
268
269
270$newcardbutton = '';
271$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', $permissiontoadd);
272
273print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
274
275// Add code for pre mass action (confirmation or email presend form)
276$topicmail = "SendBookmarkRef";
277$modelmail = "bookmark";
278$objecttmp = new Bookmark($db);
279$trackid = 'bookmark'.$object->id;
280include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
281
282$moreforfilter = '';
283
284$parameters = array();
285$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
286if (empty($reshook)) {
287 $moreforfilter .= $hookmanager->resPrint;
288} else {
289 $moreforfilter = $hookmanager->resPrint;
290}
291
292if (!empty($moreforfilter)) {
293 print '<div class="liste_titre liste_titre_bydiv centpercent">';
294 print $moreforfilter;
295 print '</div>';
296}
297
298$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
299$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
300$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
301
302print '<div class="div-table-responsive">';
303print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
304
305// Fields title search
306// --------------------------------------------------------------------
307// TODO
308
309$totalarray = array();
310$totalarray['nbfield'] = 0;
311
312// Fields title label
313// --------------------------------------------------------------------
314print '<tr class="liste_titre">';
315if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
316 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
317 $totalarray['nbfield']++;
318}
319print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
320$totalarray['nbfield']++;
321print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
322$totalarray['nbfield']++;
323print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
324$totalarray['nbfield']++;
325print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
326$totalarray['nbfield']++;
327print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
328$totalarray['nbfield']++;
329print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
330$totalarray['nbfield']++;
331print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
332$totalarray['nbfield']++;
333if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
334 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
335 $totalarray['nbfield']++;
336}
337print '</tr>'."\n";
338
339// Loop on record
340// --------------------------------------------------------------------
341$i = 0;
342$savnbfield = $totalarray['nbfield'];
343$totalarray = array();
344$totalarray['nbfield'] = 0;
345$imaxinloop = ($limit ? min($num, $limit) : $num);
346while ($i < $imaxinloop) {
347 $obj = $db->fetch_object($resql);
348 if (empty($obj)) {
349 break; // Should not happen
350 }
351
352 $object->id = $obj->rowid;
353 $object->ref = $obj->rowid;
354
355 if ($mode == 'kanban') {
356 if ($i == 0) {
357 print '<tr><td colspan="'.$savnbfield.'">';
358 print '<div class="box-flex-container">';
359 }
360 // Output Kanban
361 $selected = -1;
362 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
363 $selected = 0;
364 if (in_array($object->id, $arrayofselected)) {
365 $selected = 1;
366 }
367 }
368 print $object->getKanbanView('', array('selected' => $selected));
369 if ($i == ($imaxinloop - 1)) {
370 print '</div>';
371 print '</td></tr>';
372 }
373 } else {
374 // Show here line of result
375 $j = 0;
376 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
377 // Action column
378 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
379 print '<td class="nowrap center">';
380 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
381 $selected = 0;
382 if (in_array($object->id, $arrayofselected)) {
383 $selected = 1;
384 }
385 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
386 }
387 print '</td>';
388 if (!$i) {
389 $totalarray['nbfield']++;
390 }
391 }
392
393 // Id
394 print '<td class="nowraponall">';
395 print $object->getNomUrl(1);
396 print '</td>';
397
398 $linkintern = 1;
399 if (preg_match('/^http/i', $obj->url)) {
400 $linkintern = 0;
401 }
402 $title = $obj->title;
403 $link = $obj->url;
404 $canedit = $permissiontoadd;
405 $candelete = $permissiontodelete;
406
407 // Title
408 print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
409 print dol_escape_htmltag($title);
410 print "</td>\n";
411
412 // Url
413 print '<td class="tdoverflowmax200">';
414 if (empty($linkintern)) {
415 print img_picto('', 'url', 'class="pictofixedwidth"');
416 print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
417 } else {
418 //print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
419 print '<a class="" href="'.$obj->url.'">';
420 }
421 print $link;
422 print '</a>';
423 print "</td>\n";
424
425 // Target
426 print '<td class="tdoverflowmax100 center">';
427 if ($obj->target == 0) {
428 print $langs->trans("BookmarkTargetReplaceWindowShort");
429 }
430 if ($obj->target == 1) {
431 print $langs->trans("BookmarkTargetNewWindowShort");
432 }
433 print "</td>\n";
434
435 // Author
436 print '<td class="tdoverflowmax100 center">';
437 if ($obj->fk_user > 0) {
438 if (empty($conf->cache['users'][$obj->fk_user])) {
439 $tmpuser = new User($db);
440 $tmpuser->fetch($obj->fk_user);
441 $conf->cache['users'][$obj->fk_user] = $tmpuser;
442 }
443 $tmpuser = $conf->cache['users'][$obj->fk_user];
444 print $tmpuser->getNomUrl(-1);
445 } else {
446 print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
447 if (!$user->admin) {
448 $candelete = false;
449 $canedit = false;
450 }
451 }
452 print "</td>\n";
453
454 // Date creation
455 print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
456
457 // Position
458 print '<td class="right">'.$obj->position."</td>";
459
460 // Action column
461 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
462 print '<td class="nowrap center">';
463 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
464 $selected = 0;
465 if (in_array($object->id, $arrayofselected)) {
466 $selected = 1;
467 }
468 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
469 }
470 print '</td>';
471 if (!$i) {
472 $totalarray['nbfield']++;
473 }
474 }
475
476 print "</tr>\n";
477 }
478
479 $i++;
480}
481
482// Show total line
483include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
484
485// If no record found
486if ($num == 0) {
487 $colspan = 1;
488 foreach ($arrayfields as $key => $val) {
489 if (!empty($val['checked'])) {
490 $colspan++;
491 }
492 }
493 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
494}
495
496$db->free($resql);
497
498$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
499$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
500print $hookmanager->resPrint;
501
502print '</table>'."\n";
503print '</div>'."\n";
504
505print '</form>'."\n";
506
507
508// End of page
509llxFooter();
510$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage bookmarks.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.