private function formDataMedia($item)
 {
     $out = '';
     //$tags = show_tags($item['id'],'files');
     $out[] = '<div class="edit_box">';
     $out[] = '<div id="form_' . $item['id'] . '">';
     $f = new formInputs();
     $f->fieldLabel = 'titulo';
     $f->name = 'titulo_' . $item['id'];
     $f->value = lang($item['titulo'], true);
     //$f->useLang = true;
     //$f->containerFlagPickerStyle = 'right: 5px';
     $out[] = $f->getFormInput();
     $f = new formInputs();
     $f->fieldLabel = 'descripción';
     $f->inputType = 'textarea';
     $f->useMceEditor = false;
     $f->name = 'texto_' . $item['id'];
     $f->value = lang($item['texto'], true);
     //$f->useLang = true;
     //$f->containerFlagPickerStyle = 'right: 5px';
     $out[] = $f->getFormInput();
     $f = new formInputs();
     $f->fieldLabel = 'fuente';
     $f->name = 'fuente_' . $item['id'];
     $f->value = lang($item['fuente'], true);
     //$f->useLang = true;
     //$f->containerFlagPickerStyle = 'right: 5px';
     $out[] = $f->getFormInput();
     $f = new formInputs();
     $f->fieldLabel = 'preview';
     $f->name = 'preview_' . $item['id'];
     $f->value = lang($item['preview'], true);
     //$f->useLang = true;
     //$f->containerFlagPickerStyle = 'right: 5px';
     $out[] = $f->getFormInput();
     /*$f = new formInputs();
       $f->fieldLabel = 'Nombre del archivo';
       $f->value = $item['nombre'];
       $f->inputType = 'displayfield';
       //$f->useLang = true;
       //$f->containerFlagPickerStyle = 'right: 5px';
       $out[] = $f->getFormInput();*/
     /*$f = new formInputs();
       $f->fieldLabel = 'Etiquetas separadas por coma (tag1,tag2)';
       $f->name = 'tags_'.$item['id'];
       $f->value = html_entity_decode($tags);
       $f->inputCls = 'galeria_desc';
       $f->width = 'auto';
       $f->fieldLabelStyle = 'padding: 0;';
       //$f->useLang = true;
       //$f->containerFlagPickerStyle = 'right: 5px';
       $out[] = $f->getFormInput();*/
     $out[] = '</div>';
     $out[] = '
         <a onclick="guardarInfo(\'form_' . $item['id'] . '\',\'' . $item['tabla'] . '\',\'' . $this->type . '\');" title="' . lang('guardar') . '">
             <img class="img_boton" src="' . ICONSPATH . 'aprobar.png" alt="' . lang('guardar') . '" title="' . lang('guardar') . '"/>' . lang('guardar') . '
         </a>';
     $out[] = '
         <a onclick="closeInfoBox(\'' . $item['id'] . '\');" title="' . lang('cancelar') . '">
             <img class="img_boton" src="' . ICONSPATH . 'cross.png" alt="' . lang('cancelar') . '" title="' . lang('cancelar') . '"/>' . lang('cancelar') . '
         </a>';
     //$out[] = '<h3>Foto Original</h3>';
     //$out[] = '<p>'.ROOT.'admin/_uploads/'.$table.'/'.substr($item['nombre'],6,strlen($item['nombre'])).' <span style="color:#f00">Convertido, Borrado!</span></p>';
     // VIDEO DATA
     //$out[] = '<h3>Video Original</h3>';
     //$out[] = '<p>'.ROOT.'admin/_uploads/'.$item['table'].'/'.substr($item['nombre'],6,strlen($item['nombre'])).' <span style="color:#f00">Convertido, Borrado!</span></p>';
     //$out[] = '<h3>Video Convertido</h3>';
     //$out[] = '<p><a href="'.ROOT.'admin/'.$video.'">'.ROOT.'admin/'.$video.'</a></p>';
     //$out[] = '<h3>Video Preview (imagen jpg)</h3>';
     //$out[] = '<p><a href="'.ROOT.'admin/'.$preview.'">'.ROOT.'admin/'.$preview.'</a></p>';
     //$out[] = '<h3>+ Info</h3>';
     //$out[] = get_data_video($item['id'],$item['item_id'],$item['table'],$video);
     $out[] = '</div>';
     return join('', $out);
 }
