"Æbletærte"); public function show() { global $MEMBERS_DIR; $str = "
Looking ok?
"; $form = new Form("add"); $form->addWidget(new Hidden($vars)); $form->addWidget(new Button("yes")); $form->render(); $form = new Form("retry"); $form->addWidget(new Hidden($vars)); $form->addWidget(new Button("no")); $form->render(); break; case "retry": $name = $vars["name"]; $image = $vars["image"]; $startyear = $vars["startyear"]; $stopyear = $vars["stopyear"]; $tags = array(); default: $form = new Form("preview"); $form->addWidget(new LineEdit("Name", "name", $name)); $form->addWidget(new LineEdit("Start Year", "startyear", $startyear)); $form->addWidget(new LineEdit("Stop Year (if no longer a member)", "stopyear", $stopyear)); $form->addWidget(new ImageComboBox("Image", "image", $image, new Icons($MEMBERS_DIR."/"))); $form->addWidget(new Button("Add member")); $form->render(); break; } } public function admin($sub, $action, $vars) { switch($sub) { case "add": $this->admin_add($action, $vars); break; case "edit": // $this->admin_edit($action, $vars); break; } } public function run($params) { $str = ""; foreach($this->members as $member) { $str .= $member->show(); } return $str; } public function add($member) { $key = $member->id; $this->members[$key] = $member; } public function getNextID() { $maxid = -1; foreach($this->members as $member) { if($member->id > $maxid) $maxid = $member->id; } return $maxid + 1; } public function write() { $fp = fopen($this->file, "w"); fwrite($fp, "\n"); fwrite($fp, "