Ejemplo n.º 1
0
 /**
  * Retrieve post content
  *
  * @return string
  */
 public function getContent()
 {
     $category = $this->getCategory();
     $key = 'filtered_content';
     if (!$category->hasData($key)) {
         $cotent = $this->_filterProvider->getPageFilter()->filter($category->getContent());
         $category->setData($key, $cotent);
     }
     return $category->getData($key);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getSearchableEntities($storeId, $entityIds = null, $lastEntityId = null, $limit = 100)
 {
     $collection = $this->collectionFactory->create()->addStoreFilter($storeId)->addFieldToFilter('is_active', 1);
     $ignored = $this->getModel()->getProperty('ignored_pages');
     if (is_array($ignored) && count($ignored)) {
         $collection->addFieldToFilter('identifier', ['nin' => $ignored]);
     }
     if ($entityIds) {
         $collection->addFieldToFilter('page_id', $entityIds);
     }
     $collection->addFieldToFilter('page_id', ['gt' => $lastEntityId])->setPageSize($limit)->setOrder('page_id');
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     try {
         /** @var \Magento\Store\Model\App\Emulation $emulation */
         $emulation = $objectManager->create('Magento\\Store\\Model\\App\\Emulation');
         $emulation->startEnvironmentEmulation($storeId, true);
         /** @var \Magento\Cms\Model\Page $page */
         foreach ($collection as $page) {
             $template = $this->emailTemplateFactory->create();
             $template->emulateDesign($storeId);
             $template->setTemplateText($page->getContent())->setIsPlain(false);
             $template->setTemplateFilter($this->cmsFilterProvider->getPageFilter());
             $html = $template->getProcessedTemplate([]);
             $page->setContent($page->getContent() . $html);
         }
         $emulation->stopEnvironmentEmulation();
     } catch (\Exception $e) {
     }
     return $collection;
 }
Ejemplo n.º 3
0
 /**
  * @param $img
  * @return string
  */
 public function getImgHtml($img)
 {
     $img = $this->postHelper->getPhotoUrl($img);
     $html = '';
     if ($img != "") {
         $html = '<div class="post_photo"> <img src="' . $this->filterProvider->getPageFilter()->filter($img) . '" />  </div>';
     }
     return $html;
 }
Ejemplo n.º 4
0
 /**
  * Retrieve post content
  *
  * @return string
  */
 public function getContent()
 {
     $post = $this->getPost();
     $key = 'filtered_content';
     if (!$post->hasData($key)) {
         $cotent = $this->_filterProvider->getPageFilter()->filter($post->getContent());
         $post->setData($key, $cotent);
     }
     return $post->getData($key);
 }
Ejemplo n.º 5
0
 /**
  * Prepare HTML content
  *
  * @return string
  */
 protected function _toHtml()
 {
     $html = $this->_filterProvider->getPageFilter()->filter($this->getPage()->getContent());
     $html = $this->getLayout()->renderElement('messages') . $html;
     return $html;
 }
Ejemplo n.º 6
0
 /**
  * Prepare HTML content
  *
  * @return string
  */
 protected function _toHtml()
 {
     $html = $this->_filterProvider->getPageFilter()->filter($this->getPage()->getContent());
     return $html;
 }
 /**
  * Retrieve post content
  *
  * @return string
  */
 public function getContent()
 {
     return $this->_filterProvider->getPageFilter()->filter($this->getPost()->getContent());
     return $this->getData($k);
 }
Ejemplo n.º 8
0
 public function filter($str)
 {
     $html = $this->_filterProvider->getPageFilter()->filter($str);
     return $html;
 }
 /**
  * @covers \Magento\Cms\Model\Template\FilterProvider::getPageFilter
  */
 public function testGetPageFilterInnerCache()
 {
     $this->_objectManagerMock->expects($this->once())->method('get')->will($this->returnValue($this->_filterMock));
     $this->_model->getPageFilter();
     $this->_model->getPageFilter();
 }
Ejemplo n.º 10
0
 /**
  * @return string
  */
 public function getPostContent()
 {
     return $this->filterProvider->getPageFilter()->filter($this->getPost()->getShortContent() . $this->getPost()->getContent());
 }