From 5d474177113f563c5c4d299485e0edb27d061f8a Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 15 Nov 2010 21:06:44 -0800 Subject: more view cleanup --- include/contact_selectors.php | 69 +++++++++++++++++++++++++++++++++++++++++++ include/profile_selectors.php | 42 ++++++++++++++++++++++++++ mod/contacts.php | 2 +- mod/profiles.php | 2 +- view/contact_selectors.php | 69 ------------------------------------------- view/profile_selectors.php | 42 -------------------------- 6 files changed, 113 insertions(+), 113 deletions(-) create mode 100644 include/contact_selectors.php create mode 100644 include/profile_selectors.php delete mode 100644 view/contact_selectors.php delete mode 100644 view/profile_selectors.php diff --git a/include/contact_selectors.php b/include/contact_selectors.php new file mode 100644 index 000000000..ac1e38e4f --- /dev/null +++ b/include/contact_selectors.php @@ -0,0 +1,69 @@ +\r\n"; + + $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d", + intval($_SESSION['uid'])); + + if(count($r)) { + foreach($r as $rr) { + $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : ""); + $o .= "\r\n"; + } + } + $o .= "\r\n"; + return $o; +} + + +function contact_reputation($current) { + + $o = ''; + $o .= "\r\n"; + return $o; +} + + +function contact_poll_interval($current) { + + $o = ''; + $o .= '\r\n"; + return $o; +} diff --git a/include/profile_selectors.php b/include/profile_selectors.php new file mode 100644 index 000000000..335f292dc --- /dev/null +++ b/include/profile_selectors.php @@ -0,0 +1,42 @@ +"; + foreach($select as $selection) { + $selected = (($selection == $current) ? ' selected="selected" ' : ''); + $o .= ""; + } + $o .= ''; + return $o; +} + +function sexpref_selector($current="",$suffix="") { + $o = ''; + $select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual')); + + $o .= "'; + return $o; +} + + +function marital_selector($current="",$suffix="") { + $o = ''; + $select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') ); + + $o .= "'; + return $o; +} diff --git a/mod/contacts.php b/mod/contacts.php index f0e677ba5..c33c69fa8 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -166,7 +166,7 @@ function contacts_content(&$a) { } - require_once('view/contact_selectors.php'); + require_once('include/contact_selectors.php'); $tpl = load_view_file("view/contact_edit.tpl"); diff --git a/mod/profiles.php b/mod/profiles.php index 26e8d4ec5..0bf082efc 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -280,7 +280,7 @@ function profiles_content(&$a) { require_once('mod/profile.php'); profile_load($a,$a->user['nickname'],$r[0]['id']); - require_once('view/profile_selectors.php'); + require_once('include/profile_selectors.php'); $tpl = load_view_file('view/profed_head.tpl'); diff --git a/view/contact_selectors.php b/view/contact_selectors.php deleted file mode 100644 index ac1e38e4f..000000000 --- a/view/contact_selectors.php +++ /dev/null @@ -1,69 +0,0 @@ -\r\n"; - - $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d", - intval($_SESSION['uid'])); - - if(count($r)) { - foreach($r as $rr) { - $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : ""); - $o .= "\r\n"; - } - } - $o .= "\r\n"; - return $o; -} - - -function contact_reputation($current) { - - $o = ''; - $o .= "\r\n"; - return $o; -} - - -function contact_poll_interval($current) { - - $o = ''; - $o .= '\r\n"; - return $o; -} diff --git a/view/profile_selectors.php b/view/profile_selectors.php deleted file mode 100644 index 335f292dc..000000000 --- a/view/profile_selectors.php +++ /dev/null @@ -1,42 +0,0 @@ -"; - foreach($select as $selection) { - $selected = (($selection == $current) ? ' selected="selected" ' : ''); - $o .= ""; - } - $o .= ''; - return $o; -} - -function sexpref_selector($current="",$suffix="") { - $o = ''; - $select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual')); - - $o .= "'; - return $o; -} - - -function marital_selector($current="",$suffix="") { - $o = ''; - $select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') ); - - $o .= "'; - return $o; -} -- cgit v1.2.3