1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: cInclude("includes", "functions.con.php");
19:
20: 21: 22:
23: function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, $default)
24: {
25: global $db;
26: global $sess;
27: global $auth;
28: global $client;
29: global $cfg;
30: global $area_tree;
31: global $perm;
32:
33: $db2= cRegistry::getDb();
34: $date = date('Y-m-d H:i:s');
35: $author = "".$auth->auth["uname"]."";
36:
37:
38: set_magic_quotes_gpc($name);
39: set_magic_quotes_gpc($description);
40:
41: $template = new cApiTemplate();
42: $template->loadBy("name", $name);
43: if ($template->isLoaded() && $template->get('idtpl') != $idtpl) {
44: cRegistry::addErrorMessage(i18n("Template name already exists"));
45: return -1;
46: }
47:
48: if (!$idtpl) {
49: 50:
51: $sql = "INSERT INTO ".$cfg["tab"]["tpl"]."
52: (idtplcfg, name, description, deletable, idlay, idclient, author, created, lastmodified) VALUES
53: ('".cSecurity::toInteger(0)."', '".cSecurity::escapeDB($name, $db)."', '".cSecurity::escapeDB($description, $db)."',
54: '1', '".cSecurity::toInteger($idlay)."', '".cSecurity::toInteger($client)."', '".cSecurity::escapeDB($author, $db)."', '".cSecurity::escapeDB($date, $db)."',
55: '".cSecurity::escapeDB($date, $db)."')";
56:
57: $db->query($sql);
58: $idtpl = $db->getLastInsertedId($cfg["tab"]["tpl"]);
59:
60: 61:
62: $sql = "INSERT INTO ".$cfg["tab"]["tpl_conf"]."
63: (idtpl, author) VALUES
64: ('".cSecurity::toInteger($idtpl)."', '".cSecurity::escapeDB($auth->auth["uname"], $db)."')";
65:
66: $db->query($sql);
67: $idtplcfg = $db->getLastInsertedId($cfg["tab"]["tpl_conf"]);
68:
69:
70: $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET idtplcfg='".cSecurity::toInteger($idtplcfg)."'
71: WHERE idtpl='".cSecurity::toInteger($idtpl)."'";
72: $db->query($sql);
73:
74:
75: cInclude("includes", "functions.rights.php");
76: createRightsForElement("tpl", $idtpl);
77:
78:
79: } else {
80:
81:
82: $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET name='".cSecurity::escapeDB($name, $db)."', description='".cSecurity::escapeDB($description, $db)."', idlay='".cSecurity::toInteger($idlay)."',
83: author='".cSecurity::escapeDB($author, $db)."', lastmodified='".cSecurity::escapeDB($date, $db)."' WHERE idtpl='".cSecurity::toInteger($idtpl)."'";
84: $db->query($sql);
85:
86: if (is_array($c)) {
87:
88:
89: $sql = "DELETE FROM ".$cfg["tab"]["container"]." WHERE idtpl='".cSecurity::toInteger($idtpl, $db)."'";
90: $db->query($sql);
91:
92: foreach ($c as $idcontainer => $dummyval) {
93:
94: $sql = "INSERT INTO ".$cfg["tab"]["container"]." (idtpl, number, idmod) VALUES ";
95: $sql .= "(";
96: $sql .= "'".cSecurity::toInteger($idtpl)."', ";
97: $sql .= "'".cSecurity::toInteger($idcontainer)."', ";
98: $sql .= "'".cSecurity::toInteger($c[$idcontainer])."'";
99: $sql .= ") ";
100: $db->query($sql);
101:
102: }
103: }
104:
105:
106: conGenerateCodeForAllartsUsingTemplate($idtpl);
107:
108: }
109:
110: if ($default == 1)
111: {
112: $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET defaulttemplate = '0' WHERE idclient = '".cSecurity::toInteger($client)."'";
113: $db->query($sql);
114:
115: $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET defaulttemplate = '1' WHERE idtpl = '".cSecurity::toInteger($idtpl)."' AND idclient = '".cSecurity::toInteger($client)."'";
116: $db->query($sql);
117: } else {
118: $sql = "UPDATE ".$cfg["tab"]["tpl"]." SET defaulttemplate = '0' WHERE idtpl = '".cSecurity::toInteger($idtpl)."' AND idclient = '".cSecurity::toInteger($client)."'";
119: $db->query($sql);
120: }
121:
122:
123:
124:
125:
126:
127:
128:
129: return $idtpl;
130:
131: }
132:
133: 134: 135: 136: 137: 138: 139:
140: function tplDeleteTemplate($idtpl) {
141:
142: global $db, $client, $lang, $cfg, $area_tree, $perm;
143:
144: $sql = "DELETE FROM ".$cfg["tab"]["tpl"]." WHERE idtpl='".cSecurity::toInteger($idtpl)."'";
145: $db->query($sql);
146:
147:
148:
149: $sql = "DELETE FROM ".$cfg["tab"]["container"]." WHERE idtpl = '".cSecurity::toInteger($idtpl)."'";
150: $db->query($sql);
151:
152: $idsToDelete = array();
153: $sql = "SELECT idtplcfg FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtpl = '".cSecurity::toInteger($idtpl)."'";
154: $db->query($sql);
155: while ($db->nextRecord()) {
156: $idsToDelete[] = $db->f("idtplcfg");
157: }
158:
159: foreach ($idsToDelete as $id) {
160:
161: $sql = "DELETE FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtplcfg = '".cSecurity::toInteger($id)."'";
162: $db->query($sql);
163:
164: $sql = "DELETE FROM ".$cfg["tab"]["container_conf"]." WHERE idtplcfg = '".cSecurity::toInteger($id)."'";
165: $db->query($sql);
166:
167: }
168:
169: cInclude("includes", "functions.rights.php");
170: deleteRightsForElement("tpl", $idtpl);
171:
172: }
173:
174:
175: 176: 177: 178: 179: 180: 181:
182: function tplBrowseLayoutForContainers($idlay) {
183: global $db;
184: global $cfg;
185: global $containerinf;
186: global $lang;
187:
188: $layoutInFile = new cLayoutHandler($idlay, "", $cfg, $lang);
189: $code = $layoutInFile->getLayoutCode();
190:
191:
192: preg_match_all ("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container);
193: $iPosBody = stripos($code, '<body>');
194: $sCodeBeforeHeader = substr($code, 0, $iPosBody);
195:
196: foreach ($a_container[1] as $value) {
197: if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
198: $containerinf[$idlay][$value]["is_body"] = false;
199: } else {
200: $containerinf[$idlay][$value]["is_body"] = true;
201: }
202: }
203:
204: if (is_array($containerinf[$idlay]))
205: {
206: foreach ($containerinf[$idlay] as $key => $value)
207: {
208: $a_container[1][] = $key;
209: }
210: }
211:
212: $container = Array();
213:
214: foreach ($a_container[1] as $value)
215: {
216: if (!in_array($value, $container))
217: {
218: $container[] = $value;
219: }
220: }
221:
222: asort($container);
223:
224: if (is_array($container)) {
225: $tmp_returnstring = implode("&",$container);
226: }
227: return $tmp_returnstring;
228: }
229:
230: 231: 232: 233: 234: 235: 236: 237:
238: function tplGetContainerName($idlay, $container)
239: {
240: global $db;
241: global $cfg;
242: global $containerinf;
243:
244: if (is_array($containerinf[$idlay]))
245: {
246: if (array_key_exists($container, $containerinf[$idlay]))
247: {
248: return $containerinf[$idlay][$container]["name"];
249: }
250: }
251: }
252:
253: 254: 255: 256: 257: 258: 259: 260:
261: function tplGetContainerMode($idlay, $container)
262: {
263: global $db;
264: global $cfg;
265: global $containerinf;
266:
267: if (is_array($containerinf[$idlay]))
268: {
269: if (array_key_exists($container, $containerinf[$idlay]))
270: {
271: return $containerinf[$idlay][$container]["mode"];
272: }
273: }
274: }
275:
276: 277: 278: 279: 280: 281: 282: 283:
284: function tplGetContainerTypes($idlay, $container)
285: {
286: global $db;
287: global $cfg;
288: global $containerinf;
289:
290: if (is_array($containerinf[$idlay]))
291: {
292: if (array_key_exists($container, $containerinf[$idlay]))
293: {
294: if ($containerinf[$idlay][$container]["types"] != "")
295: {
296: $list = explode(",",$containerinf[$idlay][$container]["types"]);
297:
298: foreach ($list as $key => $value)
299: {
300: $list[$key] = trim($value);
301: }
302: return $list;
303: }
304: }
305: }
306: }
307:
308: 309: 310: 311: 312: 313: 314: 315:
316: function tplGetContainerDefault($idlay, $container)
317: {
318: global $db;
319: global $cfg;
320: global $containerinf;
321:
322: if (is_array($containerinf[$idlay]))
323: {
324: if (array_key_exists($container, $containerinf[$idlay]))
325: {
326: return $containerinf[$idlay][$container]["default"];
327: }
328: }
329: }
330:
331: 332: 333: 334: 335:
336: function tplPreparseLayout ($idlay)
337: {
338: global $containerinf;
339: global $db;
340: global $cfg;
341: global $lang;
342:
343: $layoutInFile = new cLayoutHandler($idlay, "", $cfg, $lang);
344: $code = $layoutInFile->getLayoutCode();
345:
346: $parser = new HtmlParser($code);
347: $bIsBody = false;
348: while ($parser->parse())
349: {
350: if (strtolower($parser->iNodeName) == 'body') {
351: $bIsBody = true;
352: }
353:
354: if ($parser->iNodeName == "container" && $parser->iNodeType == HtmlParser::NODE_TYPE_ELEMENT)
355: {
356: $idcontainer = $parser->iNodeAttributes["id"];
357:
358: $mode = $parser->iNodeAttributes["mode"];
359:
360: if ($mode == "")
361: {
362: $mode = "optional";
363: }
364:
365: $containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"];
366: $containerinf[$idlay][$idcontainer]["mode"] = $mode;
367: $containerinf[$idlay][$idcontainer]["default"] = $parser->iNodeAttributes["default"];
368: $containerinf[$idlay][$idcontainer]["types"] = $parser->iNodeAttributes["types"];
369: $containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody;
370: }
371: }
372: }
373:
374: 375: 376: 377: 378: 379: 380:
381: function tplDuplicateTemplate($idtpl) {
382:
383: global $db, $client, $lang, $cfg, $sess, $auth;
384:
385: $db2 = cRegistry::getDb();
386:
387: $sql = "SELECT
388: *
389: FROM
390: ".$cfg["tab"]["tpl"]."
391: WHERE
392: idtpl = '".cSecurity::toInteger($idtpl)."'";
393:
394: $db->query($sql);
395: $db->nextRecord();
396:
397: $idclient = $db->f("idclient");
398: $idlay = $db->f("idlay");
399:
400:
401: $name = sprintf(i18n("%s (Copy)"), $db->f("name"));
402: $descr = $db->f("description");
403: $author = $auth->auth["uname"];
404: $created = date('Y-m-d H:i:s');
405: $lastmod = date('Y-m-d H:i:s');
406:
407: $idtpl_conf = $db->f("idtplcfg");
408: if ($idtpl_conf) {
409:
410: $templateConf = array('idtpl'=>0, 'status'=>0, 'author'=>$author, 'created'=>$created);
411: $db->insert($cfg["tab"]["tpl_conf"], $templateConf);
412: $new_idtpl_conf = $db->getLastInsertedId($cfg["tab"]["tpl_conf"]);
413: }
414:
415: $sql = "INSERT INTO
416: ".$cfg["tab"]["tpl"]."
417: (idclient, idlay, ".($idtpl_conf?'idtplcfg,':'')." name, description, deletable,author, created, lastmodified)
418: VALUES
419: ('".cSecurity::toInteger($idclient)."', '".cSecurity::toInteger($idlay)."', ".($idtpl_conf?"'".cSecurity::toInteger($new_idtpl_conf)."', ":'')." '".cSecurity::escapeDB($name, $db)."',
420: '".cSecurity::escapeDB($descr, $db)."', '1', '".cSecurity::escapeDB($author, $db)."', '".cSecurity::escapeDB($created, $db)."', '".cSecurity::escapeDB($lastmod, $db)."')";
421: $db->query($sql);
422: $new_idtpl = $db->getLastInsertedId($cfg["tab"]["tpl"]);
423:
424:
425: $db->update($cfg["tab"]["tpl_conf"], array('idtpl'=>$new_idtpl), array('idtplcfg'=>$new_idtpl_conf));
426:
427: $a_containers = array();
428:
429: $sql = "SELECT
430: *
431: FROM
432: ".$cfg["tab"]["container"]."
433: WHERE
434: idtpl = '".cSecurity::toInteger($idtpl)."'
435: ORDER BY
436: number";
437:
438: $db->query($sql);
439:
440: while ($db->nextRecord()) {
441: $a_containers[$db->f("number")] = $db->f("idmod");
442: }
443:
444: foreach ($a_containers as $key => $value) {
445:
446:
447:
448: $sql = "INSERT INTO ".$cfg["tab"]["container"]."
449: (idtpl, number, idmod) VALUES ('".cSecurity::toInteger($new_idtpl)."', '".cSecurity::toInteger($key)."', '".cSecurity::toInteger($value)."')";
450:
451: $db->query($sql);
452:
453: }
454:
455:
456: if ($idtpl_conf) {
457: $a_container_cfg = array();
458: $sql = "SELECT
459: *
460: FROM
461: ".$cfg["tab"]["container_conf"]."
462: WHERE
463: idtplcfg = '".cSecurity::toInteger($idtpl_conf)."'
464: ORDER BY
465: number";
466:
467: $db->query($sql);
468:
469: while ($db->nextRecord()) {
470: $a_container_cfg[$db->f("number")] = $db->f("container");
471: }
472:
473: foreach ($a_container_cfg as $key => $value) {
474:
475:
476:
477: $sql = "INSERT INTO ".$cfg["tab"]["container_conf"]."
478: (idtplcfg, number, container) VALUES
479: ( '".cSecurity::toInteger($new_idtpl_conf)."', '".cSecurity::escapeDB($key, $db)."', '".cSecurity::escapeDB($value, $db)."')";
480:
481: $db->query($sql);
482:
483: }
484: }
485:
486:
487: cInclude("includes", "functions.rights.php");
488: copyRightsForElement("tpl", $idtpl, $new_idtpl);
489:
490: return $new_idtpl;
491:
492: }
493:
494: 495: 496: 497: 498: 499: 500:
501: function tplIsTemplateInUse($idtpl) {
502:
503: global $cfg, $client, $lang;
504:
505: $db = cRegistry::getDb();
506:
507: $sql = "SELECT
508: b.idcatlang, b.name, b.idlang, b.idcat
509: FROM
510: ".$cfg["tab"]["cat"]." AS a,
511: ".$cfg["tab"]["cat_lang"]." AS b
512: WHERE
513: a.idclient = '".cSecurity::toInteger($client)."' AND
514: a.idcat = b.idcat AND
515: b.idtplcfg IN (SELECT idtplcfg FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtpl = '".$idtpl."')
516: ORDER BY b.idlang ASC, b.name ASC ";
517: $db->query($sql);
518: if ($db->numRows() > 0) {
519: return true;
520: }
521:
522:
523: $sql = "SELECT
524: b.idartlang, b.title, b.idlang, b.idart
525: FROM
526: ".$cfg["tab"]["art"]." AS a,
527: ".$cfg["tab"]["art_lang"]." AS b
528: WHERE
529: a.idclient = '".cSecurity::toInteger($client)."' AND
530: a.idart = b.idart AND
531: b.idtplcfg IN (SELECT idtplcfg FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtpl = '".$idtpl."')
532: ORDER BY b.idlang ASC, b.title ASC ";
533:
534: $db->query($sql);
535:
536: if ($db->numRows() > 0) {
537: return true;
538: }
539:
540: return false;
541:
542: }
543:
544: 545: 546: 547: 548: 549: 550:
551: function tplGetInUsedData($idtpl) {
552:
553: global $cfg, $client, $lang;
554:
555: $db = cRegistry::getDb();
556:
557: $aUsedData = array();
558:
559:
560: $sql = "SELECT
561: b.idcatlang, b.name, b.idlang, b.idcat
562: FROM
563: ".$cfg["tab"]["cat"]." AS a,
564: ".$cfg["tab"]["cat_lang"]." AS b
565: WHERE
566: a.idclient = '".cSecurity::toInteger($client)."' AND
567: a.idcat = b.idcat AND
568: b.idtplcfg IN (SELECT idtplcfg FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtpl = '".$idtpl."')
569: ORDER BY b.idlang ASC, b.name ASC ";
570: $db->query($sql);
571: if ($db->numRows() > 0) {
572: while ($db->nextRecord()) {
573: $aUsedData['cat'][] = array(
574: 'name' => $db->f('name'),
575: 'lang' => $db->f('idlang'),
576: 'idcat' => $db->f('idcat'),
577: );
578: }
579: }
580:
581:
582: $sql = "SELECT
583: b.idartlang, b.title, b.idlang, b.idart
584: FROM
585: ".$cfg["tab"]["art"]." AS a,
586: ".$cfg["tab"]["art_lang"]." AS b
587: WHERE
588: a.idclient = '".cSecurity::toInteger($client)."' AND
589: a.idart = b.idart AND
590: b.idtplcfg IN (SELECT idtplcfg FROM ".$cfg["tab"]["tpl_conf"]." WHERE idtpl = '".$idtpl."')
591: ORDER BY b.idlang ASC, b.title ASC ";
592:
593: $db->query($sql);
594:
595: if ($db->numRows() > 0) {
596: while ($db->nextRecord()) {
597: $aUsedData['art'][] = array(
598: 'title' => $db->f('title'),
599: 'lang' => $db->f('idlang'),
600: 'idart' => $db->f('idart'),
601: );
602: }
603: }
604:
605: return $aUsedData;
606:
607: }
608:
609: 610: 611: 612: 613: 614: 615: 616:
617: function tplcfgDuplicate ($idtplcfg)
618: {
619: global $cfg;
620:
621: $db = cRegistry::getDb();
622: $db2 = cRegistry::getDb();
623:
624: $sql = "SELECT
625: idtpl, status, author, created, lastmodified
626: FROM
627: ".$cfg["tab"]["tpl_conf"]."
628: WHERE
629: idtplcfg = '".cSecurity::toInteger($idtplcfg)."'";
630:
631: $db->query($sql);
632:
633: if ($db->nextRecord())
634: {
635:
636: $idtpl = $db->f("idtpl");
637: $status = $db->f("status");
638: $author = $db->f("author");
639: $created = $db->f("created");
640: $lastmodified = $db->f("lastmodified");
641:
642: $sql = "INSERT INTO
643: ".$cfg["tab"]["tpl_conf"]."
644: (idtpl, status, author, created, lastmodified)
645: VALUES
646: ('".cSecurity::toInteger($idtpl)."', '".cSecurity::toInteger($status)."', '".cSecurity::escapeDB($author, $db2)."',
647: '".cSecurity::escapeDB($created, $db2)."', '".cSecurity::escapeDB($lastmodified, $db2)."')";
648:
649: $db2->query($sql);
650: $newidtplcfg = $db2->getLastInsertedId($cfg["tab"]["tpl_conf"]);
651:
652:
653: $sql = "SELECT
654: number, container
655: FROM
656: ".$cfg["tab"]["container_conf"]."
657: WHERE idtplcfg = '".cSecurity::toInteger($idtplcfg)."'";
658:
659: $db->query($sql);
660:
661: while ($db->nextRecord())
662: {
663:
664: $number = $db->f("number");
665: $container = $db->f("container");
666:
667: $sql = "INSERT INTO
668: ".$cfg["tab"]["container_conf"]."
669: ( idtplcfg, number, container)
670: VALUES
671: ('".cSecurity::toInteger($newidtplcfg)."', '".cSecurity::toInteger($number)."', '".cSecurity::escapeDB($container, $db2)."')";
672: $db2->query($sql);
673: }
674: }
675:
676: return ($newidtplcfg);
677:
678: }
679:
680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690:
691:
692: function tplAutoFillModules ($idtpl)
693: {
694: global $cfg;
695: global $db_autofill;
696: global $containerinf;
697: global $_autoFillcontainerCache;
698:
699: if (!is_object($db_autofill))
700: {
701: $db_autofill = cRegistry::getDb();
702: }
703:
704: $sql = "SELECT idlay FROM ".$cfg["tab"]["tpl"]." WHERE idtpl = '".cSecurity::toInteger($idtpl)."'";
705: $db_autofill->query($sql);
706:
707: if (!$db_autofill->nextRecord())
708: {
709: return false;
710: }
711:
712: $idlay = $db_autofill->f("idlay");
713:
714: if (!(is_array($containerinf) && array_key_exists($idlay, $containerinf) && array_key_exists($idlay, $_autoFillcontainerCache)))
715: {
716: tplPreparseLayout($idlay);
717: $_autoFillcontainerCache[$idlay] = tplBrowseLayoutForContainers($idlay);
718: }
719:
720: $a_container = explode("&",$_autoFillcontainerCache[$idlay]);
721:
722: $db = cRegistry::getDb();
723:
724: foreach ($a_container as $container)
725: {
726: switch ($containerinf[$idlay][$container]["mode"])
727: {
728:
729: case "fixed":
730: if ($containerinf[$idlay][$container]["default"] != "")
731: {
732: $sql = "SELECT idmod FROM ".$cfg["tab"]["mod"]
733: ." WHERE name = '".
734: cSecurity::escapeDB($containerinf[$idlay][$container]["default"], $db_autofill)."'";
735:
736: $db_autofill->query($sql);
737:
738: if ($db_autofill->nextRecord())
739: {
740: $idmod = $db_autofill->f("idmod");
741:
742:
743: $sql = "SELECT idcontainer FROM ".$cfg["tab"]["container"]." WHERE idtpl = '".cSecurity::toInteger($idtpl)."' AND number = '".cSecurity::toInteger($container)."'";
744:
745: $db_autofill->query($sql);
746:
747: if ($db_autofill->nextRecord())
748: {
749: $sql = "UPDATE ".$cfg["tab"]["container"].
750: " SET idmod = '".cSecurity::toInteger($idmod)."' WHERE idtpl = '".cSecurity::toInteger($idtpl)."'".
751: " AND number = '".cSecurity::toInteger($container)."' AND ".
752: " idcontainer = '".cSecurity::toInteger($db_autofill->f("idcontainer"))."'";
753: $db_autofill->query($sql);
754: } else {
755: $sql = "INSERT INTO ".$cfg["tab"]["container"].
756: " (idtpl, number, idmod) ".
757: " VALUES ( ".
758: " '$idtpl', '$container', '$idmod')";
759: $db_autofill->query($sql);
760: }
761: }
762: }
763:
764:
765: case "mandatory":
766:
767: if ($containerinf[$idlay][$container]["default"] != "")
768: {
769: $sql = "SELECT idmod FROM ".$cfg["tab"]["mod"]
770: ." WHERE name = '".
771: cSecurity::escapeDB($containerinf[$idlay][$container]["default"], $db)."'";
772:
773: $db_autofill->query($sql);
774:
775: if ($db_autofill->nextRecord())
776: {
777: $idmod = $db_autofill->f("idmod");
778:
779:
780: $sql = "SELECT idcontainer, idmod FROM ".$cfg["tab"]["container"]
781: ." WHERE idtpl = '".cSecurity::toInteger($idtpl)."' AND number = '".cSecurity::toInteger($container)."'";
782:
783: $db_autofill->query($sql);
784:
785: if ($db_autofill->nextRecord())
786: {
787:
788: } else {
789: $sql = "INSERT INTO ".$cfg["tab"]["container"].
790: " (idtpl, number, idmod) ".
791: " VALUES ( ".
792: " '".cSecurity::toInteger($idtpl)."', '".cSecurity::toInteger($container)."', '".cSecurity::toInteger($idmod)."')";
793: $db_autofill->query($sql);
794: }
795: }
796: }
797: }
798: }
799:
800: }
801: