mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 18:14:26 +02:00
Issue #4372 Extra fields.
This commit is contained in:
@@ -107,12 +107,14 @@ class contact_shortcodes extends e_shortcode
|
||||
{
|
||||
$pref = e107::getPref('contact_info');
|
||||
|
||||
if(empty($pref['address']))
|
||||
if(empty($pref['address']) && empty($pref['coordinates']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$address = trim($pref['address']);
|
||||
$address = !empty($pref['coordinates']) ? $pref['coordinates'] : $pref['address'];
|
||||
$address = trim($address);
|
||||
$address = str_replace("\n", " ", $address);
|
||||
|
||||
$zoom = varset($parm['zoom'], 'street');
|
||||
|
||||
@@ -127,7 +129,7 @@ class contact_shortcodes extends e_shortcode
|
||||
|
||||
// &z='.$zoom.'
|
||||
|
||||
return '<iframe class="sc-contact-map" src="https://maps.google.com/maps?q='.$address.'&output=embed&z='.$zoom.'"></iframe>';
|
||||
return '<iframe class="sc-contact-map" src="https://www.google.com/maps?q='.$address.'&output=embed&z='.$zoom.'"></iframe>';
|
||||
|
||||
}
|
||||
|
||||
@@ -146,7 +148,7 @@ class contact_shortcodes extends e_shortcode
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case "company":
|
||||
case "organization":
|
||||
$ret = $tp->toHTML($ipref[$type], true, 'TITLE');
|
||||
break;
|
||||
|
||||
@@ -195,7 +197,7 @@ class contact_shortcodes extends e_shortcode
|
||||
{
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control';
|
||||
$placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : '';
|
||||
$value = !empty($_POST['subject']) ? e107::getParser()->filter($_POST['subject'], 'str') : '';
|
||||
$value = !empty($_POST['subject']) ? e107::getParser()->filter($_POST['subject']) : '';
|
||||
return "<input type='text' id='contactSubject' title='".LANCONTACT_19."' name='subject' required='required' size='30' ".$placeholder." class='".$class."' value=\"".$value."\" />";
|
||||
}
|
||||
|
||||
@@ -249,11 +251,12 @@ class contact_shortcodes extends e_shortcode
|
||||
$pp = e107::getParser()->replaceConstants($pp, 'full');
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : '';
|
||||
$link = sprintf('<span class="%s"><a href="%s" target="_blank">%s</a></span>', $class, $pp, LANCONTACT_22);
|
||||
$text = e107::getParser()->lanVars(LANCONTACT_23, $link);
|
||||
return $text;
|
||||
|
||||
return e107::getParser()->lanVars(LANCONTACT_23, $link);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@@ -13,7 +13,8 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO'] = "<div>{---}</div>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=company'] = "<h4>{---}</h4>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=organization'] = "<h4>{---}</h4>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=message'] = "<p>{---}</p>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=address'] = "<address>{GLYPH=fa-map-marker} {---}</address>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=email1'] = "<div>{GLYPH=fa-envelope} {---}</div>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=email2'] = "<div>{GLYPH=fa-envelope} {---}</div>";
|
||||
@@ -21,6 +22,7 @@ $CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone1'] = "<div>{GLYPH=fas-phone-a
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone2'] = "<div>{GLYPH=fas-phone-alt} {---}</div>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone3'] = "<div>{GLYPH=fas-phone-alt} {---}</div>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=fax'] = "<div>{GLYPH=fa-fax} {---}</div>";
|
||||
$CONTACT_WRAPPER['info']['CONTACT_INFO: type=hours'] = "<div>{GLYPH=fa-clock} {---}</div>";
|
||||
|
||||
$CONTACT_TEMPLATE['info'] = "
|
||||
|
||||
@@ -29,9 +31,10 @@ $CONTACT_TEMPLATE['info'] = "
|
||||
<!-- Backward Compat. Contact Info -->
|
||||
{SITECONTACTINFO}
|
||||
<!-- New Contact Info -->
|
||||
{CONTACT_INFO: type=company}
|
||||
{CONTACT_INFO: type=organization}
|
||||
{CONTACT_INFO: type=message}
|
||||
<div class='row'>
|
||||
<div class ='col-md-6 col-lg-4 h=100'>
|
||||
<div class ='col-md-6 col-lg-4'>
|
||||
{CONTACT_INFO: type=address}
|
||||
<div class='form-group'>
|
||||
{CONTACT_INFO: type=phone1}
|
||||
@@ -41,8 +44,10 @@ $CONTACT_TEMPLATE['info'] = "
|
||||
</div>
|
||||
{CONTACT_INFO: type=email1}
|
||||
{CONTACT_INFO: type=email2}
|
||||
<br />
|
||||
{CONTACT_INFO: type=hours}
|
||||
</div>
|
||||
<div class ='col-md-6 col-lg-8 h=100'>
|
||||
<div class ='col-md-6 col-lg-8 flex-row'>
|
||||
{CONTACT_MAP: zoom=city}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user