Fixes up the list view a bit and also adds edit and delete ops.

CommentFileSizeAuthor
mollomapi_crud.patch6.29 KBJacobSingh

Comments

gábor hojtsy’s picture

Looks good except it would be best to document mollomapi_client_key_load() which I was puzzled a bit about.

JacobSingh’s picture

Yeah, actually we should rename $public_key to $client_key really everywhere in the module. Since the public_key is actually for the reseller, not the site we are modifying.

gábor hojtsy’s picture

Status: Needs review » Needs work

Well, my point was that mollomapi_client_key_load() sounds like it loads the client key, while that's not what's happening. Is there any other way to load a site but the client key? We now have

function mollomapi_client_key_load($client_key) {
  $site = mollomapi_site_get($client_key);
  $site['client_key'] = $client_key;
  return $site;
}

/**
 * Get information about a site by its public key.
 */
function mollomapi_site_get($public_key) {
  return mollomapi_invoke('mollom.getSite', array('client_key' => $public_key));
}

Why have two methods for this? Why so differently named? Why confusingly named?