<?php

defined('WEKIT_VERSION') or exit(403);

Wind::import('ADMIN:library.AdminBaseController');

class ManageController extends AdminBaseController {

	

	public function beforeAction($handlerAdapter) {

		parent::beforeAction($handlerAdapter);

		//TODO do something before all the action

	}

	private $cfg;

	public $page = 1;

	public $perpage = 20;

	

   public function run() {

 		$service = Wekit::load('config.PwConfig');

 		$config = $service->getValues('emailnotice');

		$this->setOutput($config, 'config');

    }

	public function doSetAction(){

	$arr = $this->getInput('config', 'post');

 	$config = new PwConfigSet('emailnotice');

  	foreach($arr as $k => $v){

 			if(!$v)$v=0;

			$config->set($k, $v)->flush();

 		}

		$this -> showMessage('ADMIN:success');

	}

}



?>