/[drupal]/contributions/modules/api/api.module
ViewVC logotype

Diff of /contributions/modules/api/api.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.88.2.43, Sun Oct 18 23:07:51 2009 UTC revision 1.88.2.44, Mon Nov 9 23:03:53 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: api.module,v 1.88.2.42 2009/10/15 06:42:35 drumm Exp $  // $Id: api.module,v 1.88.2.43 2009/10/18 23:07:51 drumm Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 775  function api_get_active_branch() { Line 775  function api_get_active_branch() {
775    static $branch;    static $branch;
776    
777    if (!isset($branch)) {    if (!isset($branch)) {
778      if (arg(0) == 'api') {      $item = menu_get_item();
779        if (in_array(arg(1), array('function_dump', 'functions', 'constants', 'globals', 'files', 'groups', 'search'))) {      // todo handle all cases
780          $possible_branch = arg(2);      if (isset($item['page_arguments'][0]->branch_name)) {
781        }        $branch = $item['page_arguments'][0];
       elseif (in_array(arg(1), array('function', 'file', 'constant', 'global', 'group'))) {  
         $possible_branch = arg(3);  
       }  
       else {  
         // Maybe we are on one of the branch home pages.  
         $possible_branch = arg(1);  
       }  
     }  
   
     $branches = api_get_branches();  
     if (isset($possible_branch)) {  
       foreach ($branches as $b) {  
         if ($b->branch_name === $possible_branch) {  
           $branch = $b;  
         }  
       }  
782      }      }
783      if (!isset($branch)) {      else {
784        $branch = $branches[variable_get('api_default_branch', NULL)];        $branch = $branches[variable_get('api_default_branch', NULL)];
785      }      }
786    }    }

Legend:
Removed from v.1.88.2.43  
changed lines
  Added in v.1.88.2.44

  ViewVC Help
Powered by ViewVC 1.1.2