Example #1
0
 /**
  * Get status of the Content Element
  *
  * @return  String  Content Element Status
  */
 public function getStatus()
 {
     $return = '';
     if (empty($this->table)) {
         $return .= ' ' . JText::_('COM_REDCORE_CONFIG_TRANSLATIONS_CONTENT_ELEMENT_NOT_VALID_FILE');
     }
     $fieldsTable = RTranslationTable::getTranslationsTableColumns($this->table);
     if (empty($fieldsTable)) {
         return JText::_('COM_REDCORE_CONFIG_TRANSLATIONS_CONTENT_ELEMENT_NOT_INSTALLED') . $return;
     }
     // Language is automatically added to the table if table exists
     $fieldsTable = RTranslationTable::removeFixedColumnsFromArray($fieldsTable);
     $fieldsXml = $this->getTranslateFields();
     $fields = array();
     foreach ($fieldsXml as $field) {
         $fields[(string) $field['name']] = (string) $field['name'];
         if ((string) $field['translate'] == '0') {
             unset($fieldsTable[(string) $field['name']]);
             unset($fields[(string) $field['name']]);
             continue;
         }
         foreach ($fieldsTable as $columnKey => $columnKeyValue) {
             $fields[$columnKey] = $columnKey;
             if ((string) $field['name'] == $columnKey) {
                 unset($fieldsTable[$columnKey]);
                 unset($fields[$columnKey]);
             }
         }
     }
     if (!empty($fields)) {
         $return .= ' ' . JText::_('COM_REDCORE_CONFIG_TRANSLATIONS_CONTENT_ELEMENT_FIELDS_MISSING') . implode(', ', $fields);
     }
     return JText::_('COM_REDCORE_CONFIG_TRANSLATIONS_CONTENT_ELEMENT_INSTALLED') . $return;
 }