]> git.mxchange.org Git - friendica.git/commitdiff
allow crepair to change name - as long as it isn't blank
authorfriendica <info@friendica.com>
Fri, 13 Jan 2012 02:54:35 +0000 (18:54 -0800)
committerfriendica <info@friendica.com>
Fri, 13 Jan 2012 02:54:35 +0000 (18:54 -0800)
mod/crepair.php
view/crepair.tpl
view/theme/testbubble/style.css

index 5366352784650e11ed7833f7d50478b38ddfe7e1..ec963b1053897cf912ebb8c6e83b18f2b6c10c54 100644 (file)
@@ -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 .= '<div class="error-message">' . $msg2 . EOL . EOL. $msg3 . '</div>';
 
+       $o .= EOL . '<a href="contacts/' . $cid . '">' . t('Return to contact editor') . '</a>' . EOL;
+
        $tpl = get_markup_template('crepair.tpl');
        $o .= replace_macros($tpl, array(
                '$label_name' => t('Name'),
index 94472d4482879ca2fcf96272d45b3db67ceaece3..a3e532b6159007e30d5b3fa488704d6a6b9dc661 100644 (file)
@@ -3,36 +3,40 @@
 
 <h4>$contact_name</h4>
 
-<label id="crepair-nick-label" for="crepair-nick">$label_nick</label>
-<input type="text" id="crepair-nick" name="nick" value="$contact_nick" />
+<label id="crepair-name-label" class="crepair-label" for="crepair-name">$label_name</label>
+<input type="text" id="crepair-name" class="crepair-input" name="name" value="$contact_name" />
 <div class="clear"></div>
 
-<label id="crepair-attag-label" for="crepair-attag">$label_attag</label>
-<input type="text" id="crepair-attag" name="attag" value="$contact_attag" />
+<label id="crepair-nick-label" class="crepair-label" for="crepair-nick">$label_nick</label>
+<input type="text" id="crepair-nick" class="crepair-input" name="nick" value="$contact_nick" />
 <div class="clear"></div>
 
-<label id="crepair-url-label" for="crepair-url">$label_url</label>
-<input type="text" id="crepair-url" name="url" value="$contact_url" />
+<label id="crepair-attag-label" class="crepair-label" for="crepair-attag">$label_attag</label>
+<input type="text" id="crepair-attag" class="crepair-input" name="attag" value="$contact_attag" />
 <div class="clear"></div>
 
-<label id="crepair-request-label" for="crepair-request">$label_request</label>
-<input type="text" id="crepair-request" name="request" value="$request" />
+<label id="crepair-url-label" class="crepair-label" for="crepair-url">$label_url</label>
+<input type="text" id="crepair-url" class="crepair-input" name="url" value="$contact_url" />
+<div class="clear"></div>
+
+<label id="crepair-request-label" class="crepair-label" for="crepair-request">$label_request</label>
+<input type="text" id="crepair-request" class="crepair-input" name="request" value="$request" />
 <div class="clear"></div>
  
-<label id="crepair-confirm-label" for="crepair-confirm">$label_confirm</label>
-<input type="text" id="crepair-confirm" name="confirm" value="$confirm" />
+<label id="crepair-confirm-label" class="crepair-label" for="crepair-confirm">$label_confirm</label>
+<input type="text" id="crepair-confirm" class="crepair-input" name="confirm" value="$confirm" />
 <div class="clear"></div>
 
-<label id="crepair-notify-label" for="crepair-notify">$label_notify</label>
-<input type="text" id="crepair-notify" name="notify" value="$notify" />
+<label id="crepair-notify-label" class="crepair-label" for="crepair-notify">$label_notify</label>
+<input type="text" id="crepair-notify" class="crepair-input" name="notify" value="$notify" />
 <div class="clear"></div>
 
-<label id="crepair-poll-label" for="crepair-poll">$label_poll</label>
-<input type="text" id="crepair-poll" name="poll" value="$poll" />
+<label id="crepair-poll-label" class="crepair-label" for="crepair-poll">$label_poll</label>
+<input type="text" id="crepair-poll" class="crepair-input" name="poll" value="$poll" />
 <div class="clear"></div>
 
-<label id="crepair-photo-label" for="crepair-photo">$label_photo</label>
-<input type="text" id="crepair-photo" name="photo" value="" />
+<label id="crepair-photo-label" class="crepair-label" for="crepair-photo">$label_photo</label>
+<input type="text" id="crepair-photo" class="crepair-input" name="photo" value="" />
 <div class="clear"></div>
 
 <input type="submit" name="submit" value="$lbl_submit" />
index 9901d146993505ff3b926ba53ad7543bd044ae44..118fc2e7ccf2e13f95cc4f0e06208ee90ed364d7 100644 (file)
@@ -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 = */