Example #1
0
 /**
  * Gets the actual redirect url
  * @return string Gets the url after post
  */
 private function RedirectUrl()
 {
     if ($this->logout->GetNextUrl()) {
         return FrontendRouter::Url($this->logout->GetNextUrl());
     }
     return CurrentUrl();
 }
Example #2
0
function BuildPath($FolderNavigator, $FilesPerPage = "10")
{
    $s = "";
    for ($i = 0; $i < count($FolderNavigator); $i++) {
        $s .= "/<a href=\"" . CurrentUrl() . "?fpp=" . $FilesPerPage . "&did=" . $FolderNavigator[$i][1] . "\">" . $FolderNavigator[$i][0] . "</a>";
    }
    return $s;
}
function render_admin_listarusuarios($param)
{
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    $tblusuarios = GetTable('usuarios');
    $colsusuarios = GetCols('usuarios');
    $sql = "Select * from {$tblusuarios}";
    $Cols = array(array("dbname" => $colsusuarios['uid'], "label" => "id", "width" => "45px", "sortable" => false), array("dbname" => $colsusuarios['uname'], "label" => "Usuario", "width" => "80px", "sortable" => false), array("dbname" => $colsusuarios['nombre'], "label" => "Nombre", "width" => "100px", "sortable" => true), array("dbname" => $colsusuarios['apellidos'], "label" => "Apellidos", "width" => "120px", "sortable" => true), array("dbname" => $colsusuarios['nivel'], "label" => "Nivel", "width" => "45px", "sortable" => false));
    $opciones = array(array("funcion" => "cbUserPromote", "valor" => "{$colsusuarios['nivel']}"), array("funcion" => "cbUserEdit", "valor" => "{$colsusuarios['uid']}"), array("funcion" => "cbUserDelete", "valor" => "{$colsusuarios['uid']}"), array("funcion" => "cbUserMasInfo", "valor" => "{$colsusuarios['uid']}"));
    $acciones = array(array('funcion' => "cbUserAdmAdd"));
    $userList = new Lister("admUsuarios", $sql, 25, $Cols, $colsusuarios['uid'], $opciones, "dg-admusers.css");
    $userList->table = "{$table}";
    $userList->where = "";
    $userList->GeneralActions = $acciones;
    if ($sf != "") {
        $userList->SetSort($sf, $up);
    }
    if ($start != "") {
        $userList->SetStart($start);
    }
    $listado = $userList->render();
    $resultado = SmartyInit();
    $plantilla = "usuarios/listusers.tpl";
    $resultado->assign("listado", $listado);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}
Example #4
0
function GenerateHomeLink()
{
    $homeLink = parse_url(CurrentUrl());
    $url = "http://" . $homeLink['host'] . $homeLink['path'];
    if (strpos($url, 'index.php') !== false) {
        $url = str_replace("index.php", "", $url);
    }
    return $url;
}
function render_admin_listarsecciones($param)
{
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    $tbl = GetTable('secciones');
    $col = GetCols('secciones');
    $sql = "Select * from {$tbl}";
    $Cols = array(array("dbname" => $col['sid'], "label" => "id", "width" => "45px", "sortable" => false), array("dbname" => $col['nombre'], "label" => "Nombre", "width" => "200px", "sortable" => true));
    $opciones = array(array("funcion" => "cbSeccionEdit", "valor" => "{$col['sid']}"), array("funcion" => "cbSeccionDelete", "valor" => "{$col['sid']}"));
    $acciones = array(array('funcion' => "cbSeccionAdmAdd"));
    $archivList = new Lister("admSecciones", $sql, 25, $Cols, $col['sid'], $opciones, "dg-admsecciones.css");
    $archivList->table = "{$tbl}";
    $archivList->where = "";
    $archivList->GeneralActions = $acciones;
    if ($sf != "") {
        $archivList->SetSort($sf, $up);
    }
    if ($start != "") {
        $archivList->SetStart($start);
    }
    $listado = $archivList->render();
    if ($listado === null || trim($listado) == "") {
        $aux = cbSeccionAdmAdd();
        $listado = "<br><center><a link href='{$aux['url']}'>{$aux['etiqueta']}</a></center>";
    }
    $resultado = SmartyInit();
    $plantilla = "seccion/listarseccion.tpl";
    $resultado->assign("listado", $listado);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}
 function renderPagerRow()
 {
     $row = SmartyInit();
     $CurrentUrl = CurrentUrl();
     if (!(strpos($CurrentUrl, "start=") === false)) {
         $CurrentUrl = substr($CurrentUrl, 0, strpos($CurrentUrl, "start=") - 1);
     }
     if (strpos($CurrentUrl, "?") === false) {
         $CurrentUrl .= "?";
     } else {
         if (strpos($CurrentUrl, "&", strlen($CurrentUrl) - 1) === false) {
             $CurrentUrl .= "&";
         }
     }
     list($db) = Getdb();
     $rs = $db->Execute($this->sql);
     if (!($rs === false)) {
         $this->total = $rs->PO_RecordCount($this->table, $this->where);
     } else {
         return null;
     }
     $perpage = $this->rows;
     if ($perpage >= $this->total) {
         $PageArray[] = array('Page' => 1, 'start' => 0, 'Selected' => 1);
     } else {
         if ($start <= 0) {
             $start = 1;
         }
         $TotalPaginas = 1 + floor($this->total / $perpage);
         $PaginaActual = 1 + floor($this->start / $perpage);
         $PageArray = array();
         for ($paginas = 1; $paginas < $TotalPaginas + 1; $paginas++) {
             $PageArray[] = array('Page' => $paginas, 'start' => $paginas > 1 ? ($paginas - 1) * $perpage : 0, 'Selected' => $paginas == $PaginaActual ? 1 : 0);
         }
     }
     $row->assign('Paginas', $PageArray);
     $row->assign('baseurl', $CurrentUrl);
     $Pager = $row->fetch("freeLister_pager.tpl");
     return $Pager;
 }
