library/core/class.form.php
public function GetCheckBoxGridGroup($GroupName, $Group, $Rows, $Cols) {
      $Return = '';
      $Headings = '';
      $Cells = '';
      $RowCount = count($Rows);
      $ColCount = count($Cols);
      for($j = 0; $j < $RowCount; ++$j) {
         $Alt = 1;
         for($i = 0; $i < $ColCount; ++$i) {
            $Alt = $Alt == 0 ? 1 : 0;
            $ColName = $Cols[$i];
            $RowName = $Rows[$j];

            if ($j == 0) $Headings .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                '>' . T($ColName) . '</td>';

            if (array_key_exists($RowName, $Group[$ColName])) {
               $Cells .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                   '>' . $Group[$ColName][$RowName] .
                   '</td>';
            } else {
               $Cells .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                   '>&#160;</td>';
            }
         }
         if ($Headings != '') $Return .= "<thead><tr><th>" . T($GroupName) . "</th>" .
             $Headings . "</tr></thead>\r\n<tbody>";

         $aRowName = explode('.', $RowName);
         $RowNameCount = count($aRowName);
         if ($RowNameCount > 1) {
            $RowName = '';
            for($i = 0; $i < $RowNameCount; ++$i) {
               if ($i < $RowNameCount - 1) $RowName .= '<span class="Parent">' .
                   T($aRowName[$i]) . '</span>';
               else $RowName .= T($aRowName[$i]);
            }
         } else {
            $RowName = T($RowName);
         }
         $Return .= '<tr><th>' . $RowName . '</th>' . $Cells . "</tr>\r\n";
         $Headings = '';
         $Cells = '';
      }
      return $Return == '' ? '' : '<table class="CheckBoxGrid">'.$Return.'</tbody></table>';
   }
public function GetCheckBoxGridGroup($GroupName, $Group, $Rows, $Cols) {
      $Return = '';
      $Headings = '';
      $Cells = '';
      $RowCount = count($Rows);
      $ColCount = count($Cols);
      for($j = 0; $j < $RowCount; ++$j) {
         $Alt = 1;
         for($i = 0; $i < $ColCount; ++$i) {
            $Alt = $Alt == 0 ? 1 : 0;
            $ColName = $Cols[$i];
            $RowName = $Rows[$j];

            if ($j == 0) $Headings .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                '>' . T($ColName) . '</td>';

            if (array_key_exists($RowName, $Group[$ColName])) {
               $Cells .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                   '>' . $Group[$ColName][$RowName] .
                   '</td>';
            } else {
               $Cells .= '<td' . ($Alt == 0 ? ' class="Alt"' : '') .
                   '>&#160;</td>';
            }
         }
         if ($Headings != '') $Return .= "<thead><tr><th>" . T($GroupName) . "</th>" .
             $Headings . "</tr></thead>\r\n<tbody>";

         $aRowName = explode('.', $RowName);
         $RowNameCount = count($aRowName);
         if ($RowNameCount > 1) {
            $RowName = '';
            for($i = 0; $i < $RowNameCount; ++$i) {
               if ($i < $RowNameCount - 1) $RowName .= '<span class="Parent">' .
                   T($aRowName[$i]) . '</span>';
               else $RowName .= T($aRowName[$i]);
            }
         } else {
            $RowName = T($RowName);
         }
         $Return .= '<tr><th>' . $RowName . '</th>' . $Cells . "</tr>\r\n";
         $Headings = '';
         $Cells = '';
      }
      return $Return == '' ? '' : '<table class="CheckBoxGrid">'.$Return.'</tbody></table>';
   }
public function GetCheckBoxGridGroup ( $ GroupName , $ Group , $ Rows , $ Cols ) { $ Return = '' ; $ Headings = '' ; $ Cells = '' ; $ RowCount = count ( $ Rows ) ; $ ColCount = count ( $ Cols ) ; for ( $ j = 0 ; $ j < $ RowCount ; ++ $ j ) { $ Alt = 1 ; for ( $ i = 0 ; $ i < $ ColCount ; ++ $ i ) { $ Alt = $ Alt == 0 ? 1 : 0 ; $ ColName = $ Cols [ $ i ] ; $ RowName = $ Rows [ $ j ] ; if ( $ j == 0 ) $ Headings .= '<td' . ( $ Alt == 0 ? ' class="Alt"' : '' ) . '>' . T ( $ ColName ) . '</td>' ; if ( array_key_exists ( $ RowName , $ Group [ $ ColName ] ) ) { $ Cells .= '<td' . ( $ Alt == 0 ? ' class="Alt"' : '' ) . '>' . $ Group [ $ ColName ] [ $ RowName ] . '</td>' ; } else { $ Cells .= '<td' . ( $ Alt == 0 ? ' class="Alt"' : '' ) . '>&#160;</td>' ; } } if ( $ Headings != '' ) $ Return .= "<thead><tr><th>" . T ( $ GroupName ) . "</th>" . $ Headings . "</tr></thead>\r\n<tbody>" ; $ aRowName = explode ( '.' , $ RowName ) ; $ RowNameCount = count ( $ aRowName ) ; if ( $ RowNameCount > 1 ) { $ RowName = '' ; for ( $ i = 0 ; $ i < $ RowNameCount ; ++ $ i ) { if ( $ i < $ RowNameCount - 1 ) $ RowName .= '<span class="Parent">' . T ( $ aRowName [ $ i ] ) . '</span>' ; else $ RowName .= T ( $ aRowName [ $ i ] ) ; } } else { $ RowName = T ( $ RowName ) ; } $ Return .= '<tr><th>' . $ RowName . '</th>' . $ Cells . "</tr>\r\n" ; $ Headings = '' ; $ Cells = '' ; } return $ Return == '' ? '' : '<table class="CheckBoxGrid">' . $ Return . '</tbody></table>' ; }
Returns a checkbox table.

@param string $GroupName The name of the checkbox table (the text that appears in the top-left
cell of the table). This value will be passed through the T()
function before render.

@param array $Group An array of $PermissionName => $CheckBoxXhtml to be rendered within the
grid. This represents the final (third) part of the permission name
string, as in the "Edit" part of "Garden.Roles.Edit".
ie. 'Edit' => '<input type="checkbox" id="PermissionID"
name="Role/PermissionID[]" value="20" />';

@param array $Rows An array of rows to appear in the grid. This represents the middle part
of the permission name, as in the "Roles" part of "Garden.Roles.Edit".

@param array $Cols An array of columns to appear in the grid for each row. This (again)
represents the final part of the permission name, as in the "Edit" part
of "Garden.Roles.Edit".
ie. Row1 = array('Add', 'Edit', 'Delete');
Returns a checkbox table .