]> git.sur5r.net Git - contagged/commitdiff
Merge commit '0ca5fea0cc893684982894e474a00176853535e6' into cweiske
authorAndreas Gohr <gohr@cosmocode.de>
Tue, 26 Aug 2014 09:41:51 +0000 (11:41 +0200)
committerAndreas Gohr <gohr@cosmocode.de>
Tue, 26 Aug 2014 09:41:51 +0000 (11:41 +0200)
* commit '0ca5fea0cc893684982894e474a00176853535e6':
  fix missing space in company address
  hide counter reset
  support non-http URLs in labeledURI fields (e.g. xmpp or mailto)
  support multiple URLs

Conflicts:
inc/functions.php

inc/fields.php
inc/functions.php
inc/smarty/plugins/modifier.http.php
templates/entry_edit.tpl
templates/entry_show.tpl

index 25e05085be232fc0d4e70e03a7b528438ad54ab4..0c236be696a51d1d33b7c4cf5938f15719736cc2 100644 (file)
@@ -38,7 +38,7 @@ $FIELDS = array(
     'homephone'    => 'homePhone',
     'homestreet'   => 'homePostalAddress',
     'photo'        => 'jpegPhoto',
-    'url'          => 'labeledURI',
+    '_url'         => 'labeledURI',
     'note'         => 'description',
     'manager'      => 'manager',                     // aka. key account
     '_mail'        => 'mail',
index 301148c63b91a53693e4cf6f29e3667dd3b54297..2032a037e9a888e57c3d4361d7fd85dbd5e557dd 100644 (file)
@@ -526,4 +526,3 @@ function get_fields_from_template($tpl){
     return $return;
 }
 
-?>
index ecb52e76b0f9df53b79f7fdc2c25b22e4d4579e2..f55ccb96dc30d2d8d571a85474cc27038371de61 100644 (file)
@@ -22,8 +22,8 @@ function smarty_modifier_http($string){
     list($url,$name) = explode(' ',$string,2);
 
 
-    if(!preg_match('#^\w+://#',$url)){
-        $url = 'http://'.$url;
+    if(!parse_url($url, PHP_URL_SCHEME)) {
+        $url = 'http://' . $url;
     }
 
     if(!$name) $name = $url;
index ddad5dc60c7e868f2d25d932c2885f74effd1d09..9f9fe52b452397d2142937853a4c9973a4a19141 100644 (file)
         <tr>
           <td colspan="2"><h3>{$lang.communication}</h3></td>
         </tr>
-{if $fields.url}
+{if $fields._url}
+        {foreach from=$entry.url|smarty:nodefaults item=url}
         <tr>
-          <th>{$lang.url}:</th>
-          <td><input type="text" class="input" name="entry[url]" value="{$entry.url|h}" /></td>
+          <th>{$lang.url} {counter}:</th>
+          <td><input type="text" class="input" name="entry[url][]" value="{$url|h}" /></td>
+        </tr>
+        {/foreach}
+        <tr>
+          <th>{$lang.url} {counter}:</th>
+          <td><input type="text" class="input" name="entry[url][]" value="" /></td>
         </tr>
 {/if}
 {if $fields._mail}
+        <!--{counter start=0}-->
         {foreach from=$entry.mail|smarty:nodefaults item=mail}
         <tr>
           <th>{$lang.mail} {counter}:</th>
index 1c4da29b327846c59c815912a1bfa4bae6f34b78..c9e98cab21789cd66f390a1faee73e8f9985eb9c 100644 (file)
 {if $entry.url}
           <tr>
             <th>{$lang.url}:</th>
-            <td>{$entry.url|http}</td>
+            <td>
+              {foreach from=$entry.url item=url}
+                {$url|http}<br/>
+              {/foreach}
+            </td>
           </tr>
 {/if}
 {if $entry.mail}