Example #7
0
 function renderPagerRow2()
 {
     $row = SmartyInit();
     $row->assign('titles', $this->ColsToShow);
     $row->assign('ordenado', $this->orden);
     $CurrentUrl = CurrentUrl();
     if (!(strpos($CurrentUrl, "start=") === false)) {
         $CurrentUrl = substr($CurrentUrl, 0, strpos($CurrentUrl, "start=") - 1);
     }
     if (strpos($CurrentUrl, "?") === false) {
         $CurrentUrl .= "?";
     } else {
         if (strpos($CurrentUrl, "&", strlen($CurrentUrl) - 1) === false) {
             $CurrentUrl .= "&";
         }
     }
     if (isset($this->sql) && count($this->sql) >= 0) {
         $this->total = count($this->sql);
     } else {
         return null;
     }
     $perpage = $this->rows;
     if ($perpage >= $this->total) {
         $PageArray[] = array('Page' => 1, 'start' => 0, 'Selected' => 1);
     } else {
         if ($start <= 0) {
             $start = 1;
         }
         $TotalPaginas = 1 + floor($this->total / $perpage);
         $PaginaActual = 1 + floor($this->start / $perpage);
         $PageArray = array();
         for ($paginas = 1; $paginas < $TotalPaginas + 1; $paginas++) {
             $PageArray[] = array('Page' => $paginas, 'start' => $paginas > 1 ? ($paginas - 1) * $perpage : 0, 'Selected' => $paginas == $PaginaActual ? 1 : 0);
         }
     }
     $row->assign('Paginas', $PageArray);
     $row->assign('baseurl', $CurrentUrl);
     $row->assign('Cols', $this->cols);
     $Pager = $row->fetch("lister_pager.tpl");
     return $Pager;
 }
function render_admin_verrsc($param)
{
    $did = $param['did'];
    if ($did < 1) {
        $did = vwSessionGetVar('udid');
    } else {
        vwSessionSetVar('udid', $did);
    }
    if ($did < 1) {
        header('Location: index.php');
        die;
    }
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    $tbl = GetTable('recursos');
    $col = GetCols('recursos');
    $sql = "Select * from {$tbl} where {$col['did']}={$did}";
    $Cols = array(array("dbname" => $col['rid'], "label" => "id", "width" => "45px", "sortable" => true), array("dbname" => $col['titulo'], "label" => "T&itulo", "width" => "200px", "sortable" => true), array("dbname" => $col['url'], "label" => "URL", "width" => "200px", "sortable" => false), array("dbname" => $col['archivo'], 'label' => "Archivo", "width" => "100px", "sortable" => false));
    $opciones = array(array("funcion" => "cbRscEdit", "valor" => "{$col['rid']}"), array("funcion" => "cbRscDelete", "valor" => "{$col['rid']}"));
    $acciones = array(array('funcion' => "cbRscAdmAdd"));
    $archivList = new Lister("admRecursos", $sql, 25, $Cols, $col['rid'], $opciones, "dg-admrecursos.css");
    $archivList->table = "{$tbl}";
    $archivList->where = "{$col['did']}={$did}";
    $archivList->GeneralActions = $acciones;
    if ($sf != "") {
        $archivList->SetSort($sf, $up);
    }
    if ($start != "") {
        $archivList->SetStart($start);
    }
    $listado = $archivList->render();
    if ($listado === null || trim($listado) == "") {
        $aux = cbSeccionAdmAdd();
        $listado = "<br><center><a link href='{$aux['url']}'>{$aux['etiqueta']}</a></center>";
    }
    $resultado = SmartyInit();
    $plantilla = "document/listarsc.tpl";
    $resultado->assign("listado", $listado);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}
