Exemplo n.º 1
0
 /**
  * Sort by lookup table
  *
  * @param QueryBuilder $QB
  * @param string $tablealias
  * @param string $colname
  * @param string $order
  */
 public function sort(QueryBuilder $QB, $tablealias, $colname, $order)
 {
     if (!$this->usesLookup()) {
         parent::sort($QB, $tablealias, $colname, $order);
         return;
     }
     $schema = 'data_' . $this->schema->getTable();
     $field = $this->column->getColName();
     $rightalias = $QB->generateTableAlias();
     $QB->addLeftJoin($tablealias, $schema, $rightalias, "{$tablealias}.{$colname} = {$rightalias}.pid");
     $this->column->getType()->sort($QB, $rightalias, $field, $order);
 }
Exemplo n.º 2
0
 /**
  * Form for deleting schemas
  *
  * @param Schema $schema
  * @return string
  */
 protected function html_delete(Schema $schema)
 {
     $form = new Form(array('id' => 'plugin__struct_delete'));
     $form->setHiddenField('do', 'admin');
     $form->setHiddenField('page', 'struct_schemas');
     $form->setHiddenField('table', $schema->getTable());
     $form->addHTML($this->locale_xhtml('delete_intro'));
     $form->addFieldsetOpen($this->getLang('tab_delete'));
     $form->addTextInput('confirm', $this->getLang('del_confirm'));
     $form->addButton('delete', $this->getLang('btn_delete'));
     $form->addFieldsetClose();
     return $form->toHTML();
 }