Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
row.php
1<?php
3
7
12class Row
13{
20 public static function getDefaultRowLayoutMap($positions)
21 {
22 $rowLayout = array(
23 'type' => 'cell-container',
24 'orientation' => 'horizontal',
25 'elements' => array()
26 );
27 foreach ($positions as $position)
28 {
29 $rowLayout['elements'][] = array(
30 'type' => 'cell',
31 'id' => $position
32 );
33 }
34
35 return $rowLayout;
36 }
37
38
46 public static function getRowDefaultEntity($params)
47 {
48 if (!isset($params['cellIds']))
49 {
50 $parameter = 'cellIds';
51 throw new ArgumentException($parameter);
52 }
53
54 $cellsIds = $params['cellIds'];
55 $weight = isset($params['weight']) ? $params['weight'] : 0;
56 $row = new DashboardRow();
57 $layoutMap = self::getDefaultRowLayoutMap($cellsIds);
58 $row->setLayoutMap($layoutMap);
59 $row->setGId(Util::generateUserUniqueId());
60 $row->setWeight($weight);
61
62 return $row;
63 }
64}
static getDefaultRowLayoutMap($positions)
Definition row.php:20
static generateUserUniqueId($prefix='')
Definition util.php:16