当前位置: 首页>>代码示例>>PHP>>正文


PHP Link::setHref方法代码示例

本文整理汇总了PHP中Link::setHref方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::setHref方法的具体用法?PHP Link::setHref怎么用?PHP Link::setHref使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Link的用法示例。


在下文中一共展示了Link::setHref方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 /**
  * Retorna uma lista de usuários
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     José Vicente Tezza Jr.
  * @return     Retorna uma lista de usuários do LDAP
  * @access     public
  * */
 function get($request, $id)
 {
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::OK;
     $h = new Hypermedia();
     $c = new Collection($request->resources, 'PersonalContactResource');
     try {
         $this->secured();
         $contacts = !!$id ? Controller::find(array('concept' => 'contact'), false, array('filter' => array('AND', array('=', 'user', Config::me("uidNumber")), array('=', 'id', $id)))) : Controller::find(array('concept' => 'contact'), false, array('filter' => array('=', 'user', Config::me("uidNumber"))));
         //Se nao foi encontrado contatos na consulta
         if ($contacts === false) {
             $error = new Error();
             $error->setCode(Response::NOTFOUND);
             $error->setTitle('Contacts not found');
             $error->setDescription('Contacts not found.');
             $c->setError($error);
             $h->setCollection($c);
             $response->code = Response::NOTFOUND;
             $response->body = $h->getHypermedia($request->accept[10][0]);
             return $response;
         }
         foreach ($contacts as $value) {
             $i = new Item($request->resources, 'PersonalContactResource', $value['id']);
             $d = new Data();
             $d->setName('name');
             $d->setValue($value['name']);
             $d->setPrompt('Nome do Contato');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('id');
             $d->setValue($value['id']);
             $d->setPrompt('Id do Contato');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('email');
             $d->setValue($value['email']);
             $d->setPrompt('Email do Contato');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $l = new Link();
             $l->setHref('');
             $l->setRel('delete');
             $l->setAlt('Remover');
             $l->setPrompt('Remover');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('');
             $l->setRel('put');
             $l->setAlt('Atualizar');
             $l->setPrompt('Atualizar');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('/contact/' . $value['id']);
             $l->setRel('get');
             $l->setAlt('Buscar');
             $l->setPrompt('Buscar');
             $l->setRender('link');
             $i->addLink($l);
             $c->addItem($i);
         }
         $t = new Template();
         $d = new Data();
         $d->setName('name');
         $d->setValue(null);
         $d->setPrompt('Nome do Contato');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
         $d->setName('email');
         $d->setValue(null);
         $d->setPrompt('Email do Contato');
         $d->setDataType('string');
         $d->setMaxLength(100);
//.........这里部分代码省略.........
开发者ID:cjvaz,项目名称:expressomail,代码行数:101,代码来源:PersonalContactResource.php

示例2: get

 /**
  * Retorna uma lista de usuários
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     José Vicente Tezza Jr. 
  * @return     Retorna um usuário do LDAP filtrado pelo atributo 'uid'
  * @access     public
  * */
 function get($request, $id)
 {
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::OK;
     $h = new Hypermedia();
     $c = new Collection($request->resources, 'UserResource');
     try {
         $this->secured();
         $user = Controller::find(array('concept' => 'user', 'service' => 'OpenLDAP'), false, array('filter' => array('=', 'uid', $id), 'notExternal' => true));
         //Se nao foi encontrado usuario na consulta
         if ($user === false) {
             $error = new Error();
             $error->setCode(Response::NOTFOUND);
             $error->setTitle('UserLDAP not found');
             $error->setDescription('User not found.');
             $c->setError($error);
             $h->setCollection($c);
             $response->code = Response::NOTFOUND;
             $response->body = $h->getHypermedia($request->accept[10][0]);
             return $response;
         }
         $t = new Template();
         $d = new Data();
         $d->setName('name');
         $d->setValue(null);
         $d->setPrompt('Nome do Usuário');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
         $d->setName('email');
         $d->setValue(null);
         $d->setPrompt('Email do Usuário');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
         $d->setName('telefone');
         $d->setValue(null);
         $d->setPrompt('Telefone do Usuário');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $c->setTemplate($t);
         $d = new Data();
         $d->setName('name');
         $d->setValue($user[0]['name']);
         $d->setPrompt('Nome do Usuário');
         $d->setDataType('string');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $d = new Data();
         $d->setName('email');
         $d->setValue($user[0]['mail']);
         $d->setPrompt('Email do Usuário');
         $d->setDataType('string');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $d = new Data();
         $d->setName('telephoneNumber');
         $d->setValue($user[0]['telephoneNumber']);
         $d->setPrompt('Telefone do Usuário');
         $d->setDataType('string');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $l = new Link();
         $l->setHref('');
         $l->setRel('delete');
         $l->setAlt('Remover');
         $l->setPrompt('Remover');
         $l->setRender('link');
         $c->addLink($l);
         $l = new Link();
         $l->setHref('');
         $l->setRel('put');
         $l->setAlt('Atualizar');
         $l->setPrompt('Atualizar');
//.........这里部分代码省略.........
开发者ID:cjvaz,项目名称:expressomail,代码行数:101,代码来源:UserResource.php

示例3: get


//.........这里部分代码省略.........
     $h = new Hypermedia();
     $c = new Collection($request->resources, 'DynamicContactResource', $id);
     try {
         $dynamicContact = Controller::read(array('concept' => 'dynamicContact'), false, array('filter' => array('AND', array('=', 'owner', Config::me("uidNumber")), array('=', 'id', $id))));
         //Se nao foi encontrado contatos na consulta
         if (!$dynamicContact) {
             $this->createException($request, $response, Response::NOTFOUND, 'Bad request', 'Dynamic Contact not found.');
             return $response;
         }
         //Normaliza dado
         if (is_array($dynamicContact)) {
             $dynamicContact = $dynamicContact[0];
         }
         $t = new Template();
         $d = new Data();
         $d->setName('name');
         $d->setValue(null);
         $d->setPrompt('Nome do Contato Recente');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
         $d->setName('mail');
         $d->setValue(null);
         $d->setPrompt('Email do Contato Recente');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
         $d->setName('number_of_messages');
         $d->setValue(null);
         $d->setPrompt('Quantidade de mensagens enviadas');
         $d->setDataType('integer');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(false);
         $t->addData($d);
         $c->setTemplate($t);
         $d = new Data();
         $d->setName('id');
         $d->setValue($dynamicContact['id']);
         $d->setPrompt('Identificador do Contato Recente');
         $d->setDataType('integer');
         $d->setMaxLength(null);
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $d = new Data();
         $d->setName('name');
         $d->setValue($dynamicContact['name']);
         $d->setPrompt('Nome do Contato Recente');
         $d->setDataType('string');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $d = new Data();
         $d->setName('mail');
         $d->setValue($dynamicContact['mail']);
         $d->setPrompt('Email do Contato Recente');
         $d->setDataType('string');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(true);
         $c->addData($d);
         $d = new Data();
         $d->setName('number_of_messages');
         $d->setValue($dynamicContact['number_of_messages']);
         $d->setPrompt('Quantidade de mensagens enviadas');
         $d->setDataType('integer');
         $d->setMaxLength('100');
         $d->setMinLength(null);
         $d->setRequired(false);
         $c->addData($d);
         $l = new Link();
         $l->setHref('');
         $l->setRel('delete');
         $l->setAlt('Remover');
         $l->setPrompt('Remover');
         $l->setRender('link');
         $c->addLink($l);
         $l = new Link();
         $l->setHref('');
         $l->setRel('put');
         $l->setAlt('Atualizar');
         $l->setPrompt('Atualizar');
         $l->setRender('link');
         $c->addLink($l);
         $h->setCollection($c);
     } catch (Exception $ex) {
         $this->createException($request, $response, Response::INTERNALSERVERERROR, 'Internal Server Error', 'Internal Server Error');
         return $response;
     }
     $response->body = $h->getHypermedia($request->accept[10][0]);
     return $response;
 }
开发者ID:cjvaz,项目名称:expressomail,代码行数:101,代码来源:DynamicContactResource.php

示例4: get


//.........这里部分代码省略.........
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('telephoneNumber');
             $d->setValue($value['telephoneNumber']);
             $d->setPrompt('Telefone do Usuario');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('vacationActive');
             $d->setValue($value['vacationActive']);
             $d->setPrompt('Status da Regra fora de Escritorio');
             $d->setDataType('boolean');
             $d->setMaxLength('10');
             $d->setMinLength(null);
             $d->setRequired(null);
             $i->addData($d);
             $d = new Data();
             $d->setName('vacationInfo');
             $d->setValue($value['vacationInfo']);
             $d->setPrompt('Mensagem da Regra fora de Escritorio');
             $d->setDataType('boolean');
             $d->setMaxLength('10');
             $d->setMinLength(null);
             $d->setRequired(null);
             $i->addData($d);
             $l = new Link();
             $l->setHref('');
             $l->setRel('delete');
             $l->setAlt('Remover');
             $l->setPrompt('Remover');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('');
             $l->setRel('put');
             $l->setAlt('Atualizar');
             $l->setPrompt('Atualizar');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('/userldap/' . $value['uid']);
             $l->setRel('get');
             $l->setAlt('Buscar');
             $l->setPrompt('Buscar');
             $l->setRender('link');
             $i->addLink($l);
             $c->addItem($i);
         }
         $t = new Template();
         $d = new Data();
         $d->setName('name');
         $d->setValue(null);
         $d->setPrompt('Nome do Usuario');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(true);
         $t->addData($d);
         $d = new Data();
开发者ID:cjvaz,项目名称:expressomail,代码行数:67,代码来源:UsersResource.php

示例5: Input

    if($length < 10) {
    	$size = 10;
    }
    */
    $inp = new Input();
    $inp->setName($colname);
    $inp->setValue($item);
    $inp->setSize(50);
    $inp->setMaxlength(128);
    /**/
    $tr = new Tr();
    $tr->add($colname);
    $tr->add($inp->dump());
    $tr->build();
    ++$i;
    /**/
}
$tr = new Tr();
$tr->add('&nbsp;');
$tr->add($submit->dump());
$tr->build();
unset($table);
unset($form);
$body->line('<hr />');
$backlink = new Link();
$backlink->setHref('controller.php?cmd=table_browse&table=' . $req->get('table'));
$backlink->setName('Back to list');
$backlink->build();
include_once './inc/footer.php';
unset($body);
unset($html);
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:edit_record.php

示例6: foreach

    $table->build();
    foreach ($res as $item) {
        if ($item->name == 'sqlite_sequence') {
            continue;
        }
        $struct = new Link();
        $struct->setHref('controller.php?cmd=tableinfo&table=' . $item->name . '&view=true');
        $struct->setName('Structure');
        $browse = new Link();
        $browse->setHref('controller.php?cmd=table_browse&table=' . $item->name . '&view=true');
        $browse->setName('Browse');
        $dump = new Link();
        $dump->setHref('controller.php?cmd=table_dump&table=' . $item->name . '&view=true');
        $dump->setName('Dump');
        $drop = new Link();
        $drop->setHref('controller.php?cmd=drop_view&table=' . $item->name . '&view==true');
        $drop->setName('Drop');
        $drop->setJs(' onclick="return PSA.really_drop(\'view\');" ');
        $tr = new Tr();
        $tr->add($item->name);
        $tr->add($struct->dump());
        $tr->add($browse->dump());
        $tr->add($dump->dump());
        $tr->add($drop->dump());
        $tr->build();
    }
    unset($table);
}
include_once './inc/footer.php';
unset($body);
unset($html);
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:table.php

