/** * Method to store the item * * @package MageBridge * @access public * @param array $data * @return bool */ public function store($data) { // Store the item $rt = parent::store($data); // Change the setting "load_urls" in the MageBridge configuration if ($data['published'] == 1) { MagebridgeModelConfig::saveValue('load_urls', 1); } return $rt; }
public function toggleMode() { // Validate whether this task is allowed if ($this->_validate() == false) { return false; } // Determine the toggle value $name = 'advanced'; $value = MagebridgeModelConfig::load($name); if ($value == 1) { $value = 0; } else { $value = 1; } MagebridgeModelConfig::saveValue($name, $value); $link = 'index.php?option=com_magebridge&view=config'; $this->setRedirect($link); }
/** * Method to store the item * * @package MageBridge * @access public * @param array $data * @return bool */ public function store($data) { $row = $this->getTable(); // Bind the form fields to the item table if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } // Make sure the item table is valid if (!$row->check()) { $this->setError($row->getError()); return false; } // Store the item table to the database if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } // Change the setting "load_urls" in the MageBridge configuration if ($data['published'] == 1) { MagebridgeModelConfig::saveValue('load_urls', 1); } // Save the ID for later usage $this->_id = $row->id; return true; }