/**
  * Get grids from the database.
  *
  * @param GetGridsEvent $event The subscribed event.
  *
  * @return void
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public static function getGrids(GetGridsEvent $event)
 {
     $model = $event->getModel();
     $grids = $event->getGrids();
     if ($model->type == 'semantic_html5') {
         $query = 'SELECT * FROM tl_columnset WHERE published=1 ORDER BY title';
         $result = \Database::getInstance()->query($query);
         while ($result->next()) {
             $key = sprintf($GLOBALS['TL_LANG']['tl_content']['bootstrap_columns'], $result->columns);
             $grids[$key][$result->id] = $result->title;
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Load all grids from the database.
  *
  * @param GetGridsEvent $event The subscribed event.
  *
  * @return void
  */
 public static function getGrids(GetGridsEvent $event)
 {
     $model = $event->getModel();
     $grids = $event->getGrids();
     if ($model->type == 'colsetStart' || $model->type == 'subcolumns') {
         $query = 'SELECT * FROM tl_columnset WHERE published=1 AND columns=? ORDER BY title';
         $columns = $model->sc_type;
         $result = \Database::getInstance()->prepare($query)->execute($columns);
         while ($result->next()) {
             $grids[$result->id] = $result->title;
         }
     } elseif ($model->type == 'formcolstart') {
         $query = 'SELECT * FROM tl_columnset WHERE published=1 AND columns=? ORDER BY title';
         $columns = $model->fsc_type;
         $result = \Database::getInstance()->prepare($query)->execute($columns);
         while ($result->next()) {
             $grids[$result->id] = $result->title;
         }
     }
 }