Exemplo n.º 1
0
 /**
  * Itemsproc function to extend the selection of templateLayouts in the plugin
  *
  * @param array &$config configuration array
  * @return void
  */
 public function user_templateLayout(array &$config)
 {
     $row = $this->getContentElementRow($config['row']['uid']);
     $templateLayouts = $this->templateLayoutsUtility->getAvailableTemplateLayouts($row['pid']);
     foreach ($templateLayouts as $layout) {
         $additionalLayout = [$this->getLanguageService()->sL($layout[0], true), $layout[1]];
         array_push($config['items'], $additionalLayout);
     }
 }
Exemplo n.º 2
0
 /**
  * Render template layout configuration
  *
  * @param int $pageUid
  * @return void
  */
 public function getTemplateLayoutSettings($pageUid)
 {
     $title = '';
     $field = $this->getFieldFromFlexform('settings.templateLayout', 'template');
     // Find correct title by looping over all options
     if (!empty($field)) {
         foreach ($this->templateLayoutsUtility->getAvailableTemplateLayouts($pageUid) as $layout) {
             if ($layout[1] === $field) {
                 $title = $layout[0];
             }
         }
     }
     if (!empty($title)) {
         $this->tableData[] = [$this->getLanguageService()->sL(self::LLPATH . 'flexforms_template.templateLayout'), $this->getLanguageService()->sL($title)];
     }
 }