Zum Inhalt springen

Extension schreiben mit tx_cwtfeedit_pi1

Erstellt am 5. März 2008 · Noch keine Antworten

Tags: PHP, Frage

Shivasidpao ·

Hallo zusammen,
mal im Voraus ich bisher noch keine wirklichen Extensions geschrieben.
Ich würde jetzt aber gern eine Schreiben und zwar gefällt mir die Extension news_feedit zwar aber ich hab einige Probleme damit.

Desshalb will ich mit cwtfeedit eine extension erstellen mit von mir selbst definierten Formularen.

Soweit so gut, ich hab inzwischen mit dem kickstarter das grundgerüst für meine extension erstellt und will jetzt nach der anleitung von cwtfeedit ein solches formular erstellen.

Jetzt folgt mein bisheriger PHP Code, vielleicht kann mir ja jemand einfach mal grundlegende Tipps geben was geändert werden muss bzw. Falsch ist.
denn ich bekomme immer die Fehlermeldung:

Fatal error: Call to a member function pi_getPageLink() on a non-object in ...\typo3conf\ext\cwt_feedit\pi1\class.tx_cwtfeedit_pi1.php on line 484
require_once(PATH_tslib.'class.tslib_pibase.php');
include_once(PATH_typo3conf."ext/cwt_feedit/pi1/class.tx_cwtfeedit_pi1.php");


class user_news_pi1 extends tslib_pibase {
	var $prefixId      = 'user_news_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.user_news_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'user_news';	// The extension key.
	var $pi_checkCHash = true;
	
	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content,$conf)	{
  $items = array();
	$table = fe_users;
	$items["password"]["label"] = "Password:";
  $items["password"]["label_again"] = "Password (again):";
  $items["password"]["helptext"] = "Please type in your password!";
  $items["password"]["helptext_again"] = "Please type in your password again!";
  $items["password"]["error_msg"] = "Password:";
  $items["password"]["type"] = "password";
  $items["password"]["eval"] = "twice";
  
  $form = new tx_cwtfeedit_pi1($table, $items, '0', $cruser_id, $GLOBALS["TSFE"]->id, array(), $this, array(), true);
	#$form = new tx_cwtfeedit_pi1($table, $items, $record_uid, $cruser_id, $back_id, $back_values, $this, $extending_ext, $createNew = false);
		$this->conf=$conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		
	
		
		$content = "<table>";
    $content.= $form->getFormHeader();
    $content.= $form->getElement("cruser_id");
    $content.= $form->getElement("cruser_id");
    $content.= $form->getFormFooter();
    $content.= "</table>";
	
		return $this->pi_wrapInBaseClass($content);
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_news/pi1/class.user_news_pi1.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_news/pi1/class.user_news_pi1.php']);
}

?>