1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
lists.php
См. документацию.
1<?php
3
5
6class Lists
7{
8 private $categoryCodes = array();
9 private $categoryNames = array();
10 private $sections = array();
11 private $items = array();
12
13
14 public function addItem($categoryCode = "", $item = array())
15 {
16 $this->createCategory($categoryCode);
17 $this->items[$categoryCode][] = $item;
18 }
19 public function addItems($categoryCode = "", $items = array())
20 {
21 $this->createCategory($categoryCode);
22 foreach ($items as $item)
23 {
24 $this->items[$categoryCode][] = $item;
25 }
26 }
27
28 public function addSection($categoryCode = "", $sectionCode, $sectionName)
29 {
30 $this->createCategory($categoryCode);
31
32 $this->sections[$categoryCode][] = array(
33 "ID"=> $sectionCode,
34 "NAME"=>$sectionName
35 );
36
37 }
38
39 public function setCategoryName($categoryCode = "", $name = "")
40 {
41 $this->categoryNames[$categoryCode] = $name;
42 }
43
44 private function createCategory($categoryCode)
45 {
46 if(!array_key_exists($categoryCode,$this->categoryCodes))
47 {
48 $this->categoryCodes[$categoryCode] = array();
49 $this->sections[$categoryCode] = array();
50 $this->categoryNames[$categoryCode] = "";
51
52 }
53 }
54
55
56 public function showJSON()
57 {
58 $listData = array(
59 "data" => $this->items,
60 "sections" => $this->sections,
61 "names" => $this->categoryNames,
62 );
63
64 header("Content-Type: application/x-javascript");
65 echo json_encode($listData);
66 }
67
68
69}
setCategoryName($categoryCode="", $name="")
Определения lists.php:39
showJSON()
Определения lists.php:56
addItem($categoryCode="", $item=array())
Определения lists.php:14
addItems($categoryCode="", $items=array())
Определения lists.php:19
addSection($categoryCode="", $sectionCode, $sectionName)
Определения lists.php:28
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
Определения lists.php:2