本文整理汇总了PHP中Categorie::setMultiLangs方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::setMultiLangs方法的具体用法?PHP Categorie::setMultiLangs怎么用?PHP Categorie::setMultiLangs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::setMultiLangs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setEventMessage
$action = '';
}
// Validation de l'ajout
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) {
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
// update de l'objet
if ($_POST["forcelangprod"] == $current_lang) {
$object->label = $_POST["libelle"];
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
} else {
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
}
// sauvegarde en base
if ($object->setMultiLangs() > 0) {
$action = '';
} else {
$action = 'add';
setEventMessage($object->error, 'errors');
}
}
// Validation de l'edition
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) {
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
foreach ($object->multilangs as $key => $value) {
if ($key == $current_lang) {
$object->label = $_POST["libelle-" . $key];
$object->description = dol_htmlcleanlastbr($_POST["desc-" . $key]);
} else {
示例2: setEventMessages
$action = '';
}
// Validation de l'ajout
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) {
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
// update de l'objet
if ($_POST["forcelangprod"] == $current_lang) {
$object->label = $_POST["libelle"];
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
} else {
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
}
// sauvegarde en base
if ($object->setMultiLangs($user) > 0) {
$action = '';
} else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Validation de l'edition
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) {
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
foreach ($object->multilangs as $key => $value) {
if ($key == $current_lang) {
$object->label = $_POST["libelle-" . $key];
$object->description = dol_htmlcleanlastbr($_POST["desc-" . $key]);
} else {