diff options
author | Friendika <info@friendika.com> | 2011-08-25 18:12:42 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-25 18:12:42 -0700 |
commit | 99ea045723b89a312db5227f0036c76d481e58a1 (patch) | |
tree | 44fafd9e4c81c84b9e75d5558a8f9c6324d4d040 | |
parent | 21c03fb5220d2190a8a764d5430c6fa8bc013860 (diff) | |
download | volse-hubzilla-99ea045723b89a312db5227f0036c76d481e58a1.tar.gz volse-hubzilla-99ea045723b89a312db5227f0036c76d481e58a1.tar.bz2 volse-hubzilla-99ea045723b89a312db5227f0036c76d481e58a1.zip |
some minor work on contact edit page
-rw-r--r-- | include/contact_selectors.php | 15 | ||||
-rw-r--r-- | mod/contacts.php | 7 | ||||
-rw-r--r-- | view/contact_edit.tpl | 7 | ||||
-rw-r--r-- | view/theme/dispy/style.css | 2 | ||||
-rw-r--r-- | view/theme/duepuntozero/style.css | 7 | ||||
-rw-r--r-- | view/theme/loozah/style.css | 6 |
6 files changed, 38 insertions, 6 deletions
diff --git a/include/contact_selectors.php b/include/contact_selectors.php index ac1e38e4f..1303acf74 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -46,10 +46,11 @@ function contact_reputation($current) { } -function contact_poll_interval($current) { +function contact_poll_interval($current, $disabled = false) { + $dis = (($disabled) ? ' disabled="disabled" ' : ''); $o = ''; - $o .= '<select id="contact-poll-interval" name="poll" />' . "\r\n"; + $o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n"; $rep = array( 0 => t('Frequently'), @@ -67,3 +68,13 @@ function contact_poll_interval($current) { $o .= "</select>\r\n"; return $o; } + + +function network_to_name($s) { + + call_hooks('network_to_name', $s); + + return str_replace(array(NETWORK_DFRN,NETWORK_OSTATUS,NETWORK_FEED,NETWORK_MAIL,NETWORK_DIASPORA,NETWORK_FACEBOOK,NETWORK_ZOT), + array(t('Friendika'),t('OStatus'),t('RSS/Atom'),t('Email'),t('Diaspora'),t('Facebook'),t('Zot!')),$s); + +} diff --git a/mod/contacts.php b/mod/contacts.php index 8f851e9e0..5d72cff88 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -292,6 +292,9 @@ function contacts_content(&$a) { $lblsuggest = (($r[0]['network'] === NETWORK_DFRN) ? '<div id="contact-suggest-wrapper"><a href="fsuggest/' . $r[0]['id'] . '" id="contact-suggest">' . t('Suggest friends') . '</a></div>' : ''); + $poll_enabled = (($r[0]['network'] !== NETWORK_DIASPORA) ? true : false); + + $nettype = '<div id="contact-edit-nettype">' . sprintf( t('Network type: %s'),network_to_name($r[0]['network'])) . '</div>'; $o .= replace_macros($tpl,array( '$header' => t('Contact Editor'), @@ -312,7 +315,9 @@ function contacts_content(&$a) { '$lblsuggest' => $lblsuggest, '$grps' => $grps, '$delete' => t('Delete contact'), - '$poll_interval' => contact_poll_interval($r[0]['priority']), + '$nettype' => $nettype, + '$poll_interval' => contact_poll_interval($r[0]['priority'],(! $poll_enabled)), + '$poll_enabled' => $poll_enabled, '$lastupdtext' => t('Last updated: '), '$updpub' => t('Update public posts: '), '$last_update' => $last_update, diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl index 66479210f..0ee88d372 100644 --- a/view/contact_edit.tpl +++ b/view/contact_edit.tpl @@ -3,6 +3,8 @@ <div id="contact-edit-banner-name">$name</div> +$nettype + <form action="contacts/$contact_id" method="post" > <input type="hidden" name="contact_id" value="$contact_id"> @@ -28,13 +30,14 @@ </div> <div id="contact-edit-nav-end"></div> - + {{ if $poll_enabled }} <div id="contact-edit-poll-wrapper"> <div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span></div> <div id="contact-edit-poll-text">$updpub</div> $poll_interval - <div id="contact-edit-update-now"><a href="contacts/$contact_id/update">$udnow</a></div> + <div id="contact-edit-update-now"><a href="contacts/$contact_id/update" >$udnow</a></div> </div> + {{ endif }} </div> <div id="contact-edit-end" ></div> diff --git a/view/theme/dispy/style.css b/view/theme/dispy/style.css index aa8d82bbb..78efb57ff 100644 --- a/view/theme/dispy/style.css +++ b/view/theme/dispy/style.css @@ -723,7 +723,7 @@ div[id$="wrapper"] br { clear: left; } #contact-edit-last-update-text { margin-bottom: 15px; } #contact-edit-last-updated { font-weight: bold; } #contact-edit-poll-text { display: inline; } -#contact-edit-end { clear: both; } +#contact-edit-end { clear: both; margin-bottom: 65px;} .contact-photo-menu-button { position: absolute; diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 6ac28cb95..f47af934c 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -788,6 +788,7 @@ input#dfrn-url { #contact-edit-end { clear: both; + margin-bottom: 65px; } #fsuggest-desc, #fsuggest-submit-wrapper { @@ -1378,6 +1379,12 @@ input#dfrn-url { margin-left: 30px; } +#contact-edit-nettype { + margin-top: 5px; + margin-left: 30px; +} + + #contact-edit-poll-wrapper { margin-left: 50px; margin-top: 30px; diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 74d9058f7..781526eae 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -886,6 +886,7 @@ input#dfrn-url { #contact-edit-end { clear: both; + margin-bottom: 65px; } .contact-photo-menu-button { @@ -1451,6 +1452,11 @@ padding: 5px 10px 0px; font-weight: bold; margin-left: 30px; } +#contact-edit-nettype { + margin-top: 5px; + margin-left: 30px; +} + #contact-edit-poll-wrapper { margin-left: 50px; |