Skip to content

Commit

Permalink
Rewrite rule for category, category editor for admin only, some text …
Browse files Browse the repository at this point in the history
…changes too
  • Loading branch information
Boban committed Mar 12, 2012
1 parent 16564ec commit 7f3fb7d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 2 additions & 0 deletions RewriteRules.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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 ^/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 ^/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 ^/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
16 changes: 14 additions & 2 deletions lib/Lampcms/Controllers/Settings.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,18 +81,30 @@ protected function main(){
'profile' => $this->_('Edit Profile'), 'profile' => $this->_('Edit Profile'),
'profileUrl' => '/editprofile/', 'profileUrl' => '/editprofile/',
'emailPrefs' => $this->_('Email Preferences'), 'emailPrefs' => $this->_('Email Preferences'),
'clearCache' => '' 'clearCache' => '',
'viewCategory' => '',
); );


if($this->Registry->Viewer->isAdmin()){ if($this->Registry->Viewer->isAdmin()){
$vals['clearCache'] = $this->makeClearCache(); $vals['clearCache'] = $this->makeClearCache();
$vals['viewCategory'] = $this->makeCategoryBlock();
} }


$this->aPageVars['body'] = \tplSettings::parse($vals); $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(){ protected function makeClearCache(){
return '<div class="tool"> return '<div class="tool">
<div class="icn sweep">&nbsp;</div> <div class="icn sweep">&nbsp;</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/Lampcms/Controllers/Viewcategory.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function main(){
$this->slug = $this->Request['slug']; $this->slug = $this->Request['slug'];
$this->pageID = (int)$this->Request->get('pageID', 'i', 1); $this->pageID = (int)$this->Request->get('pageID', 'i', 1);
$this->pagerPath = '/category/'.$this->slug; $this->pagerPath = '/category/'.$this->slug;
$this->counterTaggedText = $this->_('Questions in this category'); $this->counterTaggedText = $this->_('Topics in this category');


$this->getCategory() $this->getCategory()
->getCursor() ->getCursor()
Expand Down Expand Up @@ -144,4 +144,4 @@ protected function makeQlistHeader(){
return $this; return $this;
} }


} }
2 changes: 1 addition & 1 deletion lib/Lampcms/Controllers/Viewquestion.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ protected function setAnswersHeader(){


$aVars = array( $aVars = array(
$this->Question['i_ans'], $this->Question['i_ans'],
'Answer'.$this->Question['ans_s'], 'Post'.$this->Question['ans_s'],
$tabs $tabs
); );


Expand Down
12 changes: 2 additions & 10 deletions www/style/1/www/tplSettings.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class tplSettings extends \Lampcms\Template\Fast
'profileUrl' => '/editprofile/', //4 'profileUrl' => '/editprofile/', //4
'emailPrefs' => 'Email stuff', // 5 'emailPrefs' => 'Email stuff', // 5
'clearCache' => '', //6 'clearCache' => '', //6
'viewCategory' => 'View Category', //7 'viewCategory' => '', //7
'editCategory' => 'Add Category', //8
); );




Expand All @@ -66,14 +65,7 @@ class tplSettings extends \Lampcms\Template\Fast
<div class="icn changepass">&nbsp;</div> <div class="icn changepass">&nbsp;</div>
<div class="tool_link"><a href="/changepwd/">%2$s</a></div> <div class="tool_link"><a href="/changepwd/">%2$s</a></div>
</div> </div>
<div class="tool"> %7$s
<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>
%6$s %6$s
</div>'; </div>';
} }

0 comments on commit 7f3fb7d

Please sign in to comment.