EclipseGc

Untitled

Feb 29th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. protected function matchDrupalItem($path) {
  2.     // For now we can just proxy our procedural method. At some point this will
  3.     // become more complicated because we'll need to get back candidates for a
  4.     // path and them resolve them based on things like method and scheme which
  5.     // we currently can't do.
  6.     $item = menu_get_item($path);
  7.     $path_elements = explode('/', $item['path']);
  8.     $i = 0;
  9.     foreach ($path_elements as $key => $element) {
  10.       if ($element == '%') {
  11.         $path_elements[$key] = "{arg$i}";
  12.         $i++;
  13.       }
  14.     }
  15.     $item['path'] = implode('/', $path_elements);
  16.     return $item;
  17.   }
Advertisement
Add Comment
Please, Sign In to add comment