From df14d7abc472b49c8cb503dde789c9658ab73366 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 12 Jan 2012 18:54:35 -0800 Subject: [PATCH] allow crepair to change name - as long as it isn't blank --- mod/crepair.php | 6 +++++- view/crepair.tpl | 36 ++++++++++++++++++--------------- view/theme/testbubble/style.css | 11 ++++++++++ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/mod/crepair.php b/mod/crepair.php index 5366352784..ec963b1053 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -50,6 +50,7 @@ function crepair_post(&$a) { $contact = $r[0]; + $name = ((x($_POST,'name')) ? $_POST['name'] : $contact['name']); $nick = ((x($_POST,'nick')) ? $_POST['nick'] : ''); $url = ((x($_POST,'url')) ? $_POST['url'] : ''); $request = ((x($_POST,'request')) ? $_POST['request'] : ''); @@ -59,8 +60,9 @@ function crepair_post(&$a) { $attag = ((x($_POST,'attag')) ? $_POST['attag'] : ''); $photo = ((x($_POST,'photo')) ? $_POST['photo'] : ''); - $r = q("UPDATE `contact` SET `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `attag` = '%s' + $r = q("UPDATE `contact` SET `name` = '%s', `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `attag` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + dbesc($name), dbesc($nick), dbesc($url), dbesc($request), @@ -139,6 +141,8 @@ function crepair_content(&$a) { $o .= '
' . $msg2 . EOL . EOL. $msg3 . '
'; + $o .= EOL . '' . t('Return to contact editor') . '' . EOL; + $tpl = get_markup_template('crepair.tpl'); $o .= replace_macros($tpl, array( '$label_name' => t('Name'), diff --git a/view/crepair.tpl b/view/crepair.tpl index 94472d4482..a3e532b615 100644 --- a/view/crepair.tpl +++ b/view/crepair.tpl @@ -3,36 +3,40 @@

$contact_name

- - + +
- - + +
- - + +
- - + + +
+ + +
- - + +
- - + +
- - + +
- - + +
diff --git a/view/theme/testbubble/style.css b/view/theme/testbubble/style.css index 9901d14699..118fc2e7cc 100644 --- a/view/theme/testbubble/style.css +++ b/view/theme/testbubble/style.css @@ -2211,6 +2211,17 @@ margin-left: 0px; color: #efefef; } +.crepair-label { + margin-top: 10px; + float: left; + width: 250px; +} + +.crepair-input { + margin-top: 10px; + float: left; + width: 200px; +} /* ===================================== */ /* = Register, Settings, Profile Forms = */ -- 2.39.5