Example #1
0
 /**
  * @return
  */
 public function getLabels()
 {
     if (!$this->isAdmin && $this->permittedExtensions == '') {
         $this->labels['LabelRows'] = NULL;
     } else {
         $languages = array();
         if (is_array($this->languages)) {
             foreach ($this->languages as $language) {
                 if ($language['LanguageSelected']) {
                     array_push($languages, $language['LanguageKey']);
                 }
             }
         }
         $conf = array('ExtensionId' => $this->searchMode == 'global' ? '' : $this->extensionId, 'Sort' => $this->Sort ? $this->Sort : 'LabelName', 'Dir' => $this->Dir ? $this->Dir : 'ASC', 'Limit' => $this->listViewStart . ',' . $this->listViewLimit, 'Search' => !$this->searchString ? '' : $this->searchString, 'Languages' => $languages, 'Debug' => '0');
         $translations = $this->database->getTranslations($this->currentTableId, $conf, $languages);
         if ($translations) {
             // Because Of Performance Do Not Select Translation Selects, Only Need Labels
             if (!$this->searchString) {
                 $conf['Fields'] = 'tx_snowbabel_indexing_labels_' . $this->currentTableId . '.uid';
                 $this->labels['ResultCount'] = $this->database->getLabels($this->currentTableId, $conf, TRUE);
             } else {
                 $this->labels['ResultCount'] = $this->database->getTranslations($this->currentTableId, $conf, $languages, TRUE);
             }
         }
         // Add Result To Array
         $this->labels['LabelRows'] = $translations;
     }
     return $this->labels;
 }