Example #1
0
 /**
  * @return void
  */
 private function initConfiguration()
 {
     if (!is_object($this->confObj) && !$this->confObj instanceof Configuration) {
         $this->confObj = GeneralUtility::makeInstance('Snowflake\\Snowbabel\\Service\\Configuration', array());
         $this->database = $this->confObj->getDatabase();
     }
 }
Example #2
0
 /**
  * @param  $pa
  * @param  $fobj
  * @return void
  */
 public function getLanguages($pa, $fobj)
 {
     $extjsParams = NULL;
     $tcaLanguages = array();
     // get configuration object
     $this->getConfigurationObject($extjsParams);
     // get available languages
     $languages = $this->confObj->getApplicationConfiguration('AvailableLanguages');
     if (is_array($languages)) {
         foreach ($languages as $language) {
             $value = array('0' => $language['LanguageName'], '1' => $language['LanguageKey']);
             array_push($tcaLanguages, $value);
         }
     }
     $pa['items'] = $tcaLanguages;
 }
Example #3
0
 /**
  * @param  $confObj
  */
 public function __construct($confObj)
 {
     $this->confObj = $confObj;
     $this->database = $this->confObj->getDatabase();
     $this->debug = $confObj->debug;
     // Get Current TableId
     $this->currentTableId = $this->database->getCurrentTableId();
     // get Application params
     $this->showLocalExtensions = $this->confObj->getApplicationConfiguration('ShowLocalExtensions');
     $this->showSystemExtensions = $this->confObj->getApplicationConfiguration('ShowSystemExtensions');
     $this->showGlobalExtensions = $this->confObj->getApplicationConfiguration('ShowGlobalExtensions');
     $this->approvedExtensions = $this->confObj->getApplicationConfiguration('ApprovedExtensions');
     $this->showOnlyLoadedExtensions = $this->confObj->getApplicationConfiguration('ShowOnlyLoadedExtensions');
     // get User params
     $this->isAdmin = $this->confObj->getUserConfigurationIsAdmin();
     $this->permittedExtensions = $this->confObj->getUserConfiguration('PermittedExtensions');
 }
Example #4
0
 /**
  * @param $confObj
  * @return void
  */
 public function init($confObj)
 {
     $this->confObj = $confObj;
     // get Application params
     $this->copyDefaultLanguage = $this->confObj->getApplicationConfiguration('CopyDefaultLanguage');
     $this->availableLanguages = $this->confObj->getApplicationConfiguration('AvailableLanguages');
     $this->approvedExtensions = $this->confObj->getApplicationConfiguration('ApprovedExtensions');
     $this->localExtensionPath = $this->confObj->getApplicationConfiguration('LocalExtensionPath');
     $this->systemExtensionPath = $this->confObj->getApplicationConfiguration('SystemExtensionPath');
     $this->globalExtensionPath = $this->confObj->getApplicationConfiguration('GlobalExtensionPath');
     // get Extension params
     $this->sitePath = $this->confObj->getExtensionConfiguration('SitePath');
     $this->l10nPath = $this->confObj->getExtensionConfiguration('L10nPath');
     $this->loadedExtensions = $this->confObj->getExtensionConfigurationLoadedExtensions();
 }
Example #5
0
 /**
  * @param $extjsParams
  * @return null
  *
  * todo: renaming
  */
 public function getGeneralSettingsApprovedExtensionsAdded($extjsParams)
 {
     // todo: check logic
     $extjsParams = array();
     $approvedExtensionsArray = array();
     // Get Configuration Object
     $this->getConfigurationObject($extjsParams);
     // Set Values
     $approvedExtensions = $this->confObj->getApplicationConfiguration('ApprovedExtensions');
     // Prepare For Output
     if (is_array($approvedExtensions) && count($approvedExtensions) > 0) {
         foreach ($approvedExtensions as $approvedExtension) {
             array_push($approvedExtensionsArray, array('ExtensionKey' => $approvedExtension));
         }
     }
     return $approvedExtensionsArray;
 }
