Skip to content

Commit

Permalink
Initial, probably buggy, port to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Dec 10, 2011
1 parent fda2966 commit 4219ac5
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
class SettingsComponent extends Object {
class SettingsComponent extends Component {

/**
* Loads the settings from the cache/database, writes them to cache,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ class SettingsController extends SettingsAppController{
var $name = 'Settings';

function index() {
if (!empty($this->data)) {
if ($this->Setting->saveAll($this->data['Setting'], array('validate' => 'first'))) {
if (!empty($this->request->data)) {
if ($this->Setting->saveAll($this->request->data['Setting'], array('validate' => 'first'))) {
$this->Session->setFlash(__('The settings has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The settings could not be saved', true));
}
}
$this->data = $this->Setting->find('all');
$this->request->data = $this->Setting->find('all');
}
}
?>
6 changes: 3 additions & 3 deletions models/setting.php → Model/Setting.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
class Setting extends SettingsAppModel {
var $name = 'Setting';
public $name = 'Setting';

function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct();
$this->validate = array(
'key' => array(
'notempty' => array(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4219ac5

Please sign in to comment.