Example #1
0
 public function markup()
 {
     try {
         if ($this->msg == "") {
             if (ReturnInfo::msgsToLis() != "") {
                 $this->setMsg('<ul class="sriMsgs">' . ReturnInfo::msgsToLis() . '</ul>');
             } else {
                 if (!in_array($_SERVER['REMOTE_ADDR'], unserialize(IPS_DEV))) {
                     $this->setMsg('Error no especificado, use IPS_DEV');
                 } else {
                     $this->setMsg('<pre>' . print_r(debug_backtrace(), true) . '</pre>');
                 }
             }
         }
     } catch (Exception $e) {
         $infoExc = "Excepcion de tipo: " . get_class($e) . ". Mensaje: " . $e->getMessage() . " en fichero " . $e->getFile() . " en linea " . $e->getLine();
         $this->setMsg('Error mostrando detalles de error:<br />' . $infoExc);
     }
     require str_replace('//', '/', dirname(__FILE__) . '/') . 'markup/markup.php';
 }
Example #2
0
<?php

echo "\n<!-- " . get_class() . " -->\n";
?>
<script type="text/javascript">
$(document).ready(function() {
<?php 
/* BLOQUE PARA MOSTRAR returnInfo SI EXISTE ***************************/
$sri = \Sintax\Core\ReturnInfo::ensureArray();
if (count($sri) > 0) {
    foreach ($sri as $arrInfo) {
        $title = isset($arrInfo['title']) ? $arrInfo['title'] : '';
        $msg = isset($arrInfo['msg']) ? $arrInfo['msg'] : '';
        $title = preg_replace("/\r?\n/", "\\n", addslashes($title));
        $msg = preg_replace("/\r?\n/", "\\n", addslashes($msg));
        $llamadaJsMuestraMsgModal = 'muestraMsgModal(\'' . $title . '\',\'' . $msg . '\');';
        echo $llamadaJsMuestraMsgModal;
    }
}
\Sintax\Core\ReturnInfo::clear();
?>
});
</script>
<?php 
echo "\n<!-- /" . get_class() . " -->\n";
Example #3
0
 private function CrearClase($class, $ruta)
 {
     //$ruta=RUTA_APP."server/clases/Logic/";
     $stdObjTableInfo = $this->getTableInfo($class);
     if (!file_exists($ruta . ucfirst($stdObjTableInfo->tableName) . ".php")) {
         $objCreadora = new \Creadora($ruta, ucfirst($stdObjTableInfo->tableName), $stdObjTableInfo->arrAttrs, $stdObjTableInfo->tableName, $stdObjTableInfo->arrFksFrom, $stdObjTableInfo->arrFksTo);
         //$objCreadora=new Creadora (ucfirst($tableName), $arrAttrs, $tableName);
         //$objCreadora->creadoraJS (ucfirst($tableName), $arrAttrs, $tableName);
         //$objCreadora->frmSimple($arrAttrs,ucfirst($tableName));
         $title = 'Clase ' . $class . ' creada';
         $msg = '<h2 title="' . print_r($stdObjTableInfo->arrAttrs, true) . '">Creando clase ' . ucfirst($stdObjTableInfo->tableName) . ' (tooltip)</h2>';
         $msg .= "<h3>Atributos</h3><pre>" . print_r($stdObjTableInfo->arrAttrs, true) . "</pre>";
         $msg .= "<h3>FKs</h3><pre>" . print_r($stdObjTableInfo->arrFksTo, true) . "</pre>";
         $msg .= "<hr /><hr /><hr />";
         ReturnInfo::add($msg, $title);
     } else {
         $title = 'Clase ' . $class . ' NO re-creada';
         $msg = 'La clase ya existe.';
         ReturnInfo::add($msg, $title);
     }
 }
Example #4
0
 /**
  * @covers ::msgsToLis
  * @depends testAddReturnInfo
  */
 public function testLiMsgsReturnInfo($returnInfo)
 {
     $result = ReturnInfo::msgsToLis();
     $this->assertRegExp('/.*mensaje de prueba.*/', $result, 'No se encontró la cadena añadida en "testAddReturnInfo"');
 }
Example #5
0
         $msg = $infoExc;
         $title = "Situación de excepción no controlada";
         ReturnInfo::add($msg, $title);
         $location = BASE_DIR . FILE_APP . "?page=error";
     }
     error_log('redireccionando a (' . $location . ')');
     $firephp->info($location, 'redireccionando a ($location)');
     if (in_array($_SERVER['REMOTE_ADDR'], unserialize(IPS_DEV))) {
         echo '<a href="' . $location . '">Continuar a: ' . $location . '</a>';
     } else {
         header("Location: " . $location);
     }
     break;
 case "ajax":
 case "ajaxAssoc":
     ReturnInfo::clear();
     $actionData = new \stdClass();
     if (get_class($e) == "ActionException") {
         //Excepción lanzada voluntariamente
         $actionData->exito = true;
         $actionData->data = '';
         $actionData->msg = $e->getMessage();
     } else {
         //Excepcion no controlada
         $actionData->exito = false;
         $actionData->data = '';
         $actionData->msg = $infoExc;
     }
     //header('Content-Type: application/json; charset=utf-8');
     echo json_encode($actionData);
     break;