function render_admin_listardocumentos($param)
{
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    $tbl = GetTable('documentos');
    $col = GetCols('documentos');
    $sql = "Select * from {$tbl}";
    $Cols = array(array("dbname" => $col['did'], "label" => "id", "width" => "45px", "sortable" => true), array("dbname" => $col['aid'], "label" => "Archivo", "width" => "70px", "sortable" => true, "dropdown" => true, "dropcall" => array("funcion" => "cbzArchivos", "valor" => $col['aid'])), array("dbname" => $col['sid'], "label" => "Secci&oacute;n", "width" => "100px", "sortable" => false, "dropdown" => true, "dropcall" => array("funcion" => "cbzSecciones", "valor" => $col['sid'])), array("dbname" => $col['signatura'], "label" => "Signatura", "width" => "70px", "sortable" => true), array("dbname" => $col['folios'], "label" => "Folios", "width" => "70px", "sortable" => "false"));
    $opciones = array(array("funcion" => "cbDocumentoEdit", "valor" => "{$col['did']}"), array("funcion" => "cbDocumentoDelete", "valor" => "{$col['did']}"), array("funcion" => "cbDocumentoSeeRsc", "valor" => "{$col['did']}"), array("funcion" => "cbDocumentoAddRsc", "valor" => "{$col['did']}"));
    $acciones = array(array('funcion' => "cbDocumentoAdmAdd"));
    $documentList = new Lister("admDocumentos", $sql, 25, $Cols, $col['did'], $opciones, "dg-admdocumentos.css");
    $documentList->table = "{$tbl}";
    $documentList->where = "";
    $documentList->GeneralActions = $acciones;
    if ($sf != "") {
        $documentList->SetSort($sf, $up);
    }
    if ($start != "") {
        $documentList->SetStart($start);
    }
    $listado = $documentList->render();
    if ($listado === null || trim($listado) == "") {
        $aux = cbDocumentoAdmAdd();
        $listado = "<br><center><a link href='{$aux['url']}'>{$aux['etiqueta']}</a></center>";
    }
    $resultado = SmartyInit();
    $plantilla = "document/listardocument.tpl";
    $resultado->assign("listado", $listado);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}
