break; //////// GET TMPL EDITOR //////// GET TMPL EDITOR case 'getTmplEditor': require_once BASE_PATH . 'pages/apps_pub_tmpl_editor_dialog.php'; break; //////// UPDATE TEMPLATE //////// UPDATE TEMPLATE case 'updateTemplate': require_once BASE_PATH . 'includes/appdesc.class.php'; $error = null; $package = $_POST['package']; $tmpl = $_POST['template']; $code = $_POST['code']; $isTmpl = empty($package) ? true : false; $mAppDesc = new ApplicationDesc($package); // create a new translation OR load translation if (empty($code) && $mAppDesc->createEmptyTranslation($_POST['lang-code'], $_POST['lang-name']) || $mAppDesc->loadTranslation($code, $isTmpl)) { $tmpArr = explode('{', $tmpl); $properties = array(); $html = ''; foreach ($tmpArr as $r) { if (empty($r)) { continue; } $tmp = explode('}', $r); $properties[] = $tmp[0]; } $xml = new SimpleXMLElement('<description></description>'); $xml->addAttribute(XML_ATTR_LANGUAGE, $mAppDesc->getTranslationName()); $xml->addAttribute(XML_ATTR_LANGUAGE_CODE, $code);
/** * Copyright (c) 2013 EIRL DEVAUX J. - Medialoha. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * EIRL DEVAUX J. - Medialoha - initial API and implementation */ require_once BASE_PATH . 'includes/appdesc.class.php'; $package = isset($_REQUEST['package']) ? $_REQUEST['package'] : ''; $code = $_POST['code']; $isNew = empty($code); $isTmpl = empty($package) ? true : false; $mAppDesc = new ApplicationDesc($package); if (!$isNew) { $mAppDesc->loadTranslation($code, $isTmpl); } ?> <div class="modal-header"> <h3><?php echo (empty($package) ? "Template" : $package) . ' ' . $code; ?> </h3> </div> <div class="modal-body" style="clear:both; height:800px; max-height:620px;" > <div class="row" style="padding:0px 20px 15px 20px;" > <p>Property format : <b>{</b> key <b>:</b> type <b>:</b> desc <b>}</b></p> <p style="padding-left:10px;" >• <em>type = { text | list | input-small | input-medium | input-large | input-xlarge | input-xxlarge }</em></p>