Exemplo n.º 1
0
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeView(sfWebRequest $request)
 {
     $dispatcher_id = $request->getParameter('dispatcher_id');
     // used to get parent id component (extjs)
     //$this->containerId = $request->getParameter('containerId');
     // load modules file of dispatcher
     if ($dispatcher_id) {
         $criteria = new Criteria();
         $criteria->add(EtvaServicePeer::ID, $dispatcher_id);
         //$criteria->add(EtvaServicePeer::NAME_TMPL,$dispatcher);
         $etva_service = EtvaServicePeer::doSelectOne($criteria);
         erro_log(print_r($etva_service, true));
         $dispatcher = $etva_service->getNameTmpl();
         $etva_server = $etva_service->getEtvaServer();
         $tmpl = $etva_server->getAgentTmpl() . '_' . $dispatcher . '_modules';
         $directory = $this->context->getConfiguration()->getTemplateDir('etasp', '_' . $tmpl . '.php');
         //echo 'dispatcher_id ---> '.$tmpl;
         if ($directory) {
             return $this->renderPartial($tmpl);
         } else {
             return $this->renderText('Template ' . $tmpl . ' not found');
         }
     } else {
         $this->etva_server = EtvaServerPeer::retrieveByPK($request->getParameter('sid'));
     }
 }
Exemplo n.º 2
0
 function cuadro_listaGrupos($arregloAtributos, $datosConfiguracion)
 {
     /**
      * Los atributos que acepta este widget son:
      * matrizItems
      * nombre
      * seleccion
      * evento
      * limitar
      * tab
      * id
      */
     include_once $datosConfiguracion["raiz_documento"] . $datosConfiguracion["clases"] . "/cadenas.class.php";
     $this->formato = new cadenas();
     $this->cuadro_registro = $arregloAtributos['matrizItems'];
     $this->cuadroCampos = count($arregloAtributos['matrizItems']);
     $this->mi_cuadro = '';
     if ($this->cuadroCampos <= 0) {
         erro_log('Imposible rescatar los datos.');
         return false;
     }
     $this->mi_cuadro .= $this->procesarAtributosCuadroLista($arregloAtributos, $datosConfiguracion);
     for ($this->grupos_contador = 0; $this->grupos_contador < $this->cuadroCampos - 1; $this->grupos_contador++) {
         $this->valor = $this->cuadro_registro[$this->grupos_contador];
         $this->mi_cuadro .= "<optgroup ";
         $this->mi_cuadro .= "label='" . $this->valor . "'>";
         // Almacena en otra variable el vector que viene en $this->cuadro_registro[$this->grupos_contador+1] para poderlo manipular
         $this->opciones = $this->cuadro_registro[$this->grupos_contador + 1];
         // scribe las opciones del select
         $this->opciones_num_campos = count($this->opciones);
         $this->opciones_contador_valor = 0;
         $this->opciones_contador_texto = 1;
         while ($this->opciones_contador_texto < $this->opciones_num_campos) {
             $this->mi_cuadro .= "<option ";
             $this->mi_cuadro .= "value=" . $this->opciones[$this->opciones_contador_valor];
             // i debe seleccionar un registro especifico
             if ($seleccion == $this->opciones[$this->opciones_contador_valor]) {
                 $this->mi_cuadro .= " selected='true'";
             }
             $this->mi_cuadro .= ">";
             $this->texto = $this->opciones[$this->opciones_contador_texto];
             // i debe limitar el texto en la visualizacion
             if ($limitar == 1) {
                 $this->texto = $this->formato->unhtmlentities(substr($this->texto, 0, 20));
             } else {
                 $this->texto = $this->formato->formatohtml($this->texto);
             }
             $this->mi_cuadro .= $this->texto;
             $this->mi_cuadro .= "</option>";
             $this->opciones_contador_valor = $this->opciones_contador_valor + 2;
             $this->opciones_contador_texto = $this->opciones_contador_texto + 2;
         }
         $this->mi_cuadro .= "</optgroup>";
         $this->grupos_contador + 1;
     }
     $this->mi_cuadro .= "</select>\n";
     return $this->mi_cuadro;
 }