Assembla home | Assembla project page
 

Changeset 109

Show
Ignore:
Timestamp:
07/18/07 15:04:22 (1 year ago)
Author:
digitalspaghetti
Message:

Improved views and controller.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/controllers/posts_controller.php

    r108 r109  
    55        var $uses = array('Post', 'Group'); 
    66        // Set the default Paginate values       
    7         var $paginate = array('fields'=>array('Post.id', 'Post.title', 'Post.byline', 'Post.body', 'Post.comments_count' ,'Post.user_id', 'Post.stub' ,'Post.post_date' , 'Post.access_level', 'Post.frontpage' ,'Post.published' ,'User.id', 'User.username', 'Subject.id' ,'Subject.title', 'Image.filename'),'limit'=>10, 'order'=>array('Post.post_date'=>'DESC', 'Post.created' => 'DESC')); 
     7        var $paginate = array('fields'=> 
     8                                        array(  'Post.id','Post.title','Post.byline','Post.body','Post.comments_count', 
     9                                                        'Post.user_id','Post.slug','Post.post_date','Post.access_level', 
     10                                                        'Post.frontpage','Post.published','User.id','User.username','User.posts_count', 'Subject.id', 
     11                                                        'Subject.title','Image.filename'), 
     12                                        'limit'=>10, 
     13                                        'order'=>array('Post.post_date'=>'DESC', 'Post.created' => 'DESC') 
     14        ); 
    815         
    916        function index() { 
    1017                // Increase recursion to get post tags and comments 
    1118                $this->Post->recursive = 1; 
    12                  
    1319                // Check to see if RSS request instead of normal. 
    1420                $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 
     
    3238 
    3339        // The view function finds by Stub instead of ID for SEO. 
    34         function view($id = null) { 
     40        function view($stub = null) { 
    3541                if(!$id) { 
    3642                        $this->Session->setFlash('Invalid Post.'); 
    3743                        $this->redirect(array('action'=>'index'), null, true); 
    3844                } 
    39                 $this->set('post', $this->Post->findByStub($id)); 
     45                $this->set('post', $this->Post->findByStub($stub)); 
    4046        } 
    4147 
    4248        function add() { 
    43                 if(!empty($this->data)) { 
    44                         $this->cleanUpFields(); 
    45                         $this->Post->create(); 
    46                         if($this->Post->save($this->data)) { 
    47                                 $this->Session->setFlash('The Post has been saved'); 
    48                                 $this->redirect(array('action'=>'index'), null, true); 
    49                         } else { 
    50                                 $this->Session->setFlash('The Post could not be saved. Please, try again.'); 
     49                if ($this->level >= 500 ) { 
     50                        if(!empty($this->data)) { 
     51                                $this->data['Post']['user_id'] = $this->othAuth->user('id'); 
     52                                $this->cleanUpFields(); 
     53                                $this->Post->create(); 
     54                                if($this->Post->save($this->data)) { 
     55                                        $this->Session->setFlash('The Post has been saved'); 
     56                                        $this->redirect(array('action'=>'index'), null, true); 
     57                                } else { 
     58                                        $this->Session->setFlash('The Post could not be saved. Please, try again.'); 
     59                                } 
    5160                        } 
     61                } else { 
     62                        $this->Session->setFlash('You do not have permission to add a post.  Please log in.'); 
     63                        $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 
    5264                } 
    53                 $tags = $this->Post->Tag->generateList(); 
    54                 $users = $this->Post->User->generateList(); 
    55                 $subjects = $this->Post->Subject->generateList(); 
    56                 $this->set(compact('tags', 'users', 'subjects')); 
     65                $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
     66                $this->set('subjects', $this->Post->Subject->generateList()); 
     67                $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    5768        } 
    5869 
    5970        function edit($id = null) { 
    60                 if(!$id && empty($this->data)) { 
    61                         $this->Session->setFlash('Invalid Post'); 
    62                         $this->redirect(array('action'=>'index'), null, true); 
    63                 } 
    64                 if(!empty($this->data)) { 
    65                         $this->cleanUpFields(); 
    66                         if($this->Post->save($this->data)) { 
    67                                 $this->Session->setFlash('The Post saved'); 
     71                if ($this->othAuth->user('id') == $this->data['Post']['user_id'] || $this->level >= 900) { 
     72                        if(!$id && empty($this->data)) { 
     73                                $this->Session->setFlash('Invalid Post'); 
    6874                                $this->redirect(array('action'=>'index'), null, true); 
    69                         } else { 
    70                                 $this->Session->setFlash('The Post could not be saved. Please, try again.'); 
    7175                        } 
     76                        if(!empty($this->data)) { 
     77                                $this->cleanUpFields(); 
     78                                if($this->Post->save($this->data)) { 
     79                                        $this->Session->setFlash('The Post saved'); 
     80                                        $this->redirect(array('action'=>'index'), null, true); 
     81                                } else { 
     82                                        $this->Session->setFlash('The Post could not be saved. Please, try again.'); 
     83                                } 
     84                        } 
     85                } else { 
     86                        $this->Session->setFlash('You do no have permission to edit this post'); 
     87                        $this->redirect(array('controller'=>'users','action'=>'login'), null, true); 
    7288                } 
    7389                if(empty($this->data)) { 
    7490                        $this->data = $this->Post->read(null, $id); 
    7591                } 
    76                 $tags = $this->Post->Tag->generateList(); 
    77                 $users = $this->Post->User->generateList(); 
    78                 $subjects = $this->Post->Subject->generateList(); 
    79                 $this->set(compact('tags','users','subjects')); 
     92                $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
     93                $this->set('subjects', $this->Post->Subject->generateList()); 
     94                $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    8095        } 
    8196 
     
    85100                        $this->redirect(array('action'=>'index'), null, true); 
    86101                } 
    87                 if($this->Post->del($id)) { 
    88                         $this->Session->setFlash('Post #'.$id.' deleted'); 
    89                         $this->redirect(array('action'=>'index'), null, true); 
     102                if ($this->othAuth->user('id') == $this->data['Post']['user_id'] || $this->level >= 900) { 
     103                        if($this->Post->del($id)) { 
     104                                $this->Session->setFlash('Post #'.$id.' deleted'); 
     105                                $this->redirect(array('action'=>'index'), null, true); 
     106                        } 
     107                } else { 
     108                        $this->Session->setFlash('You do no have permission to edit this post'); 
     109                        $this->redirect(array('controller'=>'users','action'=>'login'), null, true); 
    90110                } 
    91111        } 
     
    93113 
    94114        function admin_index() { 
     115                // Increase recursion to get post tags and comments 
    95116                $this->Post->recursive = 1; 
    96                 $this->set('posts', $this->paginate()); 
     117                // Check to see if RSS request instead of normal. 
     118                $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 
     119                // provide different title and a description for the feed 
     120                if ($isFeed) { 
     121                        $this->set('channel', array('title' => 'Latest posts for Webrocket', 'description' => 'Webrocket RSS Feed')); 
     122                } 
     123                // Normal action 
     124                if (!$isFeed) { 
     125                        // Overide paginate limit, may need to change 
     126                        $this->cacheAction = '1 hour'; 
     127                        $this->passedArgs['limit'] = 10; 
     128                        $this->passedArgs['order'] = array('Post.post_date' => 'DESC', 'Post.created' => 'DESC'); 
     129                        $this->set('posts', $this->paginate(null, array('Post.published'=>1, 'Post.frontpage' => 1 ,'Post.access_level' => '<= ' . $this->level ))); 
     130                        $this->set('postcount', $this->Post->postCount()); 
     131                } else { 
     132                        // RSS Feed 
     133                        $this->set('posts', $this->Post->findAll(null, null, array('Post.created' => 'DESC'), 20));      
     134                } 
    97135        } 
    98136 
     
    141179                $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
    142180                $this->set('subjects', $this->Post->Subject->generateList()); 
     181                $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    143182        } 
    144183 
  • branch/models/post.php

    r89 r109  
    2020        //The Associations below have been created with all possible keys, those that are not needed can be removed 
    2121        var $belongsTo = array( 
    22                         'User' => array('className' => 'User', 
    23                                                                 'foreignKey' => 'user_id', 
    24                                                                 'conditions' => '', 
    25                                                                 'fields' => '', 
    26                                                                 'order' => '', 
    27                                                                 'counterCache' => ''), 
    28                         'Subject' => array('className' => 'Subject', 
    29                                                                 'foreignKey' => 'subject_id', 
    30                                                                 'conditions' => '', 
    31                                                                 'fields' => '', 
    32                                                                 'order' => '', 
    33                                                                 'counterCache' => ''), 
     22                        'User' => array('className' => 'User'), 
     23                        'Subject' => array('className' => 'Subject'), 
    3424                        'Image' => array('className' => 'Image') 
    3525        ); 
     
    3727        var $hasMany = array( 
    3828                        'Comment' => array('className' => 'Comment', 
    39                                                                 'foreignKey' => 'post_id', 
    40                                                                 'conditions' => '', 
    41                                                                 'fields' => '', 
    42                                                                 'order' => '', 
    43                                                                 'limit' => '', 
    44                                                                 'offset' => '', 
    45                                                                 'dependent' => '', 
    46                                                                 'exclusive' => '', 
    47                                                                 'finderQuery' => '', 
    48                                                                 'counterQuery' => ''), 
     29                                                                'foreignKey' => 'post_id'), 
    4930        ); 
    5031 
     
    5435                                                'foreignKey' => 'post_id', 
    5536                                                'associationForeignKey' => 'tag_id', 
    56                                                 'conditions' => '', 
    57                                                 'fields' => '', 
    5837                                                'order' => 'Tag.tag ASC', 
    59                                                 'limit' => '', 
    60                                                 'offset' => '', 
    61                                                 'unique' => true, 
    62                                                 'finderQuery' => '', 
    63                                                 'deleteQuery' => '', 
    64                                                 'insertQuery' => ''), 
     38                                                'unique' => true), 
    6539        ); 
    6640         
     
    6943        if (empty($this->id)) 
    7044        { 
    71             $this->data[$this->name]['stub'] = $this->getUniqueUrl($this->data[$this->name]['title'], 'stub'); 
     45            $this->data[$this->name]['slug'] = $this->getUniqueUrl($this->data[$this->name]['title'], 'slug'); 
    7246        } 
    7347         
     
    8660        $this->savefield('published', 0); 
    8761    } 
     62         
     63        function postCount() 
     64        { 
     65                $postcount = $this->findCount(); 
     66                return $postcount; 
     67        } 
    8868} 
    8969?> 
  • branch/views/posts/add.ctp

    r55 r109  
     1<?php //e($javascript->codeBlock('$j.ready(function() {$("#PostAddForm").ajaxSubmit(function() { var options = { target: ".post" }; });});'));?> 
     2 
     3<div class="success" style="display:none;"> 
     4        <h2>Post has successfuly saved.</h2> 
     5</div> 
     6 
    17<div class="post"> 
    28<h2>New Post</h2> 
    39        <?php echo $form->create('Post');?> 
    4                 <?php echo $form->input('title', array('class' => 'required'));?> 
    5                 <?php echo $form->input('byline', array('class' => 'required'));?> 
    6                 <?php echo $form->input('body', array('class' => 'required'));?> 
    7                 <?php echo $form->input('post_date', array('class' => 'required'));?> 
    8                 <?php echo $form->input('comments_count', array('class' => 'required'));?> 
    9                 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 
    10                 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
    11                 <?php echo $form->input('access_level', array('class' => 'required'));?> 
    12                 <?php echo $form->input('stub', array('class' => 'required'));?> 
    13                 <?php echo $form->input('tags', array('class' => 'required'));?> 
    14                 <?php echo $form->input('frontpage');?> 
    15                 <?php echo $form->input('published', array('class' => 'required'));?> 
    16                 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 
    17                 <?php echo $form->submit('Add');?> 
     10                <fieldset id="main-content"> 
     11                        <legend>Main Content</legend> 
     12                        <?php echo $form->input('title', array('class' => 'required'));?> 
     13                        <?php echo $form->input('byline', array('class' => 'required'));?> 
     14                        <?php echo $form->input('body',array('class'=>'wymeditor'));?> 
     15                        <?php e($form->input('image_id', array('options'=>$images)));?> 
     16                        <a href="/admin/images/add?KeepThis=true&TB_iframe=true&height=400&width=600" id="add-image" class="thickbox">Upload New Image</a> 
     17                </fieldset> 
     18                 
     19                <fieldset id="meta-content"> 
     20                        <legend>Meta Data</legend> 
     21                        <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
     22                        <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?>                             
     23                </fieldset> 
     24                 
     25                <fieldset id="publishing-options"> 
     26                        <legend>Publishing Options</legend> 
     27                        <?php echo $form->input('post_date', array('class' => 'required'));?> 
     28                        <?php echo $form->input('access_level', array('class' => 'required', 'options'=>$access_levels));?> 
     29                        <?php echo $form->input('frontpage');?> 
     30                        <?php echo $form->input('published', array('class' => 'required'));?> 
     31                </fieldset> 
     32                                 
     33                <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 
    1834        </form> 
    1935</div> 
    20 <div class="actions"> 
    21         <ul> 
    22                 <li><?php echo $html->link('List Posts', array('action'=>'index')); ?></li> 
    23                 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view'));?></li> 
    24                 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li> 
    25                 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view'));?></li> 
    26                 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li> 
    27         </ul> 
    28 </div> 
  • branch/views/posts/admin_edit.ctp

    r68 r109  
     1<?php //e($javascript->codeBlock('$j.ready(function() {$("#PostAddForm").ajaxSubmit(function() { var options = { target: ".post" }; });});'));?> 
     2 
     3<div class="success" style="display:none;"> 
     4        <h2>Post has successfuly saved.</h2> 
     5</div> 
     6 
    17<div class="post"> 
    2 <h2>New Post</h2> 
     8<h2>Edit Post</h2> 
    39        <?php echo $form->create('Post');?> 
    410                <fieldset id="main-content"> 
     
    713                        <?php echo $form->input('title', array('class' => 'required'));?> 
    814                        <?php echo $form->input('byline', array('class' => 'required'));?> 
    9                         <?php echo $form->input('body', array('class'=>'wymeditor'));?> 
    10                         <?php echo $form->input('user_id', array('class' => 'required'));?> 
     15                        <?php echo $form->input('body',array('class'=>'wymeditor'));?> 
     16                        <?php e($form->input('image_id', array('options'=>$images)));?> 
     17                        <a href="/admin/images/add?KeepThis=true&TB_iframe=true&height=400&width=600" id="add-image" class="thickbox">Upload New Image</a> 
    1118                </fieldset> 
    1219                 
     
    2532                </fieldset> 
    2633                                 
    27                 <?php echo $form->submit('Update', array('class'=>'wymupdate'));?> 
    28                 <li><?php echo $html->link('Delete', array('action'=>'delete', $html->tagValue('Post/id')), null, 'Are you sure you want to delete #' . $html->tagValue('Post/id')); ?> 
     34                <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 
    2935        </form> 
    3036</div> 
  • branch/views/posts/admin_index.ctp

    r108 r109  
    22        <div class="posts"> 
    33        <h2>List Posts</h2> 
     4        <div> 
     5                Overall there are <?php e($postcount);?> posts on this site.<br /> 
     6                From these posts, <?php e($posts[0]['User']['posts_count']);?> are yours. 
     7        </div> 
    48 
    59        <table cellpadding="0" cellspacing="0"> 
  • branch/views/posts/admin_view.ctp

    r57 r109  
    11<div class="hentry"> 
    2                 <h2 class="entry-title"><?php e($html->link($post['Post']['title'], array('controller'=>'posts', 'action'=>'view', $post['Post']['stub']))); ?></h2> 
    3                 <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 
    4                 <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
    5                 <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
    6                 <div class="entry-content"> 
    7                         <?php echo $post['Post']['body']; ?> 
    8                 </div> 
    9                  
    10                 <div class="meta"> 
    11                         Comments: <?php echo $post['Post']['comments_count']; ?><br /> 
    12                         Tags: <?php foreach ($post['Tag'] as $tag) : 
    13                                                 e($html->link($tag['tag'], 'http://technorati.com/tag/' . $tag['tag'], array('rel'=>'tag', 'class'=>'tag')));  
    14                                 endforeach;                              
     2        <h2 class="entry-title"><?php e($html->link($post['Post']['title'], array('controller'=>'posts', 'action'=>'view', $post['Post']['stub']))); ?></h2> 
     3        <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 
     4        <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
     5        <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
     6        <div class="entry-content"> 
     7                <?php echo $post['Post']['body']; ?> 
     8        </div>   
     9        <div class="meta"> 
     10                Comments: <?php echo $post['Post']['comments_count']; ?><br /> 
     11                Tags: <?php foreach ($post['Tag'] as $tag) : 
     12                                        e($html->link($tag['tag'], 'http://technorati.com/tag/' . $tag['tag'], array('rel'=>'tag', 'class'=>'tag')));  
     13                                        endforeach;                              
    1514                                ?> 
    16                 </div> 
    17                  
    18                 <span class="version" style="display: none;">0.3</span> 
    1915        </div> 
     16        <span class="version" style="display: none;">0.3</span> 
     17</div> 
  • branch/views/posts/edit.ctp

    r55 r109  
     1<?php //e($javascript->codeBlock('$j.ready(function() {$("#PostAddForm").ajaxSubmit(function() { var options = { target: ".post" }; });});'));?> 
     2 
     3<div class="success" style="display:none;"> 
     4        <h2>Post has successfuly saved.</h2> 
     5</div> 
     6 
    17<div class="post"> 
    28<h2>Edit Post</h2> 
    39        <?php echo $form->create('Post');?> 
    4                 <?php echo $form->input('id');?> 
    5                 <?php echo $form->input('title', array('class' => 'required'));?> 
    6                 <?php echo $form->input('byline', array('class' => 'required'));?> 
    7                 <?php echo $form->input('body', array('class' => 'required'));?> 
    8                 <?php echo $form->input('post_date', array('class' => 'required'));?> 
    9                 <?php echo $form->input('comments_count', array('class' => 'required'));?> 
    10                 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 
    11                 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
    12                 <?php echo $form->input('access_level', array('class' => 'required'));?> 
    13                 <?php echo $form->input('stub', array('class' => 'required'));?> 
    14                 <?php echo $form->input('tags', array('class' => 'required'));?> 
    15                 <?php echo $form->input('frontpage');?> 
    16                 <?php echo $form->input('published', array('class' => 'required'));?> 
    17                 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 
    18                 <?php echo $form->submit('Update');?> 
     10                <fieldset id="main-content"> 
     11                        <legend>Main Content</legend> 
     12                        <?php echo $form->input('id');?> 
     13                        <?php echo $form->input('title', array('class' => 'required'));?> 
     14                        <?php echo $form->input('byline', array('class' => 'required'));?> 
     15                        <?php echo $form->input('body',array('class'=>'wymeditor'));?> 
     16                        <?php e($form->input('image_id', array('options'=>$images)));?> 
     17                        <a href="/admin/images/add?KeepThis=true&TB_iframe=true&height=400&width=600" id="add-image" class="thickbox">Upload New Image</a> 
     18                </fieldset> 
     19                 
     20                <fieldset id="meta-content"> 
     21                        <legend>Meta Data</legend> 
     22                        <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
     23                        <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?>                             
     24                </fieldset> 
     25                 
     26                <fieldset id="publishing-options"> 
     27                        <legend>Publishing Options</legend> 
     28                        <?php echo $form->input('post_date', array('class' => 'required'));?> 
     29                        <?php echo $form->input('access_level', array('class' => 'required', 'options'=>$access_levels));?> 
     30                        <?php echo $form->input('frontpage');?> 
     31                        <?php echo $form->input('published', array('class' => 'required'));?> 
     32                </fieldset> 
     33                                 
     34                <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 
    1935        </form> 
    2036</div> 
    21 <div class="actions"> 
    22         <ul> 
    23                 <li><?php echo $html->link('Delete', array('action'=>'delete', $html->tagValue('Post/id')), null, 'Are you sure you want to delete #' . $html->tagValue('Post/id')); ?> 
    24                 <li><?php echo $html->link('List Posts', array('action'=>'index')); ?></li> 
    25                 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view')); ?></li> 
    26                 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li> 
    27                 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view')); ?></li> 
    28                 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li> 
    29         </ul> 
    30 </div> 
  • branch/views/posts/view.ctp

    r72 r109  
    11<div class="hentry"> 
    2                 <h2 class="entry-title"><?php e($html->link($post['Post']['title'], array('controller'=>'posts', 'action'=>'view', $post['Post']['stub']))); ?></h2> 
    3                 <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 
    4                 <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
    5                 <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
    6                  
    7                 <div class="entry-content"> 
    8                         <?php echo $post['Post']['body']; ?> 
    9                 </div> 
    10                  
    11                 <div class="meta"> 
    12                         Comments: <?php echo $post['Post']['comments_count']; ?><br /> 
    13                         Tags: <?php foreach ($post['Tag'] as $tag) : 
    14                                                 e($html->link($tag['tag'], 'http://technorati.com/tag/' . $tag['tag'], array('rel'=>'tag', 'class'=>'tag')));  
    15                                 endforeach;                              
     2        <h2 class="entry-title"><?php e($html->link($post['Post']['title'], array('controller'=>'posts', 'action'=>'view', $post['Post']['stub']))); ?></h2> 
     3        <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 
     4        <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
     5        <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
     6        <div class="entry-content"> 
     7                <?php echo $post['Post']['body']; ?> 
     8        </div>   
     9        <div class="meta"> 
     10                Comments: <?php echo $post['Post']['comments_count']; ?><br /> 
     11                Tags: <?php foreach ($post['Tag'] as $tag) : 
     12                                        e($html->link($tag['tag'], 'http://technorati.com/tag/' . $tag['tag'], array('rel'=>'tag', 'class'=>'tag')));  
     13                                        endforeach;                              
    1614                                ?> 
    17                 </div> 
    18                  
    19                 <span class="version" style="display: none;">0.3</span> 
    2015        </div> 
     16        <span class="version" style="display: none;">0.3</span> 
     17</div>