コード例 #1
0
ファイル: lib.php プロジェクト: EmmanuelYupit/educursos
 /**
  * Static recursive helper - add colspan information into categories
  *
  * @param array &$element The seed of the recursion
  *
  * @return int
  */
 public function inject_colspans(&$element)
 {
     if (empty($element['children'])) {
         return 1;
     }
     $count = 0;
     foreach ($element['children'] as $key => $child) {
         $count += grade_tree::inject_colspans($element['children'][$key]);
     }
     $element['colspan'] = $count;
     return $count;
 }
コード例 #2
0
ファイル: lib.php プロジェクト: jeffthestampede/excelsior
 /**
  * Static recursive helper - add colspan information into categories
  *
  * @param array &$element The seed of the recursion
  *
  * @return int
  */
 public function inject_colspans(&$element)
 {
     if (empty($element['children'])) {
         return 1;
     }
     $count = 0;
     foreach ($element['children'] as $key => $child) {
         if (!self::can_output_item($child)) {
             continue;
         }
         $count += grade_tree::inject_colspans($element['children'][$key]);
     }
     $element['colspan'] = $count;
     return $count;
 }