Example #1
0
        // Finalize
    // Finalize
    case 100:
        echo '
<h3>Step 6/6 - Installation completed</h3>
	    ';
        file_put_contents('conf/version', $version);
        echo 'Please note these informations:<BR>Login: <B>admin</B><BR>Password: <B>gob</B><BR><BR><a href="index.php"><span class="icon iconfa-stackoverflow"> Installation complete</a>';
        break;
    case 23:
        echo '
<h3>Step 5/6 - Fill the auxiliary tables</h3>
	    ';
        // Add default table
        echo ' - Fill translation table<BR>';
        $transM = new translationManager();
        $pluginM = new pluginManager();
        $locM = new localeManager();
        $pgId = $pluginM->getId('core');
        $langArray = array('fr_FR' => $locM->getId('fr_FR'), 'en_US' => $locM->getId('en_US'), 'de_DE' => $locM->getId('de_DE'), 'it_IT' => $locM->getId('it_IT'));
        $index = 0;
        $comment = 'core / Visiteur';
        if ($transM->getId($pgId, $langArray['fr_FR'], $index) == 0) {
            $transM->create($pgId, $langArray['fr_FR'], $index, 'Visiteur', $comment);
        }
        if ($transM->getId($pgId, $langArray['en_US'], $index) == 0) {
            $transM->create($pgId, $langArray['en_US'], $index, 'Guest', $comment);
        }
        if ($transM->getId($pgId, $langArray['de_DE'], $index) == 0) {
            $transM->create($pgId, $langArray['de_DE'], $index, 'Besucher', $comment);
        }
     }
     if (isset($_GET['translation'])) {
         $translation = $_GET['translation'];
     } elseif (isset($_POST['translation'])) {
         $translation = $_POST['translation'];
     } else {
         // TODO ERROR
     }
     if (isset($_GET['comment'])) {
         $comment = $_GET['comment'];
     } elseif (isset($_POST['comment'])) {
         $comment = $_POST['comment'];
     } else {
         // TODO ERROR
     }
     $transM = new translationManager();
     if ($transM->getId($idPlugin, $idLocale, $indexTranslation) == 0) {
         $transM->create($idPlugin, $idLocale, $indexTranslation, $translation, $comment);
         // TODO
         echo 'La traduction vient d\'être ajoutée!';
         echo '<script type="text/javascript">dataTable.ajax.reload();</script>';
     } else {
         // TODO
         echo 'Cette traduction existe déjà.';
     }
     break;
     // Display the table content
 // Display the table content
 case 'localeJsonList':
     $dataArray['data'] = array();
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tloc.id AS ID,\n\t\t\t\t\t\t\t\t\tloc.short_name AS SHORT_NAME,\n\t\t\t\t\t\t\t\t\tloc.long_name AS LONG_NAME,\n\t\t\t\t\t\t\t\t\tloc.flag_path AS FLAG_PATH,\n\t\t\t\t\t\t\t\t\tloc.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tloc.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tloc.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tloc.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tloc.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tloc.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_locale loc\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tloc.deleted_date=0\n\t\t\t\t\t\t\t\tORDER BY loc.long_name ASC");