本文整理汇总了PHP中content::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP content::getContent方法的具体用法?PHP content::getContent怎么用?PHP content::getContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::getContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
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: DOMDocument
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: print_history
/**
* 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>';
}
}