function purl_providers in Persistent URL 6
Same name and namespace in other branches
- 7 purl.module \purl_providers()
Invokes hook_purl_provider() to gather all providers.
Modules that implement hook_purl_provider need to return an array of value definitions. Each definition should have the following keys:
- name
- description
- callback
- example
See the spaces module for an usage example.
4 calls to purl_providers()
- purl_admin in ./
purl.admin.inc - Page callback for the purl administration page.
- purl_cache::set in ./
purl.module - purl_modifiers in ./
purl.module - Queries the database & modules for valid values based on modifing method.
- purl_settings_form in ./
purl.admin.inc - Settings form for choosing the operating mode of purl
File
- ./
purl.module, line 514
Code
function purl_providers($by_method = FALSE) {
static $providers;
if (!is_array($providers)) {
$providers = array();
$providers = module_invoke_all('purl_provider');
}
if ($by_method) {
static $methods;
if (!isset($methods)) {
$methods = new purl_cache();
foreach ($providers as $id => $provider) {
$methods
->add(variable_get('purl_method_' . $id, 'path'), array(
$id => $provider,
));
}
}
return $methods
->get();
}
else {
return $providers;
}
}