]> git.mxchange.org Git - friendica.git/commitdiff
Add contact detail to contact drop confirm
authorFabrixxm <fabrix.xm@gmail.com>
Tue, 23 Jun 2015 08:09:27 +0000 (10:09 +0200)
committerFabrixxm <fabrix.xm@gmail.com>
Tue, 23 Jun 2015 08:09:27 +0000 (10:09 +0200)
fix #1629

mod/contacts.php
view/templates/confirm.tpl
view/templates/contact_drop_confirm.tpl [new file with mode: 0644]
view/templates/contact_template.tpl
view/theme/quattro/templates/contact_template.tpl

index 5d40ff9940ad318753a5ac4c5225979251cd3889..6ee9a4a92b23165e2df3a49cfb4583482d14e338 100644 (file)
@@ -404,7 +404,9 @@ function contacts_content(&$a) {
                                }
 
                                $a->page['aside'] = '';
-                               return replace_macros(get_markup_template('confirm.tpl'), array(
+                               
+                               return replace_macros(get_markup_template('contact_drop_confirm.tpl'), array(
+                                       '$contact' =>  _contact_detail_for_template($orig_record[0]),
                                        '$method' => 'get',
                                        '$message' => t('Do you really want to delete this contact?'),
                                        '$extra_inputs' => $inputs,
@@ -732,54 +734,9 @@ function contacts_content(&$a) {
        $contacts = array();
 
        if(count($r)) {
-
                foreach($r as $rr) {
-
-                       switch($rr['rel']) {
-                               case CONTACT_IS_FRIEND:
-                                       $dir_icon = 'images/lrarrow.gif';
-                                       $alt_text = t('Mutual Friendship');
-                                       break;
-                               case  CONTACT_IS_FOLLOWER;
-                                       $dir_icon = 'images/larrow.gif';
-                                       $alt_text = t('is a fan of yours');
-                                       break;
-                               case CONTACT_IS_SHARING;
-                                       $dir_icon = 'images/rarrow.gif';
-                                       $alt_text = t('you are a fan of');
-                                       break;
-                               default:
-                                       break;
-                       }
-                       if(($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
-                               $url = "redir/{$rr['id']}";
-                               $sparkle = ' class="sparkle" ';
-                       }
-                       else {
-                               $url = $rr['url'];
-                               $sparkle = '';
-                       }
-
-
-                       $contacts[] = array(
-                               'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
-                               'edit_hover' => t('Edit contact'),
-                               'photo_menu' => contact_photo_menu($rr),
-                               'id' => $rr['id'],
-                               'alt_text' => $alt_text,
-                               'dir_icon' => $dir_icon,
-                               'thumb' => proxy_url($rr['thumb']),
-                               'name' => $rr['name'],
-                               'username' => $rr['name'],
-                               'sparkle' => $sparkle,
-                               'itemurl' => $rr['url'],
-                               'url' => $url,
-                               'network' => network_to_name($rr['network']),
-                       );
+                       $contacts[] = _contact_detail_for_template($rr);
                }
-
-
-
        }
 
        $tpl = get_markup_template("contacts-template.tpl");
@@ -808,3 +765,48 @@ function contacts_content(&$a) {
 
        return $o;
 }
+
+function _contact_detail_for_template($rr){
+       switch($rr['rel']) {
+               case CONTACT_IS_FRIEND:
+                       $dir_icon = 'images/lrarrow.gif';
+                       $alt_text = t('Mutual Friendship');
+                       break;
+               case  CONTACT_IS_FOLLOWER;
+                       $dir_icon = 'images/larrow.gif';
+                       $alt_text = t('is a fan of yours');
+                       break;
+               case CONTACT_IS_SHARING;
+                       $dir_icon = 'images/rarrow.gif';
+                       $alt_text = t('you are a fan of');
+                       break;
+               default:
+                       break;
+       }
+       if(($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
+               $url = "redir/{$rr['id']}";
+               $sparkle = ' class="sparkle" ';
+       }
+       else {
+               $url = $rr['url'];
+               $sparkle = '';
+       }
+       
+       
+       return array(
+               'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
+               'edit_hover' => t('Edit contact'),
+               'photo_menu' => contact_photo_menu($rr),
+               'id' => $rr['id'],
+               'alt_text' => $alt_text,
+               'dir_icon' => $dir_icon,
+               'thumb' => proxy_url($rr['thumb']),
+               'name' => $rr['name'],
+               'username' => $rr['name'],
+               'sparkle' => $sparkle,
+               'itemurl' => $rr['url'],
+               'url' => $url,
+               'network' => network_to_name($rr['network']),
+       );
+       
+}
\ No newline at end of file
index bb9e159078477936bd18daaf8a7dfcbb7fd0f33b..a365678184b400804dcf0af7a986d9103f41c95a 100644 (file)
@@ -2,7 +2,7 @@
 <center>
 <form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}">
 
-       <span id="confirm-message">{{$message}}</span>
+       <h3 id="confirm-message">{{$message}}</h3>
        {{foreach $extra_inputs as $input}}
        <input type="hidden" name="{{$input.name}}" value="{{$input.value|escape:'html'}}" />
        {{/foreach}}
diff --git a/view/templates/contact_drop_confirm.tpl b/view/templates/contact_drop_confirm.tpl
new file mode 100644 (file)
index 0000000..9b9a359
--- /dev/null
@@ -0,0 +1,8 @@
+<h1>{{"Drop contact"|t}}</h1>\r
+\r
+{{include file="contact_template.tpl" no_contacts_checkbox=True}}\r
+\r
+{{include file="confirm.tpl"}}\r
+\r
+\r
+<div class="clear"></div>
\ No newline at end of file
index 196254960bc6c2dc9eaaa53910cdd2f55bc65308..d4f65f70f91c77c51c3a0ece4555e528f7bee513 100644 (file)
@@ -7,26 +7,28 @@
 
                        <a href="{{$contact.url}}" title="{{$contact.img_hover}}" /><img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" /></a>
 
+                       {{if !$no_contacts_checkbox}}
                        <input type="checkbox" class="contact-select" name="contact_batch[]" value="{{$contact.id}}">
+                       {{/if}}
                        {{if $contact.photo_menu}}
                        <span onclick="openClose('contact-photo-menu-{{$contact.id}}');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-{{$contact.id}}">menu</span>
-                <div class="contact-photo-menu" id="contact-photo-menu-{{$contact.id}}">
-                    <ul>
-                                               {{foreach $contact.photo_menu as $k=>$c}}
-                                               {{if $c.2}}
-                                               <li><a class="{{$k}}" target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
-                                               {{else}}
-                                               <li><a class="{{$k}}" href="{{$c.1}}">{{$c.0}}</a></li>
-                                               {{/if}}
-                                               {{/foreach}}
-                    </ul>
-                </div>
+                       <div class="contact-photo-menu" id="contact-photo-menu-{{$contact.id}}">
+                               <ul>
+                                       {{foreach $contact.photo_menu as $k=>$c}}
+                                       {{if $c.2}}
+                                       <li><a class="{{$k}}" target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
+                                       {{else}}
+                                       <li><a class="{{$k}}" href="{{$c.1}}">{{$c.0}}</a></li>
+                                       {{/if}}
+                                       {{/foreach}}
+                               </ul>
+                       </div>
                        {{/if}}
                </div>
                        
        </div>
        <div class="contact-entry-photo-end" ></div>
-               <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+       <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
 
        <div class="contact-entry-end" ></div>
 </div>
index a63ffb3c9ad068f4c760cc16f397407ce4edd45e..0f0207b2bf602aecc3a6a6fc8c24e4fc0310579c 100644 (file)
@@ -7,7 +7,9 @@
 
                        <a href="{{$contact.url}}" title="{{$contact.img_hover}}" /><img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" /></a>
 
+                       {{if !$no_contacts_checkbox}}
                        <input type="checkbox" class="contact-select" name="contact_batch[]" value="{{$contact.id}}">
+                       {{/if}}
                        {{if $contact.photo_menu}}
                        <a href="#" rel="#contact-photo-menu-{{$contact.id}}" class="contact-photo-menu-button icon s16 menu" id="contact-photo-menu-button-{{$contact.id}}">menu</a>
                        <ul class="contact-photo-menu menu-popup" id="contact-photo-menu-{{$contact.id}}">