(c) 2008-2013 Agile Toolkit Limited Distributed under Affero General Public License v3 and commercial license. See LICENSE or LICENSE_COM for more information =====================================================ATK4=
Inheritance: extends View
Exemplo n.º 1
0
 function init()
 {
     parent::init();
     if (!$this->template->is_set('row')) {
         throw $this->exception('Template must have "row" tag');
     }
     $this->row_t = $this->template->cloneRegion('row');
     if ($this->template->is_set('totals')) {
         $this->totals_t = $this->template->cloneRegion('totals');
     }
 }
Exemplo n.º 2
0
 function formatRow()
 {
     parent::formatRow();
     $this->odd_even = $this->odd_even == 'odd' ? 'even' : 'odd';
     $this->current_row['odd_even'] = $this->odd_even;
 }
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
 /**
  * Format lister row.
  */
 public function formatRow()
 {
     parent::formatRow();
     if (is_array($this->current_row) || $this->current_row instanceof ArrayAccess) {
         $this->odd_even = $this->odd_even == $this->odd_css_class ? $this->even_css_class : $this->odd_css_class;
         $this->current_row['odd_even'] = $this->odd_even;
     }
 }
Exemplo n.º 5
0
 function init()
 {
     parent::init();
 }
Exemplo n.º 6
0
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;
}
Exemplo n.º 7
0
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;
}
Exemplo n.º 8
0
 /**
  * Format lister row
  *
  * @return void
  */
 function formatRow()
 {
     parent::formatRow();
     $this->odd_even = $this->odd_even == $this->odd_css_class ? $this->even_css_class : $this->odd_css_class;
     $this->current_row['odd_even'] = $this->odd_even;
 }
Exemplo n.º 9
0
 function formatRow()
 {
     $r = array();
     foreach ($this->current_row as $k => $v) {
         $r[$k] = array("k" => $v);
     }
     $this->l->v = "";
     $this->l->setStaticSource($r)->render();
     $this->current_row["cells"] = $this->l->get();
     parent::formatRow();
 }
<?php

include_once '../../class/example/couplingAndCohesion.php';
$lister = new Lister();
// 建立一個表格物件
$circle1 = new Circle(10.11);
// 建立circle1
$square1 = new Square(6.22);
// 建立square1
$lister->addItem($circle1);
$lister->addItem($square1);
$lister->out();
Exemplo n.º 11
0
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;
}
Exemplo n.º 12
0
<?php

namespace com\getinstance\util;

class Debug
{
    static function helloWorld()
    {
        print "Привет, из класса Debug!\n";
    }
}
Debug::helloWorld();
require_once 'global.php';
class Lister
{
    public static function helloWorld()
    {
        print "Привет из " . __NAMESPACE__ . "\n";
    }
}
Lister::helloWorld();
\Lister::helloWorld();
namespace main;

use com\getinstance\util\Debug;
Debug::helloWorld();
Exemplo n.º 13
0
 /**
  * Display a list of users
  * @return string - html for list
  */
 public function lister()
 {
     // display list of users
     if (!isset($_SESSION["SSP_ListerSave"])) {
         $_SESSION["SSP_ListerSave"] = new ListerSave($this->cfg->limit);
     }
     $listerSave =& $_SESSION["SSP_ListerSave"];
     $listerSave->update();
     SSP_changeParam($this->filter->alpha, 'alpha', true);
     // build query
     $fields = array("FirstName", "FamilyName", 'TownCity');
     $queryInfo = $this->buildQuery($fields);
     $this->db->query($queryInfo->sql, $queryInfo->values, "User Lister: Getting list of users");
     $list = new Lister($listerSave, $this->db, $this->cfg->userLister, 0);
     $list->setLineFunction('listerLine', $this);
     $contentPage = array();
     $contentPage["title"] = "User List";
     $contentPage["alphFilter"] = $this->alphaFilter("here", "alphaFilter");
     $contentPage["pageNav"] = $list->pageNav();
     $lineContent["memberAdminUrl"] = $this->cfg->userAdminScript;
     $lineContent["userListerUrl"] = $this->cfg->userLister;
     $lineContent["currentUserId"] = $this->session->userId;
     $contentPage["list"] = $list->displayList($lineContent, "userListerLine.tpl", "userListerNoResult.tpl", "userListerOddLine.tpl", true);
     $page = new Template($contentPage, "userListerPage.tpl", false);
     $contentMain = array("title" => "User list", "content" => $page->output());
     $tpl = $this->tpl($contentMain);
     return $tpl->output();
 }
function eventos($accion)
{
    $miArray = lastNEntriesAction($accion, 25);
    $Rows = devuelveRows($miArray);
    $col_id = 'did';
    switch ($accion) {
        case "solicitud":
            $col = GetCols('recursos');
            $col_id = $col['rid'];
            $Cols = array(array("dbname" => $col['rid'], "label" => "id del recurso", "width" => "45px", "sortable" => false), array("dbname" => $col['uid'], "label" => "Id del usuario", "width" => "45px", "sortable" => false), array("dbname" => $col['razon'], "label" => "razon", "width" => "200px", "sortable" => false));
            break;
        case "verdoc":
            $col = GetCols('documentos');
            $col_id = $col['did'];
            $Cols = array(array("dbname" => $col['did'], "label" => "id del documento", "width" => "290px", "sortable" => false));
            break;
        case "verrsc":
            $col = GetCols('recursos');
            $col_id = $col['rid'];
            $Cols = array(array("dbname" => $col['rid'], "label" => "id del recurso", "width" => "45px", "sortable" => false), array("dbname" => $col['uid'], "label" => "Id del usuario", "width" => "45px", "sortable" => false), array("dbname" => $col['restringido'], "label" => "Restringido", "width" => "200px", "sortable" => false));
            break;
        case "conceder":
            $col = GetCols('recursos');
            $col_id = $col['rid'];
            $Cols = array(array("dbname" => $col['rid'], "label" => "id del recurso", "width" => "45px", "sortable" => false), array("dbname" => $col['uid'], "label" => "Id del usuario", "width" => "45px", "sortable" => false));
            break;
        case "registro":
            $col = GetCols('usuarios');
            $col_id = $col['uid'];
            $Cols = array(array("dbname" => $col['uid'], "label" => "id del usuario", "width" => "45px", "sortable" => false), array("dbname" => $col['uname'], "label" => "Nombre", "width" => "45px", "sortable" => false), array("dbname" => $col['apellidos'], "label" => "Apellidos", "width" => "200px", "sortable" => false));
            break;
        case "editar":
            $col = GetCols('usuarios');
            $col_id = $col['uid'];
            $Cols = array(array("dbname" => $col['uid'], "label" => "id del usuario", "width" => "45px", "sortable" => false), array("dbname" => $col['uname'], "label" => "Nombre", "width" => "45px", "sortable" => false), array("dbname" => $col['apellidos'], "label" => "Apellidos", "width" => "200px", "sortable" => false));
            break;
    }
    $opciones = array();
    $acciones = array();
    $evento = new Lister("admEventos", $Rows, 25, $Cols, $col_id, $opciones, "dg-admeventos.css");
    $evento->table = "";
    $evento->where = "";
    $evento->GeneralActions = $acciones;
    if ($sf != "") {
        $docuList->SetSort($sf, $up);
    }
    if ($start != "") {
        $docuList->SetStart($start);
    }
    return $evento->render2();
}