Exemplo n.º 1
0
 protected function prepareParams()
 {
     parent::prepareParams();
     if (isset($this->arParams['FOLDER'])) {
         if (!$this->arParams['FOLDER'] instanceof Folder) {
             throw new \Bitrix\Main\ArgumentException('FOLDER not instance of \\Bitrix\\Disk\\Folder');
         }
         $this->arParams['FOLDER_ID'] = $this->arParams['FOLDER']->getId();
     }
     if (!isset($this->arParams['FOLDER_ID'])) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID required');
     }
     $this->arParams['FOLDER_ID'] = (int) $this->arParams['FOLDER_ID'];
     if ($this->arParams['FOLDER_ID'] <= 0) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID < 0');
     }
     if (!empty($this->arParams['MODE'])) {
         $this->mode = $this->arParams['MODE'];
     }
     $this->extendedAddFolder = $this->arParams['EXTENDED_ADD_FOLDER'] = !empty($this->arParams['EXTENDED_ADD_FOLDER']);
     if (empty($this->arParams['RELATIVE_PATH'])) {
         $this->arParams['RELATIVE_PATH'] = null;
     }
     return $this;
 }
Exemplo n.º 2
0
 protected function prepareParams()
 {
     //fix for compatible
     if (empty($this->arParams['STORAGE']) && empty($this->arParams['STORAGE_MODULE_ID']) && !empty($this->arParams['FOLDER'])) {
         if (!$this->arParams['FOLDER'] instanceof \Bitrix\Disk\Folder) {
             throw new ArgumentException('FOLDER must be instance of \\Bitrix\\Disk\\Folder');
         }
         $this->arParams['STORAGE'] = $this->arParams['FOLDER']->getStorage();
     }
     return parent::prepareParams();
 }
Exemplo n.º 3
0
 protected function prepareParams()
 {
     parent::prepareParams();
     if (!isset($this->arParams['FOLDER_ID'])) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID required');
     }
     $this->arParams['FOLDER_ID'] = (int) $this->arParams['FOLDER_ID'];
     if ($this->arParams['FOLDER_ID'] <= 0) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID < 0');
     }
     return $this;
 }
Exemplo n.º 4
0
 protected function prepareParams()
 {
     parent::prepareParams();
     if (isset($this->arParams['FOLDER'])) {
         if (!$this->arParams['FOLDER'] instanceof Folder) {
             throw new \Bitrix\Main\ArgumentException('FOLDER not instance of \\Bitrix\\Disk\\Folder');
         }
         $this->arParams['FOLDER_ID'] = $this->arParams['FOLDER']->getId();
     }
     if (!isset($this->arParams['FOLDER_ID'])) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID required');
     }
     $this->arParams['FOLDER_ID'] = (int) $this->arParams['FOLDER_ID'];
     if ($this->arParams['FOLDER_ID'] <= 0) {
         throw new \Bitrix\Main\ArgumentException('FOLDER_ID < 0');
     }
     if (empty($this->arParams['PATH_TO_GROUP'])) {
         $this->arParams['PATH_TO_GROUP'] = '/';
     }
     if (!empty($_GET['viewMode'])) {
         $this->storeViewMode($_GET['viewMode']);
     }
     return $this;
 }