require_once dirname(__FILE__) . '/../../../../cms_rc_admin.php'; define("MESSAGE_ERROR_MODULE_RIGHTS", 570); //load interface instance $view = CMS_view::getInstance(); //set default display mode for this page $view->setDisplayMode(CMS_view::SHOW_JSON); //This file is an admin file. Interface must be secure $view->setSecure(); //get search vars $objectId = sensitiveIO::request('objectId', 'sensitiveIO::isPositiveInteger'); $codename = sensitiveIO::request('module', CMS_modulesCatalog::getAllCodenames()); $search = sensitiveIO::request('search'); $sort = sensitiveIO::request('sort'); $dir = sensitiveIO::request('dir'); $start = sensitiveIO::request('start', 'sensitiveIO::isPositiveInteger', 0); $limit = sensitiveIO::request('limit', 'sensitiveIO::isPositiveInteger', CMS_session::getRecordsPerPage()); $limitToItems = sensitiveIO::request('items'); if ($limitToItems) { $limitToItems = explode(',', $limitToItems); } $limitToOrderedItems = sensitiveIO::request('itemsOrdered'); if ($limitToOrderedItems) { $limitToOrderedItems = explode(',', $limitToOrderedItems); } //Some actions to do on items found $unlock = sensitiveIO::request('unlock') ? true : false; $delete = sensitiveIO::request('del') ? true : false; $undelete = sensitiveIO::request('undelete') ? true : false; $publish = sensitiveIO::request('publish') ? true : false; $unpublish = sensitiveIO::request('unpublish') ? true : false; $itemsDatas = array();
$view->setSecure(); $winId = sensitiveIO::request('winId'); $fatherId = sensitiveIO::request('fatherId'); if (!$winId) { CMS_grandFather::raiseError('Unknown window Id ...'); $view->show(); } //CHECKS user has row edition clearance if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_TEMPLATES)) { //rows CMS_grandFather::raiseError('User has no rights on rows editions'); $view->setActionMessage($cms_language->getMessage(MESSAGE_ERROR_NO_RIGHTS_FOR_ROWS)); $view->show(); } //usefull vars $recordsPerPage = CMS_session::getRecordsPerPage(); // // Search Panel // $searchPanel = ''; // Keywords $searchPanel .= "{\n\tfieldLabel:\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_BY_NAME_DESCRIPTION)}',\n\txtype:\t\t\t'textfield',\n\tname: \t\t\t'keyword',\n\tvalue:\t\t\t'',\n\tminLength:\t\t3,\n\tanchor:\t\t\t'-20px',\n\tvalidateOnBlur:\tfalse,\n\tlisteners:\t\t{\n\t\t'valid':{\n\t\t\tfn: \t\t\trowWindow.search, \n\t\t\toptions:\t\t{buffer:300}\n\t\t},\n\t\t'invalid':{\n\t\t\tfn: function(field, event) {\n\t\t\t\tif (!isNaN(parseInt(field.getValue()))) {\n\t\t\t\t\tfield.clearInvalid();\n\t\t\t\t\tfield.fireEvent('valid', field);\n\t\t\t\t} else if (!field.getValue()) {\n\t\t\t\t\tfield.clearInvalid();\n\t\t\t\t}\n\t\t\t}, \n\t\t\toptions:\t\t{buffer:300}\n\t\t}\n\t}\n},"; $allGroups = CMS_rowsCatalog::getAllGroups(); natcasesort($allGroups); if ($allGroups) { $columns = sizeof($allGroups) < 2 ? sizeof($allGroups) : 2; $searchPanel .= "{\n\t\txtype: \t\t'checkboxgroup',\n\t\tfieldLabel: '{$cms_language->getJSMessage(MESSAGE_PAGE_GROUPS)}',\n\t\tcolumns: \t{$columns},\n\t\titems: ["; foreach ($allGroups as $aGroup) { $searchPanel .= "{boxLabel: '{$aGroup}', inputValue:'{$aGroup}', name: 'groups[]', listeners: {'check':rowWindow.search}},"; } //remove last comma from groups