if (sensitiveIO::isPositiveInteger($rowId)) { $row = CMS_rowsCatalog::getByID($rowId); if (!$row || $row->hasError()) { CMS_grandFather::raiseError('Unknown row for given Id : ' . $rowId); $view->show(); } } else { //create new row $row = new CMS_row(); } //MAIN TAB //Need to sanitize all datas which can contain single quotes $label = $row->getLabel(); $description = sensitiveIO::sanitizeJSString($row->getDescription(), false, true, true); //this is a textarea, we must keep cariage return $rowDefinition = $row->getDefinition(); $rowGroups = $row->getGroups(); //image $maxFileSize = CMS_file::getMaxUploadFileSize('K'); $imageDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => ''); $imageDatas = sensitiveIO::jsonEncode($imageDatas); //Groups $allGroups = CMS_rowsCatalog::getAllGroups(); $groupsfield = ''; if ($allGroups) { $columns = sizeof($allGroups) < 5 ? sizeof($allGroups) : 5; $groupsfield .= "{\n\t\txtype: \t\t'checkboxgroup',\n\t\tfieldLabel: '<span class=\"atm-help\" ext:qtip=\"{$cms_language->getJsMessage(MESSAGE_FIELD_GROUPS_DESC)}\">{$cms_language->getJsMessage(MESSAGE_FIELD_GROUPS)}</span>',\n\t\tcolumns: \t{$columns},\n\t\titems: ["; foreach ($allGroups as $aGroup) { $groupsfield .= "{boxLabel: '{$aGroup}', inputValue:'{$aGroup}', name: 'groups[]', checked:" . (isset($rowGroups[$aGroup]) ? 'true' : 'false') . "},"; } //remove last comma from groups