foreach ($properties as $p) { $pArr = explode(':', $p); // skip invalid property if (count($pArr) != 3) { continue; } // replace full description property {key:type:desc} to {key} $html = str_replace('{' . $p . '}', '{' . strtoupper($pArr[0]) . '}', $html); $xmlProp = $xmlProps->addChild('property'); $xmlProp->addChild('key', $pArr[0]); $xmlProp->addChild('type', $pArr[1]); $xmlProp->addChild('desc', $pArr[2]); $xmlProp->addChild('value', ''); } $mAppDesc->setTranslationTemplate($tmpl); $mAppDesc->setTranslationProperties($xml); $mAppDesc->commit(); } else { $error = 'Unable to load translation ' . $code . ' for package ' . $package; } if (empty($error)) { Helper::pushAlert(ALERT_SUCCESS, 'Template updated with success !'); } else { Helper::pushAlert(ALERT_ERROR, 'Something goes wrong ! Check log file in admin section.'); } if (empty($package)) { header('Location:index.php?p=' . PAGE_ID_APPS_PUB . '&n=tmpl&code=' . $code); } else { header('Location:index.php?p=' . PAGE_ID_APPS_PUB . '&app=' . Helper::getHTTPGetStringValue('app', 0) . '&code=' . $code); } break;