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);
             //instanciate modules treatments for page content tags
             $modulesTreatment = new CMS_modulesTags(MODULE_TREATMENT_PAGECONTENT_TAGS, PAGE_VISUALMODE_FORM, $cms_page);
             $modulesTreatment->setTreatmentParameters(array("language" => $cms_language, 'replaceVars' => $action != 'update-block-text'));
             $modulesTreatment->setDefinition($datas);
             $datas = $modulesTreatment->treatContent(true);
             if ($action == 'update-block-text') {
Exemplo n.º 2
0
 /**
  * set object 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 setValues($values, $prefixName)
 {
     $params = $this->getParamsValues();
     if (!$params['html']) {
         //remove html characters if any then convert line breaks to <br /> tags
         $value = isset($values[$prefixName . $this->_field->getID() . '_0']) ? nl2br(strip_tags(io::htmlspecialchars($values[$prefixName . $this->_field->getID() . '_0']))) : '';
     } else {
         $value = CMS_textEditor::parseOuterContent($values[$prefixName . $this->_field->getID() . '_0'], CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID()));
     }
     if (!$this->_subfieldValues[0]->setValue($value)) {
         return false;
     }
     return true;
 }
Exemplo n.º 3
0
 /**
  * This function is only used for old Automne modules compatibility
  * @author Sébastien Pauchet <*****@*****.**>
  */
 function createAutomneLinks($text, $module = MOD_STANDARD_CODENAME)
 {
     return CMS_textEditor::parseOuterContent($text, $module);
 }
Exemplo n.º 4
0
 /**
  * Access to description
  *
  * @access public
  * @param CMS_language $language
  * @return string
  */
 function getDescription($language = false, $useAlternative = true, $pluginsCode = true)
 {
     if (!$this->_descriptions) {
         $this->_retrieveLabels();
     }
     if (!is_a($language, 'CMS_language')) {
         $language = $this->_language;
     }
     $description = '';
     if (is_a($language, 'CMS_language') && isset($this->_descriptions[$language->getCode()]) && $this->_descriptions[$language->getCode()]) {
         $description = $this->_descriptions[$language->getCode()];
     } elseif ($useAlternative && isset($this->_descriptions[APPLICATION_DEFAULT_LANGUAGE]) && $this->_descriptions[APPLICATION_DEFAULT_LANGUAGE]) {
         $description = $this->_descriptions[APPLICATION_DEFAULT_LANGUAGE];
     } else {
         $description = '';
     }
     if ($pluginsCode) {
         //search and convert plugins codes
         $description = CMS_textEditor::parseOuterContent($description, $this->_moduleCodename);
         //then eval all plugin codes
         $callbackFunc = create_function('$string', 'ob_start();eval(sensitiveIO::sanitizeExecCommand("$string[2];"));$ret = ob_get_contents();ob_end_clean();return $ret;');
         if ($callbackFunc) {
             $description = preg_replace_callback("/(<\\?php|<\\?)(.*?)\\?>/si", $callbackFunc, $description);
         }
     }
     return $description;
 }