getDocumentObject('id', $docid);
if (empty ($document)) {
return;
} // The document has to be published
$url = curl_init($geturl);
curl_setopt($url, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($url);
curl_close($url);
if (!$data) {
return 'Seite nicht gefunden!
';
}
$data = trim($data);
if ($utf8encode) {
$data = utf8_encode($data);
}
$table = $modx->getFullTableName('site_content');
$fields = array('content' => $data, 'editedon' => time());
$result = $modx->db->update($fields, $table, 'id = "' . $docid . '"');
if ($result) {
return 'Seite geändert.
';
} else {
return 'Fehler!
';
}