From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Nov 2011 09:32:21 +0000 Subject: Rewl og krat... needs cleaning up - after port to GIT. --- forum/utils/contacts.php | 90 ++++++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 34 deletions(-) (limited to 'forum/utils/contacts.php') diff --git a/forum/utils/contacts.php b/forum/utils/contacts.php index 7458108..7c67f92 100644 --- a/forum/utils/contacts.php +++ b/forum/utils/contacts.php @@ -39,27 +39,36 @@ class Contact { public function show() { - echo "

\n"; - // echo "\tcid: " . $this->cid . "
\n"; - echo "\tName: " . $this->name . "
\n"; - if($this->co) echo "\tc/o: " . $this->co . "
\n"; - if($this->address) echo "\tAddress: " . $this->address . "
\n"; - if($this->city) echo "\tCity: " . $this->city . "
\n"; - if($this->country) echo "\tCountry: " . $this->country . "
\n"; - if($this->phone) echo "\tPhone: " . $this->phone . "
\n"; - if($this->phone2) echo "\tPhone2: " . $this->phone2 . "
\n"; - if($this->email) echo "\tEmail: email . "\">" . $this->email . "
\n"; - if($this->email2) echo "\tEmail2: email2 . "\">" . $this->email2 . "
\n"; - if($this->url) echo "\tURL: url . "\">" . $this->url . "
\n"; - if($this->url2) echo "\tURL2: url2 . "\">" . $this->url2 . "
\n"; - if($this->notes) echo "\tNotes:
\n" . parse($this->notes) . "
\n"; - echo "\tcid . "\">Edit\n"; - echo "

\n"; + $str = ""; + + $str .= "

\n"; + // $str .= "\tcid: " . $this->cid . "
\n"; + $str .= "\tName: " . $this->name . "
\n"; + if($this->co) $str .= "\tc/o: " . $this->co . "
\n"; + if($this->address) $str .= "\tAddress: " . $this->address . "
\n"; + if($this->city) $str .= "\tCity: " . $this->city . "
\n"; + if($this->country) $str .= "\tCountry: " . $this->country . "
\n"; + if($this->phone) $str .= "\tPhone: " . $this->phone . "
\n"; + if($this->phone2) $str .= "\tPhone2: " . $this->phone2 . "
\n"; + if($this->email) $str .= "\tEmail: email . "\">" . $this->email . "
\n"; + if($this->email2) $str .= "\tEmail2: email2 . "\">" . $this->email2 . "
\n"; + if($this->url) $str .= "\tURL: url . "\">" . $this->url . "
\n"; + if($this->url2) $str .= "\tURL2: url2 . "\">" . $this->url2 . "
\n"; + if($this->notes) $str .= "\tNotes:
\n" . parse($this->notes) . "
\n"; + $str .= "\tcid . "\">Edit\n"; + $str .= "

\n"; + + return $str; } public function showshort() { - echo "
cid . "\">" . $this->name . "
"; + $str = ""; + + $str .= "
cid . "\">" . $this->name . "
"; + + return $str; } function Contact($cid, $name, $co, $address, $city, $country, $phone, $phone2, $email, $email2, $url, $url2, $essential, $notes) @@ -118,35 +127,44 @@ class ContactGroup { public function show() { - echo "
\n"; - echo "
" . $this->name . "
\n"; - echo "
\n"; + $str = ""; + + $str .= "
\n"; + $str .= "
" . $this->name . "
\n"; + $str .= "
\n"; foreach($this->contacts as $contact) { - $contact->showshort(); + $str .= $contact->showshort(); } - echo "
\n"; - echo "
\n"; + $str .= "
\n"; + $str .= "
\n"; + + return $str; } public function showshort() { global $client_is_mobile_device; + + $str = ""; + $ness = 0; foreach($this->contacts as $contact) { if($contact->essential) $ness += 1; } - echo "
\n"; - echo "
gid . "\">" . $this->name . ""; + $str .= "
\n"; + $str .= "
gid . "\">" . $this->name . ""; if(!$client_is_mobile_device) - echo " - ".sizeof($this->contacts)." contacts (". sprintf("%d", sizeof($this->contacts) - $ness)." hidden)"; - echo "
\n"; - echo "
\n"; + $str .= " - ".sizeof($this->contacts)." contacts (". sprintf("%d", sizeof($this->contacts) - $ness)." hidden)"; + $str .= "
\n"; + $str .= "
\n"; foreach($this->contacts as $contact) { - if($contact->essential) $contact->showshort(); + if($contact->essential) $str .= $contact->showshort(); } - echo "
\n"; - echo "
\n"; + $str .= "
\n"; + $str .= "
\n"; + + return $str; } function ContactGroup($gid, @@ -164,11 +182,15 @@ class Contacts { public function show() { - echo "
\n"; + $str = ""; + + $str .= "
\n"; foreach($this->contactgroups as $contactgroup) { - $contactgroup->showshort(); + $str .= $contactgroup->showshort(); } - echo "
\n"; + $str .= "
\n"; + + return $str; } public function getNextCID() -- cgit v1.2.3