public static function Init($data) { $component = new Component(); $links = array(); $link = new Link(); $link->setName('fileDb'); $link->setAddress('http://localhost/' . $data['path'] . '/fileDb'); $link->setPrefix('file'); $links[] = $link; $link = new Link(); $link->setName('file'); $link->setAddress('http://localhost/' . $data['path'] . '/file'); $link->setPrefix('file'); $links[] = $link; $component->setLinks($links); chdir(dirname(__FILE__)); CConfig::saveConfigGlobal('', Component::encodeComponent($component)); }
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(' '); $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);
/** * @param Link $link * @param $values * @return Link */ protected function edit(Link $link, $values) { $link->setName($values->name)->setDescription($values->description)->setUrl($this->treatUrl($values->url))->setPublic($values->public); $this->linkFacade->save($link); return $link; }
$table->build(); $th = new Th(); $th->add('Name'); $th->add('Unique ?'); $th->add('Columns'); $th->add(' '); $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); $rescol = $sql->fo();
$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);
$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&table=' . $req->get('table') . '&id=' . $item->id); $edit->setName('[edit]'); // $edit->setTarget('edit_del'); $del = new Link(); $del->setHref('controller.php?cmd=drop_record&table=' . $req->get('table') . '&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); unset($html);
$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(); $colname = new Input();
$table->setId('listing'); $table->build(); for ($i = 0; $i < sizeof($files); ++$i) { $link = new Link(); $link->setHref('controller.php?cmd=table&db=' . urlencode($files[$i])); $link->setName('[' . $files[$i] . ']'); $vacuum = new Link(); $vacuum->setHref('controller.php?cmd=vacuum_db&db=' . urlencode($files[$i])); $vacuum->setName('[vacuum]'); $drop = new Link(); $drop->setHref('controller.php?cmd=drop_db&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&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(); } unset($table);