Drupal’s Search
Doug Green is talking about Drupal’s search engine over on CivicAction’s blog. Some good information and all the more reason to move away from MySQL 3.
Doug Green is talking about Drupal’s search engine over on CivicAction’s blog. Some good information and all the more reason to move away from MySQL 3.
Doug Green is working on a CCK module for Media Mover and pointed out that there were a few ways that the API could be improved to make it easier for other developers.
For one, the way that configuration forms have been handled is a bit cumbersome. In order to keep data accessible, configuration forms needed to be named a particular way. Previously, $form["{$action_id}_data_name"] was used to keep data straight. Now, the Media Mover API will handle this task when the configuration forms are loaded, so developers are free to name their forms as $form['data_name']. Additionally, the top level fieldset of a configuration form has some class and id data appended to it so that they can be shown and hidden as the user makes different choices. This is the same functionality as was previously spec’d, however it is done automatically now.
To do this, I’ve changed the actions parameter to work slightly differently. Now, the actions parameter expects a nested array with a verb defining each action:
$actions = array(
'harvest' => array(
'action_id' => t('My action name'),
'action_id_2' => t('My second action name'),
)
);
Because of this, the verbs declaration is no longer needed as all the data is being fetched out of the actions array. It’s also now possible to name the action_id parameters something a bit more intelligible, however these still should only contain alpha numeric characters.
Hopefully, this makes it easier for developers to write new modules and brings things more inline with how module developers are accustomed to writing Drupal code.
The trick to making the drupal xspf playlist module more useful is to allow other modules to interact with it. This includes letting xspf know that it can use files from other areas, setting thumbnails, and so.
I wrote two new hooks for xspf playlist which let other modules get into the game:
XSPF playlist supports drupal’s file attachements out of the box and Media Mover has support for this already.