Changeset 2105

Show
Ignore:
Timestamp:
06/28/06 06:45:08 (7 years ago)
Author:
diego_iastrubni
Message:

fix indentation. code should be more readable now.

plase don't indent more then 5 times at the same page, if needed use "continue" or "return". if don't know what i am talking about, read the coding style document found at your linux kernel source. if you use windows, dont. if you use *bsd.... just download that doc file :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/config.php

    r1898 r2105  
    139139  default: 
    140140    //display the appropriate module page 
    141     if (is_array($active_modules)) { 
    142       foreach ($active_modules as $modkey => $module) { 
    143         if (is_array($module['items'])){ 
    144           foreach (array_keys($module['items']) as $item){ 
    145             if ($display == $item)  { 
    146               // modules can use their own translation files 
    147               if (extension_loaded('gettext')) { 
    148                 if(is_dir("./modules/{$modkey}/i18n")) { 
    149                   bindtextdomain($modkey,"./modules/{$modkey}/i18n"); 
    150                   textdomain($modkey); 
    151                 } 
    152               } 
    153               //TODO Determine which item is this module displaying. Currently this is over the place, we should standarize on a "itemid" request var for now, we'll just cover all possibilities :-( 
    154               $possibilites = array( 
    155                 'userdisplay', 
    156                 'extdisplay', 
    157                 'id', 
    158                 'itemid', 
    159                 'category', 
    160                 'selection' 
    161               ); 
    162               $itemid = ''; 
    163               foreach($possibilites as $possibility) { 
    164                 if ( isset($_REQUEST[$possibility]) && $_REQUEST[$possibility] != '' )  
    165                   $itemid = $_REQUEST[$possibility]; 
    166               } 
    167  
    168               // create a module_hook object for this module's page 
    169               $module_hook = new moduleHook; 
    170               // populate object variables 
    171               $module_hook->install_hooks($itemid,$modkey,$item); 
    172                
    173               // include the module page 
    174               include "modules/{$modkey}/page.{$item}.php"; 
    175                
    176               // let hooking modules process the $_REQUEST 
    177               $module_hook->process_hooks($itemid,$modkey,$item,$_REQUEST); 
    178  
    179             } 
     141    if (!is_array($active_modules)) { 
     142      break; 
     143    } 
     144     
     145    foreach ($active_modules as $modkey => $module) { 
     146      if (!is_array($module['items'])){ 
     147        continue; 
     148      } 
     149       
     150      foreach (array_keys($module['items']) as $item){ 
     151        if ($display != $item)  { 
     152          continue; 
     153        } 
     154         
     155        // modules can use their own translation files 
     156        if (extension_loaded('gettext')) { 
     157          if(is_dir("./modules/{$modkey}/i18n")) { 
     158            bindtextdomain($modkey,"./modules/{$modkey}/i18n"); 
     159            textdomain($modkey); 
    180160          } 
    181161        } 
     162         
     163        //TODO Determine which item is this module displaying. Currently this is over the place, we should standarize on a "itemid" request var for now, we'll just cover all possibilities :-( 
     164        $possibilites = array( 
     165          'userdisplay', 
     166          'extdisplay', 
     167          'id', 
     168          'itemid', 
     169          'category', 
     170          'selection' 
     171        ); 
     172        $itemid = ''; 
     173        foreach($possibilites as $possibility) { 
     174          if ( isset($_REQUEST[$possibility]) && $_REQUEST[$possibility] != '' )  
     175            $itemid = $_REQUEST[$possibility]; 
     176        } 
     177 
     178        // create a module_hook object for this module's page 
     179        $module_hook = new moduleHook; 
     180         
     181        // populate object variables 
     182        $module_hook->install_hooks($itemid,$modkey,$item); 
     183         
     184        // include the module page 
     185        include "modules/{$modkey}/page.{$item}.php"; 
     186         
     187        // let hooking modules process the $_REQUEST 
     188        $module_hook->process_hooks($itemid,$modkey,$item,$_REQUEST); 
    182189      } 
    183190    }