$returnUpdate .= '<div class="csPub"><span class="' . $xEditSelectorYesNo . ' xProperty-published xSection-' . $sName . '">' . $published . '</span></div>'; $returnUpdate .= '<div class="csClone"><a href="#" class="xSectionClone">clone</a></div>'; $returnUpdate .= '<div class="csDelete"><a href="#" class="xSectionDelete">delete</a></div>'; $returnReal = $sName; if (!$isClone) { $sectionsList[$sName] = array('@attributes' => array('tags_behavior' => 'invisible', 'published' => 1), 'name' => $sName, 'title' => array('value' => '')); } BertaEditor::saveSections($sectionsList); if ($isClone) { BertaEditor::populateTags($sName, $cloneContent); } } } else { if ($decoded['action'] == 'DELETE_SECTION') { // delete a section if (!BertaEditor::deleteSection($decoded['value'])) { $returnError = 'Section cannot be deleted! Check permissions.'; } } else { $returnUpdate = $returnReal = trim($decoded['value']); $sName = trim($decoded['section']); if (strtolower($sName) != 'title' && strtolower($sName) != 'name') { $sectionsList = BertaEditor::getSections(); foreach ($sectionsList as $sN => $s) { if ((string) $sN === $sName) { $sectionsList[$sN][$property] = array('value' => $returnUpdate); break; } } BertaEditor::saveSections($sectionsList); } else {