Adaptation v10
This commit is contained in:
parent
779a864761
commit
2053074e0b
@ -605,7 +605,7 @@ class template {
|
||||
* @param array $attributes Attributs ($key => $value)
|
||||
* @return string
|
||||
*/
|
||||
public static function table(array $cols = [], array $body = [], array $head = [], array $attributes = []) {
|
||||
public static function table(array $cols = [], array $body = [], array $head = [], array $attributes = [], array $rowsId = []) {
|
||||
// Attributs par défaut
|
||||
$attributes = array_merge([
|
||||
'class' => '',
|
||||
@ -620,7 +620,7 @@ class template {
|
||||
if($head) {
|
||||
// Début des entêtes
|
||||
$html .= '<thead>';
|
||||
$html .= '<tr>';
|
||||
$html .= '<tr class="nodrag">';
|
||||
$i = 0;
|
||||
foreach($head as $th) {
|
||||
$html .= '<th class="col' . $cols[$i++] . '">' . $th . '</th>';
|
||||
@ -630,9 +630,11 @@ class template {
|
||||
$html .= '</thead>';
|
||||
}
|
||||
// Début contenu
|
||||
$html .= '<tbody>';
|
||||
$j = 0;
|
||||
foreach($body as $tr) {
|
||||
$html .= '<tr>';
|
||||
// Id de ligne pour les tableaux drag and drop
|
||||
$html .= '<tr id="' . $rowsId[$j] . '">';
|
||||
$j++;
|
||||
$i = 0;
|
||||
foreach($tr as $td) {
|
||||
$html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user