PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/message/views/message/new_messages_dialog.php

https://github.com/yii-simon/yii-user-management
PHP | 36 lines | 32 code | 4 blank | 0 comment | 2 complexity | c721d03915d7b0b69bb8be5f784e133c MD5 | raw file
  1. <?
  2. $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
  3. 'id'=>rand(1, 999999),
  4. 'options'=>array(
  5. 'show' => 'blind',
  6. 'hide' => 'explode',
  7. 'modal' => 'false',
  8. 'width' => '800px',
  9. 'title' => Yum::t('You have {count} new Messages !', array(
  10. '{count}' => count($messages))),
  11. 'autoOpen'=>true,
  12. ),
  13. ));
  14. echo '<table>';
  15. printf('<tr><th>%s</th><th>%s</th><th>%s</th><th colspan = 2>%s</th></tr>',
  16. Yum::t('From'),
  17. Yum::t('Date'),
  18. Yum::t('Title'),
  19. Yum::t('Actions'));
  20. foreach($messages as $message) {
  21. if(is_object($message) && $message->from_user instanceof YumUser )
  22. printf('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
  23. CHtml::link($message->from_user->username, array(
  24. '//profile/profile/view', 'id' => $message->from_user_id)),
  25. date(Yum::module()->dateTimeFormat, $message->timestamp),
  26. CHtml::link($message->title, array('//message/message/view', 'id' => $message->id)),
  27. CHtml::link(Yum::t('View'), array('//message/message/view', 'id' => $message->id)),
  28. CHtml::link(Yum::t('Reply'), array('//message/message/compose', 'to_user_id' => $message->from_user_id)));
  29. }
  30. echo '</table>';
  31. $this->endWidget('zii.widgets.jui.CJuiDialog');
  32. ?>