static function format_date($value, $data) { if (!isset($data['valid1970']) && $value == 0) { return ''; } if (isset($data['format'])) { $format = $data['format']; } if (empty($format)) { $format = 'd.m.Y'; if (isset($data['with_time']) && $data['with_time']) { $format = 'd.m.Y - H:i'; } if (isset($data['with_seconds']) && $data['with_seconds']) { $format = 'd.m.Y - H:i:s'; } } return CMS::date($format, $value); }
<div class="row"> <div class="col-md-7"><a class="lead" href="<?php echo $data->getUrl(); ?> "><?php echo Html::text($data->title); ?> </a></div> <div class="col-md-2 text-right"> <?php $this->widget('ext.admin.frontControl.FrontControlWidget', array('data' => $data)); ?> </div> <div class="col-md-3 text-right"><span class="icon-calendar-2"></span> <?php echo CMS::date($data->date_create); ?> <?php $this->widget('mod.users.widgets.favorites.FavoritesWidget', array('model' => $data)); ?> </div> </div> </div> <div class="panel-body"> <?php echo Html::text($data->short_text); ?> </div> <div class="panel-footer navbar-collapse collapse"> <ul class="nav nav-pills"> <li><span class="icon-user"></span> <?php
echo $children->level; ?> "> <a href="#" title=""><img src="<?php echo Html::encode($children->user_avatar); ?> " width="50" alt="" /></a> <div class="messageArea"> <span class="aro"></span> <div class="infoRow"> <span class="name"><strong><?php echo Html::encode($children->user_name); ?> </strong> сказал:</span> <span class="time"><?php echo CMS::date($children->date_create); ?> </span> <?php if ($children->controlTimeout()) { ?> <div class="comment-panel"> <?php echo $children->editLink; ?> <?php echo $children->deleteLink; ?> </div> <?php }
</td> </tr> <tr> <td><?php echo $label['date_registration']; ?> </td> <td><?php echo CMS::date($user->date_registration); ?> </td> </tr> <tr> <td><?php echo $label['last_login']; ?> </td> <td><?php echo CMS::date($user->last_login); ?> </td> </tr> </table> <?php } else { Yii::app()->tpl->alert('info', 'Пользователь заблокирован'); } if (Yii::app()->user->getIsSuperuser()) { }
protected function format_datetime($value, $parms) { if ($value == '0000-00-00') { return ''; } $format = 'd.m.Y'; if (isset($parms['with_time']) && $parms['with_time'] || isset($parms['with_seconds']) && $parms['with_seconds']) { $format .= ' - G:i'; } if (isset($parms['with_seconds']) && $parms['with_seconds']) { $format .= ':s'; } return CMS::date($format, $value); }
<form action="/admin/news/default/update?id=<?php echo $model->id; ?> " method="POST" id="edit_mode"> <h1 id="News[title]" class="edit_mode_title"><?php echo Html::text($model->title); ?> </h1> <div class="date"> <span class="icon-calendar-2"></span> <?php echo CMS::date($model->date_create); ?> </div> <div class="edit_mode_text" id="News[short_text]"><?php echo Html::text($model->short_text); ?> </div> <div class="edit_mode_text" id="News[full_text]"><?php echo Html::text($model->full_text); ?> </div> </form> <?php if (Yii::app()->hasModule('comments')) { $this->widget('mod.comments.widgets.comment.CommentWidget', array('model' => $model)); } ?>
public function render($force_format = false) { $data = $this->data; $value = parent::value(); if (empty($value)) { return ''; } if (!isset($data['valid1970']) && CMS::date('Ymd', $value) == '19700101') { return ''; } if (isset($data['format'])) { $format = $data['format']; } if ($force_format) { $format = $force_format; } if (empty($format)) { $format = 'd.m.Y'; if (isset($data['with_time']) && $data['with_time']) { $format = 'd.m.Y - H:i'; } if (isset($data['with_seconds']) && $data['with_seconds']) { $format = 'd.m.Y - H:i:s'; } } $value = CMS::date($format, $value); return $value; }
echo Html::label('Главное', 'main_image_' . $image->id); echo Html::radioButton('mainImageId', $image->is_main, array('value' => $image->id, 'class' => 'check', 'id' => 'main_image_' . $image->id)); ?> <div class="input-group"> <?php echo Html::textField('image_titles[' . $image->id . ']', $image->title, array('placeholder' => 'Название изображение', 'class' => 'form-control')); ?> <span class="input-group-btn"> <?php echo Html::ajaxLink('<i class="flaticon-delete"></i>', $this->createUrl('deleteImage', array('id' => $image->id)), array('type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:\$('#ProductImage{$image->id}').hide().remove()"), array('id' => 'DeleteImageLink' . $image->id, 'class' => 'btn btn-danger', 'confirm' => Yii::t('ShopModule.admin', 'Вы действительно хотите удалить это изображение?'))); ?> </span> </div> <div class="actions" style="display: none;"> Дата: <?php echo CMS::date($image->date_create); ?> <br/> Загрузил: <?php echo $image->author ? Html::encode($image->author->login) : ''; ?> </div> </div> </div> <?php } ?>
foreach ($model->messages as $message) { ?> <div class="media"> <div class="media-left media-middle"> <img class="media-object" src="<?php //= $message->user->avatarUrl('50x50') ?> " alt=""> </div> <div class="media-body"> <h5 class="media-heading"> <?php echo $message->user->login; ?> <small><?php echo CMS::date($message->date_create); ?> </small> </h5> <p><?php echo $message->text; ?> </p> </div> </div> <?php } ?> <?php } ?>