diff options
Diffstat (limited to 'utils/modules/members.php')
-rw-r--r-- | utils/modules/members.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/utils/modules/members.php b/utils/modules/members.php index ac32d60..fcc627c 100644 --- a/utils/modules/members.php +++ b/utils/modules/members.php @@ -14,23 +14,31 @@ class Member { public $tags; public $tagnames; + private function showTag($title, $id, $value) + { + $str = ""; + if($value != "") { + $str .= " <div class=\"member_tag\"><div class=\"member_tags_".$id."\">\n"; + $str .= " <div class=\"member_tag_name\">".$title.":</div>\n"; + $str .= " <div class=\"member_tag_value\">".Markdown($value)."</div>\n"; + $str .= " </div></div>\n"; + } + return $str; + } + public function show() { global $MEMBERS_DIR; $str = "<div class=\"member_entry\">\n"; $str .= " <div class=\"member_name\">" . htmlspecialchars_decode($this->name, ENT_QUOTES) . "</div>\n"; $str .= " <img alt=\"member\" class=\"member_image\" src=\"" . $MEMBERS_DIR."/".$this->image."\"/>\n"; - $str .= " <div class=\"member_startyear\">Member since: " . $this->startyear . "</div>\n"; - if($this->stopyear) $str .= " <div class=\"member_stopyear\">Quit: " . $this->stopyear . "</div>\n"; + $str .= $this->showTag("Member Since", "startyear", $this->startyear); + $str .= $this->showTag("Quit", "stopyear", $this->stopyear); foreach($this->tags as $name => $val) { - if($val != "") { - $str .= " <div class=\"member_tag\"><div class=\"member_tags_".$name."\">\n"; - $str .= " <div class=\"member_tag_name\">".$this->tagnames[$name]."</div>\n"; - $str .= " <div class=\"member_tag_value\">".$val."</div>\n"; - $str .= " </div></div>\n"; - } + $str .= $this->showTag($this->tagnames[$name], $name, $val); } $str .= "</div>\n"; + $str .= "<div class=\"member_footer\"></div>\n"; return $str; } @@ -118,7 +126,7 @@ class Members { $form->addWidget(new LineEdit("Start Year", "startyear", $startyear)); $form->addWidget(new LineEdit("Stop Year (if no longer a member)", "stopyear", $stopyear)); foreach($this->tags as $id => $title) { - $form->addWidget(new LineEdit($title, "tags_".$id, $tags[$id])); + $form->addWidget(new TextEdit($title, "tags_".$id, $tags[$id])); } $form->addWidget(new ImageComboBox("Image", "image", $image, new Icons($MEMBERS_DIR."/"))); $form->addWidget(new Button("Add member")); @@ -187,7 +195,7 @@ class Members { $form->addWidget(new LineEdit("Start Year", "startyear", $startyear)); $form->addWidget(new LineEdit("Stop Year (if no longer a member)", "stopyear", $stopyear)); foreach($this->tags as $id => $title) { - $form->addWidget(new LineEdit($title, "tags_".$id, $tags[$id])); + $form->addWidget(new TextEdit($title, "tags_".$id, $tags[$id], 2)); } $form->addWidget(new ImageComboBox("Image", "image", $image, new Icons($MEMBERS_DIR."/"))); $form->addWidget(new Button("Preview")); |