Skip to content

Commit

Permalink
Remove dependency 'wa72/htmlpagedom' (only 1 use)
Browse files Browse the repository at this point in the history
  • Loading branch information
OMOSde committed Jul 31, 2021
1 parent 91d4423 commit 5912cf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Contao bundle 'omosde/contao-om-imagine' change log

### 1.1.1 (2021-07-31)

* Changed: Remove dependency 'wa72/htmlpagedom' (only 1 use)

### 1.1.0 (2019-01-22)

* Added: Backend buttons to manipulate existing images
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
],
"require": {
"php": ">=5.6.0",
"contao/core-bundle": "^4.4",
"wa72/htmlpagedom": "^1.3"
"contao/core-bundle": "^4.4"
},
"conflict": {
"contao/core": "*",
Expand Down
12 changes: 1 addition & 11 deletions src/Resources/contao/classes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
namespace OMOSde\ContaoOmImagineBundle;


/**
* Use
*/
use \Wa72\HtmlPageDom\HtmlPageCrawler;


/**
* Class Hooks
*
Expand Down Expand Up @@ -154,10 +148,6 @@ public function addButtonManipulate($strContent, $strTemplate)
$strHtml .= sprintf('</select><button type="submit" name="manipulate" id="manipulate" class="tl_submit" accesskey="s">%s</button></div>', $GLOBALS['TL_LANG']['MSC'][$strButtonText]);

// add html to dom
$objCrawler = HtmlPageCrawler::create($strContent);
$objCrawler->filter('.tl_submit_container')->append($strHtml);

// return new html
return $objCrawler->saveHTML();
return substr_replace($strContent, $strHtml, strpos($strContent, '</div>', strpos($strContent, 'tl_submit_container')), 0);
}
}

0 comments on commit 5912cf2

Please sign in to comment.