app = $app; if ($intern) return; $this->app->ActionHandlerInit($this); $this->app->ActionHandler("list", "uebersetzung_list"); $this->app->ActionHandler("create", "uebersetzung_edit"); // This automatically adds a "New" button $this->app->ActionHandler("edit", "uebersetzung_edit"); $this->app->ActionHandler("delete", "uebersetzung_delete"); $this->app->DefaultActionHandler("list"); $this->app->ActionHandlerListen($app); } public function Install() { /* Fill out manually later */ } public function TableSearch(&$app, $name, $erlaubtevars) { switch ($name) { case "uebersetzung_list": $allowed['uebersetzung_list'] = array('list'); // Transfer a parameter from form -> see below for setting of parameter // $parameter = $this->app->User->GetParameter('parameter'); $heading = array('','Label', 'Sprache','Übersetzung', 'Original', 'Menü'); $width = array('1%','5%','5%','20%','20%','1%'); // Fill out manually later // columns that are aligned right (numbers etc) // $alignright = array(4,5,6,7,8); $findcols = array('id','u.label', 'u.sprache', 'u.beschriftung', 'u.original'); $searchsql = array('u.label', 'u.beschriftung', 'u.sprache', 'u.original'); $defaultorder = 1; $defaultorderdesc = 0; // Some options for the columns: // $numbercols = array(1,2); // $sumcol = array(1,2); // $alignright = array(1,2); $dropnbox = "CONCAT('') AS `auswahl`"; $menu = "
| " . " |
' AS `open`, CONCAT('') AS `auswahl`";
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS u.id, $dropnbox, u.label, u.beschriftung, u.sprache, u.original, u.id FROM uebersetzung u"." WHERE id=$id");
foreach ($result[0] as $key => $value) {
$this->app->Tpl->Set(strtoupper($key), $value);
}
/*
* Add displayed items later
*
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
$this->app->Tpl->Add('EMAIL', $email);
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
*/
$sprachen = $this->app->erp->GetSprachenSelect();
foreach ($sprachen as $key => $value) {
$this->app->Tpl->Add('SPRACHENSELECT', "");
}
$this->app->YUI->CkEditor("beschriftung","internal", null, 'JQUERY');
$this->app->YUI->CkEditor("original","internal", null, 'JQUERY');
// $this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "uebersetzung_edit.tpl");
}
/**
* Get all paramters from html form and save into $input
*/
public function GetInput(): array {
$input = array();
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
$input['label'] = $this->app->Secure->GetPOST('label');
$input['beschriftung'] = $this->app->Secure->GetPOST('beschriftung');
$input['sprache'] = $this->app->Secure->GetPOST('sprache');
$input['original'] = $this->app->Secure->GetPOST('original');
return $input;
}
/*
* Set all fields in the page corresponding to $input
*/
function SetInput($input) {
// $this->app->Tpl->Set('EMAIL', $input['email']);
$this->app->Tpl->Set('LABEL', $input['label']);
$this->app->Tpl->Set('BESCHRIFTUNG', $input['beschriftung']);
$this->app->Tpl->Set('SPRACHE', $input['sprache']);
$this->app->Tpl->Set('ORIGINAL', $input['original']);
}
}