Example #1
0
 // Add default job
 echo ' - Fill jobs table<BR>';
 $jobM = new jobManager();
 $pluginM = new pluginManager();
 if ($jobM->getId($pluginM->getId('core'), 'translate') == 0) {
     $jobM->create($pluginM->getId('core'), 'translate');
 }
 if ($jobM->getId($pluginM->getId('core'), 'backup') == 0) {
     $jobM->create($pluginM->getId('core'), 'backup');
 }
 if ($jobM->getId($pluginM->getId('core'), 'upkeep') == 0) {
     $jobM->create($pluginM->getId('core'), 'upkeep');
 }
 // Add default parameter
 echo ' - Fill parameters table<BR>';
 $parameterM = new parameterManager();
 if ($parameterM->getId(getPluginId('core'), 'DEFAULT_GROUP') == 0) {
     $parameterM->create(getPluginId('core'), 'DEFAULT_GROUP', 'members', 'members');
 }
 if ($parameterM->getId(getPluginId('core'), 'LOCAL_REGISTER') == 0) {
     $parameterM->create(getPluginId('core'), 'LOCAL_REGISTER', 'true', 'true');
 }
 if ($parameterM->getId(getPluginId('core'), 'LOCAL_CONNEXION') == 0) {
     $parameterM->create(getPluginId('core'), 'LOCAL_CONNEXION', 'true', 'true');
 }
 if ($parameterM->getId(getPluginId('core'), 'LDAP_REGISTER') == 0) {
     $parameterM->create(getPluginId('core'), 'LDAP_REGISTER', 'false', 'false');
 }
 if ($parameterM->getId(getPluginId('core'), 'LDAP_CONNEXION') == 0) {
     $parameterM->create(getPluginId('core'), 'LDAP_CONNEXION', 'false', 'false');
 }
</button>
		';
        break;
    case 'update':
        if (isset($_GET['id'])) {
            $id = $_GET['id'];
        } elseif (isset($_POST['id'])) {
            $id = $_POST['id'];
        } else {
            // TODO ERROR
        }
        if (!isset($_POST['parameterValue'])) {
            // Todo error
            echo 'erreur value';
        } else {
            $paramM = new parameterManager();
            $paramM->update($id, $_POST['parameterValue']);
            // TODO
            echo 'Le paramètre vient d\'être modifié!';
            echo '<script type="text/javascript">dataTable.ajax.reload();</script>';
        }
        break;
        // Display the table content
    // Display the table content
    case 'jsonList':
        $dataArray['data'] = array();
        $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tparam.id AS ID,\n\t\t\t\t\t\t\t\t\tparam.id_plugin AS ID_PLUGIN,\n\t\t\t\t\t\t\t\t\tparam.name AS NAME,\n\t\t\t\t\t\t\t\t\tpg.name AS PLUGINNAME,\n\t\t\t\t\t\t\t\t\tparam.parameter_value AS PARAMETER_VALUE,\n\t\t\t\t\t\t\t\t\tparam.default_value AS DEFAULT_VALUE,\n\t\t\t\t\t\t\t\t\tparam.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tparam.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tparam.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tparam.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tparam.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tparam.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_parameters param ,\n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_plugins pg\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tparam.id_plugin=pg.id\n\t\t\t\t\t\t\t\tORDER BY pg.name ASC,param.name ASC");
        $q0->execute();
        while ($r0 = $q0->fetch(PDO::FETCH_OBJ)) {
            array_push($dataArray['data'], array("ID" => $r0->ID, "PLUGINNAME" => $r0->PLUGINNAME, "NAME" => $r0->NAME, "PARAMETER_VALUE" => $r0->PARAMETER_VALUE, "DEFAULT_VALUE" => $r0->DEFAULT_VALUE, "ACTION" => '<a href="#" data-toggle="modal" data-target="#popup" onClick="insertLoader(\'#popupContent\');setPopupTitle(\'Modifier le paramètre\');$(\'#popupContent\').load(\'index.php?m=a&g=core&p=admin_parameters&a=update_form&id=' . $r0->ID . '\');"><span class="iconastic-edit-write"> Modifier </span></a>'));
        }