All pastes #766629 Raw Edit

Anonymous

public php v1 · immutable
·published 2007-11-09 00:26 UTC
rendered paste body
<?phpclass SettingsController extends AppController {	var $name = 'Settings';	var $helpers = array('Html', 'Form', 'Javascript', 'Fck');	var $uses = array("Setting");	function admin_index() {		$settings = $this->Setting->findAll();		$this->data = $settings;		$this->set("settings", $this->data);	}	function admin_update() {		if(!empty($this->data)) {			if($this->isCancelled()) {				$this->doCancel();				} else {					foreach($this->data['Setting'] as $fName => $fValue) {						//echo $fName;						$this->Setting->updateSetting($fName, $fValue);					}					//$this->redirect("/admin/settings");				}				} else {					$this->Session->setFlash("Direct access to that page is not allowed");				}				//$this->redirect("/admin/settings");			}		}		?>