Skip to content

Commit

Permalink
Fixed unbind scripts only in amp pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MDevster committed Jan 26, 2017
1 parent 7ceec1d commit 428ec4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"Pdir\\AmphtmlBundle\\": "src/"
}
},
"config": {
"files": "files"
},
"prefer-stable": true,
"minimum-stability": "dev"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pdir/amphtml-bundle",
"version": "0.1.4",
"version": "0.1.5",
"description": "Amphtml Bundle for Contao 4",
"scripts": {},
"repository": {
Expand Down
26 changes: 4 additions & 22 deletions src/Resources/contao/classes/AmphtmlHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AmphtmlHooks extends \Controller
/*
* if amp is set, load the given layout from page root
*/
public function ampGetPageLayout($objPage, &$objLayout, $objPageRegular)
public function ampGetPageLayout($objPage, &$objLayout, $objPty)
{
$amphtml = (int) \PageModel::findByPk($objPage->rootId)->amphtml;
if($amphtml == 1) {
Expand All @@ -44,7 +44,6 @@ public function ampGetPageLayout($objPage, &$objLayout, $objPageRegular)
$ampLayout = (int) \PageModel::findByPk($objPage->rootId)->ampLayout;
$ampUseInLayout = \PageModel::findByPk($objPage->rootId)->ampUseInLayout;
$objLayout = \LayoutModel::findById($ampLayout);
echo "<br><br><br><pre>"; print_r($GLOBALS['TL_FRAMEWORK_CSS']); echo "</pre>";

// enable or disable columns in layout
$desMod = deserialize($objLayout->modules);
Expand Down Expand Up @@ -99,26 +98,9 @@ public function ampGenerateFrontendUrl($arrRow, $strParams, $strUrl)
*/
public function unbindDynamicScriptTags($strBuffer)
{
/*echo "<pre>";
echo "<br>TL_FRAMEWORK_CSS";
var_dump($GLOBALS['TL_FRAMEWORK_CSS']);
echo "<br>TL_CSS";
var_dump($GLOBALS['TL_CSS']);
echo "<br>TL_USER_CSS";
var_dump($GLOBALS['TL_USER_CSS']);
echo "<br>TL_HEAD";
var_dump($GLOBALS['TL_HEAD']);
echo "<br>TL_BODY";
var_dump($GLOBALS['TL_BODY']);
echo "<br>TL_JAVASCRIPT";
var_dump($GLOBALS['TL_JAVASCRIPT']);
echo "<br>TL_JQUERY";
var_dump($GLOBALS['TL_JQUERY']);
echo "<br>TL_MOOTOOLS";
var_dump($GLOBALS['TL_MOOTOOLS']);
// echo "<br>Buffer"; var_dump($strBuffer);
echo "</pre>";*/
if(isset($_GET['amp']))
return '';

// return $strBuffer;
return $strBuffer;
}
}

0 comments on commit 428ec4e

Please sign in to comment.