/** * Initialize model with items and collections * @return void */ private function _initModel() { $this->directory_sql_item = sf_api('MODEL', 'DirectorySqlItem'); $this->directory_sql_collection = sf_api('MODEL', 'DirectorySqlCollection'); $this->directory_sql_tree = sf_api('MODEL', 'DirectorySqlTree'); $this->file_sql_item = sf_api('MODEL', 'FileSqlItem'); $this->file_sql_collection = sf_api('MODEL', 'FileSqlCollection'); // set idclient and idlang initially for correct loading $this->directory_sql_item->setIdclient($this->config_area['idclient']); $this->directory_sql_item->setIdlang($this->config_area['idlang']); $this->file_sql_item->setIdclient($this->config_area['idclient']); $this->file_sql_item->setIdlang($this->config_area['idlang']); // Enable or disable the multi language support and convert the language table if ($this->config_area['multi_language_support'] == TRUE) { // duplicate the current metadata to all available langs of the client $bool1 = $this->file_sql_item->enableMultiLanguageSupport($this->config_area['idclient'], $this->cfg->getIdLangs()); $bool2 = $this->directory_sql_item->enableMultiLanguageSupport($this->config_area['idclient'], $this->cfg->getIdLangs()); if ($bool1 == TRUE && $bool2 == TRUE) { $this->_setSystemLogMessage('enable_mls', array(), 'info'); } } else { // use the language from the start lang as default $bool1 = $this->file_sql_item->disableMultiLanguageSupport($this->config_area['idclient'], $this->config_area['start_idlang']); $bool2 = $this->directory_sql_item->disableMultiLanguageSupport($this->config_area['idclient'], $this->config_area['start_idlang']); if ($bool1 == TRUE && $bool2 == TRUE) { $this->_setSystemLogMessage('disable_mls', array(), 'info'); } } }