Example #1
0
function polform($action, $pol_form, $submit = 'Enviar', $submit_disable = false)
{
    global $pol, $link;
    $f .= '<div class="pol_form">
<form action="/accion.php?a=' . $action . '" method="post">
<input type="hidden" name="user_ID" value="' . $pol['user_ID'] . '"  />
<ol>
';
    if ($pol_form) {
        foreach ($pol_form as $v) {
            if (!$v['size']) {
                $v['size'] = '30';
            }
            if (!$v['maxlenght']) {
                $v['maxlength'] = '255';
            }
            switch ($v['type']) {
                case 'hidden':
                    $f .= '<input type="hidden" name="' . $v['name'] . '" value="' . $v['value'] . '"  />' . "\n";
                    break;
                case 'textrico':
                    $f .= '<li><b>' . $v['nombre'] . ':</b><br />';
                    include 'inc-functions-accion.php';
                    $f .= editor_enriquecido($v['name']) . '</li>' . "\n";
                    break;
                case 'text':
                    $f .= '<li><b>' . $v['nombre'] . ':</b> ' . $v['desc'] . '<br /><input type="' . $v['type'] . '" name="' . $v['name'] . '" size="' . $v['size'] . '" maxlength="' . $v['maxlegth'] . '" /></li>' . "\n";
                    break;
                case 'select_partidos':
                    $f .= '<li><b>' . NOM_PARTIDOS . ':</b><br /><select name="partido"><option value="0">Ninguno</option>';
                    $result = mysql_query("SELECT siglas, ID FROM " . SQL . "partidos WHERE estado = 'ok' ORDER BY siglas ASC", $link);
                    while ($row = mysql_fetch_array($result)) {
                        if ($v['partido'] == strtolower($row['siglas'])) {
                            $selected = ' selected="selected"';
                        } else {
                            $selected = '';
                        }
                        $f .= '<option value="' . $row['ID'] . '"' . $selected . '>' . $row['siglas'] . '</option>';
                    }
                    $f .= '</select></li>' . "\n";
                    break;
                case 'select_nivel':
                    $f .= '<li><b>Nivel de acceso:</b> Selecciona el nivel minimo necesario para editar el documento.<br />' . form_select_nivel() . '</li>' . "\n";
                    break;
                case 'select_cat':
                    $f .= '<li><b>Categor&iacute;a:</b><br />' . form_select_cat('docs') . '</li>' . "\n";
                    break;
                case 'selectexpire':
                    $f .= '<li><b>Duraci&oacute;n:</b> tiempo de expiraci&oacute;n de la expulsi&oacute;n.<br />
<select name="expire">
<option value="60">1 minuto</option>
<option value="120">2 minutos</option>
<option value="300">5 minutos</option>
<option value="600">10 minutos</option>
<option value="900">15 minutos</option>
<option value="1800">30 minutos</option>
<option value="3600">1 hora</option>
<option value="18000">5 horas</option>
<option value="86400">1 d&iacute;a</option>
<option value="259200">3 d&iacute;as</option>
<option value="518400">6 d&iacute;as</option>
<option value="777600">9 d&iacute;as</option>
</select></li>' . "\n";
                    break;
            }
        }
    }
    if ($submit_disable == true) {
        $submit_disable = ' disabled="disabled"';
    }
    $f .= '<li><input type="submit" value="' . $submit . '"' . $submit_disable . ' /></li></ol></form></div>';
    return $f;
}
Example #2
0
            foreach (nucleo_acceso('print') as $at => $at_var) {
                $txt_li['escribir'] .= '<option value="' . $at . '"' . ($at == $r['acceso_escribir'] ? ' selected="selected"' : '') . '>' . ucfirst(str_replace("_", " ", $at)) . '</option>';
            }
            pad('create', $r['ID'], $r['text']);
            $txt .= '
<form action="http://' . strtolower($pol['pais']) . '.' . DOMAIN . '/accion.php?a=editar-documento&ID=' . $r['ID'] . '" method="POST">
<input type="hidden" name="url" value="' . $r['url'] . '"  />
<input type="hidden" name="doc_ID" value="' . $r['ID'] . '"  />

<h1 class="quitar" style="margin-bottom:6px;"><a href="/doc">Documento</a>: Editar</a></h1>

<div id="doc_opciones" style="display:none;">
<table border="0" cellpadding="9">
<tr>

<td valign="bottom">Categoría:<br />' . form_select_cat('docs', $r['cat_ID']) . '</td>

<td valign="bottom"><b>Acceso leer:</b><br />
<select name="acceso_leer">' . $txt_li['leer'] . '</select><br />
<input type="text" name="acceso_cfg_leer" size="18" maxlength="900" id="acceso_cfg_leer_var" value="' . $r['acceso_cfg_leer'] . '" />
</td>

<td valign="bottom"><b>Acceso escribir:</b><br />
<select name="acceso_escribir">' . $txt_li['escribir'] . '</select><br />
<input type="text" name="acceso_cfg_escribir" size="18" maxlength="900" id="acceso_cfg_escribir_var" value="' . $r['acceso_cfg_escribir'] . '" />
</td>

</tr>

<tr><td colspan="2" valign="top">* El texto del editor se guarda automáticamente como borrador en tiempo real. Para guardar estas opciones y hacer públicos los cambios hay que dar al botón "Publicar".<br /><br />
* <a href="/doc/' . $r['url'] . '/presentacion" target="_blank"><b>Presentación</b></a> (Funciona con HTML para <a href="https://github.com/bartaz/impress.js" target="_blank">impress.js</a>, <a href="https://github.com/bartaz/impress.js/blob/master/index.html" target="_blank">código de ejemplo</a>)</td>