/**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     throw new dmException('deprecated');
     $this->withDatabase();
     $page = dmDb::table('DmPage')->findOneByIdWithI18n($arguments['id'], $arguments['culture']);
     if (!$page instanceof DmPage) {
         throw new dmException('No page with id = ' . $arguments['id']);
     }
     $this->getContext()->setPage($page);
     $area = dmDb::query('DmArea a, a.Zones z, z.Widgets w')->select('a.id, z.id, w.module, w.action, w.value')->where('a.type = ? AND a.dm_page_view_id = ?', array('content', $page->get('PageView')->get('id')))->orderBy('z.position asc, w.position asc')->fetchArray();
     $widgetTypeManager = $dmContext->get('widget_type_manager');
     $html = '';
     foreach ($area[0]['Zones'] as $zone) {
         foreach ($zone['Widgets'] as $widget) {
             if (!in_array($widget['module'] . '.' . $widget['action'], self::$skipWidgets)) {
                 $widget['css_class'] = null;
                 $widgetViewClass = $widgetTypeManager->getWidgetType($widget['module'], $widget['action'])->getViewClass();
                 $widgetView = new $widgetViewClass($widget);
                 try {
                     $html .= $widgetView->toIndexableString();
                 } catch (Exception $e) {
                     $this->log($e->getMessage());
                 }
             }
         }
     }
     $indexableText = dmSearchIndex::cleanText($html);
     die($indexableText);
 }
 /**
  * Get a page indexable content
  *
  * @return string the page text content
  */
 protected function getPageContentForIndex()
 {
     return dmSearchIndex::cleanText($this->getPageContent());
 }
Example #3
0
 protected function cleanText($text)
 {
     return dmSearchIndex::cleanText($text);
 }