Example #2
0
<?php

$out[] = '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" enctype="multipart/form-data" name="formulario" id="formulario">';
$this->moduleCfg['form']['fields'] = array(array('name' => 'googleSiteVerification'), array('name' => 'googleAnalytcsId'), array('name' => 'title'), array('name' => 'description'), array('name' => 'keywords'));
// INSTANCIA FORM INPUTS SEGUN CONFIG DEL MODULO
foreach (msort($this->moduleCfg['form']['fields'], 'name') as $campo) {
    $formInput = new formInputs();
    $formInput->tabla = $this->moduleCfg['general']['table'];
    if ($this->id) {
        if ($this->values[$campo['name']]) {
            $formInput->value = $this->values[$campo['name']];
        }
    }
    foreach ($campo as $k => $v) {
        if ($this->values[$campo['name']]) {
            $formInput->value = $this->values[$campo['name']];
        }
        if ($v || $v === false) {
            $formInput->{$k} = $v;
        }
    }
    $out[] = $formInput->getFormInput();
}
$out[] = '</form>';
Example #3
0
 public function getForm()
 {
     // VALUES FOR CREATE
     if (!$this->id) {
         if (isset($this->moduleCfg['lists']['categories'])) {
             $this->catId = $_GET['cat_id'];
             $this->values[$this->moduleCfg['lists']['items']['query']['campoCat']] = $this->catId;
         }
         if (isset($this->moduleCfg['lists']['subCategories'])) {
             $this->subcatId = $_GET['subcat_id'];
             $this->values[$this->moduleCfg['lists']['items']['query']['campoSubCat']] = $this->subcatId;
         }
         $this->mode = 'insert';
     }
     // VALUES FOR UPDATE
     if ($this->id) {
         $this->values = a("SELECT * " . $this->moduleCfg['lists']['items']['query']['selectItem'] . " FROM " . $this->moduleCfg['general']['table'] . " WHERE id=" . $this->id);
         if (isset($this->moduleCfg['lists']['categories'])) {
             $this->catId = $this->values[$this->moduleCfg['lists']['items']['query']['campoCat']];
         }
         if (isset($this->moduleCfg['lists']['subCategories'])) {
             $this->subcatId = $this->values[$this->moduleCfg['lists']['items']['query']['campoSubCat']];
         }
         $this->mode = 'update';
     }
     // IF FORM VALID AND POST SUBMITED PROCESS
     if ($this->formIsValid($this->moduleCfg['form']['fields']) && isset($_POST['submitted']) && $_POST['submitted'] == 1) {
         // SQL INSERT (NUEVO)
         if ($this->mode == 'insert') {
             if ($this->moduleCfg['general']['createTable'] && $this->config['createModuleTables']) {
                 $createTable = makeCreateTableQuery($this->moduleCfg['form']['fields'], $this->moduleCfg['general']['executeQuerys'], $this->moduleCfg['general']['table']);
             }
             $creado = makeInsertQuery($this->moduleCfg['form']['fields'], $this->moduleCfg['general']['executeQuerys'], $this->moduleCfg['general']['table']);
             $this->id = mysql_insert_id();
             if (isset($_POST['tags'])) {
                 add_tags($_POST['tags'], $this->id, $this->moduleCfg['general']['table'], $this->moduleCfg['general']['table'], $this->moduleCfg['general']['table']);
             }
         }
         // SQL UPDATE (EDIT)
         if ($this->mode == 'update') {
             $editado = makeUpdateQuery($this->moduleCfg['form']['fields'], $this->id, $this->moduleCfg['general']['executeQuerys'], $this->moduleCfg['general']['table']);
             if (isset($_POST['tags'])) {
                 add_tags($_POST['tags'], $this->id, $this->moduleCfg['general']['table'], $this->moduleCfg['general']['table'], $this->moduleCfg['general']['table']);
             }
         }
         // UPLOAD
         if (isset($this->moduleCfg['form']['uploads'])) {
             foreach ($this->moduleCfg['form']['uploads'] as $k => $v) {
                 if (is_array($v) && !empty($v)) {
                     $upload = new Upload();
                     $upload->campo = $k;
                     $upload->id = $this->id;
                     $upload->tabla = $this->moduleCfg['general']['table'];
                     $upload->cat_id = $this->catId;
                     $upload->subcat_id = $this->subcatId;
                     $upload->titulo = $_POST[$this->moduleCfg['form']['uploads']['defaultUploadTitleField']];
                     foreach ($v as $paramK => $paramV) {
                         $upload->{$paramK} = $paramV;
                     }
                     if (isset($this->moduleCfg['form']['uploads']['removeFilesBeforeUpload'])) {
                         $upload->removeFilesBeforeUpload = $this->moduleCfg['form']['uploads']['removeFilesBeforeUpload'];
                     }
                     $upload->doUpload();
                 }
             }
         }
         // REDIRECT TO LIST
         if ($this->moduleCfg['form']['general']['redirectToList']) {
             $cat = 0;
             $subcat = 0;
             if (isset($this->moduleCfg['lists']['categories']['whereCountItems'])) {
                 if (isset($_POST[$this->moduleCfg['lists']['categories']['whereCountItems']])) {
                     $cat = $_POST[$this->moduleCfg['lists']['categories']['whereCountItems']];
                 }
             }
             if (isset($this->moduleCfg['lists']['subCategories']['whereCountItems'])) {
                 if (isset($_POST[$this->moduleCfg['lists']['subCategories']['whereCountItems']])) {
                     $subcat = $_POST[$this->moduleCfg['lists']['subCategories']['whereCountItems']];
                 }
             }
             if ($this->mode == 'insert' || $this->mode == 'update') {
                 header('Location: ?m=' . $_GET['m'] . '&action=list&cat_id=' . $cat . '&subcat_id=' . $subcat);
             }
         } else {
             // REDIRECCION NUEVO
             if ($this->mode == 'insert') {
                 header('Location: ?m=' . $_GET['m'] . '&action=edit&id=' . $this->id . '&created=' . $creado);
             }
             // REDIRECCION EDIT
             if ($this->mode == 'update') {
                 header('Location: ?m=' . $_GET['m'] . '&action=edit&id=' . $this->id . '&edited=' . $editado);
             }
         }
     }
     $out[] = $this->mainBlocks->getHead();
     $out[] = $this->mainBlocks->getMenu();
     // RIGHT
     $wCls = isset($this->moduleCfg['form']['uploads']) ? '' : '';
     // forceWidthTo40
     $out[] = '
     <div id="right" class="right_' . $this->moduleCfg['general']['table'] . ' ' . $wCls . '">
     ';
     // rightPadding
     $out[] = '
         <div class="rightPadding">
         ';
     // BREAD
     $bread = new Bread();
     $bread->catId = $this->catId;
     if (isset($this->moduleCfg['lists']['categories'])) {
         $bread->categories = $this->moduleCfg['lists']['categories'];
     }
     $bread->subcatId = $this->subcatId;
     if (isset($this->moduleCfg['lists']['subcategories'])) {
         $bread->subcategories = $this->moduleCfg['lists']['subcategories'];
     }
     $bread->showAll = $this->showAll;
     $out[] = $bread->getBread();
     // ERRORS TBAR IF SUBMIT AND ERRORS FOUND
     $out[] = $this->getErrorsTbar();
     // IF CREADO O EDITADO
     $out[] = $this->getStatusTbar();
     // CREAR FORM
     if ($_GET['action'] == 'create') {
         $out[] = '<form action="?m=' . $_GET['m'] . '&amp;action=create&amp;cat_id=' . $this->catId . '&amp;subcat_id=' . $this->subcatId . '" method="post" enctype="multipart/form-data" name="formulario" id="formulario">';
     }
     // EDITAR FORM
     if ($_GET['action'] == 'edit') {
         $out[] = '<form action="?m=' . $_GET['m'] . '&amp;action=edit&amp;id=' . $this->id . '" method="post" enctype="multipart/form-data" name="formulario" id="formulario">';
     }
     // COL-1 || MAIN
     if (isset($this->moduleCfg['form']['uploads'])) {
         $out[] = '<div id="col-1">';
     } else {
         $out[] = '<div id="main">';
     }
     $out[] = '<div class="boxContainer">';
     // HIDDEN SUBMIT FIELD
     $out[] = '<input type="hidden" name="submitted" value="1" />';
     // INSTANCIA FORM INPUTS SEGUN CONFIG DEL MODULO
     foreach ($this->moduleCfg['form']['fields'] as $campo) {
         $formInput = new formInputs();
         $formInput->tabla = $this->moduleCfg['general']['table'];
         if ($this->id) {
             $formInput->item_id = $this->id;
             if ($this->values[$campo['name']]) {
                 $formInput->value = $this->values[$campo['name']];
             }
         }
         foreach ($campo as $k => $v) {
             if (isset($this->values[$campo['name']])) {
                 $formInput->value = $this->values[$campo['name']];
             }
             if ($v || $v === false) {
                 $formInput->{$k} = $v;
             }
         }
         $out[] = $formInput->getFormInput();
     }
     // SUBMIT BTN
     if ($this->moduleCfg['form']['general']['canSave']) {
         $f = new formInputs();
         $f->fieldLabel = 'Guardar';
         $f->inputType = 'submit';
         $f->name = 'submit';
         $f->submitFormId = 'formulario';
         $out[] = $f->getFormInput();
     }
     $out[] = '</div>';
     $out[] = '</div>';
     // COL-2
     if (isset($this->moduleCfg['form']['uploads'])) {
         $out[] = '<div id="col-2">';
         foreach ($this->moduleCfg['form']['uploads'] as $k => $v) {
             if (is_array($v['showMedia']) && !empty($v['showMedia'])) {
                 $out[] = '<div class="boxContainer">';
                 if ($this->id) {
                     $ShowMedia = new ShowMedia();
                     $ShowMedia->itemId = $this->id;
                     $ShowMedia->type = $k;
                     $ShowMedia->table = $this->moduleCfg['general']['table'];
                     foreach ($v['showMedia'] as $paramK => $paramV) {
                         $ShowMedia->{$paramK} = $paramV;
                     }
                 }
                 $formInput = new formInputs();
                 $formInput->fieldLabel = $v['uploadLabel'] ? $v['uploadLabel'] : lang('adjuntar ' . $k);
                 $formInput->name = $k;
                 $formInput->inputType = 'file';
                 $formInput->maxFiles = $v['maxFiles'] ? $v['maxFiles'] : 0;
                 $formInput->acceptedExtencions = isset($v['acceptedExtencions']) ? $v['acceptedExtencions'] : array('jpg', 'gif', 'png');
                 if ($this->id) {
                     $formInput->afterFieldHtml = $ShowMedia->getMediaOut();
                     $formInput->disabled = $ShowMedia->getCant() == $v['maxFiles'] ? true : false;
                 }
                 if ($v['showMedia']['fileFieldCfg']) {
                     foreach ($v['showMedia']['fileFieldCfg'] as $paramY => $paramZ) {
                         $formInput->{$paramY} = $paramZ;
                     }
                 }
                 $formInput->tabla = $this->moduleCfg['general']['table'];
                 $out[] = $formInput->getFormInput();
                 $out[] = '</div>';
             }
         }
         $out[] = '</div>';
     }
     $out[] = '</form>';
     // EO rightPadding
     $out[] = '
         </div>
         ';
     // EO RIGHT
     $out[] = '
     </div>
     ';
     $out[] = $this->mainBlocks->getFooter();
     return join("\n", $out);
 }
 public function getFrontBoxLogoutForm()
 {
     $out[] = '
     <form action="logout.php" id="loginForm" name="formulario" method="post">
     ';
     $f = new formInputs();
     $f->fieldLabel = 'Salir';
     $f->inputType = 'submit';
     $f->name = 'submit';
     $f->submitPopUp = false;
     $out[] = $f->getFormInput();
     $out[] = '
     </form>
     ';
     return join("\n", $out);
 }
