Classe : \Schwan\Code\View\SourceIndex

Fichier PHP
| Mardi 12 Mars 2024, 18:17:50

<?php
/**
* Code.Schwan
*
* GNU General Public License
*
* Copyright © 2021 - 2023, Yohann Schwan. All rights reserved.
*/
namespace Schwan\Code\View {

class
SourceIndex extends \Lys\View
{
/**
* @args string $str = ''
* @return void
*/
function send($str = '')
{
$str .= $this->fallback();

#
$text = array();

#
foreach($this->listOf('source') as $row)
{
$row = $this->sourceOf($row);

# Define $type key.
$type = $row['source_type'];

$text += array(

$type => ''
);

$text[$type] .= ''
. '<dl class="inner">'
. '<dt class="u3">'
. $this->a('source', $row)
.
'</dt>'
. ($row['source_size']
?
''
. '<dd class="u1 uCenter hs">'
. $row['source_size'] . ' <small>ko</small>'
. '</dd>'
. '<dd class="u2 uRight od">'
. $this->datetime($row['source_time'], true)
.
'</dd>'
: ''
)
.
'</dl>';
}

foreach(
$text as $type => $text)
{
$str .= ''
. '<div class="inner">'
. '<h2 class="u3">'
. $this->L($type . '_title')
.
'</h2>'
. '<div class="u1 uCenter hs">'
. $this->L('file_size_title')
.
'</div>'
. '<div class="u2 uRight od">'
. $this->L('file_info_title')
.
'</div>'
. '</div>'
. $text
. '<br>';
}

return
parent::send($str);
}
}
}