/** * Overrides the database connector update method * * @return mixed Database connector return value */ public function update($table, $data, $where = null, $quote = true) { if (!$this->isTableTranslatable($table)) { return parent::update($table, $data, $where, $quote); } // Do the language specific table switch on the table $table_translated = $table; if ($this->_lang_primary != $this->_lang_active) { $table_translated = strtolower($this->_lang_active) . '_' . $table_translated; } //Perform the actual update $result = parent::update($table_translated, $data, $where, $quote); //Check if the title_column exists in the data otherwise don't update the item $title_column = $this->_avail_tables[$table]->title_column; if ($result !== false && isset($data[$title_column]) && ($id = $this->_findPkInWhere($where))) { $node_data = array('iso_code' => $this->_lang_active, 'table_name' => $table, 'row_id' => $id, 'modified' => $this->getNow(), 'modified_by' => KFactory::get('lib.joomla.user')->id, 'status' => Nooku::STATUS_COMPLETED, 'title' => $data[$title_column]); $nodes = KFactory::get('admin::com.nooku.table.nodes'); $nodes->update($node_data); // are we updating the original item? if ($nodes->findByConditions($node_data)->original) { $this->_updateOriginalItem($table, $id); } } return $result; }