<div class="left">
    <div class="l-list-1">
        <?php App::Hook('UI')->Render('template_left_column_A'); #User Interface Hook ?>
        <?php App::Hook('UI')->Render('template_left_column_B'); #User Interface Hook ?>
        <h3><?php echo $this->__('Categories');?></h3>
        <?php
            App::Plugin("CatMultiLevelMenu_Generator")
               ->setUrlPattern($this->baseurl("/blog-by-cat/[id]/[title]"))
               ->setLinkToParent(true)
               ->setSelected($catid)
               ->setSelectedCSSClass('link-selected')
               ->setType('blog-cat')
               ->getRecursive();
        ?>
        <?php App::Hook('UI')->Render('template_left_column_C'); #User Interface Hook ?>
        <?php App::Hook('UI')->Render('template_left_column_D'); #User Interface Hook ?>
    </div>
</div>
<div class="center-large">
    <?php if($action == 'bypost'):?>
        <div class="post-list">
            <h2><a href="<?php echo $this->baseurl("/blog-by-post/{$post['id']}/" . App::Helper('Utility')->text2Normalize($post['title'])); ?>"><?php echo($post['title']);?></a></h2>
            <p class="post-short-info">
                <?php $catname = App::CategorySet()->idToName($post['category']);?>
                <a href="<?php echo $this->baseurl("/blog-by-cat/{$post['category']}/" . App::Helper('Utility')->text2Normalize($catname)); ?>"><?php echo $catname;?></a> |
                <?php echo App::Module('adminPanelUi')->adminName($post['adminref']);?> | 
                <?php echo App::Helper('Date')->dateFormated($post['entry_date'],'long'); ?> |
                <?php echo $this->__("Comment posted: ") . App::Model('Comment')->countByPostId($post['id']); ?>
            </p>
            <?php App::Hook('UI')->Render('blog_before_post'); #User Interface Hook ?>
            <?php echo($post['description']);?>
            <?php App::Hook('UI')->Render('blog_after_post'); #User Interface Hook ?>
        </div>
        <div class="comments-list">
            <h2><?php echo $this->__("Comments");?></h2>
            <?php if(!empty($comments['data'])):?>
                <ul>
                <?php foreach($comments['data'] as $comment):?>
                    <li>
                        <p class="post-short-info">
                            <?php echo App::Helper('Html')->linkTag($comment['website'],$comment['name'],Array("rel"=>"nofollow")); ?>
                            <?php echo $this->__("Says On");?> <?php echo App::Helper('Date')->dateFormated($comment['dated'],'long'); ?></p>
                        <p><?php echo($comment['comment']);?></p>
                    </li>
                <?php endforeach;?>
                </ul>
            <?php else:?>
                <p><?php echo $this->__("No comment posted yet"); ?></p>
            <?php endif;?>
        </div>
        <div class="comment-form">
            <h3><?php echo $this->__('Submit Comments');?></h3>
            
            <div class="message"></div>
            <form method="post" id="post-comment" action="<?php echo $this->baseurl("/appblog/submitcomment/{$post['id']}") ?>" class="form">
            <ul>
                <li><label><?php echo $this->__('Name');?></label><span><input type="text" name="data[Comment][name]" class="input check_notdefault" longdesc="Please enter your name." value="Type your name" /></span></li>
                <li><label><?php echo $this->__('Email Address');?></label><span><input type="text" name="data[Comment][email]" class="input check_email" longdesc="Please enter your valid email address." value="Type email address" /></span></li>
                <li><label><?php echo $this->__('Website');?></label><span><input type="text" name="data[Comment][website]" class="input" value="Type website name" /></span></li>
                <li><label><?php echo $this->__('Comments');?></label><span><textarea name="data[Comment][comment]" class="input check_notdefault" longdesc="Please type your comment here." rows="5">Type you comments</textarea></span></li>
                <li><label><?php echo App::Helper('Html')->capachaTag("blogcommet",Array("bk_color"=>"#99011E","font_color"=>"#FFFFFF"));?></label><span><input type="text" name="data[Comment][capacha]" class="input check_notempty" longdesc="Please fillin the text display left side image." value="" /></span></li>
                <li><label>&nbsp;</label><span><input type="submit" value="Submit" class="button" /></span></li>
            </ul>
            </form>
             <?php  App::Helper('JavaScript')->setAjax(array("debug"=>false,"autoHide"=>false))->appForm('#post-comment');?>
        </div>
    <?php else:?>
        <?php if(!empty($blogpost['data'])):?>
            <ul class="post-list">
            <?php foreach($blogpost['data'] as $post): ?>
                <li> 
                    <h2><a href="<?php echo $this->baseurl("/blog-by-post/{$post['id']}/" . App::Helper('Utility')->text2Normalize($post['title'])); ?>"><?php echo($post['title']);?></a></h2>
                    <p class="post-short-info">
                        <?php $catname = App::CategorySet()->idToName($post['category']);?>
                        <a href="<?php echo $this->baseurl("/blog-by-cat/{$post['category']}/" . App::Helper('Utility')->text2Normalize($catname)); ?>"><?php echo $catname;?></a> |
                        <?php echo App::Module('adminPanelUi')->adminName($post['adminref']);?> | 
                        <?php echo App::Helper('Date')->dateFormated($post['entry_date'],'long'); ?> |
                        <?php echo $this->__("Comment posted: ") . App::Model('Comment')->countByPostId($post['id']); ?>
                    </p>
                    <?php App::Hook('UI')->Render('blog_before_comment'); #User Interface Hook ?>
                    <?php echo($post['description']);?>
                    <?php App::Hook('UI')->Render('blog_after_comment'); #User Interface Hook ?>
                </li>
            <?php endforeach;?>
            </ul>
            <?php if($blogpost['paging']!=''):?>
                <p><?php echo $blogpost['link']; ?></p>
            <?php endif;?>
        <?php else:?>
            <h2><?php echo $this->__("Sorry! No post submitted yet"); ?></h2>
            <?php App::Hook('UI')->Render('blog_no_comment'); #User Interface Hook ?>
        <?php endif;?>
    <?php endif ?>
</div>
<div class="clearboth"></div>