PHP Classes

File: template/Code/empty-columns

Recommend this page to a friend!
  Classes of Fabrice Fesch   Melis Tool Creator   template/Code/empty-columns   Download  
File: template/Code/empty-columns
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Melis Tool Creator
Module for the Melis CMS to create tools
Author: By
Last change:
Date: 1 year ago
Size: 1,448 bytes
 

Contents

Class file image Download
/* * This will assign data to required fields if the column is empty * for language fields */ $engineLangTbl = $this->getServiceManager()->get('MelisEngineTableCmsLang'); $langTbl = $this->getServiceManager()->get('ModuleTplLangTable'); foreach ($tableData As $key => $val){ foreach ($val As $col => $data){ $langName = ''; if (in_array($col, [#TCREQUIRETBLFIELDS]) && $data == ''){ $langRes = $langTbl->getTableGateway()->select([ '#TCPFKEY = '. $val['DT_RowId'], $col .' IS NOT NULL' ])->current(); if (!empty($langRes) && $langRes->$col != ''){ $data = $langRes->$col; // Adding language name $cmsLang = $engineLangTbl->getEntryById($langRes->#TCLANGFKEY)->current(); if (!empty($cmsLang)) $langName = '('. $cmsLang->lang_cms_name .')'; } } #TCTABLECOLDISPLAYFILTER $tableData[$key][$col] = $data; if (!empty($langName)){ $tableData[$key][$col] .= ' '. $langName; } } }