Changeset 20339

Show
Ignore:
Timestamp:
10/01/08 08:02:29 (3 months ago)
Author:
anatoo
Message:

テンプレート周りいじった

Location:
events/phpframework/plain_php/trunk
Files:
2 added
13 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/plain_php/trunk/core/RssRenderer.php

    r20336 r20339  
    55    function render(RssResponse $r) 
    66    { 
    7         header('Content-type: text/xml; charset=UTF-8'); 
     7        header('Content-type: application/rss+xml; charset=UTF-8'); 
    88         
    99        list($title, $link, $desc) = $r->getChannel(); 
  • events/phpframework/plain_php/trunk/index.php

    r20044 r20339  
    22include_once dirname(__FILE__) . '/init.php'; 
    33 
    4 $c = new ApplicationContext(dirname(__FILE__), 'http://localhost/phwittr',  
    5                             dirname(__FILE__) . '/resource', 'http://localhost/phwittr/resource', 
    6                             'localhost', 
    7                             '/phwittr'); 
    8 ObjectBuilder::setApplicationContext($c); 
     4 
    95$response = ref(new PhwittrFront)->process(new Request('UTF-8'), $c, new RendererBuilder($c)); 
    106/* TODO 例外handlerをつける */ 
  • events/phpframework/plain_php/trunk/init.php

    r20044 r20339  
    88    set_include_path(get_include_path() . PATH_SEPARATOR . $p); 
    99 
     10include_once dirname(__FILE__) . '/default.php'; 
    1011include_once dirname(__FILE__) . '/core/function.php';     
     12include_once dirname(__FILE__) . '/model/mail/mail.php'; 
    1113 
    1214 
     15$c = new ApplicationContext(dirname(__FILE__), 'http://localhost/phwittr',  
     16                            dirname(__FILE__) . '/resource', 'http://localhost/phwittr/resource', 
     17                            'localhost', 
     18                            '/phwittr'); 
     19ObjectBuilder::setApplicationContext($c); 
     20 
     21mb_language('japanese'); 
     22mb_internal_encoding(Pool::getInstance()->fetchConfig()->encoding); 
  • events/phpframework/plain_php/trunk/resource/acount_create.php

    r20038 r20339  
    3636 
    3737<h2>登録完了しました</h2> 
    38 <p><?php echo $email ?>にメールを送信したのでそこに書かれているURLにアクセスしてください。</p> 
     38<p><?php echo $email ?>にメールを送信しました。</p> 
    3939 
    4040<!-- / #main --></div> 
  • events/phpframework/plain_php/trunk/resource/css/style.css

    r20038 r20339  
    198198    margin-left: 4px; 
    199199    border: 1px solid #cccccc; 
     200    font-size: 80%; 
    200201} 
    201202 
     
    308309} 
    309310 
    310 #people .button { 
     311a.button { 
    311312    color: #666; 
    312313    background-color: #eeeeee; 
     
    315316    font-size: 70%; 
    316317} 
    317 #people .button:hover { 
     318a.button:hover { 
    318319    text-decoration: none; 
    319320} 
  • events/phpframework/plain_php/trunk/resource/followings.php

    r20038 r20339  
    4444    <td><a href="<?php echo $c->baseUrl . '/' . $user['user_name']; ?>"><?php echo $user['user_name'] ?></a><br/> 
    4545 
    46         <a class="button" href="<?php echo "{$c->baseUrl}/friendships/delete/{$user['user_id']}/{$session->token}" ?>">remove</a> 
     46        <a class="button" href="<?php echo "{$c->baseUrl}/friendships/destroy/{$user['user_id']}/{$session->token}" ?>">remove</a> 
    4747 
    4848    </td> 
  • events/phpframework/plain_php/trunk/resource/public_timeline.php

    r20038 r20339  
    99    <base href="<?php echo $c->templateBaseUrl ?>/" /> 
    1010    <link rel="shortcut icon" href="./img/share/favicon.ico" /> 
     11    <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/public_timeline/rss" /> 
    1112 
    1213    <!-- *** stylesheet *** --> 
  • events/phpframework/plain_php/trunk/resource/settings.php

    r20038 r20339  
    5757                <?php if ($user['private_flag']) echo 'checked="checked" ' ?>/>  
    5858            <label for="private_flag">つぶやきを非公開にする</label> 
    59             <?php if ($user['private_flag']): ?> 
    60                 <a href="/public_timeline"><br/>公開中</a> 
     59            <?php if (!$user['private_flag']): ?> 
     60                <br/><a href="/public_timeline">公開中</a> 
    6161            <?php endif ?></td> 
    6262      </tr><tr> 
  • events/phpframework/plain_php/trunk/resource/statuses.php

    r20038 r20339  
    1414     
    1515    <!-- *** javascript *** --> 
    16  
     16    <script src="./js/jquery.js" type="text/javascript"></script> 
     17    <script type="text/javascript"> 
     18    $(document).ready(function () { 
     19       $(".delete_link").click(function (){ 
     20            return confirm("Sure you want to delete this update? There is NO undo!"); 
     21        }); 
     22    }); 
     23    </script> 
    1724</head> 
    1825 
     
    3845    <?php if ($is_logined): ?> 
    3946        <?php if($session->user_id === $status['user_id']): ?> 
    40             <a href="<?php echo "{$c->baseUrl}/status/delete/{$status['id']}/{$session->token}" ?>"><img src="./img/share/trash_icon.gif" /></a> 
     47            <a class="delete_link" href="<?php echo "{$c->baseUrl}/status/delete/{$status['id']}/{$session->token}" ?>"><img src="./img/share/trash_icon.gif" /></a> 
    4148        <?php else: ?> 
    4249            <a href="<?php echo "{$c->baseUrl}/home?status=@{$status['user_name']}" ?>"><img src="./img/share/reply_icon.gif" /></a> 
  • events/phpframework/plain_php/trunk/resource/timeline.php

    r20038 r20339  
    99    <base href="<?php echo $c->templateBaseUrl ?>/" /> 
    1010    <link rel="shortcut icon" href="./img/share/favicon.ico" /> 
    11  
     11    <?php if ($current_action === 'public_timeline'): ?> 
     12    <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/public_timeline/rss" /> 
     13    <?php endif ?> 
    1214    <!-- *** stylesheet *** --> 
    1315    <link href="./css/import.css" rel="stylesheet" type="text/css" media="all" /> 
    1416     
    1517    <!-- *** javascript *** --> 
    16  
     18    <script src="./js/jquery.js" type="text/javascript"></script> 
     19    <script type="text/javascript"> 
     20    $(document).ready(function() { 
     21        var textcount = $("#js_textcount"); 
     22        var comment = $("#comment"); 
     23        var baseurl = "<?php echo $c->baseUrl ?>"; 
     24        var resourceurl = "<?php echo $c->templateBaseUrl ?>"; 
     25        var url = baseurl + "/status/update/ajax"; 
     26        var token = $("#token")[0].value; 
     27        var reload = function() { 
     28            textcount.text(140 - comment[0].value.length); 
     29        }; 
     30        var bind_delete_action = function () { 
     31            $(".delete_link").click(function (){ 
     32                return confirm("Sure you want to delete this update? There is NO undo!"); 
     33            }); 
     34        }; 
     35        reload(); 
     36        comment.bind("keyup", reload); 
     37        $("#post_form").submit(function() { 
     38            if (comment[0].value.length <= 0 || 140 - comment[0].value.length < 0) { 
     39                return false; 
     40            } 
     41            $.post(url, {token: token, comment: comment[0].value}, function(data) { 
     42                if (data.success) { 
     43                    comment[0].value = ""; 
     44                    reload(); 
     45                    var st = data.status; 
     46                    var cont = ""; 
     47                    cont += "<tr><td><a href=\"" + baseurl + "/" + st.user_name + "\">"; 
     48                    cont += "<img src=\"./img/" + (st.image ? "user/" + st.user_name : "friend") + "_icon.png\" /></a></td>"; 
     49                    cont += "<td class=\"status_body\"><a href=\"" + baseurl + "/" + st.user_name + "\">" + st.user_name + "</a> " + st.comment; 
     50                    cont += " <span class=\"meta\"><a class=\"published\" href=\"" + baseurl + "/statuses/" + st.id + "\">" + st.created_at + "</a></span>" + "</td>"; 
     51                    cont += "<td><a class=\"delete_link\" href=\"" + baseurl + "/status/delete/" + st.id + "/" + token + "\">"; 
     52                    cont += "<img src=\"img/share/trash_icon.gif\" alt=\"Delete\" /></a></td></tr>"; 
     53                    cont = $(cont); 
     54                    cont.hide(); 
     55                    $("#timeline table.autopagerize_page_element").prepend(cont); 
     56                    cont.fadeIn("normal"); 
     57                     
     58                    bind_delete_action(); 
     59                } 
     60            }, "json"); 
     61            return false; 
     62        }); 
     63        bind_delete_action(); 
     64    }); 
     65    </script> 
    1766</head> 
    1867 
     
    3988<?php endforeach ?> 
    4089 
    41 <form action="<?php echo $c->baseUrl; ?>/status/update" method="post"> 
     90<form action="<?php echo $c->baseUrl; ?>/status/update" method="post" id="post_form"> 
    4291<div id="post"> 
    4392<h2>What are you doing?</h2> 
    4493<span class="textCount" id="js_textcount">140</span> 
    4594<textarea id="comment" name="comment"><?php if ($status) echo h($status) . ' ' ?></textarea> 
    46 <input type="hidden" name="token" value="<?php echo $session->token ?>" /> 
     95<input type="hidden" id="token" name="token" value="<?php echo $session->token ?>" /> 
    4796<p id="button_space"> 
    4897<input type="submit" id="twit_button" value=" update " /> 
     
    76125    <td> 
    77126        <?php if($status['user_name'] === $user_name): ?> 
    78         <a href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 
    79             <img src="img/share/trash_icon.gif" alt="Delete" class="icon16" /></a> 
     127        <a class="delete_link" href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 
     128            <img src="img/share/trash_icon.gif" alt="Delete" /></a> 
    80129        <?php else: ?> 
    81130            <a href="<?php echo "{$c->baseUrl}/home?status=@{$status['user_name']}" ?>"><img src="./img/share/reply_icon.gif" /></a> 
  • events/phpframework/plain_php/trunk/resource/user.php

    r20038 r20339  
    99    <base href="<?php echo $c->templateBaseUrl ?>/" /> 
    1010    <link rel="shortcut icon" href="./img/share/favicon.ico" /> 
     11    <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/<?php echo $user['user_name'] ?>/rss" /> 
    1112 
     13     
    1214    <!-- *** stylesheet *** --> 
    1315    <link href="./css/import.css" rel="stylesheet" type="text/css" media="all" /> 
    1416     
    1517    <!-- *** javascript *** --> 
    16  
     18    <script src="./js/jquery.js" type="text/javascript"></script> 
     19    <script type="text/javascript"> 
     20    $(document).ready(function () { 
     21       $(".delete_link").click(function (){ 
     22            return confirm("Sure you want to delete this update? There is NO undo!"); 
     23        }); 
     24    }); 
     25    </script> 
    1726</head> 
    1827 
     
    3746 
    3847 
     48<?php if (!$user['private_flag'] || $is_logined && $is_following): ?> 
     49 
     50<?php if ($is_logined): ?> 
     51 
     52    <?php if (!$is_self && $is_following): ?> 
     53    <a class="button" href="<?php echo "{$c->baseUrl}/friendships/destroy/{$user['id']}/{$session->token}" ?>">remove</a> 
     54    <?php elseif (!$is_self && !$is_following): ?> 
     55    <a class="button" href="<?php echo "{$c->baseUrl}/friendships/create/{$user['id']}/{$session->token}" ?>">follow</a> 
     56    <?php endif ?> 
     57     
     58    <?php if ($is_requesting_self): ?> 
     59    <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/accept/{$user['id']}/{$session->token}" ?>">accept</a> 
     60    <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/deny/{$user['id']}/{$session->token}" ?>">deny</a> 
     61    <?php endif ?> 
     62 
     63<?php endif ?> 
     64 
    3965<div id="timeline" class="autopagerize_page_element"> 
    4066<table> 
     
    5076    <td> 
    5177        <?php if($session && $status['user_name'] === $session->user_name): ?> 
    52         <a href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 
     78        <a class="delete_link" href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 
    5379            <img src="img/share/trash_icon.gif" alt="Delete" class="icon16" /></a> 
    5480        <?php elseif ($session): ?> 
     
    6086</table> 
    6187</div> 
     88 
     89 
     90 
     91<?php else: ?> 
     92<h3>このユーザーはプライベートです。</h3> 
     93<?php if (!$is_self): ?> 
     94 
     95 
     96<?php if ($is_requesting): ?> 
     97フォローできるようにリクエスト中です。 
     98<?php elseif (!$is_following): ?> 
     99<a class="button" href="<?php echo "{$c->baseUrl}/friendships/create/{$user['id']}/{$session->token}" ?>"> 
     100<?php if ($user['private_flag']) echo 'send request'; else echo 'remove' ?></a> 
     101 
     102<?php endif ?> 
     103 
     104<?php if ($is_requesting_self): ?> 
     105<a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/accept/{$user['id']}/{$session->token}" ?>">accept</a> 
     106<a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/deny/{$user['id']}/{$session->token}" ?>">deny</a> 
     107<?php endif ?> 
     108 
     109<?php endif ?> 
     110 
     111<?php endif ?> 
    62112 
    63113<?php if ($page > 0 || $page_limit * ($page + 1) < $status_count): ?> 
     
    82132</p> 
    83133 
    84 <?php if ($latest_status): ?> 
     134<?php if ($latest_status && (!$user['private_flag'] || $is_logined && $is_following)): ?> 
    85135<h3>最近のつぶやき</h3> 
    86136<p><?php echo $latest_status['comment']; ?></p> 
  • events/phpframework/plain_php/trunk/resource/user_followings.php

    r20038 r20339  
    4444    <td><a href="<?php echo $c->baseUrl . '/' . $user['user_name']; ?>"><?php echo $user['user_name'] ?></a><br/> 
    4545 
     46        <?php if ($user_name === $session->user_name): ?> 
    4647        <a class="button" href="<?php echo "{$c->baseUrl}/friendships/delete/{$user['user_id']}/{$session->token}" ?>">remove</a> 
    47  
     48        <?php endif ?> 
    4849    </td> 
    4950    </tr>