function windowcontent_loader()
 {
     $content = "";
     $packagecodename = $this->instanceVar->varpost("packagecodename");
     $deployed = $this->instanceVar->varpost("deployed");
     $update = $this->instanceVar->varpost("update");
     //check deployed
     if ($deployed && $update) {
         $content .= $this->instanceLang->getTranslation("Mise à jour de ce package ? ");
         $content .= "<br />";
         $content .= $this->instanceLang->getTranslation("Vérifiez les valeurs des éventuels champs de paramétrage ci-dessous (valeurs par défaut du package)");
     } else {
         if ($deployed) {
             $content .= $this->instanceLang->getTranslation("Détruire ce package ?");
         } else {
             $content .= $this->instanceLang->getTranslation("Déployer ce package ?");
         }
     }
     //check depend
     if ($this->includer->include_pratikclass("Package")) {
         $instancePackage = new PratikPackage($this->initer);
         if (!$instancePackage->checkDependAreDeployedForPackage($packagecodename)) {
             $content .= "<br /><br />" . $this->instanceLang->getTranslation("Dépendances manquantes, vérifiez :") . "<br />";
             if (file_exists("package/" . $packagecodename . "/package.descripter.php")) {
                 include "package/" . $packagecodename . "/package.descripter.php";
             }
             if (isset($descripter['depend']) && is_array($descripter['depend'])) {
                 foreach ($descripter['depend'] as $dependcour) {
                     $content .= $dependcour . " ";
                 }
             }
         }
     }
     return $content;
 }
Esempio n. 2
0
 function form_loader($deploypage)
 {
     $form = "";
     $packagecodename = $deploypage;
     //prepare form with pratikpackage
     //$this->includer->include_pratikclass("Package");
     $instancePackage = new PratikPackage();
     $preform = $instancePackage->preparePackageConfForm($packagecodename);
     //construct form
     //$this->includer->include_pratikclass("Form");
     $initer['log'] = $this->log;
     $instanceForm = new PratikForm($initer);
     $tabparam['codename'] = $packagecodename;
     $form = $instanceForm->formconverter($preform, $tabparam);
     return $form;
 }
<?php

$packagename = $_POST['packagename'];
$initer = array();
$initer['loader'] = new Load();
$instancePackage = new PratikPackage($initer);
if ($instancePackage->getPackageFromRoDKoDRoKCom($packagename)) {
    echo "Loading " . $packagename . " : done";
} else {
    echo "Error";
}
 function form_submiter()
 {
     $submitreturn = "";
     $packagecodename = $this->instanceVar->varpost("codename");
     $this->includer->include_pratikclass("Package");
     $instancePackage = new PratikPackage($this->initer);
     if ($this->instanceVar->varpost("deploysubmit")) {
         $instancePackage->deploy($packagecodename);
         $this->instanceMessage->set_message($this->instanceLang->getTranslation("Deploiement effectue"));
         if ($this->includer->include_pratikclass("Form")) {
             $instanceForm = new PratikForm($this->initer);
             $submitreturn .= $instanceForm->redirectAfterSubmiter();
         }
     } else {
         if ($this->instanceVar->varpost("destroysubmit")) {
             $instancePackage->destroy($packagecodename);
             $this->instanceMessage->set_message($this->instanceLang->getTranslation("Destruction effectuee"));
             if ($this->includer->include_pratikclass("Form")) {
                 $instanceForm = new PratikForm($this->initer);
                 $submitreturn .= $instanceForm->redirectAfterSubmiter();
             }
         } else {
             if ($this->instanceVar->varpost("updatesubmit")) {
                 $instancePackage->update($packagecodename);
                 $this->instanceMessage->set_message($this->instanceLang->getTranslation("Mise a jour effectuee"));
                 if ($this->includer->include_pratikclass("Form")) {
                     $instanceForm = new PratikForm($this->initer);
                     $submitreturn .= $instanceForm->redirectAfterSubmiter();
                 }
             } else {
                 if ($this->instanceVar->varpost("checkupdatesubmit")) {
                     $tabpackages = $this->data_loader();
                     foreach ($tabpackages as $packagecour) {
                         $packagecodename = $packagecour['nomcodepackage'];
                         $toupdate = 0;
                         if ($instancePackage->checkUpdate($packagecodename)) {
                             $toupdate = 1;
                         }
                         $this->db->query("update `package` set toupdate='" . $toupdate . "' where nomcodepackage='" . $packagecodename . "'");
                     }
                     $this->instanceMessage->set_message($this->instanceLang->getTranslation("Les dernieres mises a jours disponibles sont visibles"));
                     if ($this->includer->include_pratikclass("Form")) {
                         $instanceForm = new PratikForm($this->initer);
                         $submitreturn .= $instanceForm->redirectAfterSubmiter();
                     }
                 }
             }
         }
     }
     return $submitreturn;
 }
Esempio n. 5
0
<?php

$packagename = $_POST['packagename'];
$checklist = array();
$tabdeployedfiles = array();
//SET INITER
$initer = array();
$initer['conf'] = array();
$initer['db'] = null;
$initer['log'] = null;
//RECONSTRUCT INITER
$initer = $instanceDeploy->initerConstruct($initer);
//INIT PACKAGER
$instancePackage = new PratikPackage($initer);
//SET CONFLICT MODE
$instancePackage->setConflictResolution($instanceDeploy->conflictresolution);
//RELOAD INITER IN INSTANCE PACKAGE
$instancePackage->reloadIniter($initer);
//DEPLOY PACKAGE
$tabdeployedfiles[] = $instancePackage->deploy($packagename);
//CHECKLIST RESULT OF DEPLOYMENT OF THE PACKAGE
$checklist[] = $packagename;
$checklisttexte = "<br />";
$checklisttexte .= "<div>New package deployment :</div>";
$cptchecklist = 0;
foreach ($checklist as $checkpackage) {
    $checklisttexte .= "<div> - " . $checkpackage . "</div>";
    if ($tabdeployedfiles[$cptchecklist]) {
        foreach ($tabdeployedfiles[$cptchecklist] as $deployedfile) {
            $checklisttexte .= "<div> --- " . $deployedfile . "</div>";
        }