1
0

Added Code for Prog Display

This commit is contained in:
2014-05-23 11:22:34 +02:00
parent 9ab5db5911
commit 5210478251
8 changed files with 229 additions and 102 deletions

View File

@@ -127,10 +127,9 @@ class ProgrammeController extends Controller
*/
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Programme');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
$this->layout = '//layouts/main';
$this->render('index');
}
/**

View File

@@ -2939,8 +2939,6 @@ table th[class*="span"],
.dropdown-menu .divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: rgba(0, 0, 0, 0.2);
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
@@ -4711,17 +4709,6 @@ input[type="submit"].btn.btn-mini {
content: '';
}
.navbar .nav > li > .dropdown-menu:after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #2c3e50;
border-left: 6px solid transparent;
content: '';
}
.navbar-fixed-bottom .nav > li > .dropdown-menu:before {
top: auto;
bottom: -7px;

View File

@@ -103,8 +103,6 @@ class Programme extends CActiveRecord
*/
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('ID',$this->ID);

View File

@@ -1,3 +1,35 @@
<?php // ###### FUNCTIONS ######
function GetProgDropDownList()
{
$progDropDown = array();
$dropDownModels = array();
$criteria = new CDbCriteria;
$criteria->order = "add_date DESC";
$criteria->limit = 3;
foreach (Programme::model()->findAll($criteria) as $row) {
$dropDownModels[] = $row;
}
$dropDownModels[] = null;
$criteria = new CDbCriteria;
$criteria->order = "add_date DESC";
$criteria->limit = 8;
$criteria->condition = "Sterne=4 AND visible=1";
foreach (Programme::model()->findAll($criteria) as $row) {
$dropDownModels[] = $row;
}
foreach ($dropDownModels as $row) {
if (is_null($row))
$progDropDown[] = TbHtml::menuDivider();
else
$progDropDown[] = array('label' => $row->attributes['Name'], 'url' => '/programme/' . $row->attributes['Name']);
}
return $progDropDown;
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
@@ -42,19 +74,17 @@
'class' => 'bootstrap.widgets.TbNav',
'items' =>
[
array('label' => 'Home', 'url' => '/', 'active' => ($this->selectedNav === 'index')),
array('label' => 'Blog', 'url' => '#', 'active' => ($this->selectedNav === 'blog')),
array('label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')),
array('label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')),
['label' => 'Home', 'url' => '/', 'active' => ($this->selectedNav === 'index')],
['label' => 'Blog', 'url' => '#', 'active' => ($this->selectedNav === 'blog')],
['label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')],
['label' => '', 'items' => GetProgDropDownList(), 'htmlOptions' => ['class' => 'dropdown-append']],
['label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')],
],
],
TbHtml::navbarSearchForm('search', '',
[
'class' => 'pull-right',
'placeholder' => 'Search',
'inputOptions' =>
[
'append' => TbHtml::submitButton(TbHtml::icon(TbHtml::ICON_SEARCH)),
@@ -94,8 +124,8 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="<?php echo (YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js') ?>"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="javascript/scripts.js"></script>
<script src="/js/plugins.js"></script>
<script src="/js/main.js"></script>
<script src="/javascript/scripts.js"></script>
</body>
</html>

View File

@@ -4,19 +4,31 @@
?>
<?php
$this->breadcrumbs=array(
$this->breadcrumbs = array(
'Programme',
);
$this->menu=array(
array('label'=>'Create Programme','url'=>array('create')),
array('label'=>'Manage Programme','url'=>array('admin')),
$this->menu = array(
array('label' => 'Create Programme', 'url' => array('create')),
array('label' => 'Manage Programme', 'url' => array('admin')),
);
?>
<h1>Programmes</h1>
<div class="container">
<div class="span12">
<h1>My Prog's</h1>
<br>
<br>
<?php
foreach (Programme::model()->findAll() as $record) {
echo "<div class='well'>";
echo nl2br(print_r($record->attributes, true));
echo "</div>";
}
?>
</div>
</div>
<?php $this->widget('bootstrap.widgets.TbListView',array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>

View File

@@ -19,7 +19,7 @@ $this->selectedNav = 'about';
<?php echo TbHtml::pageHeader('About Mikescher.de', ''); ?>
<div class="well cstm-background-white">
<div class="well cstm-well-light">
<p>Welcome to my private homepage.</p>
<p>My name is Mike Schwörer, and this is my homepage - here i upload programs i write in my free time and sometimes i even write a blog entry. </p>
@@ -27,7 +27,7 @@ $this->selectedNav = 'about';
<p>If you want you can look <?php echo TbHtml::link('here', '#'); // TODO Add Link ?> at the things I programmed </p>
</div>
<div class="well cstm-background-white">
<div class="well cstm-well-light">
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm',
[