Example #5
0
$displayField = 'titulo';
$valueField = 'id';
$selectFunction = 'if(this.value) { redir(\'mails/addByEmailIdAndItemIdToAllUsers.php?emailId=' . $m['id'] . '&amp;table=' . $dbTable . '&amp;itemId=\'+this.value) }';
$out[] = '<div class="widgetBox">';
$out[] = '<div class="innerPadding">';
$mq = q("select * from mail_queue_emails order by id");
$out[] = '<h2>Add Item To Queue Using Email Template</h2>';
$out[] = '<p>Item: ' . utf8_ucfirst($dbTable) . '</p>';
$out[] = '<p>To: All Users</p>';
if ($mq) {
    foreach ($mq as $m) {
        $out[] = '<div class="widgetRow">';
        $out[] = '<p><strong>Email Name: </strong><a class="linkGray" href="?m=emails&amp;action=edit&amp;id=' . $m['id'] . '"><strong>' . $m['email_name'] . '</strong></a></p>';
        $out[] = '<p><strong>Subject: </strong>' . $m['subject_line'] . '</p>';
        $out[] = '<p><strong>From: </strong>"' . $m['email_from_name'] . '" &lt;' . $m['email_from'] . '&gt;</p>';
        $f = new formInputs();
        $f->name = $dbTable;
        $f->containerStyle = 'padding-top: 3px; margin-bottom: 0;';
        $f->inputType = 'select';
        $f->tableFrom = $dbTable;
        $f->tableOrder = $tableOrder;
        $f->displayField = $displayField;
        $f->valueField = $valueField;
        $f->function = $selectFunction;
        $f->labelWrapperCls = 'rounded5top';
        $f->inputWrapperCls = 'rounded5bottom';
        $out[] = $f->getFormInput();
        $out[] = '</div>';
    }
}
$out[] = '</div>';
Example #6
0
$f->name = 'material';
$f->inputType = 'select';
$f->array = array(array('key' => 'Polietileno baja densidad', 'value' => lang('Polietileno baja densidad')), array('key' => 'Polietileno alta densidad', 'value' => lang('Polietileno alta densidad')), array('key' => 'Polipropileno', 'value' => lang('Polipropileno')));
$f->valueField = 'key';
$f->displayField = 'value';
$f->inputWrapperCls = 'rounded5';
echo $f->getFormInput();
$f = new formInputs();
$f->name = 'otros';
$f->inputType = 'textarea';
$f->inputStyle = "height: 550px;";
$f->value = "\r\nCantidad: \n\r\nColor Material: \n\r\nAncho: \n\r\nLargo: \n\r\nEspesor (Micronaje): \n\r\nTubular: \n\r\nFuelle: \n\r\nSolapa (en caso que lleve solapa aclarar cuantos cms): \n\r\nImpresión (aclarar SI o NO): \n\r\nTexto (aclarar en caso de requerir impresión): \n\r\nColores (aclarar en caso de requerir impresión): \n\r\n1 cara ó ambas caras: \n\r\nCorrida (indicar cada cuantos centímetros): \n\r\nCentrada (indicar ubicación): \n\r\n";
$f->inputWrapperCls = 'rounded5';
$f->useMceEditor = false;
echo $f->getFormInput();
$f = new formInputs();
$f->fieldLabel = 'Enviar';
$f->inputType = 'submit';
$f->name = 'submit';
$f->submitIcon = false;
$f->submitPopUp = false;
$f->submitMode = 'contacto';
$f->submitValidate = true;
$f->submitFormId = 'contacto';
echo $f->getFormInput();
echo '</div>';
?>
                    
                </form>
                
            </div>
Example #7
0
    <?php 
$menu = array(array('link' => 'index.php', 'title' => 'HOME', 'cls' => 'opt1'), array('link' => 'la-empresa.php', 'title' => 'LA EMPRESA', 'cls' => 'opt2'), array('link' => 'productos.php', 'title' => 'PRODUCTOS', 'cls' => 'opt3'), array('link' => 'noticias.php', 'title' => 'NOTICIAS', 'cls' => 'opt4'), array('link' => 'contacto.php', 'title' => 'CONTACTO', 'cls' => 'opt5'));
if ($menu) {
    $out[] = '<ul class="menu">';
    $i = 1;
    foreach ($menu as $m) {
        $out[] = '<li class="' . $m['cls'] . '"><a href="' . $m['link'] . '" title="' . $m['title'] . '" class="' . $m['cls'] . '">' . $m['title'] . '</a></li>';
        $i++;
    }
    $f = new formInputs();
    $f->name = 'buscar';
    $f->function = 'busqueda();';
    $out[] = '<li class="opt6">' . $f->getFormInput() . '<a class="blurHandler" title=""></a></li>';
    $out[] = '</ul>';
    $out[] = '<div id="buscador" style="display: none;">';
    $out[] = '</div>';
    echo join("\n", $out);
}