diff --git a/src/Controller/TYPYPMapController.php b/src/Controller/TYPYPMapController.php --- a/src/Controller/TYPYPMapController.php +++ b/src/Controller/TYPYPMapController.php @@ -1,44 +1,49 @@ 'typ_ypmap', '#latitude' => $latitude, '#longitude' => $longitude, '#height' => $height, '#width' => $width, '#bypass' => $_GET['bypass'], '#LandingPage_URL' => $LandingPage_URL ); return $display; } } \ No newline at end of file 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,229 +1,234 @@ {% set base_images = 'http://media.yellowpages.co.th/yellowpages' %} {% set base_promotion = promotion.baseurl %}
{% if profile.logo %}
{#logo#}
{% else %}
{#end logo#} {% endif %}

{{ profile.humanname|raw }}

{% if profile.districtname or profile.cityname %} {{ [profile.districtname,profile.cityname]|join(' ') }} {% endif %} {% if profile.headings %}

{% trans %}Category{% endtrans %} : {% for key, heading in profile.headings %} {% if loop.last %} {{ heading.headingname|raw }} {% else %} {{ heading.headingname|raw }}, {% endif %} {% endfor %}

{% endif %}

{% trans %} Views {% endtrans %} : xxxxx

{#description#}
{% if profile.profile %}

{{ profile.profile|raw }}

{% endif %} {% if profile.proddesc %} {% trans %} Product And Service {% endtrans %}

{{ profile.proddesc|raw }}

{% endif %} {% if profile.brandname %} {% trans %}Brand Name{% endtrans %}

{{ profile.brandname|replace({"

":" ","

":" "}) }}

{% endif %}
{#end description#} {#picture#} {% if profile.pictures %}
{% endif %} {#end picture#} {#contact#}

{% trans %} Contact Information {% endtrans %}

{#Business Name.#} {% if profile.humanname %}

{% trans %} Business Name {% endtrans %}:

{{ profile.humanname }}
{% endif %} {#address#}

{% trans %} Address {% endtrans %}:

{{ [profile.addr,profile.soi,profile.road,profile.subdistrictname,profile.districtname,profile.cityname,profile.postcode]|join(' ') }}
{#tel.#} {% if profile.telno %}

{% trans %} Tel {% endtrans %}:

{% if profile.telno %} {% for key, tel in profile._format.telno %} {% if loop.last %} {{ tel }} {% else %} {{ tel }}, {% endif %} {% endfor %} {% endif %}
{% endif %} {#fax#} {% if profile.fax %}

{% trans %} Fax {% endtrans %}:

{% if profile.fax %} {% for key, fax in profile._format.fax %} {% if loop.last %} {{ fax }} {% else %} {{ fax }}, {% endif %} {% endfor %} {% endif %}
{% endif %} {#e-mail#} {% if profile.email %}

{% trans %} Email {% endtrans %}:

{% if profile.email %} {% for key , mail in profile.email %} {% if loop.last %} {{ mail }} {% else %} {{ mail }}, {% endif %} {% endfor %} {% endif %}
{% endif %} {#website#} {% if profile.website %}

{% trans %} Website {% endtrans %}:

{% if profile.website %} {% for key , web in profile.website %} {% if loop.last %} {{web}} {% else %} {{web}}, {% endif %} {% endfor %} {% endif %}
{% endif %} {#work-time#} {% if profile.workinghours %}

{% trans %} Work-Time {% endtrans %}:

{% if not profile.workinghours %} {% else %} {{ profile._format.workinghours }} {% endif %}
{% endif %}
{#end contact#} {#Map#} {% if profile.location.lat and profile.location.lon %}
{% endif %} {#end Map#}

{% trans %} Comment {% endtrans %}


{#facebook#}
{{ app.request.getRequestUri() }}
{#end facebook#}
{#end typ profile freelist#} 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,75 +1,81 @@ - - - - - - แผนที่ +{##} +{##} +{##} + {##} + {##} + {#แผนที่#} + +{% if latitude or longitude %} - + - +{##} - - -{% if latitude||longitude %} - + -
- {%if bypass %} - - - - {% endif %} -
+ +
+ {% if not bypass %} + + {##} + + + + {% endif %} +
- {% endif %} - +{##} +{% 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,62 +1,56 @@ 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, - 'height' => NULL, - 'width' => NULL, - 'bypass' => NULL, - 'LandingPage_URL' => NULL ) ) ); } diff --git a/typ_profile.routing.yml b/typ_profile.routing.yml --- a/typ_profile.routing.yml +++ b/typ_profile.routing.yml @@ -1,38 +1,37 @@ #typ_profile_search: # path: '/profile/{bizid}' # defaults: # _controller: '\Drupal\typ_profile\Controller\TYPProfileController::profilePage' # _title_callback: '\Drupal\typ_profile\Controller\TYPProfileController::profileTitle' # requirements: # _permission: 'access content' typ_profile.page: path: '/profile/{bizid}' defaults: _controller: '\Drupal\typ_profile\Controller\TYPProfileController::profilePage' _title_callback: '\Drupal\typ_profile\Controller\TYPProfileController::profileTitle' requirements: _permission: 'access content' typ_profile.ypmap: path: '/api/ypmap' defaults: _controller: '\Drupal\typ_profile\Controller\TYPYPMapController::ypmap' -# _title_callback: '\Drupal\typ_profile\Controller\TYPProfileController::profileTitle' requirements: _permission: 'access content' #typ_profile_promotion: # path: '/profile/get-promotion' # defaults: # _controller: '\Drupal\typ_profile\Controller\TYPProfileController::getPromotion' # _title_callback: '\Drupal\typ_profile\Controller\TYPProfileController::getTitlePromotion' # requirements: # _permission: 'access content' #typ_profile_redirect: # path: '/profile' # defaults: # _controller: '\Drupal\typ_profile\Controller\TYPProfileController::profileOverview' # _title: 'Rredirect ' # requirements: # _permission: 'access content' \ No newline at end of file diff --git a/yp_map.php b/yp_map.php --- a/yp_map.php +++ b/yp_map.php @@ -1,116 +1,46 @@ - +use Drupal\Core\Controller\ControllerBase; - - - - - - แผนที่ - - - - - +class yp_map extends ControllerBase +{ + public function __construct() + { - - - - - - -"; -} else { - echo ""; -}?> -
- - - - - - -
- - - + $display[] = array( + '#theme' => 'typ_ypmap', + '#latitude' => $latitude, + '#longitude' => $longitude, + '#height' => $height, + '#width' => $width, + '#bypass' => $_GET['bypass'], + '#LandingPage_URL' => $LandingPage_URL + ); + return $display; + } +} \ No newline at end of file