Permalink
Browse files

Rewrite rule for category, category editor for admin only, some text …

…changes too
  • Loading branch information...
1 parent 16564ec commit 7f3fb7d731ea69ce9765b7b7fa388924fcb2b10a @dkode dkode committed Mar 12, 2012
View
@@ -46,3 +46,5 @@ RewriteRule ^/([a-zA-Z\-]+)/$ /index.php?a=$1
RewriteRule ^/search/(m|r)/(.*)/page([0-9]+)\.html$ /index.php?a=search&ord=$1&q=$2&pageID=$3
RewriteRule ^/tab/(a|q)/([0-9]+)/([a-zA-Z]+)/page([0-9]+)\.html$ /index.php?a=userinfotab&tab=$1&uid=$2&sort=$3&pageID=$4 [L]
RewriteRule ^/editprofile/([0-9]+) /index.php?a=editprofile&uid=$1 [L]
+RewriteRule ^/category/([a-zA-Z0-9]+)/page([0-9]+)\.html /index.php?a=viewcategory&slug=$1&pageID=$2
+RewriteRule ^/category/([a-zA-Z0-9]+) /index.php?a=viewcategory&slug=$1
@@ -81,18 +81,30 @@ protected function main(){
'profile' => $this->_('Edit Profile'),
'profileUrl' => '/editprofile/',
'emailPrefs' => $this->_('Email Preferences'),
- 'clearCache' => ''
+ 'clearCache' => '',
+ 'viewCategory' => '',
);
if($this->Registry->Viewer->isAdmin()){
$vals['clearCache'] = $this->makeClearCache();
+ $vals['viewCategory'] = $this->makeCategoryBlock();
}
$this->aPageVars['body'] = \tplSettings::parse($vals);
}
-
+ protected function makeCategoryBlock(){
+ return '<div class="tool">
+ <div class="icn addcateg">&nbsp;</div>
+ <div class="tool_link"><a href="/viewcategories/">view Categories</a></div>
+ </div>
+ <div class="tool">
+ <div class="icn editcateg">&nbsp;</div>
+ <div class="tool_link"><a href="/editcategory/">Add Category</a></div>
+ </div>';
+ }
+
protected function makeClearCache(){
return '<div class="tool">
<div class="icn sweep">&nbsp;</div>
@@ -77,7 +77,7 @@ protected function main(){
$this->slug = $this->Request['slug'];
$this->pageID = (int)$this->Request->get('pageID', 'i', 1);
$this->pagerPath = '/category/'.$this->slug;
- $this->counterTaggedText = $this->_('Questions in this category');
+ $this->counterTaggedText = $this->_('Topics in this category');
$this->getCategory()
->getCursor()
@@ -144,4 +144,4 @@ protected function makeQlistHeader(){
return $this;
}
-}
+}
@@ -392,7 +392,7 @@ protected function setAnswersHeader(){
$aVars = array(
$this->Question['i_ans'],
- 'Answer'.$this->Question['ans_s'],
+ 'Post'.$this->Question['ans_s'],
$tabs
);
@@ -46,8 +46,7 @@ class tplSettings extends \Lampcms\Template\Fast
'profileUrl' => '/editprofile/', //4
'emailPrefs' => 'Email stuff', // 5
'clearCache' => '', //6
- 'viewCategory' => 'View Category', //7
- 'editCategory' => 'Add Category', //8
+ 'viewCategory' => '', //7
);
@@ -66,14 +65,7 @@ class tplSettings extends \Lampcms\Template\Fast
<div class="icn changepass">&nbsp;</div>
<div class="tool_link"><a href="/changepwd/">%2$s</a></div>
</div>
- <div class="tool">
- <div class="icn addcateg">&nbsp;</div>
- <div class="tool_link"><a href="/viewcategories/">%7$s</a></div>
- </div>
- <div class="tool">
- <div class="icn editcateg">&nbsp;</div>
- <div class="tool_link"><a href="/editcategory/">%8$s</a></div>
- </div>
+ %7$s
%6$s
</div>';
}

0 comments on commit 7f3fb7d

Please sign in to comment.