From 9100caa95aff02de93a1b0fae5677a6fd7ac952a Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 30 Apr 2009 08:50:47 +0000 Subject: Now all member attributes are shown in the same way. --- utils/modules/members.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'utils') 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 .= "
\n"; + $str .= "
".$title.":
\n"; + $str .= "
".Markdown($value)."
\n"; + $str .= "
\n"; + } + return $str; + } + public function show() { global $MEMBERS_DIR; $str = "
\n"; $str .= "
" . htmlspecialchars_decode($this->name, ENT_QUOTES) . "
\n"; $str .= " \"member\"image."\"/>\n"; - $str .= "
Member since: " . $this->startyear . "
\n"; - if($this->stopyear) $str .= "
Quit: " . $this->stopyear . "
\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 .= "
\n"; - $str .= "
".$this->tagnames[$name]."
\n"; - $str .= "
".$val."
\n"; - $str .= "
\n"; - } + $str .= $this->showTag($this->tagnames[$name], $name, $val); } $str .= "
\n"; + $str .= "
\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")); -- cgit v1.2.3