public function saveHubTypeTask() { // Get Variables $name = Request::getVar('type', ''); $class_path = Request::getVar('class_path', ''); $file_path = Request::getVar('file_path', ''); $row = Request::getVar('id', 0); $model = HubType::oneOrNew($row); $model->set('class_path', $class_path); $model->set('file_path', $file_path); $model->set('type', $name); if (!$model->save()) { // Fail App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=searchIndex', false), 'Failed to add HubType.', 'error'); } // Success App::redirect(Route::url('/administrator/index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=searchIndex', false), 'Successfully added ' . $name . ' to the search index.', 'success'); }