diff --git a/src/Plugin/Block/TYPProfileFacebook.php b/src/Plugin/Block/TYPProfileFacebook.php --- a/src/Plugin/Block/TYPProfileFacebook.php +++ b/src/Plugin/Block/TYPProfileFacebook.php @@ -1,55 +1,55 @@ getRequestUri(); $s = explode("/",$url); $bid = end($s); $this->data = \Drupal::service("typ.search")->getProfile($bid ,AUTO); $facebook = ''; if($this->data['customertype'] == 'FL' || $this->data['customertype'] == ''){ $facebook = format_string('
- -
Thailand YellowPages
'); + +
Thailand YellowPages
'); } $build = array(); $build[] = array( '#markup' => $facebook, ); return $build; } } \ No newline at end of file diff --git a/src/Plugin/Block/TYPProfileShareBlock.php b/src/Plugin/Block/TYPProfileShareBlock.php --- a/src/Plugin/Block/TYPProfileShareBlock.php +++ b/src/Plugin/Block/TYPProfileShareBlock.php @@ -1,1 +1,1 @@ -getRequestUri(); $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $s = explode("/",$url); $bid = end($s); $this->data = \Drupal::service("typ.search")->getProfile($bid ,AUTO); $this->result = \Drupal::service('typ.unvservice')->loadListing($this->data['customerid'],NULL); $type = $this->result['address'][$this->data['headingcode']][$this->data['addressid']]['customertype']; $telno = '';$fax = '';$workinghours = ''; if (!empty($this->data['telno'])) { foreach ($this->data['telno'] as $t) { $telno .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['fax'])) { foreach ($this->data['fax'] as $t) { $fax .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['workinghours'])) { $workinghours .= $this->formatWorkingHour($this->data['workinghours']); } $body_email = format_string(); switch ($type){ case "FL": $email = $body_email; $facebook = 'https://www.facebook.com/sharer/sharer.php?u='.format_string($this->data['proddesc']).$fullurl; $twitter = format_string($this->data['proddesc']).$fullurl; $gplus = 'https://plus.google.com/share?url='.$fullurl; break; default: $email = $body_email; $facebook = 'https://www.facebook.com/sharer/sharer.php?u='.format_string($this->data['proddesc']).$fullurl; $twitter = format_string($this->data['proddesc']).$fullurl; $gplus = 'https://plus.google.com/share?url='.$fullurl; } $base_url_images = '/themes/bootstrap/typ/images/icon-service-profilepage/'.$language; $email = base64_encode($email); header('Content-Type: text/html; charset=UTF-8'); $build = array(); $build[] = array( '#markup' => format_string('
'.t('If you own this business contact here').'
'.t('Total Promotion').'
'.t('Share this business here').'
'), ); $build['#attached']['library'] = array( 'typ_profile/profile_share' ); return $build; } } ?> \ No newline at end of file +getRequestUri(); $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $s = explode("/",$url); $bid = end($s); $this->data = \Drupal::service("typ.search")->getProfile($bid ,AUTO); $this->result = \Drupal::service('typ.unvservice')->loadListing($this->data['customerid'],NULL); $type = $this->result['address'][$this->data['headingcode']][$this->data['addressid']]['customertype']; $prodesc = $this->result['address'][$this->data['headingcode']][$this->data['addressid']][$language]['proddesc']; $telno = '';$fax = '';$workinghours = ''; if (!empty($this->data['telno'])) { foreach ($this->data['telno'] as $t) { $telno .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['fax'])) { foreach ($this->data['fax'] as $t) { $fax .= TYPProfileController::FormatPhoneNumber($t); } } if (!empty($this->data['workinghours'])) { $workinghours .= $this->formatWorkingHour($this->data['workinghours']); } $body_email = $this->data['humanname'].'%0A%0A'.$prodesc.'%0A%0A'."http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; switch ($type){ case "FL": $email = $body_email; $facebook = 'https://www.facebook.com/sharer/sharer.php?u='.format_string($this->data['proddesc']).$fullurl; $twitter = format_string($this->data['proddesc']).$fullurl; $gplus = 'https://plus.google.com/share?url='.$fullurl; break; default: $email = $body_email; $facebook = 'https://www.facebook.com/sharer/sharer.php?u='.format_string($this->data['proddesc']).$fullurl; $twitter = format_string($this->data['proddesc']).$fullurl; $gplus = 'https://plus.google.com/share?url='.$fullurl; } $base_url_images = '/themes/bootstrap/typ/images/icon-service-profilepage/'.$language; $email = base64_encode($email); header('Content-Type: text/html; charset=UTF-8'); $build = array(); $build[] = array( '#markup' => format_string('
'.t('If you own this business contact here').'
'.t('Total Promotion').'
'.t('Share this business here').'
'), ); $build['#attached']['library'] = array( 'typ_profile/profile_share' ); return $build; } } ?> \ 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,458 +1,458 @@ {% set base_images = 'http://media.yellowpages.co.th/yellowpages' %} {% set base_promotion = 'http://promotion.yellowpages.co.th/media/promotion/' %} -
+
{#{% if profile.logo %}#} {#
#} {##} {#
#} {#{% else %}#} {#
#} {##} {#
#} {#{% endif %}#}

{{ profile.humanname|raw }}

{% trans %}Category{% endtrans %} : {{ profile.headingname|raw }}

{% if type != 'FL' %} {% endif %}
{% if type != 'FL' %} {{ profile.profile|raw}} {% if profile.profile %}

{% endif %} {% else %} {{ profile.profile|raw|slice(0, 100)}}{% if profile.profile|length > 100 %}{{ '...

' }}{% endif %} {% if profile.profile %}

{% endif %} {% endif %} {#{% if not profile.addr %}{% else %}#} {#{% trans %} Address {% endtrans %}#} {#{{ [profile.addr,profile.soi,profile.road,profile.subdistrictname,#} {#profile.districtname,profile.cityname,profile.postcode]|join(' ') }}#} {#{% endif %}#} {#{% if profile.location.lat %}#} {#
#} {#{% else %}#} {#
#} {#{% endif %}#}
{% if not profile.addr %}{% else %} {% endif %} {% if not profile.telno %}{% else %} {% endif %} {% if not profile.fax %}{% else %} {% endif %} {% if not profile.email %}{% else %} {% endif %} {% if not profile.website %}{% else %} {% endif %} {% if not profile.workinghours %}{% else %} {% endif %}
{% trans %} Address {% endtrans %}: {{ [profile.addr,profile.soi,profile.road,profile.subdistrictname,profile.districtname,profile.cityname,profile.postcode]|join(' ') }}
{% trans %} Tel {% endtrans %}: {% if not profile.telno %} {% else %} {% if type == 'FL' %} {{ profile._format.telno.0 }}
{% else %} {% for key, tel in profile._format.telno %} - {% if loop.last != key+1 %}{{ tel }}{{ " ," }} + {% if loop.last != key+1 %}{{ tel }}{{ "," }} {% else %}{{ tel }}{% endif %} {% endfor %}
{% endif %} {% endif %}
{% trans %} Fax {% endtrans %}: {% if not profile.fax %} {% else %} {% if type == 'FL' %} {{ profile._format.fax.0 }}
{% else %} {% for key, fax in profile._format.fax %} - {% if loop.last != key+1 %}{{ fax }}{{ " ," }} + {% if loop.last != key+1 %}{{ fax }}{{ "," }} {% else %}{{ fax }}{% endif %} {% endfor %}
{% endif %} {% endif %}
{% trans %} Email {% endtrans %}: {% if not profile.email %} {% else %} {% if type == 'FL' %} {% set email = profile.email|split(',') %} {% for key , mail in email %} - {% if loop.last != key+1 %}{{ mail }} ,
+ {% if loop.last != key+1 %}{{ mail }},
{% else %}{{ mail }}
{% endif %} {% endfor %} {% else %} {% set email = profile.email|split(',') %} {% for key , mail in email %} - {% if loop.last != key+1 %}{{ mail }} ,
+ {% if loop.last != key+1 %}{{ mail }},
{% else %}{{ mail }}
{% endif %} {% endfor %} {% endif %} {% endif %}
{% trans %} Website {% endtrans %}: {% if not profile.website %} {% else %} {% set website = profile.website|split(',') %} {% if type == 'FL' %} {{ website.0 }} {% else %} {% for key , web in website %} - {% if loop.last != key+1 %}{{ web }} ,
+ {% if loop.last != key+1 %}{{ web }},
{% else %}{{ web }}
{% endif %} {% endfor %} {% endif %} {% endif %}
{% trans %} Work-Time {% endtrans %}: {% if not profile.workinghours %} {% else %} {{ profile._format.workinghours }}
{% endif %}
{% if type != 'FL' %} {% if not prodescription or prodescription is empty %} {% else %}
{% trans %} Product And Service {% endtrans %} {{ prodescription|raw }} {% if prodescription and profile.brandname %}
{% endif %} {% endif %} {% if not profile.brandname %} {% else %}
{% trans %} Banner {% endtrans %}
{{ profile.brandname|replace({"

":" ","

":" "}) }} {% endif %} {% endif %}

{# TAB #} {% if type == 'FL' %}
{% if promotion.promotionid %} {% endif %} {% if profile.location.lat %} {% endif %}
{% else %}
{% endif %} {#


#} {#{% if not profile.custname %}#} {#{% else %}#} {#{{ profile.custname|raw }} : แสดงความคิดเห็น#} {#{% endif %}#} {#

#} {# TAB #} {#
#} {##} {#
#} {##} {##} {#{##}#} {#
#} {#
#} {# END TAB #}

diff --git a/typ_profile.routing.yml b/typ_profile.routing.yml --- a/typ_profile.routing.yml +++ b/typ_profile.routing.yml @@ -1,30 +1,23 @@ 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_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_catalog: - path: '/profile/{bizid}/catalog' - defaults: - _controller: '\Drupal\typ_profile\Controller\TYPProfileCatalogController::catalogPage' - _title_callback: '\Drupal\typ_profile\Controller\TYPProfileCatalogController::catalogTitle' - 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