1
0

Added Visible & Enabled to BlogPost

This commit is contained in:
2014-09-13 17:37:47 +02:00
parent 5c940826de
commit ff5ecbc144
10 changed files with 69 additions and 13 deletions

View File

@@ -30,6 +30,20 @@
<?php echo $form->textAreaControlGroup($model,'Content',array('rows'=>30,'span'=>8)); ?>
<?php
if ($model->isNewRecord)
echo $form->textFieldControlGroup($model,'Visible',array('span'=>5, 'value' => '1'));
else
echo $form->textFieldControlGroup($model,'Visible',array('span'=>5, ));
?>
<?php
if ($model->isNewRecord)
echo $form->textFieldControlGroup($model,'Enabled',array('span'=>5, 'value' => '1'));
else
echo $form->textFieldControlGroup($model,'Enabled',array('span'=>5, ));
?>
<?php echo MsHtml::ajaxButton ("Preview", CController::createUrl('blog/ajaxMarkdownPreview'),
[
'type'=>'POST',

View File

@@ -17,7 +17,12 @@
<?php echo $form->textAreaControlGroup($model,'Content',array('rows'=>6,'span'=>8)); ?>
<div class="form-actions">
<?php echo $form->textFieldControlGroup($model,'Visible',array('span'=>5)); ?>
<?php echo $form->textFieldControlGroup($model,'Enabled',array('span'=>5)); ?>
<div class="form-actions">
<?php echo TbHtml::submitButton('Search', array('color' => TbHtml::BUTTON_COLOR_PRIMARY,));?>
</div>

View File

@@ -21,5 +21,13 @@
<?php echo CHtml::encode($data->Content); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('Visible')); ?>:</b>
<?php echo CHtml::encode($data->Visible); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('Enabled')); ?>:</b>
<?php echo CHtml::encode($data->Enabled); ?>
<br />
</div>

View File

@@ -29,6 +29,7 @@ $this->selectedNav = 'blog';
'date' => new DateTime($blogpost->Date),
'caption' => $blogpost->Title,
'link' => $blogpost->getLink(),
'stroked' => !($blogpost->Enabled && $blogpost->Visible),
]);
}
?>