function getLangCodes() { global $db; $l = array(); $result = $db->query('SELECT id FROM ' . $db->pre . 'language ORDER BY language', __LINE__, __FILE__); while ($row = $db->fetch_assoc($result)) { $settings = return_array('settings', $row['id']); if (!isset($l[$settings['spellcheck_dict']])) { $l[$settings['spellcheck_dict']] = array(); } $l[$settings['spellcheck_dict']] = $row['id']; } return $l; }
</tr> <tr> <td class="ubox" colspan="2"><ul> <li><?php echo $lang->phrase('admin_packages_language_edit_translations_text_1'); ?> </li> <li><?php echo $lang->phrase('admin_packages_language_edit_translations_text_2'); ?> </li> </ul></td> </tr> <?php while ($row = $db->fetch_assoc($result)) { $phrases = return_array('modules', $row['id']); if (!isset($phrases[$phrase])) { $phrases[$phrase] = ''; } ?> <tr> <td class="mbox" width="50%"><em><?php echo $row['language']; ?> </em> <?php echo $lang->phrase('admin_packages_language_edit_translation'); ?> <br /><span class="stext"><?php echo $lang->phrase('admin_packages_language_edit_translation_text'); ?> </span></td>
echo head(); error('javascript: history.back(-1);', 'Specified package (' . $id . ') does not exist.'); } $data = $db->fetch_assoc($result); $file = $gpc->get('file', none); if (empty($file)) { $file = convert2adress($data['title']) . '.zip'; } $ini = $myini->read("modules/{$data['id']}/config.ini"); if (!isset($ini['language']) || !is_array($ini['language']) || is_array($ini['language']) && count($ini['language']) == 0) { $ini['language'] = array(); } $dirs = array(); $langcodes = getLangCodes(); foreach ($langcodes as $code => $lid) { $langdata = return_array('modules', $lid); $langdata = array_intersect_key($langdata, $ini['language']); if ($lid == $config['langdir']) { $ini['language'] = $langdata; } else { $ini['language_' . $code] = $langdata; } } $myini->write("modules/{$data['id']}/config.ini", $ini); $tpl = $gpc->get('tpl', int); $tempdir = "temp/"; $error = false; require_once 'classes/class.zip.php'; $archive = new PclZip($tempdir . $file); $v_list = $archive->create("modules/{$id}/", PCLZIP_OPT_REMOVE_PATH, "modules/{$id}/"); if ($v_list == 0) {
echo foot(); } elseif ($job == 'phrase_file_copy2') { echo head(); $dest = $gpc->get('id', int); $source = $gpc->get('dir', int); $file = $gpc->get('file', none); $encfile = base64_decode($file); $phrase = $gpc->get('phrase', str); $destpath = 'language/' . $dest . '/' . $encfile; $c = new manageconfig(); if (!file_exists($destpath)) { createParentDir($encfile, 'language/' . $dest); $c->createfile($destpath, 'lang'); } $encfile = substr($encfile, 0, strlen($encfile) - 8); $langarr = return_array($encfile, $source); if (!isset($langarr[$phrase])) { error('admin.php?action=language&job=phrase_file&file=' . $file, $lang->phrase('admin_lang_phrase_not_found')); } $c->getdata($destpath, 'lang'); $c->updateconfig($phrase, str, $langarr[$phrase]); $c->savedata(); ok('admin.php?action=language&job=phrase_file&file=' . $file, $lang->phrase('admin_lang_phrase_copied')); } elseif ($job == 'phrase_delete') { echo head(); $delete = $gpc->get('delete', arr_none); $result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language'); while ($row = $db->fetch_assoc($result)) { foreach ($delete as $base) { $base = base64_decode($base); $path = "language/{$row['id']}/{$base}";
if ($file == 'javascript') { $delobj = $scache->load('loadlanguage'); $delobj->delete(); } ok('admin.php?action=language&job=lang_array&id='.$id.'&file='.$file.'&page='.$page); } elseif ($job == 'lang_default') { echo head(); $id = $gpc->get('id', int); $c = new manageconfig(); $c->getdata(); $c->updateconfig('langdir', int, $id); $data = return_array('settings', $id); $c->updateconfig('asia_charset', str, $data['charset']); $c->savedata(); $delobj = $scache->load('loadlanguage'); $delobj->delete(); ok('admin.php?action=language&job=manage'); } elseif ($job == 'lang_edit') { echo head(); $id = $gpc->get('id', int); $myini = new INI(); // Emails $mailcategories = array(