Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
category.php
1<?php
9
12
13Loc::loadMessages(__FILE__);
14
20{
21 const RECENT = 100;
22 const BASE = 1;
23 const USER = 2;
24 const ADDITIONAL = 3;
25 const CASES = 4;
26
33 public static function getName($id)
34 {
35 $name = Loc::getMessage('SENDER_TEMPLATES_CATEGORY_' . self::getCode($id));
36 return $name ?: parent::getName($id);
37 }
38
46 public static function sortByCode($codeA, $codeB)
47 {
48 $order = array(
49 self::RECENT => 1,
50 self::BASE => 200,
51 self::USER => 210,
52 self::ADDITIONAL => 220,
53 );
54
55 $orderA = isset($order[self::getId($codeA)]) ? $order[self::getId($codeA)] : 100;
56 $orderB = isset($order[self::getId($codeB)]) ? $order[self::getId($codeB)] : 100;
57
58 if ($orderA < $orderB)
59 {
60 return -1;
61 }
62 elseif ($orderA > $orderB)
63 {
64 return 1;
65 }
66
67 return 0;
68 }
69}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static sortByCode($codeA, $codeB)
Definition category.php:46