Added Pagination to Programs/index
This commit is contained in:
@@ -24,7 +24,12 @@ class ProgramHelper {
|
||||
$criteria->limit = 8;
|
||||
$criteria->condition = "Sterne >= 4 AND visible=1 AND enabled=1";
|
||||
foreach (Program::model()->findAll($criteria) as $row) {
|
||||
$dropDownModels[] = $row;
|
||||
$contains = false;
|
||||
foreach($dropDownModels as $modelElem)
|
||||
if ($modelElem != null && $modelElem->attributes['ID'] == $row->attributes['ID'])
|
||||
$contains = true;
|
||||
if (! $contains)
|
||||
$dropDownModels[] = $row;
|
||||
}
|
||||
|
||||
return $dropDownModels;
|
||||
|
||||
@@ -28,7 +28,7 @@ class SeededRandom
|
||||
|
||||
$this->RSeed = ($this->RSeed * 125) % 2796203;
|
||||
|
||||
return $this->RSeed % ($max - $min + 1) + $min;
|
||||
return $this->RSeed % ($max - $min) + $min;
|
||||
}
|
||||
|
||||
function getRandomElement(array $arr)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
class ThumbnailPreview extends CWidget {
|
||||
public $caption = '';
|
||||
public $link = '';
|
||||
public $enabled = true;
|
||||
public $description = '';
|
||||
public $category = '';
|
||||
public $language = [];
|
||||
|
||||
@@ -4,21 +4,29 @@
|
||||
|
||||
<li class="span3 thumbnailParentSpan">
|
||||
<div >
|
||||
<div class="thumbnail">
|
||||
<div class="thumbnail <?php if (! $this->enabled) print("thumbnailDisabled"); ?>">
|
||||
<div class="thumbnailInnerHead">
|
||||
<a href="<?php echo $this->link; ?>">
|
||||
<a <?php if($this->enabled) echo 'href="'. $this->link . '"'; ?>>
|
||||
<img style="width: 100%" src="<?php echo $this->image; ?>">
|
||||
</a>
|
||||
</div>
|
||||
<div class="caption">
|
||||
<?php $h_level = (strlen($this->caption) > 13) ? ["<h3>", "</h3>"] : ["<h2>", "</h2>"]; ?>
|
||||
|
||||
<?php echo $h_level[0]; ?>
|
||||
|
||||
<?php
|
||||
if ( strlen($this->caption) > 13)
|
||||
echo '<h3><a class="progThumbnailCaption" href="' . $this->link . '">' . $this->caption . '</a></h3>';
|
||||
else
|
||||
echo '<h2><a class="progThumbnailCaption" href="' . $this->link . '">' . $this->caption . '</a></h2>';
|
||||
if ($this->enabled)
|
||||
echo '<a class="progThumbnailCaption" href="' . $this->link . '">' . $this->caption . '</a>';
|
||||
else
|
||||
echo '<a class="progThumbnailCaption">' . $this->caption . '</a>';
|
||||
?>
|
||||
|
||||
<p class="thumbnailInnerDescription"><?php echo $this->description; ?></p>
|
||||
<?php echo $h_level[1]; ?>
|
||||
|
||||
<p class="thumbnailInnerDescription">
|
||||
<?php echo $this->description; ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user