Commit 954a3b53 authored by drumm's avatar drumm

#38178 by Eaton, add support for additional fields in blogapi via a couple new hooks.

parent 03c92fb6
......@@ -128,11 +128,6 @@ function blogapi_xmlrpc() {
'blogapi_mt_supported_text_filters',
array('array'),
t('Retrieve information about the text formatting plugins supported by the server.')),
array(
'mt.getTrackbackPings',
'blogapi_mt_get_trackback_pings',
array('array', 'string'),
t('Retrieve the list of TrackBack pings posted to a particular entry. This could be used to programmatically retrieve the list of pings for a particular entry, then iterate through each of those pings doing the same, until one has built up a graph of the web of entries referencing one another on a particular topic.')),
array(
'mt.publishPost',
'blogap_mti_publish_post',
......@@ -220,6 +215,8 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
if (user_access('administer nodes') && !isset($edit['date'])) {
$edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
}
node_invoke_nodeapi($edit, 'blogapi new');
node_validate($edit);
if ($errors = form_get_errors()) {
......@@ -272,6 +269,8 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
$node->body = $content;
}
node_invoke_nodeapi($node, 'blogapi edit');
node_validate($node);
if ($errors = form_get_errors()) {
return blogapi_error(implode("\n", $errors));
......@@ -473,14 +472,6 @@ function blogapi_mt_supported_text_filters() {
return $filters;
}
/**
* Blogging API callback. Can not be implemented without support from
* trackback module.
*/
function blogapi_mt_get_trackback_pings() {
return blogapi_error(t('Not implemented.'));
}
/**
* Blogging API callback. Publishes the given node
*/
......@@ -674,20 +665,6 @@ function _blogapi_mt_extra(&$node, $struct) {
$node->body = $node->body . '<!--extended-->' . $struct['mt_text_more'];
}
// mt_tb_ping_urls
if (function_exists('trackback_send')) {
if (is_array($struct['mt_tb_ping_urls'])) {
foreach ($struct['mt_tb_ping_urls'] as $tb_ping_url) {
$node->tb_url = $tb_ping_url->getVal();
trackback_send($node);
unset($node->tb_url); // make sure we don't ping twice
}
}
else {
$node->tb_url = $struct['mt_tb_ping_urls'];
}
}
// mt_convert_breaks
if ($struct['mt_convert_breaks']) {
$node->format = $struct['mt_convert_breaks'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment