[pLog-svn] r3674 - in plog/trunk: class/summary/action
templates/summary
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Sat Jul 1 11:51:57 GMT 2006
Author: oscar
Date: 2006-07-01 11:51:56 +0000 (Sat, 01 Jul 2006)
New Revision: 3674
Modified:
plog/trunk/class/summary/action/bloglistaction.class.php
plog/trunk/class/summary/action/postlistaction.class.php
plog/trunk/class/summary/action/summarydefaultaction.class.php
plog/trunk/templates/summary/blogslist.template
plog/trunk/templates/summary/index.template
plog/trunk/templates/summary/postslist.template
Log:
cosmetic changes (the current blog category or article category is not linked if it's the one we're current browsing) and $currentGlobalArticleCategory and $blogCategory are available in postlist.template, bloglist.template and index.template as the current global article category and blog category that we're browsing.
Modified: plog/trunk/class/summary/action/bloglistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/bloglistaction.class.php 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/class/summary/action/bloglistaction.class.php 2006-07-01 11:51:56 UTC (rev 3674)
@@ -38,9 +38,15 @@
// nothing to do, the view is cached
return true;
}
+
+ $categories = new BlogCategories();
+ if( $blogCategoryId != ALL_BLOG_CATEGORIES )
+ {
+ $currentBlogCategory = $categories->getBlogCategory( $blogCategoryId );
+ $this->_view->setValue( "currentBlogCategory", $currentBlogCategory);
+ }
- $this->_view->setValue( "blogCategoryId", $blogCategoryId );
-
+ $this->_view->setValue( "blogCategoryId", $blogCategoryId );
$this->setCommonData();
return true;
Modified: plog/trunk/class/summary/action/postlistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/postlistaction.class.php 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/class/summary/action/postlistaction.class.php 2006-07-01 11:51:56 UTC (rev 3674)
@@ -38,7 +38,13 @@
// nothing to do, the view is cached
return true;
}
-
+
+ $categories = new GlobalArticleCategories();
+ if( $globalArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES )
+ {
+ $currentGlobalArticleCategory = $categories->getGlobalArticleCategory( $globalArticleCategoryId );
+ $this->_view->setValue( "currentGlobalArticleCategory", $currentGlobalArticleCategory);
+ }
$this->_view->setValue( "globalArticleCategoryId", $globalArticleCategoryId );
$this->setCommonData();
Modified: plog/trunk/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarydefaultaction.class.php 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/class/summary/action/summarydefaultaction.class.php 2006-07-01 11:51:56 UTC (rev 3674)
@@ -31,6 +31,7 @@
$this->_view = new SummaryCachedView( "index",
Array( "summary" => "default",
"globalArticleCategoryId" => $globalArticleCategoryId ));
+
if( $this->_view->isCached()) {
// if the view is already cached... move along! nothing to see here
return true;
@@ -76,6 +77,7 @@
$this->_view->setValue( "globalArticleCategories", $globalArticleCategories );
$this->_view->setValue( "min", $min );
$this->_view->setValue( "step", $step );
+ $this->_view->setValue( "globalArticleCategoryId", $globalArticleCategoryId );
// we just need a random blog so... we'll get one :)
@@ -90,4 +92,4 @@
return true;
}
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/templates/summary/blogslist.template
===================================================================
--- plog/trunk/templates/summary/blogslist.template 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/templates/summary/blogslist.template 2006-07-01 11:51:56 UTC (rev 3674)
@@ -2,10 +2,22 @@
<div id="onecolumn">
<div id="intro">
<h4>{$locale->tr("blog_categories")}</h4>
- <span class="tag"><a href="?op=BlogList&globalArticleCategoryId=0">{$locale->tr("all")}</a></span>
+ <span class="tag">
+ {if $blogCategoryId != 0}
+ <a href="?op=BlogList&globalArticleCategoryId=0">{$locale->tr("all")}</a>
+ {else}
+ {$locale->tr("all")}
+ {/if}
+ </span>
{foreach from=$blogCategories item=blogCategory}
{math assign=fontSize equation="(int)((x-y)/step)+12" x=$blogCategory->getNumActiveBlogs() y=$min step=$step}
- <span class="tag"><a style="font-size: {$fontSize}px" href="?op=BlogList&blogCategoryId={$blogCategory->getId()}">{$blogCategory->getName()}</a></span>
+ <span class="tag">
+ {if $blogCategory->getId() != $blogCategoryId}
+ <a style="font-size: {$fontSize}px" href="?op=BlogList&blogCategoryId={$blogCategory->getId()}">{$blogCategory->getName()}</a>
+ {else}
+ <span style="font-size: {$fontSize}px">{$blogCategory->getName()}</span>
+ {/if}
+ </span>
{/foreach}
</div>
{if empty($currentBlogCategory)}
Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/templates/summary/index.template 2006-07-01 11:51:56 UTC (rev 3674)
@@ -41,12 +41,25 @@
{$locale->tr("summary_welcome_paragraph")}
</div>
<br/>
+
<div id="global_article_categories">
<h4>{$locale->tr("global_article_categories")}</h4>
- <span class="tag"><a href="?op=Summary&globalArticleCategoryId=0">{$locale->tr("all")}</a></span>
+ <span class="tag">
+ {if $globalArticleCategoryId != 0}
+ <a href="?op=Summary&globalArticleCategoryId=0">{$locale->tr("all")}</a>
+ {else}
+ {$locale->tr("all")}
+ {/if}
+ </span>
{foreach from=$globalArticleCategories item=globalArticleCategory}
{math assign=fontSize equation="(int)((x-y)/step)+12" x=$globalArticleCategory->getNumActiveArticles() y=$min step=$step}
- <span class="tag"><a style="font-size: {$fontSize}px" href="?op=Summary&globalArticleCategoryId={$globalArticleCategory->getId()}">{$globalArticleCategory->getName()}</a></span>
+ <span class="tag">
+ {if $globalArticleCategory->getId() != $globalArticleCategoryId}
+ <a style="font-size: {$fontSize}px" href="?op=Summary&globalArticleCategoryId={$globalArticleCategory->getId()}">{$globalArticleCategory->getName()}</a>
+ {else}
+ <span style="font-size: {$fontSize}px">{$globalArticleCategory->getName()}</span>
+ {/if}
+ </span>
{/foreach}
</div>
{include file="summary/recent.template"}
Modified: plog/trunk/templates/summary/postslist.template
===================================================================
--- plog/trunk/templates/summary/postslist.template 2006-06-30 10:37:51 UTC (rev 3673)
+++ plog/trunk/templates/summary/postslist.template 2006-07-01 11:51:56 UTC (rev 3674)
@@ -2,10 +2,22 @@
<div id="onecolumn">
<div id="intro">
<h4>{$locale->tr("global_article_categories")}</h4>
- <span class="tag"><a href="?op=PostList&globalArticleCategoryId=0">{$locale->tr("all")}</a></span>
+ <span class="tag">
+ {if $globalArticleCategoryId != 0}
+ <a href="?op=PostList&globalArticleCategoryId=0">{$locale->tr("all")}</a>
+ {else}
+ {$locale->tr("all")}
+ {/if}
+ </span>
{foreach from=$globalArticleCategories item=globalArticleCategory}
{math assign=fontSize equation="(int)((x-y)/step)+12" x=$globalArticleCategory->getNumActiveArticles() y=$min step=$step}
- <span class="tag"><a style="font-size: {$fontSize}px" href="?op=PostList&globalArticleCategoryId={$globalArticleCategory->getId()}">{$globalArticleCategory->getName()}</a></span>
+ <span class="tag">
+ {if $globalArticleCategoryId != $globalArticleCategory->getId()}
+ <a style="font-size: {$fontSize}px" href="?op=PostList&globalArticleCategoryId={$globalArticleCategory->getId()}">{$globalArticleCategory->getName()}</a>
+ {else}
+ <span style="font-size: {$fontSize}px">{$globalArticleCategory->getName()}</span>
+ {/if}
+ </span>
{/foreach}
</div>
{if empty($currentGlobalArticleCategory)}
More information about the pLog-svn
mailing list