Пример #1
0
 /**
  * Retrieves the localized string for the local language key $key, using the
  * FE localization methods.
  *
  * In $this->conf['salutation'], a suffix to the key may be set (which may
  * be either 'formal' or 'informal'). If a corresponding key exists, the
  * formal/informal localized string is used instead.
  * If the formal/informal key doesn't exist, this function just uses the
  * regular string.
  *
  * Example: key = 'greeting', suffix = 'informal'. If the key
  * 'greeting_informal' exists, that string is used.
  * If it doesn't exist, this functions tries to use the string with the key
  * 'greeting'.
  *
  * @param string $key the local language key for which to return the value, must not be empty
  *
  * @return string the requested local language key, might be empty
  */
 private function translateInFrontEnd($key)
 {
     $hasFoundATranslation = FALSE;
     $result = '';
     $availableLanguages = $this->getAvailableLanguages();
     foreach ($this->getSuffixesToTry() as $suffix) {
         foreach ($availableLanguages as $language) {
             $completeKey = $key . $suffix;
             if (isset($this->LOCAL_LANG[$language][$completeKey])) {
                 $result = parent::pi_getLL($completeKey);
                 $hasFoundATranslation = TRUE;
                 break 2;
             }
         }
     }
     if (!$hasFoundATranslation) {
         $result = $key;
     }
     return $result;
 }
    function autoTableGenerator($rowbez, $rowobj, $empty = FALSE, $show_deletionlink = TRUE)
    {
        $content = '<div style="border: 1px dashed gray;padding: 5px"><table>';
        if ($this->debug) {
            $content .= print_r($rowobj, 1);
        }
        //		$content .= $this->dump($rowbez, 1);
        if ($show_deletionlink) {
            if ($_SESSION['todo'] != 'insert' && $_SESSION['todo'] != "") {
                $content .= '<tr><td><br /><u title="delete whole part" alt="delete whole part" style="background-color:yellow;padding:5px;border: 1px solid gray;color:red" onClick="status=confirm(\'wirklich löschen?\');if(status){window.location=\'' . $_SERVER["REQUEST_URI"] . '&todo=delete&id=' . $rowobj["id"] . '&tablename=' . $this->tablename . '\';} else{}">Datensatz löschen</u><br clear="all" /><br /><br /><br /></td></tr>' . "\n";
            }
        }
        // get Mediafiles from Database:
        $mediafiles = $this->getMediafileURIs($rowobj['kerndaten_id'], $rowobj['block_nr']);
        if ($this->debug) {
            $content .= 'getMediafileURIs(' . $rowobj['kerndaten_id'] . ', ' . $rowobj['block_nr'] . ')';
        }
        foreach ($mediafiles as $nr => $data) {
            $id = $data['id'];
            $uri = $data['file_uri'];
            $sortorder = $data['sortorder'];
            $tabellenname = isset($data['partI_id']) ? 'tx_bolonline_Mediafiles_PartI' : 'tx_bolonline_Mediafiles';
            $tabellenname = isset($data['partII_id']) ? 'tx_bolonline_Mediafiles_PartII' : $tabellenname;
            $tabellenname = isset($data['partIII_id']) ? 'tx_bolonline_Mediafiles_PartIII' : $tabellenname;
            $tabellenname = isset($data['partIV_id']) ? 'tx_bolonline_Mediafiles_PartIV' : $tabellenname;
            //			print_r($tabellenname);die();
            //if (preg_match("|Part|i", $this->tabellenname)) $tabellenname = $this->tabellenname;
            $content .= "\n" . '<div id="bild_' . $id . '">
                          <img onClick="window.open(\'/' . $this->workpath_rel . $uri . '\')" src="/' . $this->workpath_rel . $uri . '" title="' . $uri . '" alt="' . $uri . '" style="width:80px;border:0px;float:left;border:1px solid gray;padding:1px;">&nbsp;&nbsp;
                          <span title="delete image no. ' . $id . ', ' . $tabellenname . '" alt="delete image no. ' . $id . ', ' . $tabellenname . '" onClick="del=confirm(\'are you shure, that you will delete the selected file?\');if(del){xajax_delImage(\'' . $id . '\',\'' . $tabellenname . '\');}else{/* do nothing */}" style="background-color:yellow;padding-left:10px;padding-right:10px;padding-top:1px;padding-bottom:1px;;border: 1px solid gray;color:red;text-decoration:underline;cursor:pointer;">';
            $content .= 'del</span>';
            $content .= '<br/><br/>
                  <span style="padding-left:10px;padding-right:10px;">
                      order: <input id="orderInput_' . $id . '" type="text" size="5" value="' . $sortorder . '"/>
                             <span onClick="console.log(document.getElementById(\'orderInput_' . $id . '\').value);
xajax_setImageOrder(\'' . $tabellenname . '\',' . $id . ',document.getElementById(\'orderInput_' . $id . '\').value);"/ style="background-color:white;padding-left:10px;padding-right:10px;padding-top:1px;padding-bottom:1px;;border: 1px solid gray;color:blue;text-decoration:underline;cursor:pointer;">set</span>
                  </span>';
            $content .= '</div><br clear="all"/>' . "\n";
        }
        $tabellenname = $this->tablename;
        // Einbau Zuordnungstabellen: #####################################################
        $content .= '<div id="association_pd_' . $rowobj['id'] . '">';
        $content .= $this->getAccociationMenueHtmlElements($rowobj['kerndaten_id'], $tabellenname, $rowobj['id']);
        $content .= '</div>';
        // Ende Einbau Zuordnungstabellen #####################################################
        if ($rowobj['kerndaten_id'] != 0) {
            //wenn Kerddaten-ID 0, keine Upload-Felder. Dann werden die Upload-Felder schon in der Ajax-Funktion setFields erzeugt.
            //Upload-Felder:
            for ($ii = 0; $ii < 5; $ii++) {
                $content .= '<input style="font-size:11px;width:200px;height:22px;margin:2px" type="file" name="fupload_' . $this->tablename . '_' . $rowobj['id'] . '_' . $rowobj['kerndaten_id'] . '_' . $ii . '_' . $rowobj['block_nr'] . '"><br />' . "\n";
            }
        }
        $bgcolor = "";
        if (preg_match("|Kerndaten|i", $this->tablename)) {
            $content .= '<tr><td style="padding: 4px">Kerndaten-ID:</td><td>' . $rowobj['kerndaten_id'] . "</td></tr>\n";
        } else {
            $content .= '<tr><td style="padding: 4px">Datensatz-ID:</td><td>' . $rowobj['id'] . "</td></tr>\n";
        }
        foreach ($rowbez as $key => $bez) {
            $label = parent::pi_getLL($this->tablename . '.' . $bez);
            $label = $label == "" ? ucfirst($bez) : $label;
            if ($_SESSION['todo'] != 'insert') {
                if (!preg_match("|^[a-zA-Z]\\d+|", $bez)) {
                    //Kerndaten, nicht editierbar
                    $trans = $rowobj[$bez];
                    //					echo '<bR>$tabellenname:'.$tabellenname.' - $bez: '.$bez;die();
                    if (preg_match("|Part|i", $tabellenname)) {
                        //wenn Haupttabelle tx_bolonline_Kerndaten, dann ist datensatz_id=kerndaten_id!
                        if ($bez == "id" || $bez == "datensatz_id") {
                            $content .= '<input type="hidden" name="datensatz_id[]" value="' . $rowobj[$bez] . '">' . "\n";
                            continue;
                        }
                    } else {
                        if ($bez == "kerndaten_id") {
                            $content .= '<input type="hidden" name="datensatz_id[]" value="' . $rowobj[$bez] . '">' . "\n";
                            continue;
                        }
                    }
                    if ($bez == "kerndaten_id") {
                        if ($_SESSION['update_id']) {
                            $trans = $_SESSION['update_id'];
                            $rowobj[$bez] = $_SESSION['update_id'];
                        }
                    }
                    if ($bez == "crdate") {
                        $trans = @date("r", $rowobj[$bez]);
                    }
                    if ($bez == "tstamp") {
                        $trans = @date("r", $rowobj[$bez]);
                    }
                    $bgcolor = ' style="padding: 4px"';
                    $content .= '<tr><td' . $bgcolor . '>' . $label . ':</td><td><input type="hidden" name="' . $bez . '[]" value="' . $rowobj[$bez] . '">' . $trans . '</td></tr>' . "\n";
                }
            } else {
                if (!preg_match("|^[a-zA-Z]\\d+|", $bez)) {
                    //Kerndaten, nicht editierbar
                    $content .= '<input type="hidden" name="' . $bez . '[]" value="' . $rowobj[$bez] . '">' . "\n";
                }
            }
            if (preg_match("|^[a-zA-Z]\\d+|", $bez)) {
                //edtierbare Daten
                if ($empty) {
                    $rowobj[$bez] = "";
                }
                //fuer Neueintrag mit leeren Datenfeldern
                $bgcolor = $key % 2 != 0 ? ' style="width:300px;background-color: lightgrey;padding: 4px"' : ' style="padding: 4px"';
                /* alle Tabellenspalten, welche, in Abhaengigkeit
                 * von der Hauptkategorie, nicht angezeigt werden 
                 * sollen, als hidden-Felder anlegen: */
                //$_REQUEST["hauptkategorie_id"]
                $zugeordnete_kategorie = $this->getMainCategories($_SESSION['update_id']);
                //				 $content .= print_r($zugeordnete_kategorie,1);
                $zugeordnete_kategorie = $zugeordnete_kategorie[0]['kategorie'];
                /* Spezialfelder und Felder an/aus */
                include "bolonline.main.conf.php";
                //		$content = $jscript_special_inputfields;//javascript fuer Spezialfelder
                //				$content.= print_r($special_inputfields,1);
                //				$content .= print_r($zugeordnete_kategorie,1);
                //				$content.='<H1>'.$fakultative_felder[$zugeordnete_kategorie][$bez].'</H1>';
                if (!isset($fakultative_felder[$zugeordnete_kategorie][$bez]) || $fakultative_felder[$zugeordnete_kategorie][$bez] == "true") {
                    //					$content.= print_r($special_inputfields[$bez],1);
                    /*
                     *  ### Ersetzung der Werte durch Vordefinierte
                     * in $special_inputfields aus 
                     * include_once ("bolonline.main.conf.php") :
                     */
                    if ($special_inputfields[$bez] != "") {
                        $content .= '<tr><td' . $bgcolor . '>' . $label . ':</td><td>' . $special_inputfields[$bez] . '</td></tr>' . "\n";
                    } else {
                        // normaler Wert, keine Ersetzung:
                        //Berechnung der Textfeldgroessen. Autom. Anpassung:
                        $height = round(strlen($rowobj[$bez]) / 65) * 16;
                        //max(40,abs(strlen($rowobj[$bez])/40));
                        //						$height = $height>90||strlen($rowobj[$bez])<1?90:$height;//=leere Felder mit Hoehe 90px
                        $height = $height > 90 ? 90 : $height;
                        //=leere Felder mit Hoehe 16px
                        $height = $height < 20 ? $height + 20 : $height;
                        $content .= '<tr><td' . $bgcolor . '>' . $label . ':</td><td><textarea name="' . $bez . '[]" style="width:400px;height:' . $height . 'px;">' . $rowobj[$bez] . '</textarea></td></tr>' . "\n";
                    }
                } else {
                    $content .= '<input type="hidden" name="' . $bez . '[]" value="' . $rowobj[$bez] . '">';
                    //				 	$content .= '<tr><td style="background-color:orange">' . $label . ':</td><td style="background-color:orange"><textarea name="' . $bez . '[]" style="width:400px;background-color:orange">' . $rowobj[$bez] . '</textarea></td></tr>' . "\n";
                }
            }
        }
        $content .= "</table></div>" . "\n";
        return $content;
    }
    function main($content, $conf)
    {
        $this->Bol = new BlumenbachOnline();
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();
        $this->fe_user = $this->Bol->fe_userdata;
        @session_start();
        $submitbutton = "";
        //		include_once("./bolonline.main.conf.php");
        /* Spezialfelder und Felder an/aus */
        include_once "bolonline.main.conf.php";
        $content .= $jscript_special_inputfields;
        //javascript fuer Spezialfelder
        //		if($this->Bol->debug) $content .= "<xmp>".print_r($_REQUEST, 1)."</xmp>";
        //		$GLOBALS['TYPO3_DB']->sql_free_result($res);
        #$content = $this->Bol->showAll($this->piVars['limit']);
        //		$content .= $this->Bol->show($_POST['id']);
        $_SESSION['todo'] = $_REQUEST["todo"] != "" ? $_REQUEST["todo"] : $_SESSION['todo'];
        $_SESSION['update_id'] = $_REQUEST["kerndaten_id"][0] != "" ? $_REQUEST["kerndaten_id"][0] : $_SESSION['update_id'];
        $_SESSION['hauptkategorie_id'] = $_REQUEST['hauptkategorie_id'] != "" ? $_REQUEST['hauptkategorie_id'] : $_SESSION['hauptkategorie_id'];
        $_SESSION['hauptkategorie_update_id'] = $_REQUEST['hauptkategorie_update_id'] != "" ? $_REQUEST['hauptkategorie_update_id'] : $_SESSION['hauptkategorie_update_id'];
        ######## XAJAX-Initialisieren:
        //require('/var/www/produktion.blumenbach.de/typo3conf/ext/bolonline/pi1/fileupload.ajax.server.php');
        require t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php';
        $xajax = t3lib_div::makeInstance('tx_xajax');
        $xajax->errorHandlerOn();
        $xajax->outputEntitiesOn();
        $xajax->cleanBufferOn();
        //wichtig!
        $xajax->setTimeout(500);
        //disabled
        $xajax->setLogFile("/var/www/produktion.blumenbach.de/typo3conf/ext/bolonline/test_ajax.log");
        $xajax->decodeUTF8InputOn();
        // for input
        $xajax->setCharEncoding('utf-8');
        //for output
        $xajax->statusMessagesOn();
        $xajax->debugOff();
        $xajax->registerExternalFunction('setUploadFields', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/fileupload.ajax.incl.php');
        $xajax->registerExternalFunction('setNoAssignedUploadFields', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/fileupload.ajax.incl.php');
        $xajax->registerExternalFunction('delImage', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/fileupload.ajax.incl.php');
        $xajax->registerExternalFunction('setFields', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/fileupload.ajax.incl.php');
        $xajax->registerExternalFunction('getDBDumpfile', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/datensicherung.php');
        $xajax->registerExternalFunction('getAccociationIDs', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/associations.pulldown.ajax.incl.php');
        $xajax->registerExternalFunction('setAccociationIDs', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/associations.pulldown.ajax.incl.php');
        $xajax->registerExternalFunction('getGettyData', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/gettySearch.ajax.incl.php');
        $xajax->registerExternalFunction('putGettyValues', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/gettySearch.ajax.incl.php');
        $xajax->registerExternalFunction('getGNDData', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/gndSearch.ajax.incl.php');
        $xajax->registerExternalFunction('putGNDValues', t3lib_extMgm::siteRelPath('bolonline') . '/pi1/gndSearch.ajax.incl.php');
        /*-------------- under development.... ---------------------*/
        //        $bis = rand(11,2999);
        //        echo $bis;
        //        for($i=0;$i<$bis;$i++) {
        //            echo chr(rand(0,150))." ";
        //        }
        //        die();
        /*------------ //under development.... ---------------------*/
        //print_r($_POST);
        $GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = $xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));
        $xajax->processRequests();
        $content .= '<table style="width:100%;border: 1px solid black">';
        if ($_SESSION['todo'] == "update" && isset($_SESSION['update_id'])) {
            require_once "hauptkategorie.changer.incl.php";
        }
        //###### Backup-Link: ############################################################################################
        include_once "db_backup.php";
        $content .= '<tr><td colspan="2"><div style="padding:5px;" id="db_backuplink" onClick="xajax_getDBDumpfile()">o <u>Hier klicken um eine Datensicherungsdatei zu erzeugen...</u></div></td></tr>';
        ##################################################################################################################
        $content .= '<tr><td colspan="2" style="background-color:lightgrey;height:1px;padding:1px"></td></tr>';
        //		$content .= 'Mediafiles: <xmp style="color:green">'.print_r($_FILES,1	).'</xmp>';
        // ################################# Datensatz editieren #################################
        $content .= '<tr><td style="width:50%">';
        $content .= '<form name="todo" action="' . $this->pi_getPageLink($GLOBALS['TSFE']->id) . '" method="POST">';
        $content .= '<select style="background-color:#fcfbc4;width:100%;padding:2px" name="todo" onChange="document.todo.submit()">
						<option value="">bitte wählen</option>
				   		<option style="color:blue" value="insert"' . ($_SESSION['todo'] == "insert" ? " selected" : "") . '>neuer Datensatz</option>
					<option style="color:red" value="update"' . ($_SESSION['todo'] == "update" ? " selected" : "") . '>bestehenden Datensatz editieren</option>
					</select>';
        $content .= '</form></td>';
        //print_r($_POST);
        if ($_SESSION['todo'] == 'update') {
            $content .= '<td style="width:50%"><form name="update" action="' . $this->pi_getPageLink($GLOBALS['TSFE']->id) . '" method="POST">';
            $content .= '<input type="hidden" name="todo" value="update">';
            $content .= '<select style="background-color:#fda92a;width:100%;padding:2px" name="kerndaten_id[]" onChange="document.update.submit()">
																		<option value="">bitte wählen</option>';
            /****** Hauptkategorie-Zuordnung aendern: *******************/
            $datensatz_ids = array();
            $datensatz_ids = $this->Bol->getUpdateTeaser($_SESSION['hauptkategorie_id']);
            //			$content .= $this->Bol->dump($datensatz_ids);
            foreach ($datensatz_ids as $id => $value) {
                $zugeordnete_kategorie = $this->Bol->getMainCategories($id);
                $content .= '<option value="' . $id . '"' . ($_SESSION['update_id'] == $id ? " selected" : "") . '>' . substr($value, 0, 250) . ' ->' . $zugeordnete_kategorie[0]['kategorie'] . '</option>';
            }
            $content .= '</select>';
            $content .= '</form></td></tr>';
        }
        // ################################# Ende Datensatz editieren #################################
        $content .= '<tr><td colspan="2" style="background-color:lightgrey;height:1px;padding:1px"></td></tr>';
        if ($_SESSION['todo'] == "update" && isset($_SESSION['update_id'])) {
            require "hauptkategorie.updater.incl.php";
        }
        /*--------- Funktion fuer Multiple Select der Tabellenzuordnung gelb ------*/
        $content .= '<script language="JavaScript">
                        function getMultiple(ob) {
                                var arSelected = "";
                                var counter = 0;
                                while (ob.selectedIndex != -1) {
                                if (counter==0) arSelected+= ob.options[ob.selectedIndex].value;
                                else arSelected+="|"+ob.options[ob.selectedIndex].value;
                                        ob.options[ob.selectedIndex].selected = false;
                                        counter++;
                                } // You can use the arSelected array for further processing.

                        return arSelected;
                        }
                      </script>';
        /*-------- /Funktion fuer Multiple Select der Tabellenzuordnung gelb ------*/
        $content .= '<tr><td colspan="2" style="background-color:lightgrey;height:1px;padding:1px"></td></tr>';
        $content .= '<tr><td colspan="2" style="height:10px"></td></tr>';
        //$content .= '<form action="' . $this->pi_getPageLink($GLOBALS['TSFE']->id) . '" method="POST" id="stammdaten" name="stammdaten">';
        //$content .= '<tr><td><br /><br />'.$this->setUploadFields().'</td></tr>';
        //		print_r($this->Bol->getTableColumns());
        $content .= '<tr><td colspan="2">';
        #if($_POST['todo']!=0){
        switch ($_SESSION['todo']) {
            case "insert":
                $submitbutton = htmlspecialchars($this->pi_getLL('submit_button_label'));
                $submit_label = htmlspecialchars($this->pi_getLL('submit_label_new'));
                //		$content .=  'insert';
                //				$content .= $this->Bol->show();
                $content .= '<form name="neueintrag" method="POST">';
                $this->Bol->tablename = 'tx_bolonline_Kerndaten';
                $this->Bol->getTableColumns();
                $blockbez = '<br /><b style="color:green">Block: ' . $this->Bol->tablename . '</b><br />';
                $content .= $blockbez;
                $content .= $this->Bol->show(0) . '<br /><br /><br />';
                $kerndaten_id = $this->Bol->insert(t3lib_div::_POST());
                // da $this->Bol->tablename = 'tx_bolonline_Kerndaten' ist die hier zurückgegebene id die kerndaten_id!
                $this->Bol->tablename = 'tx_bolonline_PartI';
                $this->Bol->getTableColumns();
                $blockbez = '<br /><b style="color:red">Block: ' . $this->Bol->tablename . '</b><br />';
                $content .= $blockbez;
                $content .= $this->Bol->show(0) . '<br /><br /><br />';
                $this->Bol->insert(t3lib_div::_POST(), $kerndaten_id);
                $this->Bol->tablename = 'tx_bolonline_PartII';
                $this->Bol->getTableColumns();
                $blockbez = '<br /><b style="color:blue">Block: ' . $this->Bol->tablename . '</b><br />';
                $content .= $blockbez;
                $content .= $this->Bol->show(0) . '<br /><br /><br />';
                $this->Bol->insert(t3lib_div::_POST(), $kerndaten_id);
                $this->Bol->tablename = 'tx_bolonline_PartIII';
                $this->Bol->getTableColumns();
                $blockbez = '<br /><b style="color:yellow">Block: ' . $this->Bol->tablename . '</b><br />';
                $content .= $blockbez;
                $content .= $this->Bol->show(0) . '<br /><br /><br />';
                $this->Bol->insert(t3lib_div::_POST(), $kerndaten_id);
                $this->Bol->tablename = 'tx_bolonline_PartIV';
                $this->Bol->getTableColumns();
                // Blockbezeichner aus Sprachdatei holen:
                $__blockbez = parent::pi_getLL($this->tablename . '.d');
                $blockbez = '<br /><b style="color:orange">' . $__blockbez . '</b><br />';
                $content .= $blockbez;
                $content .= $this->Bol->show(0) . '<br /><br /><br />';
                $this->Bol->insert(t3lib_div::_POST(), $kerndaten_id);
                $content .= '<input type="submit" value="' . $submit_label . '"></form>';
                //				echo 'UPDATE-ID:'.$kerndaten_id;
                if ($kerndaten_id > 0) {
                    $_SESSION['todo'] = "update";
                    $_SESSION['update_id'] = $kerndaten_id;
                    $text = "/intern/bol_db/?no_cache=1&kerndaten_id=" . $kerndaten_id;
                    $link = $text;
                    //					$link = $text . $this->pi_getPageLink($GLOBALS['TSFE']->$kerndaten_id, '');
                    //					echo 'WEITERLEITUNG nach: '.$link;
                    @header("Location: " . $link);
                }
                break;
            case "update":
                $submitbutton = htmlspecialchars($this->pi_getLL('update_button_label'));
                $submit_label = htmlspecialchars($this->pi_getLL('submit_label_update'));
                if ($_SESSION['update_id'] > 0) {
                    //					$this->Bol->tablename = 'tx_bolonline_Kerndaten';
                    //					$this->Bol->getTableColumns();
                    //					echo $this->Bol->update(t3lib_div :: _POST(), $_SESSION['update_id']);
                    //					$blockbez = '<br /><b>Block: ' . $this->Bol->tablename . '</b><br />';
                    //					$content .= $blockbez;
                    //					$content .= $this->Bol->show($_SESSION['update_id']);
                    // File-Upload-Felder:
                    //					$content .= '<script language="JavaScript">xajax_setUploadFields(1,"_kerndaten")</script>';
                    $content .= '<style type="text/css">' . "\n";
                    $content .= '#partcontentdiv_kerndaten {
                                        border: 2px solid green;
                                        padding: 5px;
                                }
                                #partcontentdiv_partI {
                                        border: 2px solid red;
                                        padding: 5px;
                                }
                        #partcontentdiv_partII {
                                        border: 2px solid blue;
                                        padding: 5px;
                                }
                        #partcontentdiv_partIII {
                                        border: 2px solid yellow;
                                        padding: 5px;
                                }
                        #partcontentdiv_partIV {
                                        border: 2px solid orange;
                                        padding: 5px;
                                }
                                .blockbez_tx_bolonline_Kerndaten { color: green }
                                .blockbez_tx_bolonline_PartI { color: red; }
                                .blockbez_tx_bolonline_PartII { color: blue; }
                                .blockbez_tx_bolonline_PartIII { color: yellow; }
                                .blockbez_tx_bolonline_PartIV { color: orange; }
										
										
                                ' . "\n";
                    $content .= '</style>' . "\n";
                    // alle anderen Felder:
                    $content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_Kerndaten","kerndaten",1,0,0)</script>';
                    $content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartI","partI",1,1)</script>';
                    $content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartII","partII",1,1)</script>';
                    $content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartIII","partIII",1,1)</script>';
                    $content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartIV","partIV",1,1)</script>';
                    $content .= '<div id="partcontentdiv_kerndaten" style="width:700px;"><h1>Kerndaten</h1></div><br /><br />';
                    $content .= '<div id="partcontentdiv_partII" style="width:700px;"><h1>PartII-FELDER</h1></div><br /><br />';
                    $content .= '<div id="partcontentdiv_partI" style="width:700px;"><h1>PartI-FELDER</h1></div><br /><br />';
                    $content .= '<div id="partcontentdiv_partIII" style="width:700px;"><h1>PartIII-FELDER</h1></div><br /><br />';
                    $content .= '<div id="partcontentdiv_partIV" style="width:700px;"><h1>PartIV-FELDER</h1></div><br /><br />';
                    //					if ($_SESSION['todo'] != 'delete' && $_SESSION['todo'] != '') {
                    //						$content .= '</td></tr><tr><td>
                    //						<br><br>
                    //						<h3>' . $submit_label . '</h3><br>
                    //						<input type="submit" name="' . $this->prefixId . '[submit_button]" value="' . $submitbutton . '">
                    //						</form>
                    //						<br />
                    //						<!--<p>You can click here to ' . $this->pi_linkToPage('get to this page again', $GLOBALS['TSFE']->id) . '</p>-->
                    //							';
                    //					}
                    $this->Bol->tablename = 'tx_bolonline_Kerndaten';
                    $this->Bol->getTableColumns();
                    //					$this->Bol->update(t3lib_div :: _POST(), $_SESSION['update_id']);
                    $this->Bol->update(t3lib_div::_POST(), $_SESSION['update_id']);
                    /*
                    					$this->Bol->tablename = 'tx_bolonline_Kerndaten';
                    					$this->Bol->getTableColumns();
                    					$this->Bol->update(t3lib_div :: _POST(), $_SESSION['update_id']);
                    					$blockbez = '<br /><b>Block: '.$this->Bol->tablename.'</b><br />';
                    					$content .= $blockbez;
                    					$content .= $this->Bol->show($_SESSION['update_id']);
                    */
                    $this->Bol->tablename = 'tx_bolonline_PartI';
                    $this->Bol->getTableColumns();
                    $this->Bol->update(t3lib_div::_POST(), $_SESSION['update_id']);
                    /*
                    					$blockbez = '<br /><b>Block: '.$this->Bol->tablename.'</b><br />';
                    					$content .= $blockbez;
                    					$content .= $this->Bol->show($_SESSION['update_id']);
                    */
                    $this->Bol->tablename = 'tx_bolonline_PartII';
                    $this->Bol->getTableColumns();
                    $this->Bol->update(t3lib_div::_POST(), $_SESSION['update_id']);
                    //					$content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartII","partII",1)</script>';
                    /*
                    					$blockbez = '<br /><b>Block: '.$this->Bol->tablename.'</b><br />';
                    					$content .= $blockbez;
                    					$content .= $this->Bol->show($_SESSION['update_id']);
                    */
                    $this->Bol->tablename = 'tx_bolonline_PartIII';
                    $this->Bol->getTableColumns();
                    $this->Bol->update(t3lib_div::_POST(), $_SESSION['update_id']);
                    /*
                    					$blockbez = '<br /><b>Block: '.$this->Bol->tablename.'</b><br />';
                    					$content .= $blockbez;
                    					$content .= $this->Bol->show($_SESSION['update_id']);
                    */
                    $this->Bol->tablename = 'tx_bolonline_PartIV';
                    $this->Bol->getTableColumns();
                    $this->Bol->update(t3lib_div::_POST(), $_SESSION['update_id']);
                    #$content .= '<script language="JavaScript">xajax_setFields("tx_bolonline_PartIV","partIV",1)</script>';
                    /*
                    					$blockbez = '<br /><b>Block: '.$this->Bol->tablename.'</b><br />';
                    					$content .= $blockbez;
                    					$content .= $this->Bol->show($_SESSION['update_id']);
                    */
                }
                break;
            case "delete":
                $deleted = $this->Bol->delete($_REQUEST['id'], $_REQUEST['tablename']);
                if ($deleted) {
                    $content .= 'Der Datensatz Nr. ' . $_REQUEST['id'] . 'aus Tabelle ' . $_REQUEST['tablename'] . ' wurde gelöscht!';
                } else {
                    $content .= "<div style='color:red'>something went wrong, couldǹt delete!</div>";
                }
                break;
            default:
                //				$content .= $this->Bol->show($_GET['id']);
                //				$content .= "Bitte Aktion wählen!";
                break;
        }
        $content .= '</td></tr></table>';
        return $this->pi_wrapInBaseClass($content);
    }
Пример #4
0
 /**
  * Main function, called from TypoScript
  * A content object that renders "tt_content" records. See the comment to this class for TypoScript example of how to trigger it.
  * This detects the CType of the current content element and renders it accordingly. Only wellknown types are rendered.
  *
  * @param	tslib_pibase	$invokingObj the tt_news object
  * @return	string			Plain text content
  */
 function extraCodesProcessor(&$invokingObj)
 {
     $content = '';
     $this->conf = $invokingObj->conf;
     if ($this->conf['code'] == 'PLAINTEXT') {
         $this->cObj = $invokingObj->cObj;
         $this->config = $invokingObj->config;
         $this->tt_news_uid = $invokingObj->tt_news_uid;
         $this->enableFields = $invokingObj->enableFields;
         $this->sys_language_mode = $invokingObj->sys_language_mode;
         $this->templateCode = $invokingObj->templateCode;
         $this->renderPlainText = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_directmail_pi1');
         $this->renderPlainText->init($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_directmail_pi1.']);
         $this->renderPlainText->cObj = $this->cObj;
         $this->renderPlainText->labelsList = 'tt_news_author_prefix,tt_news_author_date_prefix,tt_news_author_email_prefix,tt_news_short_header,tt_news_bodytext_header';
         $lines = array();
         $singleWhere = 'tt_news.uid=' . intval($this->tt_news_uid);
         $singleWhere .= ' AND type=0' . $this->enableFields;
         // type=0->only real news.
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_news', $singleWhere);
         $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
         // get the translated record if the content language is not the default language
         if ($GLOBALS['TSFE']->sys_language_content) {
             $OLmode = $this->sys_language_mode == 'strict' ? 'hideNonTranslated' : '';
             $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_news', $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);
         }
         if (is_array($row)) {
             // Render the title
             $lines[] = $this->renderPlainText->renderHeader($row['title']);
             // Render author of the tt_news record
             $lines[] = $this->renderAuthor($row);
             // Render the short version of the tt_news record
             $lines[] = $this->renderPlainText->breakContent(strip_tags($this->renderPlainText->parseBody($row['short'], 'tt_news_short')));
             // Render the main text of the tt_news record
             $lines[] = $this->renderPlainText->breakContent(strip_tags($this->renderPlainText->parseBody($row['bodytext'], 'tt_news_bodytext')));
             // Render the images of the tt_news record.
             $lines[] = $this->getImages($row);
             // Render the downloads of the tt_news record.
             $lines[] = $this->renderPlainText->renderUploads($row['news_files']);
         } elseif ($this->sys_language_mode == 'strict' && $this->tt_news_uid) {
             $noTranslMsg = $this->cObj->stdWrap($invokingObj->pi_getLL('noTranslMsg', 'Sorry, there is no translation for this news-article'), $this->conf['noNewsIdMsg_stdWrap.']);
             $content .= $noTranslMsg;
         }
         if (!empty($lines)) {
             $content = implode(LF, $lines) . $content;
         }
         // Substitute labels
         if (!empty($content)) {
             $markerArray = array();
             $markerArray = $this->renderPlainText->addLabelsMarkers($markerArray);
             $content = $this->cObj->substituteMarkerArray($content, $markerArray);
         }
     }
     return $content;
 }