Пример #1
0
 public function __construct($fieldName, $fieldInfo, $value)
 {
     if (!isset($fieldInfo['values'])) {
         throw new \DAO_Exception('`values` options must be defined', $fieldName);
     }
     parent::__construct($fieldName, $fieldInfo, $value);
 }
Пример #2
0
 public function __construct($szFieldName, $fieldInfo, $aValue)
 {
     if (empty($fieldInfo['columns']) || !is_array($fieldInfo['columns'])) {
         if (!empty($fieldInfo['columns'])) {
             $columns = explode('&', $fieldInfo['columns']);
             $fieldInfo['columns'] = array();
             foreach ($columns as $row) {
                 $tmp = explode('=', $row);
                 $key = $tmp[0];
                 if (sizeof($tmp) < 2) {
                     $value = '';
                 } else {
                     $value = $tmp[1];
                 }
                 $fieldInfo['columns'][$key] = $value;
             }
         } else {
             throw new Exception('fieldInfo["columns"] not defined');
         }
     }
     if (empty($aValue)) {
         $aValue = array();
     }
     if (is_string($aValue)) {
         $aValue = unserialize($aValue);
     }
     parent::__construct($szFieldName, $fieldInfo, $aValue);
 }
Пример #3
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (empty($Value)) {
         $this->aValue = date('Y-m-d');
     }
 }
Пример #4
0
 public function __construct($fieldName, $fieldInfo, $value)
 {
     parent::__construct($fieldName, $fieldInfo, $value);
     if (empty($this->aValue)) {
         $this->aValue = array();
     }
 }
Пример #5
0
 function __construct($szFieldName, $szFieldInfo, $Value)
 {
     parent::__construct($szFieldName, $szFieldInfo, $Value);
     if (!empty($this->fieldInfo['no_rn'])) {
         $this->aValue = str_replace("\n", '', $this->aValue);
     }
 }
Пример #6
0
 public function __construct($szFieldName, $fieldInfo, $aValue)
 {
     parent::__construct($szFieldName, $fieldInfo, $aValue);
     if (!empty($this->fieldInfo['dir'])) {
         $this->szDir = $this->fieldInfo['dir'];
     }
     $this->nLeft = isset($fieldInfo['left']) ? intval($fieldInfo['left']) : 0;
     $this->nTop = isset($fieldInfo['top']) ? intval($fieldInfo['top']) : 0;
     $this->nRight = isset($fieldInfo['right']) ? intval($fieldInfo['right']) : 0;
     $this->nBottom = isset($fieldInfo['bottom']) ? intval($fieldInfo['bottom']) : 0;
     $this->szBackgroundColor = isset($fieldInfo['background-color']) ? $fieldInfo['background-color'] : '';
     $this->szBackgroundImage = isset($fieldInfo['background-image']) ? $fieldInfo['background-image'] : '';
     $this->szTextColor = isset($fieldInfo['text-color']) ? $fieldInfo['text-color'] : '';
     $this->szFontFile = isset($fieldInfo['font']) ? $fieldInfo['font'] : 'arial.ttf';
     $this->nFontSize = isset($fieldInfo['font-size']) ? $fieldInfo['font-size'] : 18;
     $this->szType = !empty($fieldInfo['image-type']) ? $fieldInfo['image-type'] : 'image/jpeg';
     switch ($this->szType) {
         case 'image/jpeg':
             $this->szExtension = 'jpg';
             break;
         case 'image/png':
             $this->szExtension = 'png';
             break;
         case 'image/gif':
             $this->szExtension = 'gif';
             break;
         default:
             $this->szType = 'image/jpeg';
             $this->szExtension = 'jpg';
     }
 }
Пример #7
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (empty($Value)) {
         $this->aValue = !empty($this->fieldInfo['default']) ? $this->fieldInfo['default'] : date('Y-m-d H:i:s');
     }
 }
Пример #8
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (empty($fieldInfo['max_size'])) {
         throw new DAO_Exception('Parameter `max_size` not found', $this->szFieldName);
     }
     // �������� �� HTML-��������
     $this->aValue = $this->aValue;
 }
Пример #9
0
 /**
  *
  * @param unknown $szFieldName
  * @param unknown $fieldInfo
  * @param unknown $Value
  *
  * @throws Exception
  */
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (empty($fieldInfo['values'])) {
         throw new Exception('TStatic_Rubricator::TStatic_Rubricator не определено поле values');
     }
     if (empty($this->aValue)) {
         $this->aValue = array();
     } elseif (is_string($this->aValue)) {
         $this->aValue = unserialize($this->aValue);
     }
 }
Пример #10
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (empty($this->fieldInfo['model'])) {
         throw new \ForbiddenException('не опеределен поле model:' . $this->szFieldName);
     }
     if (!class_exists($this->fieldInfo['model'])) {
         throw new \NotFoundException('Model not found  :' . $this->fieldInfo['model']);
     }
     if (empty($Value)) {
         $this->aValue = 0;
     }
 }
