| 1 |
<?php |
<?php |
| 2 |
// $Id: emfield.module,v 1.21.2.5 2009/05/29 01:10:28 aaron Exp $ |
// $Id: emfield.module,v 1.21.2.6 2009/08/24 20:26:58 aaron Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implement hook_menu |
* Implement hook_menu |
| 270 |
// $module = $field['widget']['helper_module']; |
// $module = $field['widget']['helper_module']; |
| 271 |
$providers = emfield_allowed_providers($field, $module); |
$providers = emfield_allowed_providers($field, $module); |
| 272 |
foreach ($providers as $provider) { |
foreach ($providers as $provider) { |
| 273 |
$success = emfield_include_invoke($module, $provider->name, 'extract', $embed, $field); |
$success = emfield_include_invoke($module, $provider->name, 'extract', trim($embed), $field); |
| 274 |
// we've been given an array of regex strings, so let's see if we can find a match |
// we've been given an array of regex strings, so let's see if we can find a match |
| 275 |
if (is_array($success)) { |
if (is_array($success)) { |
| 276 |
foreach ($success as $regex) { |
foreach ($success as $regex) { |
| 277 |
$matches = NULL; |
$matches = NULL; |
| 278 |
if (preg_match($regex, $embed, $matches)) { |
if (preg_match($regex, trim($embed), $matches)) { |
| 279 |
return array('provider' => $provider->name, 'value' => $matches[1]); |
return array('provider' => $provider->name, 'value' => $matches[1]); |
| 280 |
} |
} |
| 281 |
} |
} |