diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 1a30656c4..8f85accf7 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -506,21 +506,24 @@ $text .= "
"; - $text .= "Company - ".$frm->text('contact_info[company]', varset($pref['contact_info']['company']), 200, ['size'=>'block-level', 'placeholder'=>'My Company'])." + $text .= "Organization + ".$frm->text('contact_info[organization]', varset($pref['contact_info']['organization']), 200, ['size'=>'block-level', 'placeholder'=>'eg. My Company Inc.'])." "; $text .= "Address - ".$frm->textarea('contact_info[address]', varset($pref['contact_info']['address']), 2, 80, ['size'=>'block-level', 'placeholder'=>'123 address st. city, state, zip/postal, country'])." + ".$frm->textarea('contact_info[address]', varset($pref['contact_info']['address']), 2, 80, ['size'=>'block-level', 'placeholder'=>"eg. 123 Address St.\nCity, State, Zip/postal\nCountry"])." "; + + $contactFields = [ 'phone1' => ['label'=>'Phone', 'placeholder'=>'+1-555-555-5555'], 'phone2' => ['label'=>'Phone', 'placeholder'=>'+1-444-444-4444'], 'phone3' => ['label'=>'Phone', 'placeholder'=>'+1-333-333-3333'], 'fax' => ['label'=>'Fax', 'placeholder'=>'+1-555-555-5555'], - 'email1' => ['label'=>LAN_EMAIL, 'placeholder'=>'info@mycompany.com'], - 'email2' => ['label'=>LAN_EMAIL, 'placeholder'=>'sales@mycompany.com'] + 'email1' => ['label'=>LAN_EMAIL, 'placeholder'=>'info@myorganization.com'], + 'email2' => ['label'=>LAN_EMAIL, 'placeholder'=>'sales@myorganization.com'], + 'coordinates' => ['label'=>"Map Coordinates", 'placeholder'=>'eg. 36.169941,-115.139832 or leave blank to use address'], ]; foreach($contactFields as $type => $var) @@ -531,7 +534,13 @@ $text .= "
"; } + $text .= "Hours + ".$frm->textarea('contact_info[hours]', varset($pref['contact_info']['hours']), 2, 80, ['size'=>'block-level', 'placeholder'=>"eg. Mon - Fri (9am-5pm)\nSat (closed)\nSun (closed)"])." + "; + $text .= "Custom message + ".$frm->textarea('contact_info[message]', varset($pref['contact_info']['message']), 2, 80, ['size'=>'block-level', 'placeholder'=>"(Optional) Custom text message."])." + "; $text .= ""; diff --git a/e107_core/shortcodes/batch/contact_shortcodes.php b/e107_core/shortcodes/batch/contact_shortcodes.php index b62fda558..ae6a34720 100644 --- a/e107_core/shortcodes/batch/contact_shortcodes.php +++ b/e107_core/shortcodes/batch/contact_shortcodes.php @@ -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 ''; + return ''; } @@ -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 ""; } @@ -249,11 +251,12 @@ class contact_shortcodes extends e_shortcode $pp = e107::getParser()->replaceConstants($pp, 'full'); $class = (!empty($parm['class'])) ? $parm['class'] : ''; $link = sprintf('%s', $class, $pp, LANCONTACT_22); - $text = e107::getParser()->lanVars(LANCONTACT_23, $link); - return $text; + + return e107::getParser()->lanVars(LANCONTACT_23, $link); + } } -?> + diff --git a/e107_core/templates/contact_template.php b/e107_core/templates/contact_template.php index 95d6d1934..836793ab5 100644 --- a/e107_core/templates/contact_template.php +++ b/e107_core/templates/contact_template.php @@ -13,7 +13,8 @@ if (!defined('e107_INIT')) { exit; } $CONTACT_WRAPPER['info']['CONTACT_INFO'] = "
{---}
"; -$CONTACT_WRAPPER['info']['CONTACT_INFO: type=company'] = "

{---}

"; +$CONTACT_WRAPPER['info']['CONTACT_INFO: type=organization'] = "

{---}

"; +$CONTACT_WRAPPER['info']['CONTACT_INFO: type=message'] = "

{---}

"; $CONTACT_WRAPPER['info']['CONTACT_INFO: type=address'] = "
{GLYPH=fa-map-marker} {---}
"; $CONTACT_WRAPPER['info']['CONTACT_INFO: type=email1'] = "
{GLYPH=fa-envelope} {---}
"; $CONTACT_WRAPPER['info']['CONTACT_INFO: type=email2'] = "
{GLYPH=fa-envelope} {---}
"; @@ -21,6 +22,7 @@ $CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone1'] = "
{GLYPH=fas-phone-a $CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone2'] = "
{GLYPH=fas-phone-alt} {---}
"; $CONTACT_WRAPPER['info']['CONTACT_INFO: type=phone3'] = "
{GLYPH=fas-phone-alt} {---}
"; $CONTACT_WRAPPER['info']['CONTACT_INFO: type=fax'] = "
{GLYPH=fa-fax} {---}
"; +$CONTACT_WRAPPER['info']['CONTACT_INFO: type=hours'] = "
{GLYPH=fa-clock} {---}
"; $CONTACT_TEMPLATE['info'] = " @@ -29,9 +31,10 @@ $CONTACT_TEMPLATE['info'] = " {SITECONTACTINFO} - {CONTACT_INFO: type=company} + {CONTACT_INFO: type=organization} + {CONTACT_INFO: type=message}
-
+
{CONTACT_INFO: type=address}
{CONTACT_INFO: type=phone1} @@ -41,8 +44,10 @@ $CONTACT_TEMPLATE['info'] = "
{CONTACT_INFO: type=email1} {CONTACT_INFO: type=email2} +
+ {CONTACT_INFO: type=hours}
-
+
{CONTACT_MAP: zoom=city}
diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css index d19afdbd4..45a42eebb 100644 --- a/e107_web/css/e107.css +++ b/e107_web/css/e107.css @@ -381,8 +381,8 @@ cursor: pointer; #uiAlert { z-index: 10001 } #uiAlert .alert { z-index:10000; box-shadow:1px 4px 5px rgba(0,0,0,0.4) } #uiAlert.notifications { top: 48%; left: 0; width: 100%; } - -#contactInfo iframe.sc-contact-map { width:100%; min-height:195px } +#contactInfo .row { display: flex } +#contactInfo iframe.sc-contact-map { width:100%; height:100%; } #login-template { max-width: 330px; margin-right: auto; margin-left: auto; }