Example #6
0
 /**
  * @param  $confObj
  */
 public function __construct($confObj)
 {
     $this->confObj = $confObj;
     $this->debug = $confObj->debug;
     // get Application params
     $this->availableLanguages = $this->confObj->getApplicationConfiguration('AvailableLanguages');
     // get Extension params
     // get User parasm
     $this->isAdmin = $this->confObj->getUserConfigurationIsAdmin();
     $this->permittedLanguages = $this->confObj->getUserConfiguration('PermittedLanguages');
     $this->allocatedGroups = $this->confObj->getUserConfiguration('AllocatedGroups');
     $this->selectedLanguages = $this->confObj->getUserConfiguration('SelectedLanguages');
 }
Example #7
0
 /**
  * @return void
  */
 public function setMetaData()
 {
     // Set metadata to configure grid properties
     $metaData['metaData']['idProperty'] = 'RecordId';
     $metaData['metaData']['root'] = 'LabelRows';
     // Set field for totalcounts -> paging
     $metaData['metaData']['totalProperty'] = 'ResultCount';
     // Set standard sorting
     $metaData['metaData']['sortInfo']['field'] = $this->Sort ? $this->Sort : 'LabelName';
     $metaData['metaData']['sortInfo']['direction'] = $this->Dir ? $this->Dir : 'ASC';
     // Set fields
     $metaData['metaData']['fields'] = array();
     array_push($metaData['metaData']['fields'], 'LabelId');
     array_push($metaData['metaData']['fields'], 'LabelName');
     array_push($metaData['metaData']['fields'], 'LabelDefault');
     // Add fields for selected languages
     if (is_array($this->languages)) {
         foreach ($this->languages as $language) {
             if ($language['LanguageSelected']) {
                 array_push($metaData['metaData']['fields'], 'TranslationId_' . $language['LanguageKey']);
                 array_push($metaData['metaData']['fields'], 'TranslationValue_' . $language['LanguageKey']);
             }
         }
     }
     // Set columns
     $metaData['columns'] = array(array('header' => 'LabelId', 'dataIndex' => 'LabelId', 'hidden' => TRUE), array('header' => $this->confObj->getLocallang('translation_listview_GridHeaderLabel'), 'dataIndex' => 'LabelName', 'sortable' => TRUE, 'hidden' => !$this->showColumnLabel), array('header' => $this->confObj->getLocallang('translation_listview_GridHeaderDefault'), 'dataIndex' => 'LabelDefault', 'sortable' => TRUE, 'hidden' => !$this->showColumnDefault));
     // Add Columns For Selected Languages
     if (is_array($this->languages)) {
         foreach ($this->languages as $language) {
             if ($language['LanguageSelected']) {
                 // Translation Id
                 $addColumn = array('header' => 'TranslationId_' . $language['LanguageKey'], 'dataIndex' => 'TranslationId_' . $language['LanguageKey'], 'hidden' => TRUE);
                 array_push($metaData['columns'], $addColumn);
                 // Translation Value
                 $addColumn = array('header' => $language['LanguageName'], 'dataIndex' => 'TranslationValue_' . $language['LanguageKey'], 'sortable' => TRUE, 'editor' => array('xtype' => 'textarea', 'multiline' => TRUE, 'grow' => TRUE, 'growMin' => 30, 'growMax' => 200), 'renderer' => 'CellPreRenderer');
                 array_push($metaData['columns'], $addColumn);
             }
         }
     }
     // Add MetaData
     $this->labels = $metaData;
     // Add Data Array
     $this->labels['LabelRows'] = array();
 }
Example #8
0
 /**
  * @param $id
  * @return string
  */
 private function getColumnLabel($id)
 {
     $labelName = 'translation_columnselection_' . $id;
     $label = $this->confObj->getLocallang($labelName);
     return $label;
 }