Fix for Fix for Code

  1.   /**
  2.    * Get a layer's children.
  3.    *
  4.    * @param $layers array
  5.    *   The layers to search.
  6.    * @param $parent_lid string
  7.    *   The layer ID of the layer to get the children for.
  8.    */
  9.   private function childLayers(array &$layers, $parent_lid = NULL) {
  10.     $children = array();
  11.     foreach ($layers as $lid => $layer) {
  12.       if (!$parent_lid && strpos($lid, '.') === FALSE) {
  13.         $children[$lid] = &$layer;
  14.       }
  15.       elseif ($parent_lid && strpos($lid, $parent_lid) === 0 && strpos(substr($lid, strlen($parent_lid) + 1), '.') === FALSE) {
  16.         $children[$lid] = &$layer;
  17.       }
  18.     }
  19.  
  20.     return $children;
  21.   }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.