Example #10
0
$Menu .= FormatMenuItem("NavNextItem", $Params, "Next", "Next", $NextItem);
$Params->Add("smf", 1);
$Params->Set("fid", $NextItem);
$Menu .= FormatMenuItem("NavNextItemGroup", $Params, "&gt;&gt;", "Next " . $Config->FilesPerPage, $NextItem);
$Params->Remove("smf");
$Params->Set("fid", $LastItem);
$Menu .= FormatMenuItem("NavLastItem", $Params, "&gt;|", "Last", $LastItem);
// ----------------------------------
// 7. WRITE THE REMAINDER OF THE PAGE
// ----------------------------------
echo "<ul class=\"NavMenu MainMenu\">" . $Menu . "</ul>\r\n";
echo "<div class=\"DisplayContainer\">\r\n";
// If a file has not been requested, write out the introductory paragraph (if there is one)
if ($Config->FileID == 0 && $Config->PageIntroduction != "" && ($Config->CurrentWorkingDirectory == $Config->CurrentBrowsingDirectory || $Config->CurrentWorkingDirectory != $Config->CurrentBrowsingDirectory && $Config->UsePageIntroductionInSubFolders)) {
    echo "<div class=\"Introduction\">" . $Config->PageIntroduction . "</div>\r\n";
}
// Write out the selected files
echo $FileDisplay;
echo "</div>\r\n" . "<ul class=\"NavMenu SubMenu\">\r\n" . $Menu . "</ul>\r\n" . "<div class=\"ListContainer\">\r\n";
// Write out the file/folder listing
if (trim($FileList) == "") {
    echo "<div class=\"ListEmpty\">No files or folders could be found.</div>\r\n";
} else {
    echo $FileList;
}
// Write out the page footer
echo "</div>\r\n" . "<div class=\"Foot\">\r\n         <form name=\"frmPager\" action=\"" . CurrentUrl() . "\" method=\"get\">";
$p = new Parameters();
$p->DefineCollection($_GET);
$p->Remove("fpp");
echo $p->GetHiddenInputs() . "<div class=\"Pager\">\r\n            <div class=\"PagerLabel\">Files/Page: </div>\r\n            <div class=\"PagerValue\"><input type=\"text\" name=\"fpp\" class=\"PagerInput\" value=\"" . $Config->FilesPerPage . "\" onchange=\"document.frmPager.submit();\" /></div>\r\n         </div>\r\n         </form>\r\n         <div class=\"ApplicationInformation\"><a href=\"http://lussumo.com\">Lussumo</a> <a href=\"http://thefilebrowser.com\">Filebrowser</a> " . $Config->Version . " &copy; " . $Config->Date . "</div>\r\n         <div class=\"DeveloperInformation\">Developed by " . $Config->Developer . "</div>\r\n      </div>\r\n   </div>\r\n   </body>\r\n</html>";
function render_admin_listarestadisticas($param)
{
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    // Recursos
    $tbl = GetTable('recursos');
    $col = GetCols('recursos');
    $sql = "Select * from {$tbl}";
    $Cols = array(array("dbname" => $col['rid'], "label" => "id", "width" => "45px", "sortable" => false), array("dbname" => $col['nombre'], "label" => "Nombre", "width" => "200px", "sortable" => false), array("dbname" => $col['acceso'], "label" => "Nº Accesos", "width" => "45px", "sortable" => true), array("dbname" => $col['solicitud'], "label" => "Nº Solicitudes", "width" => "45px", "sortable" => true, "sort" => "D"));
    $opciones = array();
    $acciones = array();
    $recurList = new Lister("admRecursos", $sql, 25, $Cols, $col['rid'], $opciones, "dg-admrecursos.css");
    $recurList->table = "{$tbl}";
    $recurList->where = "";
    $recurList->GeneralActions = $acciones;
    if ($sf != "") {
        $recurList->SetSort($sf, $up);
    }
    if ($start != "") {
        $recurList->SetStart($start);
    }
    $listadoRecur = $recurList->render();
    if ($listadoRecur === null || trim($listadoRecur) == "") {
        $listadoRecur = "<br><center>No hay estadisticas a mostrar</a></center>";
    }
    //Documentos
    $tbl = GetTable('documentos');
    $col = GetCols('documentos');
    $sql = "Select * from {$tbl}";
    $Cols = array(array("dbname" => $col['did'], "label" => "id", "width" => "45px", "sortable" => false), array("dbname" => $col['visitas'], "label" => "Visitas", "width" => "45px", "sortable" => true, "sort" => "D"), array("dbname" => $col['signatura'], "label" => "Signatura", "width" => "200px", "sortable" => false));
    $opciones = array();
    $acciones = array();
    $docuList = new Lister("admDocumentos", $sql, 25, $Cols, $col['did'], $opciones, "dg-admdocumentos.css");
    $docuList->table = "{$tbl}";
    $docuList->where = "";
    $docuList->GeneralActions = $acciones;
    if ($sf != "") {
        $docuList->SetSort($sf, $up);
    }
    if ($start != "") {
        $docuList->SetStart($start);
    }
    $listadoDocu = $docuList->render();
    //****************
    if ($listadoDocu === null || trim($listadoDocu) == "") {
        $listadoDocu = "<br><center>No hay estadisticas a mostrar</a></center>";
    }
    ///********
    $listadoRegistros = eventos('registro');
    $listadoVerdoc = eventos('verdoc');
    $listadoVerrsc = eventos('verrsc');
    $listadoSolicitudes = eventos('solicitud');
    $listadoEdicion = eventos('editar');
    $listadoConceder = eventos('conceder');
    ///********
    $resultado = SmartyInit();
    $plantilla = "estadisticas/listarestadisticas.tpl";
    $resultado->assign("listadoRecur", $listadoRecur);
    $resultado->assign("listadoDocu", $listadoDocu);
    $resultado->assign("listadoRegistros", $listadoRegistros);
    $resultado->assign("listadoVerdoc", $listadoVerdoc);
    $resultado->assign("listadoVerrsc", $listadoVerrsc);
    $resultado->assign("listadoSolicitudes", $listadoSolicitudes);
    $resultado->assign("listadoConceder", $listadoConceder);
    $resultado->assign("listadoEdicion", $listadoEdicion);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}