]> git.mxchange.org Git - friendica.git/commitdiff
more view cleanup
authorFriendika <info@friendika.com>
Tue, 16 Nov 2010 05:06:44 +0000 (21:06 -0800)
committerFriendika <info@friendika.com>
Tue, 16 Nov 2010 05:06:44 +0000 (21:06 -0800)
include/contact_selectors.php [new file with mode: 0644]
include/profile_selectors.php [new file with mode: 0644]
mod/contacts.php
mod/profiles.php
view/contact_selectors.php [deleted file]
view/profile_selectors.php [deleted file]

diff --git a/include/contact_selectors.php b/include/contact_selectors.php
new file mode 100644 (file)
index 0000000..ac1e38e
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+
+
+function contact_profile_assign($current,$foreign_net) {
+
+       $o = '';
+
+       $disabled = (($foreign_net) ? ' disabled="true" ' : '');
+
+       $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\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 .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
+               }
+       }
+       $o .= "</select>\r\n";
+       return $o;
+}
+
+
+function contact_reputation($current) {
+
+       $o = '';
+       $o .= "<select id=\"contact-reputation-selector\" name=\"reputation\" />\r\n";
+
+       $rep = array(
+               0 => t('Unknown | Not categorised'),
+               1 => t('Block immediately'),
+               2 => t('Shady, spammer, self-marketer'),
+               3 => t('Known to me, but no opinion'),
+               4 => t('OK, probably harmless'),
+               5 => t('Reputable, has my trust')
+       );
+
+       foreach($rep as $k => $v) {
+               $selected = (($k == $current) ? " selected=\"selected\" " : "");
+               $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
+       }
+       $o .= "</select>\r\n";
+       return $o;
+}
+
+
+function contact_poll_interval($current) {
+
+       $o = '';
+       $o .= '<select id="contact-poll-interval" name="poll" />' . "\r\n";
+
+       $rep = array(
+               0 => t('Frequently'),
+               1 => t('Hourly'),
+               2 => t('Twice daily'),
+               3 => t('Daily'),
+               4 => t('Weekly'),
+               5 => t('Monthly')
+       );
+
+       foreach($rep as $k => $v) {
+               $selected = (($k == $current) ? " selected=\"selected\" " : "");
+               $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
+       }
+       $o .= "</select>\r\n";
+       return $o;
+}
diff --git a/include/profile_selectors.php b/include/profile_selectors.php
new file mode 100644 (file)
index 0000000..335f292
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+
+function gender_selector($current="",$suffix="") {
+       $o = '';
+       $select = array('', t('Male'), t('Female'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Other'), t('Undecided'));
+
+       $o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
+       foreach($select as $selection) {
+               $selected = (($selection == $current) ? ' selected="selected" ' : '');
+               $o .= "<option value=\"$selection\" $selected >$selection</option>";
+       }
+       $o .= '</select>';
+       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 .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
+       foreach($select as $selection) {
+               $selected = (($selection == $current) ? ' selected="selected" ' : '');
+               $o .= "<option value=\"$selection\" $selected >$selection</option>";
+       }
+       $o .= '</select>';
+       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 .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
+       foreach($select as $selection) {
+               $selected = (($selection == $current) ? ' selected="selected" ' : '');
+               $o .= "<option value=\"$selection\" $selected >$selection</option>";
+       }
+       $o .= '</select>';
+       return $o;
+}      
index f0e677ba5926a3f805d26bea4ce699a4954c6d63..c33c69fa86d0b024777a707a8cc887a73c389cf6 100644 (file)
@@ -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");
 
index 26e8d4ec5e0f09beeb6bb5abb733fd3f4c6ff6da..0bf082efc2d375b02c2f199aa3489f223409056e 100644 (file)
@@ -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 (file)
index ac1e38e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-
-function contact_profile_assign($current,$foreign_net) {
-
-       $o = '';
-
-       $disabled = (($foreign_net) ? ' disabled="true" ' : '');
-
-       $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\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 .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
-               }
-       }
-       $o .= "</select>\r\n";
-       return $o;
-}
-
-
-function contact_reputation($current) {
-
-       $o = '';
-       $o .= "<select id=\"contact-reputation-selector\" name=\"reputation\" />\r\n";
-
-       $rep = array(
-               0 => t('Unknown | Not categorised'),
-               1 => t('Block immediately'),
-               2 => t('Shady, spammer, self-marketer'),
-               3 => t('Known to me, but no opinion'),
-               4 => t('OK, probably harmless'),
-               5 => t('Reputable, has my trust')
-       );
-
-       foreach($rep as $k => $v) {
-               $selected = (($k == $current) ? " selected=\"selected\" " : "");
-               $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
-       }
-       $o .= "</select>\r\n";
-       return $o;
-}
-
-
-function contact_poll_interval($current) {
-
-       $o = '';
-       $o .= '<select id="contact-poll-interval" name="poll" />' . "\r\n";
-
-       $rep = array(
-               0 => t('Frequently'),
-               1 => t('Hourly'),
-               2 => t('Twice daily'),
-               3 => t('Daily'),
-               4 => t('Weekly'),
-               5 => t('Monthly')
-       );
-
-       foreach($rep as $k => $v) {
-               $selected = (($k == $current) ? " selected=\"selected\" " : "");
-               $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
-       }
-       $o .= "</select>\r\n";
-       return $o;
-}
diff --git a/view/profile_selectors.php b/view/profile_selectors.php
deleted file mode 100644 (file)
index 335f292..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-
-function gender_selector($current="",$suffix="") {
-       $o = '';
-       $select = array('', t('Male'), t('Female'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Other'), t('Undecided'));
-
-       $o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
-       foreach($select as $selection) {
-               $selected = (($selection == $current) ? ' selected="selected" ' : '');
-               $o .= "<option value=\"$selection\" $selected >$selection</option>";
-       }
-       $o .= '</select>';
-       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 .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
-       foreach($select as $selection) {
-               $selected = (($selection == $current) ? ' selected="selected" ' : '');
-               $o .= "<option value=\"$selection\" $selected >$selection</option>";
-       }
-       $o .= '</select>';
-       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 .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
-       foreach($select as $selection) {
-               $selected = (($selection == $current) ? ' selected="selected" ' : '');
-               $o .= "<option value=\"$selection\" $selected >$selection</option>";
-       }
-       $o .= '</select>';
-       return $o;
-}