Changeset 9300

Show
Ignore:
Timestamp:
08/19/08 20:04:21 (4 months ago)
Author:
afz
Message:

separate template for entries in category, so users can more customizable themes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jaws/html/gadgets/Blog/HTML.php

    r9216 r9300  
    11811181            $tpl->SetBlock('show_category'); 
    11821182            $tpl->SetVariable('title', $name); 
    1183             $tpl->ParseBlock('show_category'); 
    1184             $result = $tpl->Get(); 
    11851183            $entries = $model->GetEntriesByCategory($id); 
    11861184            if (!Jaws_Error::IsError($entries)) { 
     1185                $date = $GLOBALS['app']->loadDate(); 
    11871186                foreach ($entries as $e) { 
    1188                     $result .= $this->ShowEntry($e, true, true); 
    1189                 } 
    1190             } 
    1191             return $result; 
     1187                    $tpl->SetBlock('show_category/item'); 
     1188                    $id = empty($e['fast_url']) ? $e['id'] : $e['fast_url']; 
     1189 
     1190                    $text = $e['text']; 
     1191                    if (strpos($text, '[more]') !== false) { 
     1192                        $post = explode('[more]', $text); 
     1193                        $perm_url = $GLOBALS['app']->Map->GetURLFor('Blog', 'SingleView', array('id' => $id)); 
     1194                        $text = $post[0]. ' '. _t('BLOG_READ_MORE', "$perm_url#more"); 
     1195                    } 
     1196 
     1197                    $tpl->SetVariable('url', $GLOBALS['app']->Map->GetURLFor('Blog', 'SingleView', array('id' => $id))); 
     1198                    $tpl->SetVariable('title', $e['title']); 
     1199                    $tpl->SetVariable('text', Jaws_Gadget::ParseText($text, 'Blog')); 
     1200                    $tpl->SetVariable('username', $e['username']); 
     1201                    $tpl->SetVariable('posted_by', _t('BLOG_POSTED_BY')); 
     1202                    $tpl->SetVariable('name', $e['name']); 
     1203                    $tpl->SetVariable('author-url', $GLOBALS['app']->Map->GetURLFor('Blog', 'View', array('id' => $e['username']))); 
     1204                    $tpl->SetVariable('createtime', $date->Format($e['publishtime'])); 
     1205                    $tpl->SetVariable('createtime-monthname', $date->Format($e['publishtime'], 'MN')); 
     1206                    $tpl->SetVariable('createtime-month', $date->Format($e['publishtime'], 'm')); 
     1207                    $tpl->SetVariable('createtime-day', $date->Format($e['publishtime'], 'd')); 
     1208                    $tpl->SetVariable('createtime-year', $date->Format($e['publishtime'], 'Y')); 
     1209                    $tpl->SetVariable('createtime-time', $date->Format($e['publishtime'], 'g:ia')); 
     1210                    $tpl->ParseBlock('show_category/item'); 
     1211                } 
     1212            } 
     1213 
     1214            $tpl->ParseBlock('show_category'); 
     1215            return $tpl->Get(); 
    11921216        } else { 
    11931217            require_once JAWS_PATH . 'include/Jaws/HTTPError.php'; 
  • trunk/jaws/html/gadgets/Blog/templates/ShowCategory.html

    r2 r9300  
    11<!-- BEGIN show_category --> 
    2 <h1>{title}</h1> 
     2<div class="gadget blog_category_posts"> 
     3  <h2>{title}</h2> 
     4  <div class="content"> 
     5    <ul> 
     6    <!-- BEGIN item --> 
     7      <li><a href="{url}" title="{createtime}">{title}</a></li> 
     8    <!-- END item --> 
     9    </ul> 
     10  </div> 
     11</div> 
    312<!-- END show_category -->