You are here

function blogapi_blogger_get_users_blogs in Blog API 7.2

Same name and namespace in other branches
  1. 8 modules/blogapi_blogger/blogapi_blogger.module \blogapi_blogger_get_users_blogs()
  2. 7 blogapi.module \blogapi_blogger_get_users_blogs()

Service callback for blogger.getUsersBlogs

1 string reference to 'blogapi_blogger_get_users_blogs'
blogapi_blogger_services_resources in modules/blogapi_blogger/blogapi_blogger.module
Implements hook_services_resources().

File

modules/blogapi_blogger/blogapi_blogger.module, line 331
Provides Blogger services for BlogAPI

Code

function blogapi_blogger_get_users_blogs($appid, $username, $password) {

  // Validate the user.
  $user = blogapi_validate_user($username, $password);
  $types = blogapi_get_node_types();
  if (empty($types)) {
    return array();
  }
  $structs = array();
  foreach ($types as $type) {
    $structs[] = array(
      'url' => url('user/' . $user->uid, array(
        'absolute' => TRUE,
      )),
      'blogid' => $type,
      'blogName' => $user->name . ": " . $type,
    );
  }
  return $structs;
}