</content> <mediafolder>{$mFTest}</mediafolder> <mediaCacheData type="{$defaultGalleryType}" fullscreen="{$FullScreen}"> <file /> </mediaCacheData> </entry> EOT; // write xml $fileName = $options['XML_ROOT'] . str_replace('%', $decoded['section'], $options['blog.%.xml']); if(file_exists($fileName)) { // insert the new xml fragment into the blog xml $xmlStr = file_get_contents($fileName); if(!empty($decoded['before_entry'])) { $e =& BertaEditor::getEntry($decoded['before_entry'], $blog); if($e) { $firstEntryStarts = strpos($xmlStr, $e['uniqid']['value']); $firstEntryStarts = strrpos(substr($xmlStr, 0, $firstEntryStarts), '<entry'); } else $firstEntryStarts = strpos($xmlStr, '</blog>'); } else $firstEntryStarts = strpos($xmlStr, '</blog>'); if($firstEntryStarts !== false) // if an existing entry is found, then insert the new one before it $xmlStr = substr($xmlStr, 0, $firstEntryStarts) . $insertXML . substr($xmlStr, $firstEntryStarts); else // otherwise - assume the new one will be the first entry $xmlStr = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . "<blog>\n{$insertXML}</blog>";
$blog = BertaContent::loadBlog($decoded['section']); $entry = BertaContent::getEntry($decoded['entry'], $blog); echo BertaGallery::getHTMLForEntry($entry, true); } break; case 'galleryEditor': if($decoded['section'] && $decoded['entry']) { $blog = BertaEditor::loadBlog($decoded['section']); $entry = BertaEditor::getEntry($decoded['entry'], $blog); if($entry) { $galType = !empty($entry['mediaCacheData']['@attributes']['type']) ? $entry['mediaCacheData']['@attributes']['type'] : 'slideshow'; $imageSize = !empty($entry['mediaCacheData']['@attributes']['size']) ? $entry['mediaCacheData']['@attributes']['size'] : 'large'; $FullScreen=!empty($entry['mediaCacheData']['@attributes']['fullscreen']) ? $entry['mediaCacheData']['@attributes']['fullscreen'] : $berta->settings->get('entryLayout', 'galleryFullScreenDefault'); echo '<div class="xEntryGalleryEditor-wrap"><div class="xEntryGalleryEditor xPanel">'; //echo '; echo '<div class="xEntryGalleryToolbar xGreyBack">'; echo '<div class="xEntryAddImagesFallback">' . '<iframe name="xEntryUploadFrame' . $entry['id']['value'] . '" id="xEntryUploadFrame' . $entry['id']['value'] . '" class="xEntryUploadFrame"></iframe>' . '<form target="xEntryUploadFrame' . $entry['id']['value'] . '" action="' . $ENGINE_ABS_ROOT . 'upload.php?section=' . $decoded['section'] . '&entry=' . $entry['id']['value'] . '&mediafolder=' . $entry['mediafolder']['value'] . '&session_id=' . session_id() . '" class="xEntryGalleryForm" method="post" enctype="multipart/form-data">' . '<input type="hidden" name="upload_key" value="" />' . '<input type="hidden" name="upload_type" value="fallback" />' .
$e['updated'] = array('value' => date('d.m.Y H:i:s')); BertaEditor::saveBlog($decoded['section'], $blog); if($decoded['property'] == 'tags') BertaEditor::populateTags($decoded['section'], $blog); } else if($decoded['action'] == 'CREATE_NEW_ENTRY') { // create new entry on the spot $returnUpdate['entrynum'] = count($blog['entry']) + (isset($blog['@attributes']) ? -1 : 0); } else if($decoded['action'] == 'ORDER_ENTRIES') { // apply the new order //print_r($blog['entry']); $blog = BertaEditor::loadBlog($decoded['section']); $newEntriesList = array(); foreach($decoded['value'] as $oIdx => $oId) { $newEntriesList[$oIdx] = BertaEditor::getEntry($oId, $blog); } //print_r($blog['entry']); if(!empty($blog['entry']['@attributes'])) $newEntriesList['@attributes'] = $blog['entry']['@attributes']; //print_r($newEntriesList); $blog['entry'] = $newEntriesList; //BertaEditor::saveBlog($decoded['section'], $blog); //BertaEditor::populateTags($decoded['section'], $blog); } else { // section property include 'update/inc.update.sections_editor.php'; } }