global $current_user, $adb;
$dl = vtlib_purify($_REQUEST['download']);
$dl = !empty($dl);
if (!$dl) {
    header('Content-Type: text/html; charset=UTF8');
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title><?php 
    echo $title;
    ?>
</title>
<style type="text/css">@import url("themes/softed/style.css");br { display: block; margin: 2px; }</style>
</head><body class=small style="font-size: 12px; margin: 2px; padding: 2px;">
<?php 
}
set_time_limit(0);
ini_set('memory_limit', '1024M');
if (empty($_REQUEST['languagecode']) or empty($_REQUEST['languagename'])) {
    echo '<br><br><b>Necessary Parameters {languagecode} or {languagename} not present</b><br>';
} else {
    $languagecode = vtlib_purify($_REQUEST['languagecode']);
    $languagename = vtlib_purify($_REQUEST['languagename']);
    Vtiger_Package::languageFromFilesystem($languagecode, $languagename, $dl);
    if ($dl) {
        die;
    }
    echo "<b>Language Package should be exported to the packages/optional directory of your install.</b><br>";
}
?>
</body>
</html>
Example #2
0
        Vtiger_Package::packageFromFilesystem($module_export, false, true);
    } else {
        $package->export($module, '', "{$module_export}.zip", true);
    }
} else {
    global $adb, $vtiger_current_version;
    $lngrs = $adb->pquery('select * from vtiger_language where prefix=?', array($module_export));
    if ($lngrs and $adb->num_rows($lngrs) == 1) {
        // we have a language file
        $lnginfo = $adb->fetch_array($lngrs);
        $lngxml = 'include/language/' . $lnginfo['prefix'] . '.manifest.xml';
        if (!file_exists($lngxml)) {
            $mnf = fopen($lngxml, 'w');
            fwrite($mnf, "<?xml version='1.0'?>\n");
            fwrite($mnf, "<module>\n");
            fwrite($mnf, "<type>language</type>\n");
            fwrite($mnf, "<name>" . $lnginfo['name'] . "</name>\n");
            fwrite($mnf, "<label>" . $lnginfo['label'] . "</label>\n");
            fwrite($mnf, "<prefix>" . $lnginfo['prefix'] . "</prefix>\n");
            fwrite($mnf, "<version>" . $vtiger_current_version . "</version>\n");
            fwrite($mnf, "<dependencies>\n");
            fwrite($mnf, "  <vtiger_version>" . $vtiger_current_version . "</vtiger_version>\n");
            fwrite($mnf, "  <vtiger_max_version>" . $vtiger_current_version . "</vtiger_max_version>\n");
            fwrite($mnf, "</dependencies>\n");
            fwrite($mnf, "</module>\n");
            fclose($mnf);
        }
        $package->languageFromFilesystem($lnginfo['prefix'], $lnginfo['name'], true);
    }
}
exit;