Created
June 20, 2014 08:30
-
-
Save sorenmalling/7dbba5c4efef22b92797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CategoryService { | |
| /** | |
| * Build category selector | |
| * | |
| * @param array $config array (passed by reference) which contains the current information about the current field being rendered | |
| * @param \TYPO3\CMS\Backend\Form\FormEngine $formEngine a reference to the parent object (an instance of the t3lib_TCEforms class). | |
| * | |
| * @return string | |
| */ | |
| public function categorySelector($config, \TYPO3\CMS\Backend\Form\FormEngine &$formEngine) { | |
| $categories = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('sys_category.uid, sys_category.title, sys_category_record_mm.locked', 'sys_category', 'sys_category_record_mm', $config['table'], 'AND uid_foreign = ' . $config['row']['uid'], '', 'sys_category.title'); | |
| while ($currentCategories[] = $GLOBALS['TYPO3_DB']->sql_fetch_row($categories)) { | |
| } | |
| array_pop($currentCategories); | |
| $javscript = ' | |
| <script type="text/javascript" src="/typo3conf/ext/bolius_products/Resources/Public/Scripts/Suggest.js" ></script> | |
| '; | |
| $formEngine->additionalCode_pre['tx_boliusproducts_categoryselector'] = $javscript; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'type' => 'user', | |
| 'userFunc' => 'Bolius\\BoliusProducts\\Service\\CategoryService->categorySelector' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment