Zum Inhalt springen

Inhalt des Backend Moduls mit Kickstarter wird nicht angezeigt

Erstellt am 21. Februar 2014 · Noch keine Antworten

Tags: Frage

arcas2004 ·

Hallo!

Ich wollte für meine Extension, die schon zwei funktionierende Frontend Plugins besitzt, auch noch ein Backend Modul zur Bearbeitung einer Datenbanktabelle der Extension hinzufügen.
Leider kenn ich mich mit der Backend Programmierung in Typo3 noch so gar nicht aus.

Das Backend Modul habe ich über Kickstarter generiert und mein Problem ist folgendes:
das Modul erscheint zwar wie vorgesehen unter 'Web' aber es wird mir nichts angezeigt. Also auch der Standardtext nicht. Der Bereich in dem der Content stehen sollte bleibt einfach leer.
Ohne anzeige ist es schwer für mich, zu sehen was genau das Problem ist und wo im Code ich arbeiten sollte.

Woran könnte es liegen? Ich habe den Code der Extension nicht verändert.

Das ist der Inhalt der index.php

<?php
/***************************************************************
 *  Copyright notice
 *
 *  (c) 2014 Visible Internetmarketing <info@visible-internetmarketing.de>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
 *
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/


$GLOBALS['LANG']->includeLLFile('EXT:extension_name/mod1/locallang.xml');
//require_once(PATH_t3lib . 'class.t3lib_scbase.php');
$GLOBALS['BE_USER']->modAccess($MCONF, 1);	// This checks permissions and exits if the users has no permission for entry.
	// DEFAULT initialization of a module [END]


/**
 * Module 'Edit Joblist' for the 'extension_name' extension.
 *
 * @author	Visible Internetmarketing <info@visible-internetmarketing.de>
 * @package	TYPO3
 * @subpackage	tx_vicheckincompanies
 */
class tx_vicheckincompanies_module1 extends t3lib_SCbase {
	protected $pageinfo;

	/**
	 * Initializes the module.
	 *
	 * @return void
	 */
	public function init() {
		parent::init();

		/*
		if (t3lib_div::_GP('clear_all_cache'))	{
			$this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php';
		}
		*/
	}

	/**
	 * Adds items to the ->MOD_MENU array. Used for the function menu selector.
	 *
	 * @return	void
	 */
	public function menuConfig() {
		$this->MOD_MENU = array(
			'function' => array(
				'1' => $GLOBALS['LANG']->getLL('function1'),
				'2' => $GLOBALS['LANG']->getLL('function2'),
				'3' => $GLOBALS['LANG']->getLL('function3'),
			)
		);
		parent::menuConfig();
	}

	/**
	 * Main function of the module. Write the content to $this->content
	 * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
	 *
	 * @return void
	 */
	public function main() {
			// Access check!
			// The page will show only if there is a valid page and if this page may be viewed by the user
		$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
		$access = is_array($this->pageinfo) ? 1 : 0;
	
			// Initialize doc
		$this->doc = t3lib_div::makeInstance('template');
		$this->doc->setModuleTemplate(t3lib_extMgm::extPath('extension_name') . 'mod1/mod_template.html');
		$this->doc->backPath = $GLOBALS['BACK_PATH'];
		$docHeaderButtons = $this->getButtons();

		if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) {

				// Draw the form
			$this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';

				// JavaScript
			$this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
				</script>
			';
			$this->doc->postCode='
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>
			';
				// Render content:
			$this->moduleContent();
		} else {
				// If no access or if ID == zero
			$docHeaderButtons['save'] = '';
			$this->content .= $this->doc->spacer(10);
		}

			// Compile document
		$markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
		$markers['CONTENT'] = $this->content;

			// Build the <body> for the module
		$this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
		$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
		$this->content .= $this->doc->endPage();
		$this->content .= $this->doc->insertStylesAndJS($this->content);
		
	}

	/**
	 * Prints out the module HTML.
	 *
	 * @return void
	 */
	public function printContent() {
		$this->content .= $this->doc->endPage();
		echo $this->content;
	}

	/**
	 * Generates the module content.
	 *
	 * @return void
	 */
	protected function moduleContent() {
		switch ((string)$this->MOD_SETTINGS['function']) {
			case 1:
				$content = '<div align="center"><strong>Hello World!</strong></div><br />
					The "Kickstarter" has made this module automatically, it contains a default framework for a backend module but apart from that it does nothing useful until you open the script '.substr(t3lib_extMgm::extPath('extension_name'),strlen(PATH_site)).'mod1/index.php and edit it!
					<hr />
					<br />This is the GET/POST vars sent to the script:<br />'.
					'GET:' . t3lib_div::view_array($_GET) . '<br />'.
					'POST:' . t3lib_div::view_array($_POST) . '<br />'.
					'';
				$this->content .= $this->doc->section('Message #1:', $content, 0, 1);
				break;
			case 2:
				$content = '<div align=center><strong>Menu item #2...</strong></div>';
				$this->content .= $this->doc->section('Message #2:', $content, 0, 1);
				break;
			case 3:
				$content = '<div align=center><strong>Menu item #3...</strong></div>';
				$this->content .= $this->doc->section('Message #3:', $content, 0, 1);
				break;
		}
	}
	

	/**
	 * Creates the panel of buttons for submitting the form or otherwise perform operations.
	 *
	 * @return array All available buttons as an assoc.
	 */
	protected function getButtons()	{
		$buttons = array(
			'csh' => '',
			'shortcut' => '',
			'save' => ''
		);

			// CSH
		$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']);

			// SAVE button
		$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';

			// Shortcut
		if ($GLOBALS['BE_USER']->mayMakeShortcut())	{
			$buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
		}

		return $buttons;
	}
	
}



if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/extension_name/mod1/index.php'])) {
	include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/extension_name/mod1/index.php']);
}




	// Make instance:
/** @var $SOBE tx_vicheckincompanies_module1 */
$SOBE = t3lib_div::makeInstance('tx_vicheckincompanies_module1');
$SOBE->init();

	// Include files?
foreach ($SOBE->include_once as $INC_FILE) {
	include_once($INC_FILE);
}

$SOBE->main();
$SOBE->printContent();

?>

Das ist der Inhalt der conf.php

<?php

	// DO NOT REMOVE OR CHANGE THESE 2 LINES:
$MCONF['name'] = 'web_txvicheckincompaniesM1';
$MCONF['script'] = '_DISPATCH';
	
$MCONF['access'] = 'user,group';

$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';
$MLANG['default']['ll_ref'] = 'LLL:EXT:extension_name/mod1/locallang_mod.xml';
?>

Danke im Voraus für die Hilfe!