菜单

typo3后台样式调用

2013年08月6日 - typo3

Show all.
1,异常处理

$o_flashMessage = t3lib_div::makeInstance(
                        't3lib_FlashMessage',
                        $GLOBALS['LANG']->getLL('function1.file_upload_success', true),
                        'Info',
                        t3lib_FlashMessage::OK
                );
                                t3lib_FlashMessageQueue::addMessage($o_flashMessage);
                $content .= t3lib_FlashMessageQueue::renderFlashMessages();

2,使用typo3后台自带的选项卡

$menus = array();
                        if($rowsForCreate){
                                $menus[] = array(
                                        'label' => 'Create Records',
                                        'content' => $thead.$rowsForCreate.$tfoot
                                );
                        }
                        if($rowsForOverride){
                                $menus[] = array(
                                        'label' => 'Override Records',
                                        'content' => $thead.$rowsForOverride.$tfoot
                                );
                        }
                        if($rowsForDelete){
                                $menus[] = array(
                                        'label' => 'Delete Records',
                                        'content' => $thead.$rowsForDelete.$tfoot
                                );
                        }
                        if($rowsForKeep){
                                $menus[] = array(
                                        'label' => 'Keep Records',
                                        'content' => $thead.$rowsForKeep.$tfoot
                                );
                        }
                        if(empty($menus))throw new Exception("Nothing need to be change. Records in database are the same as in the csv file.", 1);
                        $content .= $this->doc->getDynTabMenu($menus, 'records_tabs');        

3,使用表格样式,只要class一样就自动有了样式

$thead = ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''.
                                ''
                        ;

4,使用树状结构展示数组

t3lib_div::naturalKeySortRecursive($baseData);
                        $arrayBrowser = t3lib_div::makeInstance('t3lib_arrayBrowser');
                        $arrayBrowser->varName = 'TesterUnitData';
                        $arrayBrowser->expAll = TRUE;
                        $arrayBrowser->dontLinkVar = TRUE;
                        $tree = $arrayBrowser->tree($baseData, '', '');
                        $label = 'TesterUnitData';
                        $content.= '
KAM NachnameKAM VornameNAMESTRPLZORTLandTU NumberCheck All
'; $content.= '
' . $label . '
' . $tree . '
'; $content .= '
';

DEMO:

$this->doc->JScode = '';

function moduleContent(){
                    $thead = ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''.
                        ''
                    ;
                    $tfoot = '
KAM NachnameKAM VornameNAMESTRPLZORTLandTU NumberCheck All
'; $tableArray[] = array(4,5,6); $menus[] = array( 'label' => 'Keep Records1', 'content' => $thead.'testtesttesttesttesttesttesttesttest'.$tfoot ); $menus[] = array( 'label' => 'Keep Records2', 'content' => $this->doc->table($tableArray).$this->doc->spacer(10) ); if(empty($menus))throw new Exception("Nothing need to be change. Records in database are the same as in the csv file.", 1); $this->content .= $this->doc->getDynTabMenu($menus, 'records_tabs'); }

发表评论

电子邮件地址不会被公开。 必填项已用*标注