示例7: Th

 $table->setClas('result');
 $table->build();
 $th = new Th();
 $th->add('Name');
 $th->add('Unique ?');
 $th->add('Columns');
 $th->add('&nbsp;');
 $th->build();
 foreach ($res as $item) {
     if ($item->unique == 1) {
         $uniq = 'Y';
     } else {
         $uniq = 'N';
     }
     $drop = new Link();
     $drop->setHref('controller.php?cmd=drop_idx&idxname=' . $item->name . '&table=' . $req->get('table'));
     $drop->setName('[ drop ]');
     $drop->setJs(' onclick="return PSA.really_drop(\' index [' . $item->name . ']\');" ');
     $tr = new Tr();
     if ($odd) {
         $tr->setGlobalClass('even');
         $odd = FALSE;
     } else {
         $tr->setGlobalClass('odd');
         $odd = TRUE;
     }
     $tr->add($item->name);
     $tr->setClas('center');
     $tr->add($uniq);
     $q = "PRAGMA index_info(" . $item->name . ")";
     $sql->qo($q);
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:tableinfo.php

示例8: get

 /**
  * Retorna uma lista de grupos
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     Adrino Coutinho da Silva. 
  * @return     Retorna uma lista de Contatos Dinâmicos, Grupos, Contatos Pessoais, Grupos Compartilhados e Contatos Compartilhados
  * @access     public
  * */
 function get($request)
 {
     $this->secured();
     //verificar se a preferencia de contatos dinamicos nao esta ativada
     if (!$this->isEnabledDynamicContacts(Config::me("uidNumber"))) {
         $response = new Response($request);
         $this->createException($request, $response, Response::UNAUTHORIZED, 'Resource unauthorized', 'disabled dynamic contacts preference');
         return $response;
     }
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::OK;
     $h = new Hypermedia();
     $c = new Collection($request->resources, 'UserContactsResource');
     try {
         $d = new Data();
         $d->setName('User Contacts');
         $d->setValue(null);
         $d->setPrompt('Contatos do usuário');
         $d->setDataType(null);
         $d->setMaxLength(null);
         $d->setMinLength(null);
         $d->setRequired(null);
         $c->addData($d);
         //Recupera os contatos dinâmicos do usuario
         $dynamicContacts = Controller::find(array('concept' => 'dynamicContact'), false, array('filter' => array('=', 'owner', Config::me("uidNumber")), 'order' => array('number_of_messages', 'name', 'mail'), 'orderDesc' => array(true, false, false)));
         if ($dynamicContacts) {
             foreach ($dynamicContacts as $value) {
                 $d = new Data();
                 $i = new Item($request->resources, 'DynamicContactsResource', $value['id']);
                 $d->setName('name');
                 $d->setValue($value['name']);
                 $d->setPrompt('Nome do Contato Recente');
                 $d->setDataType('string');
                 $d->setMaxLength('100');
                 $d->setMinLength(null);
                 $d->setRequired(true);
                 $i->addData($d);
                 $d = new Data();
                 $d->setName('mail');
                 $d->setValue($value['mail']);
                 $d->setPrompt('Email do Contato Recente');
                 $d->setDataType('string');
                 $d->setMaxLength('100');
                 $d->setMinLength(null);
                 $d->setRequired(true);
                 $i->addData($d);
                 $d = new Data();
                 $d->setName('number_of_messages');
                 $d->setValue((int) $value['number_of_messages']);
                 $d->setPrompt('Quantidade de mensagens enviadas');
                 $d->setDataType('integer');
                 $d->setMaxLength('100');
                 $d->setMinLength(null);
                 $d->setRequired(false);
                 $i->addData($d);
                 $d = new Data();
                 $d->setName('id');
                 $d->setValue($value['id']);
                 $d->setPrompt('Id do contato dinamico');
                 $d->setDataType('integer');
                 $d->setMaxLength('100');
                 $d->setMinLength(null);
                 $d->setRequired(false);
                 $i->addData($d);
                 $l = new Link();
                 $l->setHref('');
                 $l->setRel('delete');
                 $l->setAlt('Remover');
                 $l->setPrompt('Remover');
                 $l->setRender('link');
                 $i->addLink($l);
                 $l = new Link();
                 $l->setHref('');
                 $l->setRel('put');
                 $l->setAlt('Atualizar');
                 $l->setPrompt('Atualizar');
                 $l->setRender('link');
                 $i->addLink($l);
                 $l = new Link();
                 $l->setHref('/dynamiccontact/' . $value['id']);
                 $l->setRel('get');
                 $l->setAlt('Buscar');
                 $l->setPrompt('Buscar');
                 $l->setRender('link');
                 $i->addLink($l);
                 $c->addItem($i);
             }
         }
         $idS = array(Config::me("uidNumber"));
//.........这里部分代码省略.........
开发者ID:cjvaz,项目名称:expressomail,代码行数:101,代码来源:UserContactsResource.php

示例9: get

 /**
  * Retorna uma lista de contatos recentes 
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     José Vicente Tezza Jr. 
  * @return     Retorna uma lista de contatos recentes
  * @access     public
  * */
 function get($request)
 {
     $this->secured();
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::OK;
     $h = new Hypermedia();
     $c = new Collection($request->resources, 'DynamicContactsResource');
     try {
         $dynamicContacts = Controller::find(array('concept' => 'dynamicContact'), false, array('filter' => array('=', 'owner', Config::me("uidNumber")), 'order' => array('number_of_messages', 'name', 'mail'), 'orderDesc' => array(true, false, false)));
         //Se nao foi encontrado contatos na consulta
         if (!$dynamicContacts) {
             $this->createException($request, $response, Response::NOTFOUND, 'Bad request', 'Dynamic Contact not found.');
             return $response;
         }
         $dynamicContacts = array_slice($dynamicContacts, 0, 50);
         foreach ($dynamicContacts as $value) {
             $d = new Data();
             $i = new Item($request->resources, 'DynamicContactsResource', $value['id']);
             $d->setName('name');
             $d->setValue($value['name']);
             $d->setPrompt('Nome do Contato Recente');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('mail');
             $d->setValue($value['mail']);
             $d->setPrompt('Email do Contato Recente');
             $d->setDataType('string');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(true);
             $i->addData($d);
             $d = new Data();
             $d->setName('number_of_messages');
             $d->setValue($value['number_of_messages']);
             $d->setPrompt('Quantidade de mensagens enviadas');
             $d->setDataType('integer');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(false);
             $i->addData($d);
             $d = new Data();
             $d->setName('id');
             $d->setValue($value['id']);
             $d->setPrompt('Id do contato dinamico');
             $d->setDataType('integer');
             $d->setMaxLength('100');
             $d->setMinLength(null);
             $d->setRequired(false);
             $i->addData($d);
             $l = new Link();
             $l->setHref('');
             $l->setRel('delete');
             $l->setAlt('Remover');
             $l->setPrompt('Remover');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('');
             $l->setRel('put');
             $l->setAlt('Atualizar');
             $l->setPrompt('Atualizar');
             $l->setRender('link');
             $i->addLink($l);
             $l = new Link();
             $l->setHref('/dynamiccontact/' . $value['id']);
             $l->setRel('get');
             $l->setAlt('Buscar');
             $l->setPrompt('Buscar');
             $l->setRender('link');
             $i->addLink($l);
             $c->addItem($i);
         }
         $t = new Template();
         $d = new Data();
         $d->setName('name');
         $d->setValue(null);
         $d->setPrompt('Nome do Contato Recente');
         $d->setDataType('string');
         $d->setMaxLength(100);
         $d->setMinLength(null);
         $d->setRequired(false);
         $t->addData($d);
         $d = new Data();
         $d->setName('mail');
         $d->setValue(null);
//.........这里部分代码省略.........
开发者ID:cjvaz,项目名称:expressomail,代码行数:101,代码来源:DynamicContactsResource.php

示例10: Tr

        /**/
        $tr = new Tr();
        if ($odd) {
            $tr->setGlobalClass('even');
            $odd = FALSE;
        } else {
            $tr->setGlobalClass('odd');
            $odd = TRUE;
        }
        if (!$is_view) {
            $edit = new Link();
            $edit->setHref('controller.php?cmd=edit_record&amp;table=' . $req->get('table') . '&amp;id=' . $item->id);
            $edit->setName('[edit]');
            // $edit->setTarget('edit_del');
            $del = new Link();
            $del->setHref('controller.php?cmd=drop_record&amp;table=' . $req->get('table') . '&amp;id=' . $item->id);
            $del->setName('[del]');
            $del->setJs(' onclick="return PSA.really_drop(\'record\');" ');
            $tr->add($edit->dump());
            $tr->add($del->dump());
        }
        foreach ($item as $data) {
            $tr->add(htmlentities($data));
        }
        $tr->build();
    }
    unset($table);
}
$body->line('</div>');
include_once './inc/footer.php';
unset($body);
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:table_browse.php

示例11: Body

$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
// TODO: check if table name already exists
$name = new Input();
$name->setName('tblname');
$name->setSize(50);
$name->setMaxlength(128);
$name->setId('tblname');
$body->line('<span class="vet">Table name</span><br /> ');
$body->line($name->dump());
$create = new Link();
$create->setHref('controller.php?cmd=table_add_action');
$create->setName('<button>Create</button>');
$body->line($create->dump());
$body->line('<hr />');
$body->line('<span class="vet">Fields</span><br /> ');
$table = new Table();
$table->setClas('result');
$table->build();
$th = new Th();
$th->add('name');
$th->add('type');
$th->add('primary');
$th->add('size');
$th->add('null');
$th->add('default');
$th->build();
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:table_add.php

示例12: Table

 $table = new Table();
 $table->setId('listing');
 $table->build();
 for ($i = 0; $i < sizeof($files); ++$i) {
     $link = new Link();
     $link->setHref('controller.php?cmd=table&amp;db=' . urlencode($files[$i]));
     $link->setName('[' . $files[$i] . ']');
     $vacuum = new Link();
     $vacuum->setHref('controller.php?cmd=vacuum_db&amp;db=' . urlencode($files[$i]));
     $vacuum->setName('[vacuum]');
     $drop = new Link();
     $drop->setHref('controller.php?cmd=drop_db&amp;db=' . urlencode($files[$i]));
     $drop->setName('[drop]');
     $drop->setJs(' onclick="return PSA.really_drop(\'database\');" ');
     $schema = new Link();
     $schema->setHref('controller.php?cmd=schema_db&amp;db=' . urlencode($files[$i]));
     $schema->setName('[schema]');
     $tr = new Tr();
     if ($odd) {
         $tr->setGlobalClass('even');
         $odd = FALSE;
     } else {
         $tr->setGlobalClass('odd');
         $odd = TRUE;
     }
     $tr->add($link->dump());
     $tr->add($vacuum->dump());
     $tr->add($drop->dump());
     $tr->add($schema->dump());
     $tr->build();
 }
开发者ID:broozer,项目名称:psa,代码行数:31,代码来源:base.php


注:本文中的Link::setHref方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。