2014-05-19 10:16:43 +02:00
|
|
|
<?php
|
2014-05-28 11:02:52 +02:00
|
|
|
/* @var $this ProgramController */
|
2014-05-19 10:16:43 +02:00
|
|
|
/* @var $dataProvider CActiveDataProvider */
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
2014-06-02 19:31:14 +02:00
|
|
|
|
|
|
|
const PROGS_INDEX_ROWSIZE = 4;
|
|
|
|
const PROGS_INDEX_PAGESIZE = 16;
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$this->breadcrumbs = array(
|
|
|
|
'Programs',
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->menu = array(
|
|
|
|
array('label' => 'Create Program', 'url' => array('create')),
|
|
|
|
array('label' => 'Manage Program', 'url' => array('admin')),
|
|
|
|
);
|
2014-05-19 10:16:43 +02:00
|
|
|
?>
|
|
|
|
|
2014-05-23 11:22:34 +02:00
|
|
|
<div class="container">
|
2014-05-28 21:29:49 +02:00
|
|
|
|
|
|
|
<h1>My Programs</h1>
|
|
|
|
<br><br>
|
|
|
|
|
2014-05-28 17:19:57 +02:00
|
|
|
<div class="row-fluid">
|
|
|
|
|
2014-05-23 11:22:34 +02:00
|
|
|
<?php
|
2014-06-02 19:31:14 +02:00
|
|
|
|
2014-05-28 21:29:49 +02:00
|
|
|
$criteria = new CDbCriteria;
|
|
|
|
$criteria->order = "add_date DESC";
|
|
|
|
$criteria->condition = "visible=1";
|
|
|
|
|
|
|
|
$all = Program::model()->findAll($criteria);
|
2014-05-23 11:22:34 +02:00
|
|
|
|
2014-06-02 19:31:14 +02:00
|
|
|
$pagecount = ceil(count($all) / PROGS_INDEX_PAGESIZE);
|
|
|
|
|
|
|
|
$all = array_slice($all, ($page - 1) * PROGS_INDEX_PAGESIZE, PROGS_INDEX_PAGESIZE);
|
|
|
|
|
|
|
|
$rowcount = ceil((count($all) / PROGS_INDEX_ROWSIZE));
|
|
|
|
|
|
|
|
for ($i = 0; $i < $rowcount; $i++) {
|
2014-05-28 17:19:57 +02:00
|
|
|
echo '<ul class="thumbnails">';
|
2014-05-23 11:22:34 +02:00
|
|
|
|
2014-06-02 19:31:14 +02:00
|
|
|
foreach (array_slice($all, $i * PROGS_INDEX_ROWSIZE, PROGS_INDEX_ROWSIZE) as $record) {
|
2014-05-28 17:19:57 +02:00
|
|
|
$this->widget('ThumbnailPreview',
|
|
|
|
[
|
|
|
|
'caption' => $record->attributes['Thumbnailname'],
|
2014-05-28 21:29:49 +02:00
|
|
|
'link' => '/programs/view/' . $record->attributes['Name'],
|
2014-05-28 17:19:57 +02:00
|
|
|
'description' => $record->attributes['Description'],
|
|
|
|
'category' => $record->attributes['Kategorie'],
|
|
|
|
'language' => explode("|", $record->attributes['Language']),
|
|
|
|
'image' => '/images/programs/thumbnails/' . $record->attributes['Name'] . '.jpg',
|
|
|
|
'starcount' => $record->attributes['Sterne'],
|
|
|
|
'downloads' => $record->attributes['Downloads'],
|
|
|
|
'date' => new DateTime($record->attributes['add_date']),
|
2014-06-02 19:31:14 +02:00
|
|
|
'enabled' => $record->attributes['enabled'],
|
2014-05-28 17:19:57 +02:00
|
|
|
]);
|
|
|
|
}
|
2014-05-23 11:22:34 +02:00
|
|
|
|
2014-05-28 17:19:57 +02:00
|
|
|
echo '</ul>';
|
|
|
|
}
|
2014-05-23 11:22:34 +02:00
|
|
|
?>
|
2014-05-28 17:19:57 +02:00
|
|
|
|
2014-05-23 11:22:34 +02:00
|
|
|
</div>
|
2014-06-02 19:31:14 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if ($pagecount > 1) {
|
|
|
|
$pagination_arr = array();
|
|
|
|
|
|
|
|
$pagination_arr[] = ['label' => '«', 'url' => '?page=' . ($page-1), 'disabled' => ($page <= 1)];
|
|
|
|
for($i = 1; $i <= $pagecount; $i++) {
|
|
|
|
$pagination_arr[] = ['label' => $i, 'url' => '?page=' . $i, 'active' => ($i == $page)];
|
|
|
|
}
|
|
|
|
$pagination_arr[] = ['label' => '»', 'url' => '?page=' . ($page+1), 'disabled' => ($page >= $pagecount)];
|
|
|
|
|
|
|
|
echo TbHtml::pagination($pagination_arr,
|
|
|
|
[
|
|
|
|
'align' => 'right',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2014-05-23 11:22:34 +02:00
|
|
|
</div>
|
2014-05-19 10:16:43 +02:00
|
|
|
|