Page MenuHomePhabricator

No OneTemporary

diff --git a/templates/typ-profile.html.twig b/templates/typ-profile.html.twig
--- a/templates/typ-profile.html.twig
+++ b/templates/typ-profile.html.twig
@@ -1,234 +1,229 @@
{% set base_images = 'http://media.yellowpages.co.th/yellowpages' %}
{% set base_promotion = promotion.baseurl %}
<div class="margin-tb-fifteen padding-lr-thity typ-profile-freelist col-md-12 col-sm-12 col-xs-12 ">
<div class="no-gutter col-md-12 col-sm-12 col-xs-12">
{% if profile.logo %}
<div class="typ-medium-img col-md-3 col-sm-3 col-xs-12"> {#logo#}
<img class="img-responsive" src="{{ profile.logo }}"/>
</div>
{% else %}
<div class="typ-medium-img col-md-3 col-sm-3 col-xs-12">
<img class="img-responsive typ-default-border" src="/themes/contrib/typtheme/images/logo/logo-y-default.jpg"/>
</div> {#end logo#}
{% endif %}
<div class="col-md-7 col-sm-7 col-xs-6">
<h1>{{ profile.humanname|raw }}</h1>
{% if profile.districtname or profile.cityname %}
{{ [profile.districtname,profile.cityname]|join(' ') }}
{% endif %}
{% if profile.headings %}
<p class="typ-txt-bold">
{% trans %}Category{% endtrans %} :
{% for key, heading in profile.headings %}
{% if loop.last %}
<a href="{{ base_path }}heading/{{ heading.headingname }}">{{ heading.headingname|raw }}</a>
{% else %}
<a href="{{ base_path }}heading/{{ heading.headingname }}">{{ heading.headingname|raw }}</a>,
{% endif %}
{% endfor %}
</p>
{% endif %}
</div>
<div class="col-md-2 col-sm-2 col-xs-6">
<p>{% trans %} Views {% endtrans %} : xxxxx </p>
</div>
</div>
{#description#}
<div class="margin-top-thirty col-md-12 col-sm-12 col-xs-12 typ-profile-freelist-desc">
{% if profile.profile %}
<p>{{ profile.profile|raw }}</p>
{% endif %}
{% if profile.proddesc %}
<strong>{% trans %} Product And Service {% endtrans %}</strong>
<p>{{ profile.proddesc|raw }}</p>
{% endif %}
{% if profile.brandname %}
<strong>{% trans %}Brand Name{% endtrans %}</strong>
<p>{{ profile.brandname|replace({"<p>":" ","</p>":" "}) }}</p>
{% endif %}
</div> {#end description#}
{#picture#}
{% if profile.pictures %}
<div class="typ-profile-img margin-top-thirty col-md-12 col-sm-12 col-xs-12">
<ul class="no-gutter">
{% for key, picture in profile.pictures %}
<li>
<img src="{{ picture.file }}" alt="" />
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{#end picture#}
{#contact#}
<div class="typ-address-content margin-top-thirty col-md-12 col-sm-12 col-xs-12">
<h1>{% trans %} Contact Information {% endtrans %}</h1>
{#Business Name.#}
{% if profile.humanname %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Business Name {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{{ profile.humanname }}
</div>
</div>
{% endif %}
{#address#}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Address {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{{ [profile.addr,profile.soi,profile.road,profile.subdistrictname,profile.districtname,profile.cityname,profile.postcode]|join(' ') }}
</div>
</div>
{#tel.#}
{% if profile.telno %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Tel {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{% if profile.telno %}
{% for key, tel in profile._format.telno %}
{% if loop.last %}
<a href='tel:{{ tel }}'>{{ tel }}</a>
{% else %}
<a href='tel:{{ tel }}'>{{ tel }}</a>,
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
{#fax#}
{% if profile.fax %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Fax {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{% if profile.fax %}
{% for key, fax in profile._format.fax %}
{% if loop.last %}
<a href="tel:{{ fax }}">{{ fax }}</a>
{% else %}
<a href="tel:{{ fax }}">{{ fax }}</a>,
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
{#e-mail#}
{% if profile.email %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Email {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{% if profile.email %}
{% for key , mail in profile.email %}
{% if loop.last %}
<a href="mailto:{{ mail }}">{{ mail }}</a>
{% else %}
<a href="mailto:{{ mail }}">{{ mail }}</a>,
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
{#website#}
{% if profile.website %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Website {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{% if profile.website %}
{% for key , web in profile.website %}
{% if loop.last %}
<a href="{{key|trim }}" target="_blank">{{web}}</a>
{% else %}
<a href="{{key|trim}}" target="_blank">{{web}}</a>,
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
{#work-time#}
{% if profile.workinghours %}
<div class="typ-address-detail col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-sm-3 col-xs-12">
<p class="typ-txt-bold">{% trans %} Work-Time {% endtrans %}:</p>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
{% if not profile.workinghours %}
{% else %}
{{ profile._format.workinghours }}
{% endif %}
</div>
</div>
{% endif %}
</div> {#end contact#}
{#Map#}
{% if profile.location.lat and profile.location.lon %}
<div class="margin-top-thirty col-md-12 col-sm-12 col-xs-12">
<div class="google-map-size">
- <iframe width="100%" scrolling="no" frameborder="0" src="/modules/typ/typ_profile/yp_map.php?latitude={{ profile.location.lat }}&amp;longitude={{ profile.location.lon }}&amp;height=420&amp;width=445" allowtransparency="true" marginwidth="0" marginheight="0"></iframe>
+ <iframe width="100%" scrolling="no" frameborder="0" src="/api/ypmap?latitude={{ profile.location.lat }}&amp;longitude={{ profile.location.lon }}&amp;height=420&amp;width=445&amp;is_plain=true" allowtransparency="true" marginwidth="0" marginheight="0"></iframe>
<div class="text-center">
- <a class="iframe btn btn-md typ-link-btn" href="/modules/typ/typ_profile/yp_map.php?bypass=1&latitude={{ profile.location.lat }}&longitude={{ profile.location.lon }}&iframe=true&width=800&height=580">{% trans %}View list on search by map {% endtrans %}</a>
+ <a class="iframe btn btn-md typ-link-btn" href="/api/ypmap?bypass=1&latitude={{ profile.location.lat }}&longitude={{ profile.location.lon }}&iframe=true&width=800&height=580&is_plain=true">{% trans %}View list on search by map {% endtrans %}</a>
<a class="btn btn-md typ-link-btn" target="_blank" href="http://maps.google.com/maps?z=10&t=m&q=loc:{{ profile.location.lat }},{{ profile.location.lon }}">{% trans %} Navigation {% endtrans %}</a>
</div>
- {#<iframe width="100%" scrolling="no" frameborder="0" src="/modules/typ/typ_profile/controller/TYPYPMapController?latitude={{ profile.location.lat }}&amp;longitude={{ profile.location.lon }}&amp;height=420&amp;width=445" allowtransparency="true" marginwidth="0" marginheight="0"></iframe>#}
- {#<div class="text-center">#}
- {#<a class="iframe btn btn-md typ-link-btn" href="/modules/typ/typ_profile/controller/TYPYPMapController?bypass=1&latitude={{ profile.location.lat }}&longitude={{ profile.location.lon }}&iframe=true&width=800&height=580">{% trans %}View list on search by map {% endtrans %}</a>#}
- {#<a class="btn btn-md typ-link-btn" target="_blank" href="http://maps.google.com/maps?z=10&t=m&q=loc:{{ profile.location.lat }},{{ profile.location.lon }}">{% trans %} Navigation {% endtrans %}</a>#}
- {#</div>#}
</div>
</div>
{% endif %}
{#end Map#}
<div class="margin-top-thirty col-md-12 col-sm-12 col-xs-12">
<h3>{% trans %} Comment {% endtrans %}</h3>
<hr/>
</div>
{#facebook#}
<div class="col-md-12 col-sm-12 col-xs-12">
{{ app.request.getRequestUri() }}
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=986936604724797";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-width="100%" data-href="http://{{ facebook_comment }}" data-numposts="5"></div>
</div> {#end facebook#}
</div> {#end typ profile freelist#}
<input type="hidden" class="catname" value="{{ profile.headingname|raw }}">
<input type="hidden" class="lang" value="{{ profile.lang|raw }}">
<input type="hidden" class="cat_address" value="{{ [profile.subdistrictname,profile.districtname,profile.cityname,profile.postcode]|join(' ') }}">
diff --git a/templates/typ-ypmap.html.twig b/templates/typ-ypmap.html.twig
--- a/templates/typ-ypmap.html.twig
+++ b/templates/typ-ypmap.html.twig
@@ -1,81 +1,81 @@
{#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">#}
{#<html xmlns="http://www.w3.org/1999/xhtml">#}
{#<head>#}
{#<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />#}
{#<meta name="viewport" content="initial-scale=1.0, user-scalable=no">#}
{#<title>แผนที่</title>#}
{% if latitude or longitude %}
<!-- Google Map API -->
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>var jQuery_1_1_3 = $.noConflict(true);</script>
- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDC0YkSE1985EKtSMMlczky7zORmSQtn6Y&language=th"></script>
+ <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCy6wD8CNZqyxEuF0z6COU4uICKu2iXQU&language=th"></script>
<style type="text/css">
#map-canvas{
/*width: "{{ height }}px";
height: "{{ width }}"; */
width: "{{ width }}px";
height: "{{ height }}";
}
</style>
<script type="text/javascript">
var map;
// jQuery_1_1_3(".zoom", window.parent.document).hide();
function initialize(){
// alert("Tab Show Arealdy");
google.maps.event.trigger(map, 'resize');
var center = new google.maps.LatLng({{ latitude }},{{ longitude }});
map.setCenter(center);
//jQuery_1_1_3("#map-canvas").after(btt);<a target='_blank' href='https://www.google.co.th/maps/search/{{ latitude }},{{ longitude }}'>Zoom</a>");
}
function loadMap() {
jQuery_1_1_3("#mapClick").remove();
jQuery_1_1_3( "#map-canvas" ).animate({
height: {{ height }}
}, 200, function() {
initialize();
});
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng({{ latitude }},{{ longitude }})
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng({{ latitude }},{{ longitude }}), map: map,
- icon:"{{ LandingPage_URL }}/images/map_pointer.png"
+ icon:"/themes/contrib/typtheme/images/icon/marker/icon-pin-1.png"
});
}
</script>
{#</head>#}
<style type="text/css">
*{padding:0;margin:0;}
</style>
<body {% if bypass %} onload="loadMap()" {% endif %} >
<div id="map-canvas">
{% if not bypass %}
{#<a id="mapClick" href="#" onclick="loadMap(); return false;">#}
<a id="mapClick" href="#" onclick="loadMap(); return false;">
<img class="google_map_mobile"width="100%" src="/modules/typ/typ_profile/digital-map-610x340.jpg">
</a>
{% endif %}
</div>
</body>
{#</html>#}
{% endif %}
\ No newline at end of file
diff --git a/typ_profile.module b/typ_profile.module
--- a/typ_profile.module
+++ b/typ_profile.module
@@ -1,56 +1,61 @@
<?php
/**
* @file
* Module file for tablesort_example.
*/
/**
* @defgroup tablesort_example Example: Tablesort
* @ingroup examples
* @{
* Example of a sortable table display.
* Three columns are sortable (Numbers, Letters and Mixture)
* We are using TableSort Extender
* extend('Drupal\Core\Database\Query\TableSortExtender')
*/
/**
* @} End of "defgroup tablesort_example".
*/
//namespace Drupal\typ\Form;
/*if (class_exists("\TYP\Legacy\Form\TYPLegacyCustomerController")) {
echo 'yes';
} else {
echo 'no';
}
exit;
*/
function typ_profile_theme() {
return array(
'typ_profile' => array(
'variables' => array(
'profile' => NULL,
'prodescription' => NULL,
'catalog' => NULL,
'type' => NULL,
'promotion' => NULL,
'breadcrumbs' => NULL,
'base_path' => NULL,
'facebook_comment' => NULL,
)
),
'typ_promotion' => array(
'variables' => array(
'url' => NULL
)
),
'typ_ypmap' => array(
'variables' => array(
+ 'latitude' => NULL,
+ 'longitude' => NULL,
+ 'width' => NULL,
+ 'height' => NULL,
+ 'bypass' => NULL
)
)
);
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Dec 24, 11:08 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
193697

Event Timeline