示例#1
0
 function createDefaultButtons()
 {
     $this->buttonPane = new wPane("");
     $this->buttonPane->setCSS("padding", "5px");
     $this->buttonPane->setCSS("text-alignment", "center");
     $b1 = new wButton("Guardar", $this->buttonPane, "Guardar");
     $b2 = new wButton("Eliminar", $this->buttonPane, "Eliminar");
     $b3 = new wButton("Nuevo", $this->buttonPane, "Nuevo");
     $b1->addListener("onclick", "requestSaveForm", $this);
     $b1->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $this->id);
     $b1->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->coreObject->name);
     $b1->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->id);
     $b2->addListener("onclick", "requestDeleteForm", $this);
     $b2->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $this->id);
     $b2->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->coreObject->name);
     $b2->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->id);
     $b3->addListener("onclick", "requestNewForm", $this);
     $b3->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->id);
     $b3->Listener["onclick"]->addParameter(XAJAX_QUOTED_VALUE, $this->coreObject->name);
 }
示例#2
0
}
include 'xajax_core/xajax.inc.php';
require_once "Extensions/wGui/wUI.php";
require_once "gspanel_class.php";
$xajax = new xajax();
$FormWindow = new wWindow("FormWindow");
$FormWindow->type = WINDOW . FIXED;
$FormWindow->title = "Prueba";
$label = new wLabel("Registros de pruebas", $FormWindow, "Registros de pruebas");
$GSPAnel = new GSControlPanel($FormWindow, "Ejemplo", "example");
$aumentaButton = new wButton("aumbutton", $GSPAnel->dForm->buttonPane);
$aumentaButton->setCSS("width", "100px");
$aumentaButton->label = "Aumentar visitas";
$aumentaButton->addListener("onclick", "aumentarVisitas");
$aumentaButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->dForm->id);
$disminuyeButton = new wButton("disbutton", $GSPAnel->dForm->buttonPane);
$disminuyeButton->setCSS("width", "100px");
$disminuyeButton->label = "Diminuir visitas";
$disminuyeButton->addListener("onclick", "disminuirVisitas");
$disminuyeButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->dForm->id);
function aumentarVisitas($source, $event, $formData)
{
    global $GSPAnel;
    $objResponse = new xajaxResponse();
    $task = newObject("example", $formData["ID"]);
    if ($task->ID < 2) {
        $objResponse->script("alert('Selecciona un ejemplo primero')");
    } else {
        $valorvisitas = $task->visita + 1;
        $task->visita = $valorvisitas;
        $task->save();
    }
}
$GSPAnel->addTab("Pasos", "gsteplog", "gtasklog_id");
$initiateButton = new wButton("initbutton2", $GSPAnel->aForms[1]->buttonPane);
$initiateButton->label = "Iniciar";
$initiateButton->addListener("onclick", "iniciarPaso");
$initiateButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->aForms[1]->id);
$initiateButton = new wButton("closebutton2", $GSPAnel->aForms[1]->buttonPane);
$initiateButton->label = "Finalizar";
$initiateButton->addListener("onclick", "cerrarPaso");
$initiateButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->aForms[1]->id);
$initiateButton = new wButton("runButton", $GSPAnel->aForms[1]->buttonPane);
$initiateButton->label = "Ejecutar";
$initiateButton->addListener("onclick", "ejecutarPaso");
$initiateButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->aForms[1]->id);
$checkStatus = new wButton("checkstatus", $GSPAnel->dForm->buttonPane);
$checkStatus->label = "Estado";
$checkStatus->addListener("onclick", "checkStatus");
$checkStatus->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->dForm->id);
/* Ejecutar Paso */
function ejecutarPaso($source, $event, $formData)
{
    global $GSPAnel;
    $objResponse = new xajaxResponse();
    $task = newObject("gsteplog", $formData["ID"]);
    if ($task->ID < 2) {
        $objResponse->script("alert('Selecciona una tarea primero')");
    } else {
        $MSG = $task->run();
        $objResponse->assign("statusBox", "value", "Paso llamado a ejecucion ( {$task->ERROR} )");
        $objResponse->script("CallAllHandlers()");
$buttonHost->src = $SYS["ROOT"] . "/Apps/GlobalSche/local/Img/host.png";
$buttonHost->addListener("onclick", "activateHostWindow");
$mainPanel = new wPane("rootFakedWindow", $layout);
$mainPanel->setCSS("background-color", "white");
$mainPanel->setCSS("border", "1px");
$mainPanel->setCSS("width", "100%");
$mainPanel->setCSS("min-height", "660px");
$mainPanel->setCSS("position", "relative");
/* Tareas */
$FormWindow = new wWindow("FormWindow", $mainPanel, false);
$FormWindow->title = "Tareas Definidas";
$FormWindow->setCSS("display", "none");
$FormWindow->setCSS("width", "1100px");
$GSPAnel = new GSControlPanel($FormWindow, "Tareas", "gtask");
$GSPAnel->addTab("Pasos", "gstep", "gtask_id");
$TestTaskButton = new wButton("runTestTask", $GSPAnel->aForms[1]->buttonPane);
$TestTaskButton->label = "Probar";
$TestTaskButton->addListener("onclick", "runTestTask");
$TestTaskButton->Listener["onclick"]->addParameter(XAJAX_FORM_VALUES, $GSPAnel->aForms[1]->id);
/* Programaciones */
$FormWindowSche = new wWindow("FormWindowSche", $mainPanel, false);
$FormWindowSche->setCSS("display", "none");
$FormWindowSche->title = "Programaciones Definidas";
$FormWindowSche->setCSS("width", "1100px");
$GSPAnelSche = new GSControlPanel($FormWindowSche, "Planificaciones", "schedule");
/* Hosts */
$FormWindowHost = new wWindow("FormHost", $mainPanel, false);
$FormWindowHost->setCSS("display", "none");
$FormWindowHost->title = "Conexiones";
$FormWindowHost->setCSS("width", "1100px");
$GSPAnelScheHost = new GSControlPanel($FormWindowHost, "Conexiones", "ghost");