Пример #11
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     if (!empty($fieldInfo['values']) && is_string($fieldInfo['values'])) {
         $fieldInfo['values'] = explode(';', $fieldInfo['values']);
     }
     if (empty($fieldInfo['values']) || !is_array($fieldInfo['values'])) {
         throw new DAO_Exception('входящий параметр $fieldInfo["values"] не массив. Имя поля:', $szFieldName);
     }
     if (empty($Value)) {
         $Value = 0;
     }
     parent::__construct($szFieldName, $fieldInfo, intval($Value));
 }
Пример #12
0
 public function __construct($fieldName, $fieldInfo, $value)
 {
     parent::__construct($fieldName, $fieldInfo, $value);
     // trying to decode incoming data
     if (!empty($this->aValue)) {
         if (is_string($this->aValue)) {
             $this->aValue = unserialize($this->aValue);
         }
         $this->status = isset($this->aValue['status']) ? $this->aValue['status'] : '';
         $this->errorMessage = isset($this->aValue['errorMessage']) ? $this->aValue['errorMessage'] : '';
         $this->loadTime = isset($this->aValue['loadTime']) ? $this->aValue['loadTime'] : '';
     }
 }
Пример #13
0
 /**
  *
  * @param unknown $szFieldName
  * @param unknown $fieldInfo
  * @param unknown $Value
  */
 public function __construct($szFieldName, $fieldInfo, $Value)
 {
     self::validateFieldInfo($fieldInfo, $szFieldName);
     // after initialization config will be always array
     $fieldInfo['images'] = self::returnImagesArray($fieldInfo['images']);
     parent::__construct($szFieldName, $fieldInfo, $Value);
     $this->image = DAO_Image::getInstance();
     if (!empty($_REQUEST[$this->szFieldName . '_delete'])) {
         $this->bDelete = true;
     }
     $register = new SystemRegister('System/columns/image/');
     // Сразу конвертируем в байты из мегабайт
     $this->maxFileSize = floatval($register->max_size->value) * 1024 * 1024;
 }
Пример #14
0
 public function __construct($szFieldName, $fieldInfo, $aValues)
 {
     // Если обозначен путь, где находится функция - грузим его
     if (!empty($fieldInfo['func_path'])) {
         require_once APPLICATION_PATH . $fieldInfo['func_path'];
     }
     // Заплата, на случай если callback подан в виде строки
     if (is_string($fieldInfo['callback'])) {
         $fieldInfo['callback'] = explode('::', $fieldInfo['callback']);
     }
     // Проверяем существование функции
     if (!is_callable($fieldInfo['callback'])) {
         throw new Exception('Calculated: `callback` not defined');
     }
     parent::__construct($szFieldName, $fieldInfo, $aValues);
 }
Пример #15
0
 public function __construct($fieldName, $fieldInfo, $fieldValue = array())
 {
     if (empty($fieldInfo['table'])) {
         throw new \ForbiddenException('Table key not defined');
     }
     if (empty($fieldInfo['foreighnKey'])) {
         throw new \ForbiddenException('Foreighn key not defined');
     }
     if (empty($fieldInfo['innerKey'])) {
         throw new \ForbiddenException('Inner key not defined');
     }
     if (empty($fieldInfo['model'])) {
         throw new \ForbiddenException('Model key not defined');
     }
     $this->tableName = $fieldInfo['table'];
     $this->innerKey = $fieldInfo['innerKey'];
     $this->foreighnKey = $fieldInfo['foreighnKey'];
     $this->linkedModel = $fieldInfo['model'];
     parent::__construct($fieldName, $fieldInfo, $fieldValue);
 }
Пример #16
0
 function __construct($szFieldName, $fieldInfo, $Value)
 {
     parent::__construct($szFieldName, $fieldInfo, $Value);
     if (!is_array($this->fieldInfo)) {
         throw new DAO_Exception('CCategory::Ccategory данные об элементе должны быть массивом', $this->szFieldName);
     }
     if (empty($this->fieldInfo['cross_name'])) {
         $this->fieldInfo['cross_name'] = 'name';
     }
     if (empty($this->fieldInfo['cross_table'])) {
         throw new DAO_Exception('Ccategory::Ccategory не опеределен поле cross_table', $this->szFieldName);
     }
     if (empty($this->fieldInfo['cross_index'])) {
         $this->fieldInfo['cross_index'] = 'id';
     }
     if (empty($Value)) {
         if (empty($_REQUEST[$szFieldName])) {
             $this->aValue = 0;
         }
     }
 }
Пример #17
0
 public function __construct($fieldName, $fieldInfo, $value)
 {
     parent::__construct($fieldName, $fieldInfo, $value);
     $this->normalizeValue();
 }
Пример #18
0
 public function __construct($fieldName, $fieldInfo, $value)
 {
     parent::__construct($fieldName, $fieldInfo, intval($value));
 }