1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Issue #2446 e_menu multilan value fix.

This commit is contained in:
Cameron
2017-03-02 09:39:50 -08:00
parent 50a16b76c9
commit aa36466220
6 changed files with 70 additions and 18 deletions

View File

@@ -261,6 +261,48 @@ class e_menu
}
/**
* @param int $id menu_id
* @param array $parms
* @return mixed
*/
public function updateParms($id, $parms)
{
$model = e107::getModel();
$model->setModelTable("menus");
$model->setFieldIdName("menu_id");
$model->setDataFields(array('menu_parms'=>'json'));
$model->load($id, true);
$d = $model->get('menu_parms');
$model->setPostedData('menu_parms', e107::unserialize($d));
foreach($parms as $key=>$value)
{
if(!is_array($value))
{
$model->setPostedData('menu_parms/'.$key, $value);
}
else
{
$lang = key($value);
$val = $value[$lang];
$model->setPostedData('menu_parms/'.$key.'/'.$lang, $val);
}
}
return $model->save();
// return $model;
}
/**
* Add a Menu to the Menu Table.
* @param string $plugin folder name