Beispiel #1
0
 /**
  * Logic for the event edit screen
  *
  * @access public
  * @return array
  * @since 0.9
  */
 function &getData()
 {
     if (empty($this->_data)) {
         $res = new stdclass();
         // original file
         $source = $this->getSource();
         $helper =& JRegistryFormat::getInstance('INI');
         $object = $helper->stringToObject(file_get_contents($source));
         $res->from = get_object_vars($object);
         // target file
         $path = $this->getTarget();
         MissingtAdminHelper::checkHistory($path);
         if (file_exists($path)) {
             $object = $helper->stringToObject(file_get_contents($path));
             $strings = get_object_vars($object);
             $present = array();
             foreach ($res->from as $k => $v) {
                 if (isset($strings[$k]) && !empty($strings[$k])) {
                     $present[$k] = $strings[$k];
                 }
             }
             $res->to = $present;
         } else {
             $res->to = array();
         }
         $this->_data = $res;
     }
     return $this->_data;
 }
Beispiel #2
0
 /**
  * loads the language file into _currentLang
  */
 protected function _loadLangFile()
 {
     jimport('joomla.filesystem.file');
     switch ($this->getLocation()) {
         case 'admin':
             $file = JPATH_ADMINISTRATOR . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.' . $this->_id . '.ini';
             break;
         case 'site':
             $file = JPATH_SITE . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.' . $this->_id . '.ini';
             break;
     }
     if (JFile::exists($file)) {
         MissingtAdminHelper::checkHistory($file);
         $this->_data = MissingTLine::iniStringToArray(file_get_contents($file));
     }
 }