Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1083254
TYPProfileFacebook.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
TYPProfileFacebook.php
View Options
<?php
namespace
Drupal\typ_profile\Plugin\Block
;
/**
* @file
* Contains \Drupal\search\Plugin\Block\SearchBlock.
*/
use
Drupal\Core\Block\BlockBase
;
use
Drupal\Core\Url
;
use
Drupal\typ_legacy\Service\TYPLegacyLandingPageService
;
use
Drupal\typ_search\Service\TYPSearchService
;
use
Drupal\typ_legacy\Serivee
;
/**
* Provides a 'Search form' block.
*
* @Block(
* id = "typ_profile_share_facebook",
* admin_label = @Translation("Profile facebook"),
* category = @Translation("TYP")
* )
*/
class
TYPProfileFacebook
extends
BlockBase
{
protected
$data
;
protected
$result
;
public
function
getCacheMaxAge
()
{
return
0
;
// NOCACHE!
}
public
function
build
(){
$url
=
\Drupal
::
request
()->
getRequestUri
();
$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
);
$facebook
=
''
;
if
(
$this
->
data
[
'customertype'
]
==
'FL'
||
$this
->
data
[
'customertype'
]
==
''
||
$this
->
result
[
'accounting_status'
]
==
'1'
||
$this
->
data
[
'hide'
]
==
'1'
||
$this
->
data
[
'accounting_status'
]
==
'1'
){
$facebook
=
format_string
(
'<div class="text-center"><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/th_TH/sdk.js#xfbml=1&version=v2.4";
fjs.parentNode.insertBefore(js, fjs);
}(document,
\'
script
\'
,
\'
facebook-jssdk
\'
));</script>
<div class="fb-page" data-href="https://www.facebook.com/ThailandYellowPages" data-width="350" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="false"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/ThailandYellowPages"><a href="https://www.facebook.com/ThailandYellowPages">Thailand YellowPages</a></blockquote></div></div></div>'
,
array
());
}
$build
=
array
();
$build
[]
=
array
(
'#markup'
=>
$facebook
,
);
return
$build
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Dec 25, 3:56 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
193880
Attached To
rPF typ_profile
Event Timeline
Log In to Comment