@@ -58,18 +58,18 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $source = $args->getReturn(); |
| 60 | 60 | |
| 61 | - if(strpos($source, '<html') === false && !$this->container->get('front')->Request()->isXmlHttpRequest()) { |
|
| 61 | + if (strpos($source, '<html') === false && !$this->container->get('front')->Request()->isXmlHttpRequest()) { |
|
| 62 | 62 | return $source; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $containerId = $this->container->get('config')->getByNamespace('WbmTagManager', 'wbmTagManagerContainer'); |
| 66 | 66 | $prettyPrint = $this->container->get('config')->getByNamespace('WbmTagManager', 'wbmTagManagerJsonPrettyPrint'); |
| 67 | 67 | |
| 68 | - if( |
|
| 68 | + if ( |
|
| 69 | 69 | !empty($containerId) && |
| 70 | 70 | strtolower($this->container->get('front')->Request()->getModuleName()) != 'backend' |
| 71 | 71 | ) { |
| 72 | - if(!$this->container->get('front')->Request()->isXmlHttpRequest()) { |
|
| 72 | + if (!$this->container->get('front')->Request()->isXmlHttpRequest()) { |
|
| 73 | 73 | $headTag = file_get_contents($this->container->getParameter('wbm_tag_manager.plugin_dir') . '/Resources/tags/head.html'); |
| 74 | 74 | $bodyTag = file_get_contents($this->container->getParameter('wbm_tag_manager.plugin_dir') . '/Resources/tags/body.html'); |
| 75 | 75 | |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | $source |
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | - if($dataLayer = $this->container->get('wbm_tag_manager.variables')->getVariables()) { |
|
| 85 | + if ($dataLayer = $this->container->get('wbm_tag_manager.variables')->getVariables()) { |
|
| 86 | 86 | array_walk_recursive($dataLayer, array($this, 'castArrayValues')); |
| 87 | 87 | |
| 88 | 88 | $bodyTag = $bodyTag . |
| 89 | 89 | "<script>dataLayer.push(" . |
| 90 | - json_encode($dataLayer,($prettyPrint) ? JSON_PRETTY_PRINT : null) . |
|
| 90 | + json_encode($dataLayer, ($prettyPrint) ? JSON_PRETTY_PRINT : null) . |
|
| 91 | 91 | ");</script>"; |
| 92 | 92 | |
| 93 | 93 | $this->container->get('wbm_tag_manager.variables')->setVariables(null); |
@@ -100,15 +100,15 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | $matches = preg_split('/(<body.*?>)/i', $source, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
| 102 | 102 | |
| 103 | - if(!empty($matches)) { |
|
| 103 | + if (!empty($matches)) { |
|
| 104 | 104 | /* assemble the HTML output back with the iframe code in it */ |
| 105 | 105 | $source = $matches[0] . $matches[1] . $bodyTag . $matches[2]; |
| 106 | 106 | } |
| 107 | - } else if($dataLayer = $this->container->get('wbm_tag_manager.variables')->getVariables()) { |
|
| 107 | + } else if ($dataLayer = $this->container->get('wbm_tag_manager.variables')->getVariables()) { |
|
| 108 | 108 | array_walk_recursive($dataLayer, array($this, 'castArrayValues')); |
| 109 | 109 | |
| 110 | 110 | $source = "<script>dataLayer.push(" . |
| 111 | - json_encode($dataLayer,($prettyPrint) ? JSON_PRETTY_PRINT : null) . |
|
| 111 | + json_encode($dataLayer, ($prettyPrint) ? JSON_PRETTY_PRINT : null) . |
|
| 112 | 112 | ");</script>" . |
| 113 | 113 | $source; |
| 114 | 114 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | '_' . strtolower($args->getSubject()->Request()->getControllerName()) . |
| 67 | 67 | '_' . strtolower($args->getSubject()->Request()->getActionName()); |
| 68 | 68 | |
| 69 | - if($module == 'frontend_checkout_ajaxcart'){ |
|
| 69 | + if ($module == 'frontend_checkout_ajaxcart') { |
|
| 70 | 70 | $module = 'frontend_checkout_' . strtolower($args->getSubject()->Request()->getParam('action')); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $propertyRepo = $this->container->get('models')->getRepository('WbmTagManager\Models\Property'); |
| 79 | 79 | $dataLayer = $propertyRepo->getChildrenList(0, $module, true); |
| 80 | 80 | |
| 81 | - if(!empty($dataLayer)) { |
|
| 81 | + if (!empty($dataLayer)) { |
|
| 82 | 82 | $this->viewVariables = $args->getSubject()->View()->getAssign(); |
| 83 | 83 | |
| 84 | 84 | $dataLayer = $this->fillValues($dataLayer); |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | $dataLayer = str_replace($search, $replace, $dataLayer); |
| 102 | 102 | |
| 103 | 103 | preg_match('/({"startArrayOf":".*?"},)/i', $dataLayer, $matches); |
| 104 | - foreach($matches as $match){ |
|
| 104 | + foreach ($matches as $match) { |
|
| 105 | 105 | $foreachObj = json_decode(rtrim($match, ',')); |
| 106 | - if($foreachObj->startArrayOf){ |
|
| 106 | + if ($foreachObj->startArrayOf) { |
|
| 107 | 107 | $arguments = explode(' as ', $foreachObj->startArrayOf); |
| 108 | 108 | $dataLayer = str_replace( |
| 109 | 109 | $match, |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | $modules = $qb->getQuery()->getArrayResult(); |
| 38 | 38 | |
| 39 | - foreach($modules as &$module){ |
|
| 39 | + foreach ($modules as &$module) { |
|
| 40 | 40 | $module['name'] = $this->container->get('snippets') |
| 41 | 41 | ->getNamespace("backend/plugins/wbm/tagmanager") |
| 42 | 42 | ->get($module['module']); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | ->setParameter(':moduleName', $module); |
| 36 | 36 | |
| 37 | 37 | |
| 38 | - if($dataLayer){ |
|
| 38 | + if ($dataLayer) { |
|
| 39 | 39 | $qb->select( |
| 40 | 40 | array( |
| 41 | 41 | 'property.name', |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | unset($property['id']); |
| 54 | 54 | |
| 55 | 55 | if (!empty($subProperties)) { |
| 56 | - if(empty($value)) { |
|
| 56 | + if (empty($value)) { |
|
| 57 | 57 | $property = $subProperties; |
| 58 | 58 | } else { |
| 59 | 59 | $property = array( |