$tableM->create('core_parameters'); } if ($tableM->getId('core_pages') == 0) { $tableM->create('core_pages'); } if ($tableM->getId('core_jobs') == 0) { $tableM->create('core_jobs'); } $init = new initialisation(); // Add default plugin echo ' - Fill plugin table<BR>'; $pluginM = new pluginManager(); if ($pluginM->getId('core') == 0) { $pluginM->create('core', $version); $plugin = new plugin($pluginM->getId('core')); $plugin->updateActivated(1); } $init = new initialisation(); // Add locale echo ' - Fill locale table<BR>'; $locM = new localeManager(); if ($locM->getId('fr_FR') == 0) { $locM->create('fr_FR', 'Français', 'icon-libflags-fr'); } if ($locM->getId('en_US') == 0) { $locM->create('en_US', 'American', 'icon-libflags-us'); } if ($locM->getId('de_DE') == 0) { $locM->create('de_DE', 'Deutsch', 'icon-libflags-de'); } if ($locM->getId('it_IT') == 0) {
if (isset($_GET['id'])) { $id = $_GET['id']; } elseif (isset($_POST['id'])) { $id = $_POST['id']; } else { // TODO ERROR } if (isset($_GET['value'])) { $value = $_GET['value']; } elseif (isset($_POST['value'])) { $value = $_POST['value']; } else { // TODO ERROR } $plugin = new plugin($id); $plugin->updateActivated($value); break; // Display the table content // Display the table content case 'setupJsonList': $dataArray['data'] = array(); $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tg.id AS ID,\n\t\t\t\t\t\t\t\t\tg.name AS NAME,\n\t\t\t\t\t\t\t\t\tg.version AS VERSION,\n\t\t\t\t\t\t\t\t\tg.activated AS ACTIVATED,\n\t\t\t\t\t\t\t\t\tg.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tg.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tg.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tg.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tg.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tg.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_plugins g\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tg.deleted_date=0\n\t\t\t\t\t\t\t\tORDER BY g.name ASC"); $q0->execute(); while ($r0 = $q0->fetch(PDO::FETCH_OBJ)) { array_push($dataArray['data'], array("ID" => $r0->ID, "NAME" => $r0->NAME, "VERSION" => $r0->VERSION, "ENABLE" => $r0->ACTIVATED, "ACTION" => '<a href="#" data-toggle="modal" data-target="#popup" onClick="insertLoader(\'#popupContent\');setPopupTitle(\'Modifier le plugin\');$(\'#popupContent\').load(\'index.php?m=a&g=core&p=admin_plugins&a=updateForm&id=' . $r0->ID . '\');"><span class="iconfa-edit-write"> Modifier</span></a>')); } $q0->closeCursor(); echo json_encode($dataArray); break; case 'availableJsonList': $dir = 'plugins';