ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 5060


Ignore:
Timestamp:
Jan 28, 2008, 1:14:45 AM (12 years ago)
Author:
ogawa
Message:

#1843:pc側もOpenPNEっぽく

Location:
OpenPNE/branches/work/ogawa/symfony
Files:
64 added
8 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/config/routing.yml

    r5059 r5060  
    44  param: { module: home, action: index }
    55
    6 default_symfony:
    7   url:   /symfony/:action/*
    8   param: { module: default }
     6logout:
     7  url:   /logout
     8  param: { module: login, action: logout }
    99
    1010default_index:
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/config/view.yml

    r5059 r5060  
    1010#    language:     en
    1111
    12   stylesheets:    [main]
     12  stylesheets:    [pc]
    1313
    1414  javascripts:    []
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/lib/myUser.class.php

    r5050 r5060  
    33class myUser extends sfBasicSecurityUser
    44{
     5  public function getMemberId()
     6  {
     7    return $this->getAttribute('member_id');
     8  }
     9
     10  public function setMemberId($member_id)
     11  {
     12    return $this->setAttribute('member_id', $member_id);
     13  }
    514}
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/modules/home/actions/actions.class.php

    r5059 r5060  
    1717  public function executeIndex()
    1818  {
     19    $member_id = $this->getUser()->getMemberId();
     20    $this->member = MemberPeer::retrieveByPK($member_id);
     21    $this->my_diaries = DiaryPeer::retrieveByMemberId($member_id);
    1922    return sfView::SUCCESS;
    2023  }
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/modules/home/templates/indexSuccess.php

    r5059 r5060  
    1 login ok.
     1<div class="contentLeft">
     2  <div class="box">
     3    <p><?php echo $member->getNickname(); ?>さん</p>
     4  </div>
     5</div>
     6
     7<div class="contentRight">
     8
     9<div class="outer"><div class="inner">
     10  <h2>最新日記・レビュー</h2>
     11  <div class="myDiary">
     12    <h3>最新日記</h3>
     13    <div class="contentBox">
     14      <dl class="articleList">
     15<?php foreach ($my_diaries as $diary) : ?>
     16        <dt><?php echo $diary->getCreatedAt('m月d日'); ?></dt>
     17        <dd><?php echo link_to(sprintf('%s(%d)', $diary->getTitle(), $diary->countDiaryComments()), 'diary/' . $diary->getId()); ?></dd>
     18<?php endforeach; ?>
     19      </dl>
     20      <ul class="links">
     21        <li><?php echo link_to('もっと読む', 'diary/list'); ?></li>
     22        <li><?php echo link_to('日記を書く', 'diary/edit'); ?></li>
     23      </ul>
     24    </div>
     25  </div>
     26</div></div>
     27
     28</div>
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/modules/login/actions/actions.class.php

    r5059 r5060  
    4040    if ($member) {
    4141      if ($member->getPassword() === md5($password . $member->getPasswordSalt())) {
     42        $this->getUser()->setMemberId($member->getId());
    4243        return true;
    4344      }
  • OpenPNE/branches/work/ogawa/symfony/apps/pc/templates/layout.php

    r5050 r5060  
    11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     2<html xmlns="http://www.w3.org/1999/xhtml">
    33<head>
    44
     
    1111
    1212</head>
    13 <body>
     13<body class="<?php echo $sf_user->isAuthenticated() ? 'authenticated' : 'unauthenticated'; ?>">
     14<div class="container">
    1415
     16<div class="header">
     17  <h1><?php echo link_to(sfConfig::get('app_sns_name'), '/'); ?></h1>
     18
     19  <div class="logo">
     20    <?php echo link_to(image_tag('dummy.gif', array('alt' => sfConfig::get('app_sns_name'))), '@homepage'); ?>
     21  </div>
     22
     23  <?php if ($sf_user->isAuthenticated()) : ?>
     24  <div class="globalNavi">
     25    <?php echo link_to(image_tag('dummy.gif', array('alt' => 'マイホーム')), '@homepage', array('class' => 'globalNavi4')); ?>
     26    <?php echo link_to(image_tag('dummy.gif', array('alt' => 'ログアウト')), '@logout', array('class' => 'globalNavi9')); ?>
     27  </div>
     28  <?php endif; ?>
     29</div>
     30
     31<div class="contents">
    1532<?php echo $sf_data->getRaw('sf_content') ?>
     33</div>
    1634
     35</div>
    1736</body>
    1837</html>
  • OpenPNE/branches/work/ogawa/symfony/lib/model/DiaryPeer.php

    r5052 r5060  
    1010class DiaryPeer extends BaseDiaryPeer
    1111{
     12  static public function retrieveByMemberId($member_id, $limit = 5)
     13  {
     14    $c = new Criteria();
     15    $c->add(self::MEMBER_ID, $member_id);
     16    return self::doSelect($c);
     17  }
    1218}
Note: See TracChangeset for help on using the changeset viewer.