Skip to content
Snippets Groups Projects
Commit f60d258b authored by Markus Guenther's avatar Markus Guenther
Browse files

[FEATURE][WIP] Add create category button to redirect module

parent 0a519db4
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ namespace SGalinski\DfTools\Controller;
***************************************************************/
use SGalinski\DfTools\Domain\Model\RedirectTestCategory;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
/**
* Controller for the RedirectTestCategory domain model
......@@ -84,6 +85,22 @@ class RedirectTestCategoryController extends AbstractController {
$this->redirectTestCategoryRepository->remove($category);
}
}
/**
* Creates a redirect test category
*
* @param RedirectTestCategory $redirectTestCategory
* @return void
*/
public function createAction(RedirectTestCategory $redirectTestCategory) {
$this->redirectTestCategoryRepository->add($redirectTestCategory);
/** @var $persistenceManager PersistenceManager */
$persistenceManager = $this->objectManager->get('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager');
$persistenceManager->persistAll();
$this->view->assign('records', array($redirectTestCategory));
}
}
?>
\ No newline at end of file
......@@ -96,12 +96,21 @@ class RedirectTestCategoryDataProvider extends AbstractDataProvider {
}
/**
* Not implemented!
* Creates a single redirect test category
*
* @param array $newRecord
* @return void
* @return array
*/
protected function createRecord(array $newRecord) {
public function createRecord(array $newRecord) {
$parameters = array(
'__trustedProperties' => $newRecord['__trustedProperties'],
'newRedirectTestCategory' => array(
'category' => $newRecord['category'],
)
);
$this->extBaseConnector->setParameters($parameters);
return $this->extBaseConnector->runControllerAction('RedirectTestCategory', 'create');
}
/**
......
......@@ -72,7 +72,8 @@ TYPO3.DfTools.RedirectTestCategory.Store = Ext.extend(TYPO3.DfTools.DirectStore,
autoLoad: false,
api: {
read: TYPO3.DfTools.RedirectTestCategory.DataProvider.read,
update: TYPO3.DfTools.RedirectTestCategory.DataProvider.update
update: TYPO3.DfTools.RedirectTestCategory.DataProvider.update,
create: TYPO3.DfTools.RedirectTestCategory.DataProvider.create,
}
}, configuration);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment