$view->setActionMessage($cms_language->getJsMessage(MESSAGE_PAGE_ERROR_UPDATE_BLOCK_CONTENT)); } } else { CMS_grandFather::raiseError('Can\'t get block class type ' . $blockClass . ' to update content'); $view->setActionMessage($cms_language->getJsMessage(MESSAGE_PAGE_ERROR_UPDATE_BLOCK_CONTENT)); } break; case 'update-block-text': case 'update-block-varchar': //update block content if (class_exists($blockClass)) { $cms_block = new $blockClass(); $cms_block->initializeFromBasicAttributes($blockId); if ($action == 'update-block-text') { $errors = ''; if (!sensitiveIO::checkXHTMLValue($value, $errors)) { //Send an error to user about his content $jscontent = "\n\t\t\t\t\tAutomne.message.popup({\n\t\t\t\t\t\tmsg: \t\t\t\t'" . $cms_language->getJsMessage(MESSAGE_PAGE_COPY_PASTE_ERROR) . ($errors ? "<br /><br />" . sensitiveIO::sanitizeJSString($errors) : '') . "',\n\t\t\t\t\t\tbuttons: \t\t\tExt.MessageBox.OK,\n\t\t\t\t\t\tclosable: \t\t\ttrue,\n\t\t\t\t\t\ticon: \t\t\t\tExt.MessageBox.ERROR\n\t\t\t\t\t});"; $view->addJavascript($jscontent); $view->show(); } $value = CMS_textEditor::parseOuterContent($value); } $cms_block->writeToPersistence($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false, array("value" => $value)); //instanciate the clientspace $clientSpace = CMS_moduleClientSpace_standard_catalog::getByTemplateAndTagID($tpl, $cs, $visualMode == PAGE_VISUALMODE_FORM); //get block's row from CS $row = $clientSpace->getRow($rowId, $rowTag); if ($row) { //get row datas $datas = $row->getData($cms_language, $cms_page, $clientSpace, PAGE_VISUALMODE_FORM);
/** * check object Mandatories Values * * @param array $values : the POST result values * @param string prefixname : the prefix used for post names * @return boolean true on success, false on failure * @access public */ function checkMandatory($values, $prefixName, $newFormat = false) { //if field is required check values $params = $this->getParamsValues(); if ($this->_field->getValue('required')) { if (!isset($values[$prefixName . $this->_field->getID() . '_0']) || !$values[$prefixName . $this->_field->getID() . '_0']) { return false; } } //check value for copy/paste and XHTML conformity if ($newFormat && $params['html'] && isset($values[$prefixName . $this->_field->getID() . '_0']) && $values[$prefixName . $this->_field->getID() . '_0']) { $value = $values[$prefixName . $this->_field->getID() . '_0']; $errors = ''; if (!sensitiveIO::checkXHTMLValue($value, $errors)) { //Send an error to user about his content global $cms_language; if (is_object($cms_language)) { return $cms_language->getMessage(self::MESSAGE_OBJECT_TEXT_COPY_PASTE_ERROR, array($this->getFieldLabel($cms_language)), MOD_POLYMOD_CODENAME) . ($errors ? '<br /><br />' . $errors : ''); } else { return false; } } } return true; }