Beispiel #1
0
$codename = sensitiveIO::request('module', CMS_modulesCatalog::getAllCodenames());
$cms_page = CMS_tree::getPageByID($currentPage);
if (!$cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_EDIT) || !$cms_user->hasModuleClearance(MOD_CMS_FORMS_CODENAME, CLEARANCE_MODULE_EDIT)) {
    die('No rigths on page or module ...');
    exit;
}
//ARGUMENTS CHECK
if (!$cs || !$rowTag || !$rowId || !$blockId) {
    die("Data missing.");
}
/*
$cms_block = new CMS_block_cms_forms();
$cms_block->initializeFromBasicAttributes($_POST["block"]);
*/
//instanciate block
$cms_block = new CMS_block_polymod();
$cms_block->initializeFromID($blockId, $rowId);
$cms_module = CMS_modulesCatalog::getByCodename(MOD_CMS_FORMS_CODENAME);
// Language
if (isset($_REQUEST["items_language"])) {
    CMS_session::setSessionVar("items_language", $_REQUEST["items_language"]);
} elseif (CMS_session::getSessionVar("items_language") == '') {
    CMS_session::setSessionVar("items_language", $cms_module->getParameters("default_language"));
}
$items_language = new CMS_language(CMS_session::getSessionVar("items_language"));
//
// Get default search options
//
// Get search options from posted datas
if ($_POST["cms_action"] == 'search') {
    CMS_session::setSessionVar("items_ctg", $_POST["items_ctg"]);
 if (!is_object($cms_page) || $cms_page->hasError() || !$cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_EDIT) || !$cms_user->hasModuleClearance(MOD_STANDARD_CODENAME, CLEARANCE_MODULE_EDIT)) {
     CMS_grandFather::raiseError('Insufficient rights on page ' . $cms_page->getID());
     break;
 }
 //CHECKS user has module clearance
 if (!$cms_user->hasModuleClearance($codename, CLEARANCE_MODULE_EDIT)) {
     CMS_grandFather::raiseError('Error, user has no rights on module : ' . $codename);
     break;
 }
 //ARGUMENTS CHECK
 if (!$cs || !$rowTag || !$rowId || !$blockId) {
     CMS_grandFather::raiseError('Data missing ...');
     break;
 }
 //instanciate block
 $cms_block = new CMS_block_polymod();
 $cms_block->initializeFromID($blockId, $rowId);
 //instanciate block module
 $cms_module = CMS_modulesCatalog::getByCodename($codename);
 //get block datas if any
 $data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false);
 //get block parameters requirements
 $blockParamsDefinition = $cms_block->getBlockParametersRequirement($data["value"], $cms_page, true);
 //instanciate row
 $row = new CMS_row($rowId);
 //checks and assignments
 $formok = true;
 if (isset($blockParamsDefinition['search'])) {
     if (sizeof($blockParamsDefinition['search'])) {
         foreach ($blockParamsDefinition['search'] as $searchName => $searchParams) {
             foreach ($searchParams as $paramType => $paramValue) {
Beispiel #3
0
if (!is_object($cms_page) || $cms_page->hasError() || !$cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_EDIT) || !$cms_user->hasModuleClearance(MOD_STANDARD_CODENAME, CLEARANCE_MODULE_EDIT)) {
    CMS_grandFather::raiseError('Insufficient rights on page ' . $cms_page->getID());
    $view->show();
}
//CHECKS user has module clearance
if (!$cms_user->hasModuleClearance($codename, CLEARANCE_MODULE_EDIT)) {
    CMS_grandFather::raiseError('Error, user has no rights on module : ' . $codename);
    $view->show();
}
//ARGUMENTS CHECK
if (!$cs || !$rowTag || !$rowId || !$blockId) {
    CMS_grandFather::raiseError('Data missing ...');
    $view->show();
}
//instanciate block
$cms_block = new CMS_block_polymod();
$cms_block->initializeFromID($blockId, $rowId);
//instanciate block module
$cms_module = CMS_modulesCatalog::getByCodename($codename);
//get block datas if any
$data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false);
//get block parameters requirements
$blockParamsDefinition = $cms_block->getBlockParametersRequirement($data["value"], $cms_page, true);
//instanciate row
$row = new CMS_row($rowId);
$winLabel = sensitiveIO::sanitizeJSString($cms_language->getMessage(MESSAGE_PAGE_TITLE, array($row->getLabel(), $cms_module->getLabel($cms_language)), MOD_POLYMOD_CODENAME));
$items = array();
$rowParams = array();
if (isset($blockParamsDefinition['var'])) {
    $blockVarContent = array();
    foreach ($blockParamsDefinition['var'] as $varId => $variables) {