* code for custom set.

This commit is contained in:
azhi
2013-08-07 16:37:28 +08:00
parent bac24e0c81
commit 1f3cde2847
6 changed files with 20 additions and 18 deletions

View File

@@ -19,7 +19,7 @@ class custom extends control
*/
public function index()
{
die(js::locate(inlink('setCustom')));
die(js::locate(inlink('set')));
}
/**
@@ -30,7 +30,7 @@ class custom extends control
* @access public
* @return void
*/
public function setCustom($module = 'story', $field = 'priList')
public function set($module = 'story', $field = 'priList')
{
if($module == 'user' and $field == 'priList') $field = 'roleList';
$currentLang = $this->app->getClientLang();
@@ -44,10 +44,12 @@ class custom extends control
foreach($_POST['keys'] as $index => $key)
{
$value = $_POST['values'][$index];
if(!$value or !$key) continue;
$system = $_POST['systems'][$index];
$this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value);
}
if(!dao::getError()) die(js::reload('parent'));
if(dao::isError()) die(js::error(dao::getError()));
die(js::reload('parent'));
}
$this->view->title = $this->lang->custom->common . $this->lang->colon . $this->lang->custom->story;