예제 #1
0
             exit;
         } else {
             echo json_encode(array('result' => $foundRecord, 'msg' => 'Template found!', 'results' => $content->template, 'sectionInstances' => $content->sectionInstances, 'tabs' => $content->tabs, 'sections' => $content->sections));
             exit;
         }
     } else {
         echo json_encode(array('result' => false, 'msg' => 'AJAX Validation failed'));
         exit;
     }
 }
 ////////////////////////////////////////////////////
 // loadContent Content BY ID
 ////////////////////////////////////////////////////
 if ($_POST['action'] == 'loadContent') {
     if (isset($_POST['nodeID']) && is_int((int) $_POST['nodeID']) && isset($_POST['languageID']) && is_int((int) $_POST['languageID'])) {
         $foundRecord = $content->getContent((int) $_POST['nodeID'], (int) $_POST['languageID']);
         if ($foundRecord !== true) {
             echo json_encode(array('result' => false, 'msg' => 'Error obtaining content from the database'));
             exit;
         } else {
             // echo(json_encode(array('result' => $foundRecord, 'msg' => 'Content found', 'results' => $content->results)));
             echo json_encode(array('result' => $foundRecord, 'msg' => 'Content found', 'results' => $content->results));
             exit;
         }
     } else {
         echo json_encode(array('result' => false, 'msg' => 'AJAX Validation failed'));
         exit;
     }
 }
 ////////////////////////////////////////////////////
 // saveContent Content BY ID
예제 #2
0
    echo '<li><a href="#' . $lang . '">' . $bezeichnung . '</a></li>';
}
if ($news->content_id != '') {
    echo '<li><a href="#add" title="' . $p->t('news/uebersetzen') . '">+</a></li>';
}
echo '</ul>';
$idx = 0;
foreach ($sprachen as $lang) {
    $sprachindex[$lang] = $idx;
    $idx++;
    $verfasser = '';
    $betreff = '';
    $text = '';
    $sichtbar = '';
    if ($news->content_id != '') {
        $content->getContent($news->content_id, $lang, null, null, false);
        $xml_inhalt = new DOMDocument();
        if ($content->content != '') {
            $xml_inhalt->loadXML($content->content);
        }
        if ($xml_inhalt->getElementsByTagName('verfasser')->item(0)) {
            $verfasser = $xml_inhalt->getElementsByTagName('verfasser')->item(0)->nodeValue;
        }
        if ($xml_inhalt->getElementsByTagName('betreff')->item(0)) {
            $betreff = $xml_inhalt->getElementsByTagName('betreff')->item(0)->nodeValue;
        }
        if ($xml_inhalt->getElementsByTagName('text')->item(0)) {
            $text = $xml_inhalt->getElementsByTagName('text')->item(0)->nodeValue;
        }
        $sichtbar = $content->sichtbar;
    }
예제 #3
0
/**
 * Zeigt die Historie eines Contents an. 
 * 
 */
function print_history()
{
    global $content_id, $sprache, $version, $method, $filterstr;
    if ($method == 'history_changes') {
        if (!isset($_GET['v1']) || !isset($_GET['v2'])) {
            echo 'Invalid Parameter';
            return false;
        }
        $v1 = $_GET['v1'];
        $v2 = $_GET['v2'];
        $content_old = new content();
        $content_old->getContent($content_id, $sprache, $v1);
        $dom = new DOMDocument();
        $dom->loadXML($content_old->content);
        $content_old = $dom->getElementsByTagName('inhalt')->item(0)->nodeValue;
        $content_new = new content();
        $content_new->getContent($content_id, $sprache, $v2);
        $dom = new DOMDocument();
        $dom->loadXML($content_new->content);
        $content_new = $dom->getElementsByTagName('inhalt')->item(0)->nodeValue;
        $arr_old = explode("\n", trim($content_old));
        $arr_new = explode("\n", trim($content_new));
        $diff = new Diff($arr_new, $arr_old);
        $tdf = new TableDiffFormatter();
        echo '<table>';
        echo html_entity_decode($tdf->format($diff));
        echo '</table>';
    } else {
        $content = new content();
        $content->loadVersionen($content_id, $sprache);
        $datum_obj = new datum();
        echo '<h3>Versionen</h3>';
        echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="GET">';
        echo '
			<input type="hidden" name="action" value="history">
			<input type="hidden" name="method" value="history_changes">
			<input type="hidden" name="sprache" value="' . $sprache . '">
			<input type="hidden" name="version" value="' . $version . '">
			<input type="hidden" name="filter" value="' . implode(' ', $filterstr) . '">
			<input type="hidden" name="content_id" value="' . $content_id . '">';
        echo 'Änderungen von Version
			<input type="text" value="1" size="2" name="v1"> zu 
			<input type="text" value="2" size="2" name="v2"> 
			<input type="submit" value="Anzeigen">
			</form>';
        echo '<ul>';
        foreach ($content->result as $row) {
            echo '<li>';
            echo '<b>Version ' . $row->version . '</b><br>Erstellt am ' . $datum_obj->formatDatum($row->insertamum, 'd.m.Y') . ' von ' . $row->insertvon;
            if ($row->updateamum != '' || $row->updatevon != '') {
                echo '<br>Letzte Änderung von ' . $row->updatevon . ' am ' . $datum_obj->formatDatum($row->updateamum, 'd.m.Y');
            }
            if ($row->reviewvon != '' || $row->reviewamum != '') {
                echo '<br>Review von ' . $row->reviewvon . ' am ' . $datum_obj->formatDatum($row->reviewamum, 'd.m.Y');
            }
            echo '<br><br>';
            echo '</li>';
        }
        echo '</ul>';
    }
}