DROP TABLE IF EXISTS `groups`;
DROP TABLE IF EXISTS `send_mails`;
+DROP TABLE IF EXISTS `news`;
DROP TABLE IF EXISTS `site_configs`;
DROP TABLE IF EXISTS `cake_sessions`;
+/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cake_sessions` (
`id` varchar(255) NOT NULL default '',
`data` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_configs` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`key_name` VARCHAR(64) NOT NULL,
UNIQUE INDEX `site_settings_key`(`key_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE `news` (
+ `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ `title` varchar(512) NOT NULL,
+ `value` TEXT NOT NULL,
+ `public_flag` ENUM('public','private') NOT NULL DEFAULT 'public',
+ `date` DATE NOT NULL,
+ `end_date` DATE NOT NULL DEFAULT '0000-00-00',
+ `modified` DATETIME NOT NULL,
+ PRIMARY KEY(`id`),
+ INDEX `news_date`(`date`),
+ INDEX `news_public_date_end`(`public_flag`, `date`, `end_date`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
CREATE TABLE `send_mails` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INTEGER UNSIGNED NULL,
`from_user_id` INTEGER UNSIGNED NULL,
`subject` TEXT NOT NULL,
`body` TEXT NOT NULL,
+ `useragent` varchar(512) NOT NULL,
+ `host` varchar(64) NOT NULL,
`created` DATETIME NOT NULL,
`modified` DATETIME NOT NULL,
PRIMARY KEY(`id`),
return $data;
}
+ function _restore_html_news($data, $nl2br = false) {
+ $data['title'] = $this->{$this->modelClass}->restore_html($data['title'], false, false, false);
+
+ if (isset($data['value']) && !empty($data['value'])) {
+ $data['value'] = $this->{$this->modelClass}->restore_html($data['value'], false, false, false);
+ if ($nl2br) {
+ $data['value'] = str_replace('<br />', "\n", $data['value']);
+ }
+ }
+
+ return $data;
+ }
+
// アドレス復号化
function decrypt_mail($data)
{
return true;
}
+ // 最新のお知らせ
+ function get_news($limit = 5) {
+ $this->News = CorePlus::set_model('News');
+
+ $news = $this->News->find('all', array(
+ 'conditions' => array(
+ 'News.public_flag' => 'public',
+ 'News.end_date > ' => date('Y-m-d 00:00:00', time()),
+ ),
+ 'fields' => '',
+ 'recursive' => -1,
+ 'order' => array(
+ 'News.date' => 'desc'
+ ),
+ 'limit' => $limit,
+ ));
+
+ foreach($news as $k => $v) {
+ $news[$k]['News'] = $this->_restore_html_news($v['News']);
+ }
+
+ return $news;
+ }
+
}
/*
}
function mycharacter(){
+ // お知らせ
+ $news = array();
+ if (empty($this->site_configs['Site.myHome']['value'])) {
+ $news = $this->get_news();
+ }
+ $this->set('news', $news);
+
$this->set('isOwner', true);
$this->_index($this->user_id);
--- /dev/null
+<?php
+class NewsController extends AppController {
+
+ var $name = 'News';
+ var $helpers = array(
+ 'Group',
+ 'Select',
+ 'Time',
+ );
+
+ // listView用のpagenate設定
+ var $paginate = array(
+ 'conditions' => array(
+ 'News.public_flag' => 'public',
+ ),
+ 'fields' => array(
+ 'News.id',
+ 'News.title',
+ 'News.value',
+ 'News.date',
+ 'News.end_date',
+ 'News.modified',
+ ),
+ 'recursive' => -1,
+ 'limit' => 20,
+ 'order' => array(
+ 'News.date' => 'desc'
+ ),
+ );
+
+
+ function beforeFilter() {
+
+ parent::beforeFilter();
+
+ // Cache
+ $this->cacheAction = array(
+ 'view' => Configure::read('Cache.expireLong'),
+ 'index' => Configure::read('Cache.expireLong'),
+ );
+
+ // 認証なしアクセス可
+ $this->AuthPlus->allow('index');
+ $this->AuthPlus->allow('view');
+
+ // 設定
+ $this->set_public_flag4view();
+ }
+
+ /* アクション */
+ function index() {
+ $this->_index(false);
+ }
+
+ function admin_index() {
+ $this->_index(true);
+ }
+
+ function admin_add() {
+ if (!empty($this->data)) {
+ $this->News->create();
+ if ($this->News->save($this->data, array('fieldList' => $this->SendMail->fields['add'], 'validate' => false))) {
+ $this->Session->setFlash(__('The news has been saved', true));
+ $this->redirect(array('action' => 'index'));
+ } else {
+ $this->Session->setFlash(__('The news could not be saved. Please, try again.', true));
+ }
+ }
+
+ $this->set('title_for_layout', " - ". __('Add News', true));
+ }
+
+ function admin_edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid news', true));
+ $this->redirect(array('action' => 'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->News->save($this->data)) {
+ $this->Session->setFlash(__('The news has been saved', true));
+ $this->redirect(array('action' => 'index'));
+ } else {
+ $this->Session->setFlash(__('The news could not be saved. Please, try again.', true));
+ $this->data['News']['id'] = $id;
+ }
+ }
+ if (empty($this->data)) {
+ $news = $this->News->find('first', array(
+ 'conditions' => array(
+ 'News.id' => $id
+ ),
+ 'fields' => '',
+ 'recursive' => -1,
+ 'order' => array(
+ 'News.date' => 'desc'
+ ),
+ ));
+ if (empty($news)) {
+ $this->Session->setFlash(__('Invalid news', true));
+ $this->redirect(array('action' => 'index'));
+ }
+
+ $news['News'] = $this->_restore_html_news($news['News'], true);
+
+ $this->data = $news;
+ }
+
+ $this->set('title_for_layout', " - ". __('Edit News', true));
+ }
+
+ function admin_delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Id.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->News->delete($id)) {
+ $this->Session->setFlash(__('News deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->Session->setFlash(__('News was not deleted', true));
+ $this->redirect(array('action' => 'index'));
+ }
+
+ function _index($isAdmin = false)
+ {
+ $this->set('isAdmin', $isAdmin);
+
+ if ($isAdmin) {
+ unset($this->paginate['conditions']['News.public_flag']);
+
+ $this->paginate['fields'] = '';
+ }
+
+ $news = $this->paginate();
+ foreach ($news as $k => $v) {
+ $news[$k]['News'] = $this->_restore_html_news($v['News']);
+
+ }
+
+ $this->set('news', $news);
+
+ $this->set('title_for_layout', " - ". __('News List', true));
+ }
+
+}
}
- // ユーザ情報表示
- if ($this->AuthPlus->user()) {
- $name = $this->user['User']['name'];
- self::_index();
- } else {
- $name = __('Guest', true);
- }
- $this->set('title_for_layout', " - ". sprintf(__("%s's Home", true), $name));
+ // お知らせ
+ $this->set('news', $this->get_news());
+ }
// 全体の情報
self::_view($this->user_id);
}
$this->set('users', $users);
- $this->set('title_for_layout', " - ". __('List Users', true));
+ $this->set('title_for_layout', " - ". __('Users List', true));
}
function _search($isAdmin = false) {
msgid "Receive"
msgstr "受信者"
+
+msgid "Invalid news"
+msgstr "指定のお知らせはありません。"
+
+msgid "The news has been saved"
+msgstr "お知らせを保存しました。"
+
+msgid "The news could not be saved. Please, try again."
+msgstr "お知らせを保存できませんでした。"
+
+msgid "News deleted"
+msgstr "お知らせを削除しました。"
+
+msgid "News was not deleted"
+msgstr "お知らせを削除できませんでした。"
+
+msgid "Add News"
+msgstr "お知らせ作成"
+
+msgid "Edit News"
+msgstr "お知らせ編集"
+
+msgid "News"
+msgstr "お知らせ"
+
+msgid "News List"
+msgstr "お知らせ一覧"
+
+msgid "Released"
+msgstr "公開日"
+
+msgid "End Date as the Home News"
+msgstr "ホーム掲載終了日"
+
+msgid "You cannot set the Past date."
+msgstr "過去の日付を設定することはできません。"
+
+msgid "Invalid date."
+msgstr "正しい日付を入力してください。"
+
'boolean' => __('Incorrect value.', true),
'compare2fields' => __('Input same as avobe.', true),
'comparison' => __('Please input number %2$s %3$d.', true),
+ 'date' => __('Invalid date.', true),
'isAddress' => __('Invalid mail address.', true),
'isPcMail' => __('Invalid PC-mail address.', true),
'isUnique' => __('It was already registed.', true),
'maxLength' => __('Less than %2$d characters', true),
'notEmpty' => __('Please be sure to input.', true),
'numeric' => __('Please input only number.', true),
+ 'onlyFuture' => __('You cannot set the Past date.', true),
'orderNumeric' => __('Order must be only number.', true),
'profileType' => __('Invalid Type.', true),
'publicFlag' => __('Incorrect value.', true),
--- /dev/null
+<?php
+class News extends AppModel {
+ var $name = 'News';
+
+ var $fields = array(
+ 'add' => array('title', 'value', 'public_flag', 'date', 'end_date'),
+ 'edit' => array('title', 'value', 'public_flag', 'date', 'end_date'),
+ 'escape' => array(
+ 'title' => array(
+ 'html' => false,
+ 'tags' => false,
+ 'images' => false,
+ 'sctipts' => false,
+ ),
+ 'value' => array(
+ 'html' => false,
+ 'tags' => false,
+ 'images' => false,
+ 'sctipts' => false,
+ ),
+ ),
+ );
+
+ var $validate = array(
+ 'title' => array(
+ 'notEmpty' => array(
+ 'rule' => array('notEmpty'),
+ ),
+ ),
+ 'value' => array(
+ 'notEmpty' => array(
+ 'rule' => array('notEmpty'),
+ ),
+ ),
+ 'date' => array(
+ 'date' => array(
+ 'rule' => array('date'),
+ ),
+ 'onlyFuture' => array(
+ 'rule' => array('onlyFuture'),
+ 'on' => 'create',
+ ),
+ ),
+ 'end_date' => array(
+ 'date' => array(
+ 'rule' => array('date'),
+ ),
+ ),
+ );
+
+ function afterSave($created) {
+ $this->deleteCache4News();
+
+ return parent::afterSave($created);
+ }
+ function afterDelete() {
+ $this->deleteCache4News();
+
+ return parent::afterDelete();
+ }
+
+ /* キャッシュ削除 */
+ function deleteCache4News($news_id = null)
+ {
+ clearCache('_news.php', 'views', '');
+ clearCache('_news_index');
+ if ($news_id) {
+ clearCache('_news_view_'.$news_id);
+ }
+
+ // Home
+ @unlink(CACHE.'views'.DS.'element_news_cache_information');
+ }
+
+ /* validate */
+ function onlyFuture($data, $oneday = true)
+ {
+ if (empty($data) || (!isset($data['date']) && !isset($data['datetime']))) {
+ return false;
+ }
+
+ if (isset($data['date'])) {
+ $date = $data['date'];
+ } else {
+ $date = $data['datetime'];
+ }
+
+ // 00:00:00時を基準に判定
+ $today = date('Y-m-d 00:00:00');
+ $today_timestanp = strtotime($today);
+ $data_time = strtotime($date);
+
+ if ($data_time >= $today_timestanp) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+}
--- /dev/null
+<?php
+/* News Test cases generated on: 2010-12-23 20:12:13 : 1293102553*/
+App::import('Controller', 'News');
+
+class TestNewsController extends NewsController {
+ var $autoRender = false;
+
+ function redirect($url, $status = null, $exit = true) {
+ $this->redirectUrl = $url;
+ }
+}
+
+class NewsControllerTestCase extends CakeTestCase {
+ var $fixtures = array('app.news');
+
+ function startTest() {
+ $this->News =& new TestNewsController();
+ $this->News->constructClasses();
+ }
+
+ function endTest() {
+ unset($this->News);
+ ClassRegistry::flush();
+ }
+
+ function testIndex() {
+
+ }
+
+ function testView() {
+
+ }
+
+ function testAdd() {
+
+ }
+
+ function testEdit() {
+
+ }
+
+ function testDelete() {
+
+ }
+
+ function testAdminIndex() {
+
+ }
+
+ function testAdminView() {
+
+ }
+
+ function testAdminAdd() {
+
+ }
+
+ function testAdminEdit() {
+
+ }
+
+ function testAdminDelete() {
+
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/* News Test cases generated on: 2010-12-23 20:12:45 : 1293102525*/
+App::import('Model', 'News');
+
+class NewsTestCase extends CakeTestCase {
+ var $fixtures = array('app.news');
+
+ function startTest() {
+ $this->News =& ClassRegistry::init('News');
+ }
+
+ function endTest() {
+ unset($this->News);
+ ClassRegistry::flush();
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/* News Fixture generated on: 2010-12-23 20:12:45 : 1293102525 */
+class NewsFixture extends CakeTestFixture {
+ var $name = 'News';
+
+ var $fields = array(
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
+ 'title' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 512, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'value' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'date' => array('type' => 'datetime', 'null' => false, 'default' => NULL, 'key' => 'index'),
+ 'end_date' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+ 'modified' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+ 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'news_date' => array('column' => 'date', 'unique' => 0), 'news_public_date_end' => array('column' => array('public_flag', 'date', 'end_date'), 'unique' => 0)),
+ 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
+ );
+
+ var $records = array(
+ array(
+ 'id' => 1,
+ 'title' => 'Lorem ipsum dolor sit amet',
+ 'value' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
+ 'date' => '2010-12-23 20:08:45',
+ 'end_date' => '2010-12-23 20:08:45',
+ 'modified' => '2010-12-23 20:08:45'
+ ),
+ );
+}
+?>
\ No newline at end of file
'character_index',
array(
'character' => $characters,
- 'isOwner' => $isOwner,
+ 'isOwner' => true,
'isAdmin' => false,
'cache' => array(
'time' => time() + Configure::read('Cache.expireShort'),
-<?php
+<?php
+if (empty($site_configs['Site.myHome']['value']) && !empty($isOwner)) {
+ echo $this->element('information', array(
+ 'cache' => time() + Configure::read('Cache.expireLong'),
+ ));
+}
?>
+
<div class="characters listview">
<div class="box full">
<div class="boxHeader"><h2><span>
));
?>
+<?php
+if (isset($news)) {
+ echo $this->element('information', array(
+ 'news' => $news,
+ 'cache' => time() + Configure::read('Cache.expireLong'),
+ ));
+}
+?>
+
<?php
$add_url = $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add'));
?>
--- /dev/null
+<?php if (isset($news) && !empty($news)): ?>
+<div class="news">
+<div class="SimpleBox" id="Infomation_homeNews">
+<ul class="information">
+<?php
+foreach ($news as $v) {
+ echo $html->tag('li', sprintf(
+ '%s %s',
+ $v['News']['date'],
+ $html->link($v['News']['title'], array(
+ 'controller' => 'news',
+ 'action' => 'view',
+ $v['News']['id'],
+ ), array(
+ 'escape' => false,
+ ))
+ ));
+}
+?>
+</ul>
+<div style="text-align: right; margin-right:10px;">
+<?php
+echo $html->link(__(' ...More', true), array(
+ 'controller' => 'news',
+ 'action' => 'index',
+));
+?>
+</div>
+</div>
+</div>
+<?php endif ?>
--- /dev/null
+<ul>
+
+<li><?php echo $html->link(__('News List', true), array('controller' => 'news', 'action' => 'index'));?></li>
+
+<li><?php echo $html->link(__('Add News', true), array('controller' => 'news', 'action' => 'add')); ?></li>
+</ul>
--- /dev/null
+<ul>
+ <li><?php echo $html->link(__('Users List', true), array('controller' => 'users', 'action' => 'listview')); ?> </li>
+</ul>
</li>
<li>
+<?php echo $html->link(__('News', true), array('controller' => 'news', 'action' => 'index')); ?>
+</li>
+
+<li>
<?php echo $html->link(__('Site Settings', true), array('controller' => 'site_configs', 'action' => 'edit')); ?>
</li>
break;
}
break;
+ case 'news':
+ echo $this->element('sidenav_admin_news', array());
+ break;
default:
echo null;
break;
--- /dev/null
+<div class="news form">
+<?php echo $this->Form->create('News');?>
+<fieldset>
+<legend><?php __('Add News'); ?></legend>
+<?php
+ echo $form->input('title', array(
+ 'maxLength' => 512,
+ 'class' => 'longInput',
+ ));
+ echo $form->input('value', array(
+ 'label' => __('Detail', true),
+ 'class' => 'InformationInput',
+ ));
+ echo $select->create_publicflag_select($public_flags, 'public_flag', array(
+ 'label' => __('Public Flag', true),
+ 'default' => 'private',
+ ));
+ echo $form->input('date', array(
+ 'label' => __('Released', true),
+ 'default' => time(),
+ 'dateFormat' => 'YMD',
+ 'timeFormat' => 24,
+ 'minYear' => date('Y'),
+ 'maxYear' => date('Y')+1,
+ 'separator' => '/',
+ 'monthNames' => false,
+ ));
+ echo $form->input('end_date', array(
+ 'label' => __('End Date as the Home News', true),
+ 'default' => time() + 60*60*24*365,
+ 'dateFormat' => 'YMD',
+ 'minYear' => date('Y')-1,
+ 'maxYear' => date('Y')+10,
+ 'separator' => '/',
+ 'monthNames' => false,
+ ));
+?>
+</fieldset>
+<?php echo $token->create(); ?>
+<?php echo $this->Form->end(__('Submit', true));?>
+</div>
+
+
+<div class="backButton">
+<?php
+echo $form->create('', array('url' => array(
+ 'action' => 'index'),
+ 'type' => 'GET',
+ 'id' => 'CancelButton'
+));
+echo $form->end(array('label' => __('Cancel', true)));
+?>
+</div>
--- /dev/null
+<div class="news form">
+<?php echo $this->Form->create('News');?>
+<fieldset>
+<legend><?php __('Edit News'); ?></legend>
+<?php
+ echo $form->input('title', array(
+ 'maxLength' => 512,
+ 'class' => 'longInput',
+ ));
+ echo $form->input('value', array(
+ 'label' => __('Detail', true),
+ 'class' => 'InformationInput',
+ ));
+ echo $select->create_publicflag_select($public_flags, 'public_flag', array(
+ 'label' => __('Public Flag', true),
+ 'default' => 'private',
+ ));
+ echo $form->input('date', array(
+ 'label' => __('Released', true),
+ 'dateFormat' => 'YMD',
+ 'minYear' => date('Y'),
+ 'maxYear' => date('Y')+1,
+ 'separator' => '/',
+ 'monthNames' => false,
+ ));
+ echo $form->input('end_date', array(
+ 'label' => __('End Date as the Home News', true),
+ 'dateFormat' => 'YMD',
+ 'minYear' => date('Y')-1,
+ 'maxYear' => date('Y')+10,
+ 'separator' => '/',
+ 'monthNames' => false,
+ ));
+?>
+</fieldset>
+<?php echo $token->create(); ?>
+<?php echo $this->Form->end(__('Submit', true));?>
+</div>
+
+<div class="backButton">
+<?php
+echo $form->create('', array('url' => array(
+ 'action' => 'view', $this->data['News']['id']),
+ 'type' => 'GET',
+ 'id' => 'CancelButton'
+));
+echo $form->end(array('label' => __('Cancel', true)));
+?>
+</div>
--- /dev/null
+<div class="news listview">
+
+<div class="box full">
+<div class="boxHeader"><h2><span><?php __('News');?></h2></span></div>
+<div class="boxBody">
+
+<p>
+<?php
+echo $this->Paginator->counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+</p>
+
+<div class="paging">
+ <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ | <?php echo $this->Paginator->numbers();?>
+ |
+ <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<table cellpadding="0" cellspacing="0">
+<tr>
+ <th><?php echo $paginatorEx->sortAllow('id');?></th>
+ <th><?php echo $paginatorEx->sortAllow(__('Released' ,true), 'date');?></th>
+ <th><?php echo $paginatorEx->sortAllow('title');?></th>
+ <th><?php echo $paginatorEx->sortAllow('public_flag');?></th>
+ <th><?php echo $paginatorEx->sortAllow(__('End Date as the Home News' ,true), 'end_date');?></th>
+ <th><?php echo $paginatorEx->sortAllow('modified');?></th>
+</tr>
+<?php
+$i = 0;
+foreach ($news as $news):
+ $class = null;
+ if ($i++ % 2 == 0) {
+ $class = ' class="altrow"';
+ }
+?>
+<tr<?php echo $class;?>>
+ <td rowspan="2"><?php echo $news['News']['id']; ?></td>
+ <td><?php echo $news['News']['date']; ?></td>
+ <td><?php echo $news['News']['title']; ?></td>
+ <td><?php echo $select->get_i18n_public_flag($news['News']['public_flag'], $public_flags); ?></td>
+ <td><?php echo $news['News']['end_date']; ?></td>
+ <td><?php echo $news['News']['modified']; ?></td>
+</tr>
+<tr>
+ <td colspan="5">
+ <div><?php echo nl2br($news['News']['value']); ?></div>
+ <div class="actions">
+ <?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $news['News']['id'])); ?>
+ <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $news['News']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $news['News']['id'])); ?>
+ </div>
+ </td>
+</tr>
+<?php endforeach; ?>
+</table>
+
+<div class="paging">
+ <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ | <?php echo $this->Paginator->numbers();?>
+ |
+ <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+</div>
+
+</div?
\ No newline at end of file
--- /dev/null
+<div class="news listview">
+
+<div class="box full">
+<div class="boxHeader"><h2><span><?php __('News');?></h2></span></div>
+<div class="boxBody">
+
+<p>
+<?php
+echo $this->Paginator->counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+</p>
+
+<div class="paging">
+ <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ | <?php echo $this->Paginator->numbers();?>
+ |
+ <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<?php
+$i = 0;
+foreach ($news as $news):
+ $class = null;
+ if ($i++ % 2 == 0) {
+ $class = ' class="altrow"';
+ }
+?>
+
+<div class="SimpleBox" id="Infomation_index">
+<div class="innerBox">
+<div class="box full">
+
+<div class="boxHeader"><h3>
+ <?php echo $news['News']['date']; ?> <?php echo $news['News']['title']; ?>
+ <span><?php __('End Date as the Home News') ?> : <?php echo $news['News']['end_date']; ?></span>
+</h3></div>
+
+<div class="boxBody">
+ <div class="infoBody">
+ <?php echo nl2br($news['News']['value']); ?>
+ </div>
+
+ <div class="infoModified">
+ (<?php __('Modified') ?>:<?php echo $time->niceshort($news['News']['modified']); ?>)
+ </div>
+
+</div>
+</div>
+</div>
+</div>
+
+<?php endforeach; ?>
+
+<div class="paging">
+<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ | <?php echo $this->Paginator->numbers();?> |
+<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+</div>
+</div>
\ No newline at end of file
font-size: 16px;
}
-/* ユーザ情報 */
-div.UserAgent,
-div.Host {
+/* お知らせ */
+ul.information li {
+ display: list-item;
+ margin-left: 10px;
+}
+ul.information li span {
+ margin-right: 10px;
+}
+.infoBody {
+ font-size: 130%;
+ padding: 15px 10px;
+}
+.infoModified {
font-size: 80%;
- text-align: right;
color: #999;
+ text-align: left;
}
-
+}
\ No newline at end of file
/* SimpleBox */
.SimpleBox {
padding: 10px;
- margin-top: 15px;
+ margin-top: 3px;
+ margin-right: 25px;
background:#e6e49f;
background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f));
background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f);
border-radius:8px;
text-decoration:none;
}
+div.news .SimpleBox {
+ margin-top: 0px;
+ margin-bottom: 10px;
+}
+
.SimpleBox ul li {
list-style: disc inside none;
}