Einzelnen Beitrag anzeigen
  #7  
Alt 30.08.06, 20:23
Benutzerbild von Junior
Junior Junior ist offline
TYPO3 Forum Team
Administrator
 
Registriert seit: 18.08.04
Ort: Zürich
Alter: 33
Beiträge: 2.815
Junior eine Nachricht über Skype™ schicken

Erstamals vielen Dank für deine ausfürhlichen Erklärungen, die mir weitergeholfen haben, jedoch im FE noch keine Ausgabe bringt :sad:

Ich poste jetzt hier mal mein Zwischenergebnis:

Fields Overview (Kickstarter)
Code:
hotelname	Hotel Name		String input		
contact		Contact Person		String input		
address		Address	Text 		area		
plz		Zip-Code		String input		
ort		City			String input		
country		Country			String input		
phone1		Phone 1			String input		
phone2		Phone 2			String input		
fax1		Fax 1			String input		
fax2		Fax 2			String input		
email		E-Mail			Link		
www		WWW			Link		
imagelist	Image (LIST View)	Files images, 1 files
imagesingle	Image (SINGLE View)	Files images, 3 files
priceez	Price 	(Single Room)		String input
pricedouble	Price (Double Room)	String input		
about		About the Hotel		Text area with RTE

Auszug aus der class.tx_t3fhotel_pi1.php
PHP-Code:
require_once(PATH_tslib.'class.tslib_pibase.php');

class 
tx_hotel_pi1 extends tslib_pibase {
 function 
main($content,$conf){
  
$this->conf=$conf;
  
$this->pi_setPiVarDefaults();
  
$this->pi_loadLL();
  
  
// Template in string-variable einlesen
  
$this->cObj->fileResource('/fileadmin/template/hotel-manager.html');

  
// array erstellen das die zu ersetzenden labels enthält
  
$sub['###HOTELNAME###'] = 'hotelname';
  
$sub['###CONTACT###'] = 'contact';
  
$sub['###ADDRESS###'] = 'address';
  
$sub['###PLZ###'] = 'plz';
  
$sub['###ORT###'] = 'ort';
  
$sub['###COUNTRY###'] = 'country';
  
$sub['###PHONE1###'] = 'phone1';
  
$sub['###PHONE2###'] = 'phone2';
  
$sub['###FAX1###'] = 'fax1';
  
$sub['###FAX2###'] = 'fax2';
  
$sub['###EMAIL###'] = 'email';
  
$sub['###WWW###'] = 'www';
  
$sub['###IMAGELIST###'] = 'imagelist';
  
$sub['###IMAGESINGLE###'] = 'imagesingle';
  
$sub['###PRICEEZ###'] = 'priceez';
  
$sub['###PRICEDOUBLE###'] = 'pricedouble';
  
$sub['###ABOUT###'] = 'about';
  
  
// Mittels typo-funktion labels aus array ersetzen lassen:
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###HOTELNAME###','hotelname');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###CONTACT###','contact');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ADDRESS###','address');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PLZ###','plz');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ORT###','ort');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###COUNTRY###','country');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PHONE1###','phone1');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PHONE2###','phone2');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###FAX1###','fax1');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###FAX2###','fax2');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###WWW###','www');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###IMAGELIST###','imagelist');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###IMAGESINGLE###','imagesingle');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PRICEEZ###','priceez');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PRICEDOUBLE###','pricedouble');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ABOUT###','about');
  
  
// von deinem plugin erzeugten content an typo zurückliefern:
  
return $tmpl;
 }

Komplette class.tx_t3fhotel_pi1.php
PHP-Code:
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2005 Antoine Monot, Jr. (Junior) (admin@typo3forum.net)
*  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!
***************************************************************/
/**
 * Plugin 'Hotel Manager' for the 't3f_hotel' extension.
 *
 * @author    Antoine Monot, Jr. (Junior) <admin@typo3forum.net>
 */

require_once(PATH_tslib.'class.tslib_pibase.php');

class 
tx_hotel_pi1 extends tslib_pibase {
 function 
main($content,$conf){
  
$this->conf=$conf;
  
$this->pi_setPiVarDefaults();
  
$this->pi_loadLL();
  
  
// Template in string-variable einlesen
  
$this->cObj->fileResource('rel/fileadmin/template/hotel-manager.html');

  
// array erstellen das die zu ersetzenden labels enthält
  
$sub['###HOTELNAME###'] = 'hotelname';
  
$sub['###CONTACT###'] = 'contact';
  
$sub['###ADDRESS###'] = 'address';
  
$sub['###PLZ###'] = 'plz';
  
$sub['###ORT###'] = 'ort';
  
$sub['###COUNTRY###'] = 'country';
  
$sub['###PHONE1###'] = 'phone1';
  
$sub['###PHONE2###'] = 'phone2';
  
$sub['###FAX1###'] = 'fax1';
  
$sub['###FAX2###'] = 'fax2';
  
$sub['###EMAIL###'] = 'email';
  
$sub['###WWW###'] = 'www';
  
$sub['###IMAGELIST###'] = 'imagelist';
  
$sub['###IMAGESINGLE###'] = 'imagesingle';
  
$sub['###PRICEEZ###'] = 'priceez';
  
$sub['###PRICEDOUBLE###'] = 'pricedouble';
  
$sub['###ABOUT###'] = 'about';
  
  
// Mittels typo-funktion labels aus array ersetzen lassen:
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###HOTELNAME###','hotelname');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###CONTACT###','contact');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ADDRESS###','address');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PLZ###','plz');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ORT###','ort');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###COUNTRY###','country');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PHONE1###','phone1');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PHONE2###','phone2');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###FAX1###','fax1');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###FAX2###','fax2');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###WWW###','www');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###IMAGELIST###','imagelist');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###IMAGESINGLE###','imagesingle');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PRICEEZ###','priceez');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###PRICEDOUBLE###','pricedouble');
  
$tmpl $this->cObj->substituteMarkerInObject($tmpl,$sub,'###ABOUT###','about');
  
  
// von deinem plugin erzeugten content an typo zurückliefern:
  
return $tmpl;
 }
}

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

?>
In meiner FE-Ausgabe erscheint jetzt nichts. Ich habe mich an die PART-Marker noch nicht getraut, brauche sie dann aber später für eine LIST und eine SINGLE View.

Kann mir jemand auf die Sprünge helfen? Ich kenne mich in PHP nur rudimentär aus und dafür reichts schon nicht mehr.

Ganz lieben Gruss

Junior
__________________
TYPO3forum.net empfiehlt Domain Factory als Hoster!



Geändert von Junior (31.08.06 um 09:29 Uhr).
Mit Zitat antworten