[drupal-devel] Describing the WebDAV module

Fabiano Sant'Ana listas at wundo.net
Mon Jul 11 21:56:48 UTC 2005


What is my Idea?
We will have a global array ($_webdav) created by webdav hook_menu, each dav
module(for example, DAV_upload.module) will create a item in $_webdav['hooks']
with informations about how to call the hook, what is the base collection name,
etc.
In hook_menu webdav.module will parse the User Request and put it on $_webdav,
then it will call the hook_dav function to handle the response.

Here an example...

In webdav.module...
  function webdav_menu($may_cache) {
    global $_webdav;
    if(!isset($_webdav))
      $_webdav = array();

    $items = array();
    $items[] = array('path'     => 'webdav',
                     'title'    => t('WebDAV Interface'),
                     'callback' => 'webdav_interface',
                     'access'   => user_access('access nodes')); //administer
nodes

    return $items;
  }

In webdav.upload.module (I think that I need a better name)... ;)
  function dav_upload_menu($may_cache) {
    global $_webdav;

    $_webdav['hooks'][] = array('collection' => 'upload',
                                'handler'    => 'dav_upload_handler');
  }

Sorry if have any error in code I write just to elucidate, and sorry for not
reply the other e-mails, but I'm not at home.

cheers,
Fabiano Sant'Ana




More information about the drupal-devel mailing list