Permalink
Browse files

Widget system properly working in subdir install.

  • Loading branch information...
1 parent 84912b1 commit 7afa239d338ba0ccb60ec4c8e8f95dcb1d1f1687 Carl Svensson committed Oct 10, 2012
Showing with 235 additions and 235 deletions.
  1. +2 −2 app/app_controller.php
  2. +1 −1 app/config/core.php
  3. +1 −1 app/controllers/widgets_controller.php
  4. +231 −231 app/views/layouts/default.ctp
View
@@ -45,8 +45,8 @@ public function beforeFilter() {
}
public function getWidgets($page='') {
- if(empty($page)) { $page = $_SERVER['REQUEST_URI']; }
- if(strpos($_SERVER['REQUEST_URI'], 'questions/') == 1) { $page = '/questions/view'; }
+ if(empty($page)) { $page = Router::url(null, false); }
+ //if(strpos($_SERVER['REQUEST_URI'], 'questions/') == 1) { $page = '/questions/view'; }
$this->set('widgets', $this->Widget->findPage($page));
}
View
@@ -33,7 +33,7 @@
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
- Configure::write('debug', 2);
+ Configure::write('debug', 0);
/**
* CakePHP Log Level:
@@ -42,7 +42,7 @@ public function add() {
$this->set('referer', $this->referer());
if(!empty($this->data)) {
$this->data['Widget']['global'] = ($this->data['Widget']['global'] == 'on') ? 1 : 0;
- $page = str_replace(array('/widgets/add', '?'), array('',''), $_SERVER['REQUEST_URI']);
+ $page = end(explode('/widgets/add', Router::url(null, false)));
$this->data['Widget']['page'] = $page;
if(strpos($page, 'questions/') == 1) { $this->data['Widget']['page'] = '/questions/view'; }
if($this->Widget->save($this->data)) {
Oops, something went wrong.

0 comments on commit 7afa239

Please sign in to comment.