-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageExternalContent.php
More file actions
46 lines (33 loc) · 914 Bytes
/
PageExternalContent.php
File metadata and controls
46 lines (33 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
class PageExternalContent extends Frontend
{
public function generate(Database_Result $objPage)
{
$strUrl = $objPage->externalcontent_url;
$objRequest = new Request();
$objRequest->send($strUrl);
if ($objRequest->hasError())
{
echo "ERROR";
die();
}
if (!$objPage->noSearch)
{
$this->import('Search');
$arrData = array
(
'url' => $strUrl,
'content' => $objRequest->response,
'title' => (strlen($objPage->pageTitle) ? $objPage->pageTitle : $objPage->title),
'protected' => ($objPage->protected ? '1' : ''),
'groups' => $objPage->groups,
'pid' => $objPage->id,
'language' => $objPage->language
);
$this->Search->indexPage($arrData);
}
if ($objPage->externalcontent_output)
echo $objRequest->response;
}
}
?>