Ejemplo n.º 1
0
    $id = $gpc->get('id', int);
    $result = $db->query("SELECT id, title FROM {$db->pre}packages WHERE id = '{$id}' LIMIT 1", __LINE__, __FILE__);
    if ($db->num_rows() != 1) {
        echo head();
        error('javascript: self.close();', 'Specified package (' . $id . ') does not exist.');
    }
    $data = $db->fetch_assoc($result);
    $dest = $gpc->get('language', int);
    $source = $gpc->get('dir', int);
    $file = 'modules.lng.php';
    $phrase = $gpc->get('phrase', str);
    $destpath = 'language/' . $dest . '/' . $file;
    $c = new manageconfig();
    if (!file_exists($destpath)) {
        createParentDir($file, 'language/' . $dest);
        $c->createfile($destpath, 'lang');
    }
    $file = substr($file, 0, strlen($file) - 8);
    $langarr = return_array($file, $source);
    if (!isset($langarr[$phrase])) {
        error('admin.php?action=language&job=phrase_file&file=' . $file, 'Phrase not found!');
    }
    $c->getdata($destpath, 'lang');
    $c->updateconfig($phrase, str, $langarr[$phrase]);
    $c->savedata();
    ok('admin.php?action=cms&job=package_language&id=' . $id);
} elseif ($job == 'package_language_edit') {
    echo head();
    $phrase = $gpc->get('phrase', none);
    $id = $gpc->get('id', int);
    $result = $db->query("SELECT id, title FROM {$db->pre}packages WHERE id = '{$id}' LIMIT 1", __LINE__, __FILE__);
Ejemplo n.º 2
0
   <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php 
    echo $lang->phrase('admin_lang_create');
    ?>
" /></td>
  </tr>
 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == 'phrase_add_lngfile2') {
    $dir = base64_decode($gpc->get('dir', none));
    $file = $gpc->get('file', none);
    $c = new manageconfig();
    $result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language');
    while ($row = $db->fetch_assoc($result)) {
        $c->createfile("language/{$row['id']}/{$dir}{$file}.lng.php", 'lang');
    }
    echo head();
    ok('admin.php?action=language&job=phrase_file&file=' . urlencode(base64_encode("{$dir}{$file}.lng.php")), $lang->phrase('admin_lang_langfile_created'));
} elseif ($job == 'phrase_add_mailfile') {
    echo head();
    $result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language');
    ?>
<form name="form" method="post" action="admin.php?action=language&job=phrase_add_mailfile2">
 <table class="border" border="0" cellspacing="0" cellpadding="4">
  <tr>
   <td class="obox" colspan="2"><?php 
    echo $lang->phrase('admin_lang_add_new_mail_file');
    ?>
</td>
  </tr>