/**
  * list action
  * @var Tx_KiddogNews_Domain_Model_Category $category
  * @return string The rendered list action
  */
 public function editAction(Tx_KiddogNews_Domain_Model_Category $category = NULL)
 {
     $this->view->assign('category', $category);
     t3lib_div::debug($this->settings['category']['root']);
     $this->view->assign('allCategories', $this->categoryRepository->findAll());
     $this->view->assign('rootCategorie', $this->settings['category']['root']);
 }
 /**
  * Wrapper for TYPO3s famous debug() function
  *
  * @param string $title
  * @return string the altered string.
  * @author Bastian Waidelich <*****@*****.**>
  */
 public function render($title = NULL)
 {
     ob_start();
     t3lib_div::debug($this->renderChildren(), $title);
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
示例#3
0
 /**
  * Wrapper for tx_apimacmade::debug() or t3lib_dib::debug() if
  * EXT:api_macmade is not loaded.
  *
  * @param string $header The debug output header.
  * @return string The debug output.
  */
 public function render($header = 'DEBUG')
 {
     ob_start();
     if (class_exists('tx_apimacmade')) {
         tx_apimacmade::debug($this->renderChildren(), $header);
     } else {
         t3lib_div::debug($this->renderChildren(), $header);
     }
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
/**
 * Example can be found in the testsite package at the page-path "/Intro/TypoScript examples/Menu object examples/Loading multiple.../"
 *
 * @param	array		The menu item array, $this->I (in the parent object)
 * @param	array		TypoScript configuration for the function. Notice that the property "parentObj" is a reference to the parent (calling) object (the tslib_Xmenu class instantiated)
 * @return	array		The processed $I array returned (and stored in $this->I of the parent object again)
 * @see tslib_menu::userProcess(), tslib_tmenu::writeMenu(), tslib_gmenu::writeMenu()
 */
function user_keepRolloverAtOnClick($I, $conf)
{
    $itemRow = $conf['parentObj']->menuArr[$I['key']];
    // Setting the document status content to the value of the page title on mouse over
    if (!$I['linkHREF']['TARGET']) {
        $I['linkHREF']['HREF'] = '#';
        $I['linkHREF']['onClick'] .= 'ARO_setLocation' . $conf['setLocation'] . '(' . $itemRow['uid'] . ',\'' . $I['theName'] . '\'); return false;';
    } else {
        $I['linkHREF']['onClick'] .= 'ARO_setActiveImg' . '(\'' . $I['theName'] . '\');';
    }
    if ($I['linkHREF']['onMouseover']) {
        $I['linkHREF']['onMouseover'] = 'ARO_' . $I['linkHREF']['onMouseover'];
    }
    if ($I['linkHREF']['onMouseout']) {
        $I['linkHREF']['onMouseout'] = 'ARO_' . $I['linkHREF']['onMouseout'];
    }
    if ($conf['parentObj']->isActive($itemRow['uid'])) {
        $conf['parentObj']->WMextraScript .= '
<script type="text/javascript">
	/*<![CDATA[*/
 ARO_Image = "' . $I['theName'] . '";
 ' . $I['linkHREF']['onMouseover'] . '
	/*]]>*/
</script>
		';
    }
    // Update the link in the parent object:
    $conf['parentObj']->I = $I;
    // setting internal $I - needed by setATagParts() function!
    $conf['parentObj']->setATagParts();
    // Setting the A1 and A2 of the internal $I
    $I = $conf['parentObj']->I;
    // retrieving internal $I
    $I['parts']['ATag_begin'] = $I['A1'];
    // Setting the ATag_begin to the value of this $I
    // Debug:
    if ($conf['debug']) {
        // Outputting for debug example:
        echo 'ITEM: <h2>' . htmlspecialchars($itemRow['uid'] . ': ' . $itemRow['title']) . '</h2>';
        t3lib_div::debug($itemRow);
        t3lib_div::debug($I);
        echo '<hr />';
    }
    // Returns $I:
    return $I;
}
 function sec($piVars)
 {
     // config
     $this->confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['wt_doorman']);
     // Get backandconfig
     $this->removeXSS = t3lib_div::makeInstance('tx_wtdoorman_RemoveXSS');
     // Create new instance for removeXSS class
     // let's go
     if ($this->confArr['debug'] == 1) {
         t3lib_div::debug($piVars, 'wt_doorman input values - ' . $this->debugMessage);
     }
     if (count($piVars) > 0) {
         // if piVars are set
         foreach ($piVars as $key => $value) {
             // one loop for every var
             if (array_key_exists($key, $this->secParams) || array_key_exists('*', $this->secParams)) {
                 // if current key is an allowed parameter OR there is a wildcard in first level
                 if (!is_array($piVars[$key])) {
                     // first level
                     if (!array_key_exists('*', $this->secParams)) {
                         // if wildcard should NOT be used
                         $piVars[$key] = $this->filter($piVars[$key], $this->secParams[$key]);
                         // clean current string with his method
                     } else {
                         // use wildcard (all keys will be handled in the same way
                         $piVars[$key] = $this->filter($piVars[$key], $this->secParams['*']);
                         // clean all this strings with method from *
                     }
                 } else {
                     // second level
                     if (count($piVars[$key]) > 0) {
                         // only if exists
                         foreach ($piVars[$key] as $key2 => $value2) {
                             // one row for every key in second level
                             if (!is_array($value2)) {
                                 // only on second level
                                 if (!array_key_exists('*', $this->secParams[$key])) {
                                     // if wildcard should NOT be used
                                     $piVars[$key][$key2] = $this->filter($piVars[$key][$key2], $this->secParams[$key][$key2]);
                                     // clean current string with his method
                                 } else {
                                     // use wildcard (all keys will be handled in the same way
                                     $piVars[$key][$key2] = $this->filter($piVars[$key][$key2], $this->secParams[$key]['*']);
                                     // clean all this strings with method from *
                                 }
                             } else {
                                 unset($piVars[$key][$key2]);
                             }
                             // delete
                         }
                     } else {
                         unset($piVars[$key]);
                     }
                     // delete
                 }
             } else {
                 // curent key exists not in allowed array
                 if ($this->delNotSetVars == 1) {
                     unset($piVars[$key]);
                 }
                 // delete
             }
         }
         if ($this->allow_removeXSS) {
             $piVars = array_map(array($this->removeXSS, 'RemoveXSS'), $piVars);
         }
         // removeXSS recursive for all piVars
         if ($this->confArr['debug'] == 1) {
             t3lib_div::debug($piVars, 'wt_doorman output values - ' . $this->debugMessage);
         }
         return $piVars;
         // return cleaned piVars
     }
 }
 /**
  * List view, listing the records from the table.
  * Does also provide the single view if the "showUid" piVar is set.
  *
  * @param	string		HTML input content - not used, ignore.
  * @param	array		TypoScript configuration array
  * @return	string		HTML content for the listing.
  */
 function listView($content, $conf)
 {
     // Init:
     $this->conf = $conf;
     // Setting the TypoScript passed to this function in $this->conf
     $this->pi_setPiVarDefaults();
     $this->pi_loadLL();
     // Loading the LOCAL_LANG values
     $this->pi_USER_INT_obj = 1;
     // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
     $this->lConf = $lConf = $this->conf['listView.'];
     // Local settings for the listView function
     $this->pi_alwaysPrev = $this->lConf['alwaysPrev'];
     $this->viewMode = 'listView';
     // Select either single view or list view:
     if ($this->piVars['showUid']) {
         // If a single element should be displayed:
         $this->internal['currentTable'] = 'fe_users';
         $this->internal['currentRow'] = $this->pi_getRecord('fe_users', $this->piVars['showUid']);
         $content = $this->singleView($content, $conf);
         return $content;
     } else {
         if (!isset($this->piVars['pointer'])) {
             $this->piVars['pointer'] = 0;
         }
         // Initializing the query parameters:
         list($this->internal['orderBy'], $this->internal['descFlag']) = explode(':', $this->piVars['sort']);
         $this->internal['results_at_a_time'] = t3lib_div::intInRange($lConf['results_at_a_time'], 0, 1000, 3);
         // Number of results to show in a listing.
         $this->internal['maxPages'] = t3lib_div::intInRange($lConf['maxPages'], 0, 1000, 2);
         // The maximum number of "pages" in the browse-box: "Page 1", 'Page 2', etc.
         $this->internal['searchFieldList'] = 'username,name,email,country,city,zip,telephone,address,title';
         $this->internal['orderByList'] = 'username,name,email,country,city,zip';
         // selectable fe-group, contributed by Stefan Padberg <*****@*****.**>, modified by Stefan Strasser
         // calculate where-clause:
         if ($this->config['groupSelectmode'] != 0) {
             $where = 'AND ( ';
             if ($this->config['groupSelectmode'] == -1) {
                 $whereConn = 'AND';
                 $whereLike = 'NOT LIKE';
             } else {
                 $whereConn = 'OR';
                 $whereLike = 'LIKE';
             }
             for ($i = 0; $i < count($this->groupSelectArray); $i++) {
                 if ($i != 0) {
                     $where .= $whereConn;
                 }
                 $where .= ' usergroup ' . $whereLike . ' "' . $this->groupSelectArray[$i] . '" ' . $whereConn . ' usergroup ' . $whereLike . ' "%,' . $this->groupSelectArray[$i] . '" ' . $whereConn . ' usergroup ' . $whereLike . ' "' . $this->groupSelectArray[$i] . ',%" ' . $whereConn . ' usergroup ' . $whereLike . ' "%,' . $this->groupSelectArray[$i] . ',%" ';
             }
             $where .= ')';
         }
         // end of selectable fe-group modification, adding $where to the query below
         // Get number of records:
         $query = $this->pi_list_query('fe_users', 1, $where);
         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         if ($GLOBALS['TYPO3_DB']->sql_error()) {
             t3lib_div::debug(array($GLOBALS['TYPO3_DB']->sql_error(), $query));
         }
         list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
         // Make listing query, pass query to MySQL:
         $query = $this->pi_list_query('fe_users', 0, $where);
         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         if ($GLOBALS['TYPO3_DB']->sql_error()) {
             t3lib_div::debug(array($GLOBALS['TYPO3_DB']->sql_error(), $query));
         }
         $this->internal['currentTable'] = 'fe_users';
         // Put the whole list together:
         $fullTable = '';
         // Clear var;
         // Adds the whole list table
         $fullTable .= $this->pi_list_makelist($res, $this->conf['listView.']['tableParams_list']);
         // Adds the result browser:
         $fullTable .= '<p>' . $this->pi_list_browseresults() . '</p>';
         // Adds the search box:
         $fullTable .= $this->pi_list_searchBox();
         // Returns the content from the plugin.
         return $fullTable;
     }
 }
 /**
  * Debugs a SQL query from a QueryResult
  *
  * @param $queryResult
  * @param boolean $explainOutput
  * @return void
  */
 public function debugQuery($queryResult, $explainOutput = FALSE)
 {
     $GLOBALS['TYPO3_DB']->debugOutput = 2;
     if ($explainOutput) {
         $GLOBALS['TYPO3_DB']->explainOutput = true;
     }
     $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;
     $queryResult->toArray();
     t3lib_div::debug($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
     $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;
     $GLOBALS['TYPO3_DB']->explainOutput = false;
     $GLOBALS['TYPO3_DB']->debugOutput = false;
 }
 /**
  * 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
  */
 public function main($content, $conf)
 {
     // config
     global $TSFE;
     $local_cObj = $TSFE->cObj;
     // cObject
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_loadLL();
     $this->pi_USER_INT_obj = 1;
     $this->div = t3lib_div::makeInstance('tx_wtcart_div');
     // Create new instance for div functions
     $this->calc = t3lib_div::makeInstance('tx_wtcart_calc');
     // Create new instance for calculation functions
     $this->dynamicMarkers = t3lib_div::makeInstance('tx_wtcart_dynamicmarkers');
     // Create new instance for dynamicmarker function
     $this->tmpl['all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART###');
     // Load HTML Template
     $this->tmpl['empty'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_EMPTY###');
     // Load HTML Template
     $this->tmpl['minprice'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_MINPRICE###');
     // Load HTML Template
     $this->tmpl['item'] = $this->cObj->getSubpart($this->tmpl['all'], '###ITEM###');
     // work on subpart 2
     $content_item = '';
     $cartNet = $cartGross = $cartTaxReduced = $cartTaxNormal = $this->cartCount = $this->cartServiceAttribute1Sum = $this->cartServiceAttribute1Max = $this->cartServiceAttribute2Sum = $this->cartServiceAttribute2Max = $this->cartServiceAttribute3Sum = $this->cartServiceAttribute3Max = 0;
     // new for Shipping radiolist and Payment radiolist and Special checkboxlist
     $this->tmpl['shipping_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_SHIPPING###');
     // Load HTML Template
     $this->tmpl['shipping_item'] = $this->cObj->getSubpart($this->tmpl['shipping_all'], '###ITEM###');
     // work on subpart 2
     $this->tmpl['shipping_condition_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_SHIPPING_CONDITIONS###');
     // Load HTML Template
     $this->tmpl['shipping_condition_item'] = $this->cObj->getSubpart($this->tmpl['shipping_condition_all'], '###ITEM###');
     // work on subpart 2
     $this->tmpl['payment_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_PAYMENT###');
     $this->tmpl['payment_item'] = $this->cObj->getSubpart($this->tmpl['payment_all'], '###ITEM###');
     // work on subpart 2
     $this->tmpl['payment_condition_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_PAYMENT_CONDITIONS###');
     // Load HTML Template
     $this->tmpl['payment_condition_item'] = $this->cObj->getSubpart($this->tmpl['payment_condition_all'], '###ITEM###');
     // work on subpart 2
     $this->tmpl['special_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_SPECIAL###');
     $this->tmpl['special_item'] = $this->cObj->getSubpart($this->tmpl['special_all'], '###ITEM###');
     // work on subpart 2
     $this->tmpl['special_condition_all'] = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['main.']['template']), '###WTCART_SPECIAL_CONDITIONS###');
     // Load HTML Template
     $this->tmpl['special_condition_item'] = $this->cObj->getSubpart($this->tmpl['special_condition_all'], '###ITEM###');
     // work on subpart 2
     // read variables
     $this->gpvar['title'] = $this->cObj->cObjGetSingle($this->conf['settings.']['title'], $this->conf['settings.']['title.']);
     // get title
     $this->gpvar['price'] = $this->cObj->cObjGetSingle($this->conf['settings.']['price'], $this->conf['settings.']['price.']);
     // get price
     $this->gpvar['qty'] = intval($this->cObj->cObjGetSingle($this->conf['settings.']['qty'], $this->conf['settings.']['qty.']));
     // get qty
     $this->gpvar['tax'] = $this->cObj->cObjGetSingle($this->conf['settings.']['tax'], $this->conf['settings.']['tax.']);
     // get tax
     $this->gpvar['service_attribute_1'] = floatval($this->cObj->cObjGetSingle($this->conf['settings.']['service_attribute_1'], $this->conf['settings.']['service_attribute_1.']));
     // get service_attribute_1
     $this->gpvar['service_attribute_2'] = floatval($this->cObj->cObjGetSingle($this->conf['settings.']['service_attribute_2'], $this->conf['settings.']['service_attribute_2.']));
     // get service_attribute_2
     $this->gpvar['service_attribute_3'] = floatval($this->cObj->cObjGetSingle($this->conf['settings.']['service_attribute_3'], $this->conf['settings.']['service_attribute_3.']));
     // get service_attribute_3
     $this->gpvar['puid'] = intval($this->cObj->cObjGetSingle($this->conf['settings.']['puid'], $this->conf['settings.']['puid.']));
     // get puid
     $this->gpvar['cid'] = intval($this->cObj->cObjGetSingle($this->conf['settings.']['cid'], $this->conf['settings.']['cid.']));
     // get cuid
     $this->gpvar['sku'] = $this->cObj->cObjGetSingle($this->conf['settings.']['sku'], $this->conf['settings.']['sku.']);
     // get sku
     $this->gpvar['min'] = $this->cObj->cObjGetSingle($this->conf['settings.']['min'], $this->conf['settings.']['min.']);
     // get min
     $this->gpvar['max'] = $this->cObj->cObjGetSingle($this->conf['settings.']['max'], $this->conf['settings.']['max.']);
     // get max
     if ($this->gpvar['cid']) {
         $row = $this->pi_getRecord('tt_content', $this->gpvar['cid']);
         $flexformData = t3lib_div::xml2array($row['pi_flexform']);
         $this->gpvar['puid'] = $this->pi_getFFvalue($flexformData, 'puid', 'sDEF');
         $this->gpvar['title'] = $this->pi_getFFvalue($flexformData, 'title', 'sDEF');
         $this->gpvar['sku'] = $this->pi_getFFvalue($flexformData, 'sku', 'sDEF');
         $this->gpvar['price'] = $this->pi_getFFvalue($flexformData, 'price', 'sDEF');
         $this->gpvar['tax'] = $this->pi_getFFvalue($flexformData, 'tax', 'sDEF');
         $attributes = split("\n", $this->pi_getFFvalue($flexformData, 'attributes', 'sDEF'));
         foreach ($attributes as $line) {
             list($key, $value) = explode("==", $line, 2);
             switch ($key) {
                 case 'service_attribute_1':
                     $this->gpvar['service_attribute_1'] = floatval($value);
                     break;
                 case 'service_attribute_2':
                     $this->gpvar['service_attribute_2'] = floatval($value);
                     break;
                 case 'service_attribute_3':
                     $this->gpvar['service_attribute_3'] = floatval($value);
                     break;
                 case 'min':
                     $this->gpvar['min'] = intval($value);
                     break;
                 case 'max':
                     $this->gpvar['max'] = intval($value);
                     break;
             }
         }
     }
     if ($this->gpvar['qty'] === 0) {
         // if no qty given
         $this->gpvar['qty'] = 1;
         // set to 1
     }
     // debug output
     if ($this->conf['debug']) {
         t3lib_div::debug($this->div->getProductsFromSession(), $this->extKey . ': ' . 'Values in session at the beginning');
         t3lib_div::debug($this->gpvar, $this->extKey . ': ' . 'Given params');
         t3lib_div::debug($this->conf, $this->extKey . ': ' . 'Typoscript configuration');
         t3lib_div::debug($_POST, $this->extKey . ': ' . 'All POST variables');
     }
     // remove product from session
     if (isset($this->piVars['del'])) {
         $this->div->removeProductFromSession($this);
         // remove product
     }
     // change qty
     if (isset($this->piVars['qty']) && is_array($this->piVars['qty'])) {
         $this->div->changeQtyInSession($this);
         // change qty
     }
     // change shipping
     if (isset($this->piVars['shipping'])) {
         $this->div->changeShippingInSession($this->piVars['shipping']);
         // change shipping
     }
     // change payment
     if (isset($this->piVars['payment'])) {
         $this->div->changePaymentInSession($this->piVars['payment']);
         // change payment
     }
     // change special
     if (isset($this->piVars['special'])) {
         $this->div->changeSpecialInSession($this->piVars['special']);
         // change payment
     }
     // add further product to session
     $this->newProduct = $this->div->getProductDetails($this->gpvar, $this);
     // get details from product
     if ($this->newProduct !== false) {
         $this->newProduct['qty'] = $this->gpvar['qty'];
         $this->newProduct['service_attribute_1'] = $this->gpvar['service_attribute_1'];
         $this->newProduct['service_attribute_2'] = $this->gpvar['service_attribute_2'];
         $this->newProduct['service_attribute_3'] = $this->gpvar['service_attribute_3'];
         $this->div->addProduct2Session($this->newProduct, $this);
     }
     // read all products from session
     $this->product = $this->div->getProductsFromSession();
     // there are products in the session
     if (count($this->product) > 0) {
         // loop for every product in the session
         foreach ((array) $this->product as $product) {
             // clear marker array to avoid problems with error msg etc.
             unset($this->markerArray);
             // price total
             $product['price_total'] = $product['price'] * $product['qty'];
             // enable .field in typoscript
             $local_cObj->start($product, $this->conf['db.']['table']);
             foreach ((array) $this->conf['settings.']['fields.'] as $key => $value) {
                 if (!stristr($key, '.')) {
                     // no .
                     //$this->markerArray['###' . strtoupper($key) . '###'] = $local_cObj->cObjGetSingle($this->conf['settings.']['fields.'][$key], $this->conf['settings.']['fields.'][$key . '.']); // write to marker
                     // name of the current field in the TypoScript
                     $ts_key = $this->conf['settings.']['fields.'][$key];
                     // configuration array of the current field in the TypoScript
                     $ts_conf = $this->conf['settings.']['fields.'][$key . '.'];
                     switch ($key) {
                         case 'delete':
                             $ts_conf = $this->div->add_variant_gpvar_to_imagelinkwrap($product, $ts_key, $ts_conf, $this);
                             break;
                         default:
                             // nothing to do, there is no default now
                     }
                     $ts_rendered_value = $local_cObj->cObjGetSingle($ts_key, $ts_conf);
                     $this->markerArray['###' . strtoupper($key) . '###'] = $ts_rendered_value;
                     // write to marker
                     // adds the ###QTY_NAME### marker in case of variants
                     $this->markerArray = $this->div->add_qtyname_marker($product, $this->markerArray, $this);
                 }
             }
             // replace error msg
             $this->markerArray['###ERROR_MSG###'] = '';
             foreach ($product['error'] as $error) {
                 $this->markerArray['###ERROR_MSG###'] .= sprintf($this->pi_getLL('wt_cart_ll_error_' . $error), $product[$error]);
             }
             $content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['item'], $this->markerArray);
             // add inner html to variable
             $cartGross += $product['price_total'];
             $this->cartCount += $product['qty'];
             $this->cartServiceAttribute1Sum += $product['service_attribute_1'] * $product['qty'];
             $this->cartServiceAttribute1Max = $this->cartServiceAttribute1Max > $product['service_attribute_1'] ? $this->cartServiceAttribute1Max : $product['service_attribute_1'];
             $this->cartServiceAttribute2Sum += $product['service_attribute_2'] * $product['qty'];
             $this->cartServiceAttribute2Max = $this->cartServiceAttribute2Max > $product['service_attribute_2'] ? $this->cartServiceAttribute2Max : $product['service_attribute_2'];
             $this->cartServiceAttribute3Sum += $product['service_attribute_3'] * $product['qty'];
             $this->cartServiceAttribute3Max = $this->cartServiceAttribute3Max > $product['service_attribute_3'] ? $this->cartServiceAttribute3Max : $product['service_attribute_3'];
             // get the formular with the markers ###TAX## for calculating tax
             $str_wrap = $this->conf['settings.']['fields.']['tax.']['default.']['setCurrent.']['wrap'];
             // save the formular with marker, we need it later
             $str_wrap_former = $str_wrap;
             // replace the ###TAX### with current tax rate like 0.07 or 0.19
             $str_wrap = str_replace('###TAX###', $product['tax'], $str_wrap);
             // assign the forular with tax rates to TypoScript
             $this->conf['settings.']['fields.']['tax.']['default.']['setCurrent.']['wrap'] = $str_wrap;
             $cartNet += $product['price_total'] - $local_cObj->cObjGetSingle($this->conf['settings.']['fields.']['tax'], $this->conf['settings.']['fields.']['tax.']);
             $curr_tax = $local_cObj->cObjGetSingle($this->conf['settings.']['fields.']['tax'], $this->conf['settings.']['fields.']['tax.']);
             switch ($product['tax']) {
                 case 0:
                     break;
                 case 1:
                 case $this->conf['tax.']['reducedCalc']:
                     $cartTaxReduced += $curr_tax;
                     // add tax from this product to overall
                     break;
                 case 2:
                 case $this->conf['tax.']['normalCalc']:
                     $cartTaxNormal += $curr_tax;
                     // add tax from this product to overall
                     break;
                 default:
                     echo '<div style="border:2em solid red;padding:2em;color:red;"><h1 style="color:red;">wt_cart Error</h1><p>tax is "' . $product['tax'] . '".<br />This is an undefined value in class.tx_wtcart_pi1.php. ABORT!<br /><br />Are you sure, that you included the wt_cart static template?</p></div>';
                     exit;
             }
             $this->conf['settings.']['fields.']['tax.']['default.']['setCurrent.']['wrap'] = $str_wrap_former;
         }
         // loop for every product in the session
         // item for payment
         $payment_id = $this->div->getPaymentFromSession();
         if ($payment_id) {
             $this->markerArray['###QTY###'] = 1;
             $this->markerArray['###TITLE###'] = $this->conf['payment.']['options.'][$payment_id . '.']['title'];
             $this->markerArray['###PRICE###'] = $this->conf['payment.']['options.'][$payment_id . '.']['extra'];
             $this->markerArray['###PRICE_TOTAL###'] = $this->conf['payment.']['options.'][$payment_id . '.']['extra'];
             $content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['special_item'], $this->markerArray);
             // add inner html to variable
         }
         $subpartArray['###CONTENT###'] = $content_item;
         // work on subpart 3
         $subpartArray['###CONTENT###'] .= '<input type="hidden" name="tx_wtcart_pi1[update_from_cart]" value="1">';
         $this->cartGrossNoService = $cartGross;
         $cartNetNoService = $cartNet;
         // SHIPPING
         $shipping_id = $this->div->getShippingFromSession();
         if (!$shipping_id) {
             $shipping_id = intval($this->conf['shipping.']['preset']);
             $this->div->changeShippingInSession($shipping_id);
         }
         // check if selected shipping option is available
         if ($newshipping_id = $this->checkOptionIsNotAvailable('shipping', $shipping_id)) {
             $shipping_id = $newshipping_id;
             $this->div->changeShippingInSession($newshipping_id);
         }
         $shipping_values = $this->calc->calculateOptionById($this->conf, 'shipping', $shipping_id, $this);
         $shipping_net = $shipping_values['net'];
         $shipping_gross = $shipping_values['gross'];
         $cartNet += $shipping_values['net'];
         $cartGross += $shipping_values['gross'];
         if ($this->conf['shipping.']['options.'][$shipping_id . '.']['tax'] == 'reduced') {
             $cartTaxReduced += $shipping_gross - $shipping_net;
         } else {
             $cartTaxNormal += $shipping_gross - $shipping_net;
         }
         // PAYMENT
         $payment_id = $this->div->getPaymentFromSession();
         if (!$payment_id) {
             $payment_id = intval($this->conf['payment.']['preset']);
             $this->div->changePaymentInSession($payment_id);
         }
         // check if selected payment option is available
         if ($newpayment_id = $this->checkOptionIsNotAvailable('payment', $payment_id)) {
             $payment_id = $newpayment_id;
             $this->div->changePaymentInSession($newpayment_id);
         }
         $payment_values = $this->calc->calculateOptionById($this->conf, 'payment', $payment_id, $this);
         $payment_net = $payment_values['net'];
         $payment_gross = $payment_values['gross'];
         $cartNet += $payment_values['net'];
         $cartGross += $payment_values['gross'];
         if ($this->conf['payment.']['options.'][$payment_id . '.']['tax'] == 'reduced') {
             $cartTaxReduced += $payment_gross - $payment_net;
         } else {
             $cartTaxNormal += $payment_gross - $payment_net;
         }
         // SPECIAL
         $special_ids = $this->div->getSpecialFromSession();
         $overall_special_gross = 0.0;
         $overall_special_net = 0.0;
         foreach ($special_ids as $special_id) {
             $special_values = $this->calc->calculateOptionById($this->conf, 'special', $special_id, $this);
             $special_net = $special_values['net'];
             $special_gross = $special_values['gross'];
             $cartNet += $special_values['net'];
             $cartGross += $special_values['gross'];
             if ($this->conf['special.']['options.'][$special_id . '.']['tax'] == 'reduced') {
                 $cartTaxReduced += $special_gross - $special_net;
             } else {
                 $cartTaxNormal += $special_gross - $special_net;
             }
             $overall_special_gross += $special_gross;
             $overall_special_net += $special_net;
         }
         $sesArray = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->extKey . '_cart_' . $GLOBALS["TSFE"]->id);
         $sesArray['service_cost_net'] = $shipping_net + $payment_net + $overall_special_net;
         $sesArray['service_cost_gross'] = $shipping_gross + $payment_gross + $overall_special_gross;
         $sesArray['cart_gross'] = $cartGross;
         $sesArray['cart_gross_no_service'] = $this->cartGrossNoService;
         $sesArray['cart_net'] = $cartNet;
         $sesArray['cart_net_no_service'] = $cartNetNoService;
         $sesArray['cart_tax_reduced'] = $cartTaxReduced;
         $sesArray['cart_tax_normal'] = $cartTaxNormal;
         $GLOBALS['TSFE']->fe_user->setKey('ses', $this->extKey . '_cart_' . $GLOBALS["TSFE"]->id, $sesArray);
         $outerArr = array('service_cost_net' => $sesArray['service_cost_net'], 'service_cost_gross' => $sesArray['service_cost_gross'], 'cart_gross' => $cartGross, 'cart_gross_no_service' => $this->cartGrossNoService, 'cart_net' => $cartNet, 'cart_net_no_service' => $cartNetNoService, 'cart_tax_reduced' => $cartTaxReduced, 'cart_tax_normal' => $cartTaxNormal);
         $local_cObj->start($outerArr, $this->conf['db.']['table']);
         // enable .field in typoscript
         foreach ((array) $this->conf['settings.']['overall.'] as $key => $value) {
             if (!stristr($key, '.')) {
                 // no .
                 $this->outerMarkerArray['###' . strtoupper($key) . '###'] = $local_cObj->cObjGetSingle($this->conf['settings.']['overall.'][$key], $this->conf['settings.']['overall.'][$key . '.']);
             }
         }
         if ($sesArray['cart_gross_no_service'] < floatval($this->conf['cart.']['cartmin.']['value'])) {
             $cartMinStr = $this->price_format($this->conf['cart.']['cartmin.']['value']);
             $minPriceArray['###ERROR_MINPRICE###'] = sprintf($this->pi_getLL('wtcart_ll_minprice'), $cartMinStr);
             $subpartArray['###MINPRICE###'] = $this->cObj->substituteMarkerArrayCached($this->tmpl['minprice'], $minPriceArray);
         }
         if (!($sesArray['cart_gross_no_service'] < floatval($this->conf['cart.']['cartmin.']['value'])) || $sesArray['cart_gross_no_service'] < floatval($this->conf['cart.']['cartmin.']['value']) && !$this->conf['cart.']['cartmin.']['hideifnotreached.']['service']) {
             $shippingArray['###CONTENT###'] = $this->renderOptionList('shipping', $shipping_id);
             if ($shippingArray['###CONTENT###']) {
                 $subpartArray['###SHIPPING_RADIO###'] = $this->cObj->substituteMarkerArrayCached($this->tmpl['shipping_all'], null, $shippingArray);
             } else {
                 $subpartArray['###SHIPPING_RADIO###'] = '';
             }
             $paymentArray['###CONTENT###'] = $this->renderOptionList('payment', $payment_id);
             if ($paymentArray['###CONTENT###']) {
                 $subpartArray['###PAYMENT_RADIO###'] = $this->cObj->substituteMarkerArrayCached($this->tmpl['payment_all'], null, $paymentArray);
             } else {
                 $subpartArray['###PAYMENT_RADIO###'] = '';
             }
             $specialArray['###CONTENT###'] = $this->renderOptionList('special', $special_ids);
             if ($specialArray['###CONTENT###']) {
                 $subpartArray['###SPECIAL_CHECKBOX###'] = $this->cObj->substituteMarkerArrayCached($this->tmpl['special_all'], null, $specialArray);
             } else {
                 $subpartArray['###SPECIAL_CHECKBOX###'] = '';
             }
         }
     }
     // there isn't any product in the session
     if (!(count($this->product) > 0)) {
         if (!empty($this->tmpl['all'])) {
             // if template found
             $this->tmpl['all'] = $this->tmpl['empty'];
             // overwrite normal template with empty template
         } else {
             // no template - show error
             $this->tmpl['all'] = $this->div->msg($this->pi_getLL('error_noTemplate', 'No Template found'));
         }
     }
     $this->content = $this->cObj->substituteMarkerArrayCached($this->tmpl['all'], $this->outerMarkerArray, $subpartArray);
     // Get html template
     $this->content = $this->dynamicMarkers->main($this->content, $this);
     // Fill dynamic locallang or typoscript markers
     $this->content = preg_replace('|###.*?###|i', '', $this->content);
     // Finally clear not filled markers
     return $this->pi_wrapInBaseClass($this->content);
 }
示例#9
0
 /**
  * Finds all posts for the Latest-View
  * @param var $time
  * @return array The posts
  */
 public function findLatest($time)
 {
     t3lib_div::debug($time);
     $query = $this->createQuery();
     return $query->matching($query->greaterThan('date', time() - $time))->setOrderings(array('date' => Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING))->execute();
 }
 public static function debug($var = '', $header = '', $group = 'Debug')
 {
     $callingClassName = '\\TYPO3\\CMS\\Core\\Utility\\DebugUtility';
     if (class_exists($callingClassName) && method_exists($callingClassName, 'debug')) {
         call_user_func($callingClassName . '::debug', $var, $header, $group);
     } else {
         if (class_exists('t3lib_utility_Debug') && method_exists('t3lib_utility_Debug', 'debug')) {
             t3lib_utility_Debug::debug($var, $header, $group);
         } else {
             if (class_exists('t3lib_div') && method_exists('t3lib_div', 'debug')) {
                 t3lib_div::debug($var, $header, $group);
             }
         }
     }
 }
function debug($variable = '', $name = '*variable*', $line = '*line*', $file = '*file*', $recursiveDepth = 3, $debugLevel = E_DEBUG)
{
    // If you wish to use the debug()-function, and it does not output something, please edit the IP mask in TYPO3_CONF_VARS
    if (!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
        return;
    }
    if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debug'))) {
        $GLOBALS['error']->debug($variable, $name, $line, $file, $recursiveDepth, $debugLevel);
    } else {
        $title = $name === '*variable*' ? '' : $name;
        $group = $line === '*line*' ? NULL : $line;
        t3lib_div::debug($variable, $title, $group);
    }
}
/**
 * Debug function. Substitute since no config_default.php file is included anywhere
 *
 * @param	mixed		Debug var
 * @param	string		Header string
 * @return	void
 */
function debug($p1, $p2 = '')
{
    t3lib_div::debug($p1, $p2);
}
    /**
     * Main function, returning the HTML content of the module
     *
     * @return string  HTML
     */
    function main()
    {
        $query = $this->query('*');
        $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        if ($GLOBALS['TYPO3_DB']->sql_error()) {
            t3lib_div::debug(array('SQL error:', $GLOBALS['TYPO3_DB']->sql_error()));
        }
        $count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
        if (!t3lib_div::GPvar('do_update')) {
            $onClick = "document.location='" . t3lib_div::linkThisScript(array('do_update' => 1)) . "'; return false;";
            return 'There are ' . $count . ' rows in "tt_content" to update. Do you want to perform the action now?

					<form action=""><input type="submit" value="DO IT" onclick="' . htmlspecialchars($onClick) . '"></form>
					';
        } else {
            while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                $xml = trim('
<T3FlexForms>
	<meta>
		<dataStructureUid></dataStructureUid>
		<currentSheetId>s_logout</currentSheetId>
	</meta>
	<data>
		<sDEF>
			<lDEF>
				<show_forgot_password>
					<vDEF>' . $row['tx_newloginbox_show_forgot_password'] . '</vDEF>
				</show_forgot_password>
			</lDEF>
		</sDEF>
		<s_welcome>
			<lDEF>
				<header>
					<vDEF>' . $row['tx_newloginbox_header_welcome'] . '</vDEF>
				</header>
				<message>
					<vDEF>' . $row['tx_newloginbox_msg_welcome'] . '</vDEF>
				</message>
			</lDEF>
		</s_welcome>
		<s_success>
			<lDEF>
				<header>
					<vDEF>' . $row['tx_newloginbox_header_success'] . '</vDEF>
				</header>
				<message>
					<vDEF>' . $row['tx_newloginbox_msg_success'] . '</vDEF>
				</message>
			</lDEF>
		</s_success>
		<s_error>
			<lDEF>
				<header>
					<vDEF>' . $row['tx_newloginbox_header_error'] . '</vDEF>
				</header>
				<message>
					<vDEF>' . $row['tx_newloginbox_msg_error'] . '</vDEF>
				</message>
			</lDEF>
		</s_error>
		<s_status>
			<lDEF>
				<header>
					<vDEF>' . $row['tx_newloginbox_header_status'] . '</vDEF>
				</header>
				<message>
					<vDEF>' . $row['tx_newloginbox_msg_status'] . '</vDEF>
				</message>
			</lDEF>
		</s_status>
		<s_logout>
			<lDEF>
				<header>
					<vDEF>' . $row['tx_newloginbox_header_logout'] . '</vDEF>
				</header>
				<message>
					<vDEF>' . $row['tx_newloginbox_msg_logout'] . '</vDEF>
				</message>
			</lDEF>
		</s_logout>
	</data>
</T3FlexForms>
						');
                $updateRecord = array();
                $updateRecord['tx_newloginbox_show_forgot_password'] = 0;
                $updateRecord['tx_newloginbox_header_welcome'] = '';
                $updateRecord['tx_newloginbox_msg_welcome'] = '';
                $updateRecord['tx_newloginbox_header_success'] = '';
                $updateRecord['tx_newloginbox_msg_success'] = '';
                $updateRecord['tx_newloginbox_header_error'] = '';
                $updateRecord['tx_newloginbox_msg_error'] = '';
                $updateRecord['tx_newloginbox_header_status'] = '';
                $updateRecord['tx_newloginbox_msg_status'] = '';
                $updateRecord['tx_newloginbox_header_logout'] = '';
                $updateRecord['tx_newloginbox_msg_logout'] = '';
                $updateRecord['pi_flexform'] = $xml;
                $updateQ = t3lib_BEfunc::DBcompileUpdate('tt_content', 'uid=' . intval($row['uid']), $updateRecord);
                $res = $GLOBALS['TYPO3_DB']->sql_query($updateQ);
                if ($GLOBALS['TYPO3_DB']->sql_error()) {
                    t3lib_div::debug(array('SQL error:', $updateQ));
                }
                return sprintf('ROW %s updated.', $count);
            }
        }
    }
 /**
  * Explain select queries
  * If $this->explainOutput is set, SELECT queries will be explained here. Only queries with more than one possible result row will be displayed.
  * The output is either printed as raw HTML output or embedded into the TS admin panel (checkbox must be enabled!)
  *
  * TODO: Feature is not DBAL-compliant
  *
  * @param	string		SQL query
  * @param	string		Table(s) from which to select. This is what comes right after "FROM ...". Required value.
  * @param	integer		Number of resulting rows
  * @return	boolean		True if explain was run, false otherwise
  */
 protected function explain($query, $from_table, $row_count)
 {
     if ((int) $this->explainOutput == 1 || (int) $this->explainOutput == 2 && t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
         // raw HTML output
         $explainMode = 1;
     } elseif ((int) $this->explainOutput == 3 && is_object($GLOBALS['TT'])) {
         // embed the output into the TS admin panel
         $explainMode = 2;
     } else {
         return false;
     }
     $error = $this->sql_error();
     $trail = t3lib_div::debug_trail();
     $explain_tables = array();
     $explain_output = array();
     $res = $this->sql_query('EXPLAIN ' . $query, $this->link);
     if (is_resource($res)) {
         while ($tempRow = $this->sql_fetch_assoc($res)) {
             $explain_output[] = $tempRow;
             $explain_tables[] = $tempRow['table'];
         }
         $this->sql_free_result($res);
     }
     $indices_output = array();
     // Notice: Rows are skipped if there is only one result, or if no conditions are set
     if ($explain_output[0]['rows'] > 1 || t3lib_div::inList('ALL', $explain_output[0]['type'])) {
         // only enable output if it's really useful
         $debug = true;
         foreach ($explain_tables as $table) {
             $tableRes = $this->sql_query('SHOW TABLE STATUS LIKE \'' . $table . '\'');
             $isTable = $this->sql_num_rows($tableRes);
             if ($isTable) {
                 $res = $this->sql_query('SHOW INDEX FROM ' . $table, $this->link);
                 if (is_resource($res)) {
                     while ($tempRow = $this->sql_fetch_assoc($res)) {
                         $indices_output[] = $tempRow;
                     }
                     $this->sql_free_result($res);
                 }
             }
             $this->sql_free_result($tableRes);
         }
     } else {
         $debug = false;
     }
     if ($debug) {
         if ($explainMode) {
             $data = array();
             $data['query'] = $query;
             $data['trail'] = $trail;
             $data['row_count'] = $row_count;
             if ($error) {
                 $data['error'] = $error;
             }
             if (count($explain_output)) {
                 $data['explain'] = $explain_output;
             }
             if (count($indices_output)) {
                 $data['indices'] = $indices_output;
             }
             if ($explainMode == 1) {
                 t3lib_div::debug($data, 'Tables: ' . $from_table, 'DB SQL EXPLAIN');
             } elseif ($explainMode == 2) {
                 $GLOBALS['TT']->setTSselectQuery($data);
             }
         }
         return true;
     }
     return false;
 }
/**
 * Used in the menu item state example of the "testsite" package at page-path "/Intro/TypoScript examples/Menu object examples/Menu state test/"
 *
 * @param	array		The menu item array, $this->I (in the parent object)
 * @param	array		TypoScript configuration for the function. Notice that the property "parentObj" is a reference to the parent (calling) object (the tslib_Xmenu class instantiated)
 * @return	array		The processed $I array returned (and stored in $this->I of the parent object again)
 * @see tslib_menu::userProcess(), tslib_tmenu::writeMenu(), tslib_gmenu::writeMenu()
 */
function user_IProcFuncTest($I, $conf)
{
    $itemRow = $conf['parentObj']->menuArr[$I['key']];
    // Setting the document status content to the value of the page title on mouse over
    $I['linkHREF']['onMouseover'] .= 'extraRollover(\'' . rawurlencode($itemRow['title']) . '\');';
    $conf['parentObj']->I = $I;
    $conf['parentObj']->setATagParts();
    $I = $conf['parentObj']->I;
    if ($I['parts']['ATag_begin']) {
        $I['parts']['ATag_begin'] = $I['A1'];
    }
    if ($conf['debug']) {
        // Outputting for debug example:
        echo 'ITEM: <h2>' . htmlspecialchars($itemRow['uid'] . ': ' . $itemRow['title']) . '</h2>';
        t3lib_div::debug($itemRow);
        t3lib_div::debug($I);
        echo '<hr />';
    }
    // Returns:
    return $I;
}
    /**
     * Calling function that checks system, IM, GD, dirs, database
     * and lets you alter localconf.php
     *
     * This method is called from init.php to start the Install Tool.
     *
     * @return void
     */
    function init()
    {
        // Must be called after inclusion of init.php (or from init.php)
        if (!defined('PATH_typo3')) {
            exit;
        }
        if (!$this->passwordOK) {
            exit;
        }
        // Setting stuff...
        $this->check_mail();
        $this->setupGeneral();
        $this->generateConfigForm();
        if (count($this->messages)) {
            t3lib_div::debug($this->messages);
        }
        if ($this->step) {
            $this->output($this->outputWrapper($this->stepOutput()));
        } else {
            // Menu...
            switch ($this->INSTALL['type']) {
                case 'images':
                    $this->checkIM = 1;
                    $this->checkTheConfig();
                    $this->silent = 0;
                    $this->checkTheImageProcessing();
                    break;
                case 'database':
                    $this->checkTheConfig();
                    $this->silent = 0;
                    $this->checkTheDatabase();
                    break;
                case 'update':
                    $this->checkDatabase();
                    $this->silent = 0;
                    $this->updateWizard();
                    break;
                case 'config':
                    $this->silent = 0;
                    $this->checkIM = 1;
                    $this->message('About configuration', 'How to configure TYPO3', $this->generallyAboutConfiguration());
                    $this->message('System Information', 'Your system has the following configuration', '
							<dl id="systemInformation">
								<dt>OS detected:</dt>
								<dd>' . (TYPO3_OS == 'WIN' ? 'WIN' : 'UNIX') . '</dd>
								<dt>UNIX/CGI detected:</dt>
								<dd>' . (PHP_SAPI == 'cgi' ? 'YES' : 'NO') . '</dd>
								<dt>PATH_thisScript:</dt>
								<dd>' . PATH_thisScript . '</dd>
							</dl>
						');
                    $this->checkTheConfig();
                    $ext = 'Write config to localconf.php';
                    if ($this->fatalError) {
                        if ($this->config_array['no_database'] || !$this->config_array['mysqlConnect']) {
                            $this->message($ext, 'Database not configured yet!', '
								<p>
									You need to specify database username,
									password and host as one of the first things.
									<br />
									Next you\'ll have to select a database to
									use with TYPO3.
								</p>
								<p>
									Use the form below.
								</p>
							', 2);
                        } else {
                            $this->message($ext, 'Fatal error encountered!', '
								<p>
									Somewhere above a fatal configuration
									problem is encountered.
									Please make sure that you\'ve fixed this
									error before you submit the configuration.
									TYPO3 will not run if this problem is not
									fixed!
									<br />
									You should also check all warnings that may
									appear.
								</p>
							', 2);
                        }
                    } elseif ($this->mode == '123') {
                        if (!$this->fatalError) {
                            $this->message($ext, 'Basic configuration completed', '
								<p>
									You have no fatal errors in your basic
									configuration.
									You may have warnings though. Please pay
									attention to them!
									However you may continue and install the
									database.
								</p>
								<p>
									<strong>
										<span style="color:#f00;">Step 2: </span>
									</strong>
									<a href="' . $this->scriptSelf . '?TYPO3_INSTALL[type]=database' . ($this->mode ? '&mode=' . rawurlencode($this->mode) : '') . '">Click here to install the database.</a>
								</p>
							', -1, 1);
                        }
                    }
                    $this->message($ext, 'Very Important: Changing Image Processing settings', '
						<p>
							When you change the settings for Image Processing
							you <em>must</em> take into account
							that <em>old images</em> may still be in typo3temp/
							folder and prevent new files from being generated!
							<br />
							This is especially important to know, if you\'re
							trying to set up image processing for the very first
							time.
							<br />
							The problem is solved by <a href="' . htmlspecialchars($this->setScriptName('cleanup')) . '">clearing the typo3temp/ folder</a>.
							Also make sure to clear the cache_pages table.
						</p>
					', 1, 1);
                    $this->message($ext, 'Very Important: Changing Encryption Key setting', '
						<p>
							When you change the setting for the Encryption Key
							you <em>must</em> take into account that a change to
							this value might invalidate temporary information,
							URLs etc.
							<br />
							The problem is solved by <a href="' . htmlspecialchars($this->setScriptName('cleanup')) . '">clearing the typo3temp/ folder</a>.
							Also make sure to clear the cache_pages table.
						</p>
					', 1, 1);
                    $this->message($ext, 'Update localconf.php', '
						<p>
							This form updates the localconf.php file with the
							suggested values you see below. The values are based
							on the analysis above.
							<br />
							You can change the values in case you have
							alternatives to the suggested defaults.
							<br />
							By this final step you will configure TYPO3 for
							immediate use provided that you have no fatal errors
							left above.
						</p>' . $this->setupGeneral('get_form') . '
					', 0, 1);
                    $this->output($this->outputWrapper($this->printAll()));
                    break;
                case 'extConfig':
                    $this->silent = 0;
                    $this->generateConfigForm('get_form');
                    // Get the template file
                    $templateFile = @file_get_contents(PATH_site . $this->templateFilePath . 'InitExtConfig.html');
                    // Get the template part from the file
                    $template = t3lib_parsehtml::getSubpart($templateFile, '###TEMPLATE###');
                    // Define the markers content
                    $markers = array('action' => $this->action, 'content' => $this->printAll(), 'write' => 'Write to localconf.php', 'notice' => 'NOTICE:', 'explanation' => '
							By clicking this button, localconf.php is updated
							with new values for the parameters listed above!
						');
                    // Fill the markers in the template
                    $content = t3lib_parsehtml::substituteMarkerArray($template, $markers, '###|###', TRUE, FALSE);
                    // Send content to the page wrapper function
                    $this->output($this->outputWrapper($content));
                    break;
                case 'cleanup':
                    $this->checkTheConfig();
                    $this->silent = 0;
                    $this->cleanupManager();
                    break;
                case 'phpinfo':
                    $this->silent = 0;
                    $this->phpinformation();
                    break;
                case 'typo3conf_edit':
                    $this->silent = 0;
                    $this->typo3conf_edit();
                    break;
                case 'logout':
                    $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';
                    if (is_file($enableInstallToolFile) && trim(file_get_contents($enableInstallToolFile)) !== 'KEEP_FILE') {
                        unlink(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
                    }
                    $this->session->destroySession();
                    t3lib_utility_Http::redirect($this->scriptSelf);
                    break;
                case 'about':
                default:
                    $this->silent = 0;
                    $this->message('About', 'Warning - very important!', $this->securityRisk() . $this->alterPasswordForm(), 2);
                    $this->message('About', 'Using this script', '
						<p>
							Installing TYPO3 has always been a hot topic on the
							mailing list and forums. Therefore we\'ve developed
							this tool which will help you through configuration
							and testing.
							<br />
							There are three primary steps for you to take:
						</p>
						<p>
							<strong>1: Basic Configuration</strong>
							<br />
							In this step your PHP-configuration is checked. If
							there are any settings that will prevent TYPO3 from
							running correctly you\'ll get warnings and errors
							with a description of the problem.
							<br />
							You\'ll have to enter a database username, password
							and hostname. Then you can choose to create a new
							database or select an existing one.
							<br />
							Finally the image processing settings are entered
							and verified and you can choose to let the script
							update the configuration file,
							typo3conf/localconf.php with the suggested settings.
						</p>
						<p>
							<strong>2: Database Analyser</strong>
							<br />
							In this step you can either install a new database
							or update the database from any previous TYPO3
							version.
							<br />
							You can also get an overview of extra/missing
							fields/tables in the database compared to a raw
							sql-file.
							<br />
							The database is also verified against your
							\'tables.php\' configuration ($TCA) and you can
							even see suggestions to entries in $TCA or new
							fields in the database.
						</p>
						<p>
							<strong>3: Update Wizard</strong>
							<br />
							Here you will find update methods taking care of
							changes to the TYPO3 core which are not backwards
							compatible.
							<br />
							It is recommended to run this wizard after every
							update to make sure everything will still work
							flawlessly.
						</p>
						<p>
							<strong>4: Image Processing</strong>
							<br />
							This step is a visual guide to verify your
							configuration of the image processing software.
							<br />
							You\'ll be presented to a list of images that should
							all match in pairs. If some irregularity appears,
							you\'ll get a warning. Thus you\'re able to track an
							error before you\'ll discover it on your website.
						</p>
						<p>
							<strong>5: All Configuration</strong>
							<br />
							This gives you access to any of the configuration
							options in the TYPO3_CONF_VARS array. Every option
							is also presented with a comment explaining what it
							does.
						</p>
						<p>
							<strong>6: Cleanup</strong>
							<br />
							Here you can clean up the temporary files in typo3temp/
							folder and the tables used for caching of data in
							your database.
						</p>
					');
                    $this->message('About', 'Why is this script stand-alone?', '
						<p>
							You would think that this script should rather be a
							module in the backend and access-controlled to only
							admin-users from the database. But that\'s not how
							it works.
							<br />
							The reason is, that this script must not be
							depending on the success of the configuration of
							TYPO3 and whether or not there is a working database
							behind. Therefore the script is invoked from the
							backend init.php file, which allows access if the
							constant \'TYPO3_enterInstallScript\' has been
							defined and is not false. That is and should be the
							case <em>only</em> when calling the script
							\'typo3/install/index.php\' - this script!
						</p>
					');
                    $headCode = 'Header legend';
                    $this->message($headCode, 'Notice!', '
						<p>
							Indicates that something is important to be aware
							of.
							<br />
							This does <em>not</em> indicate an error.
						</p>
					', 1);
                    $this->message($headCode, 'Just information', '
						<p>
							This is a simple message with some information about
							something.
						</p>
					');
                    $this->message($headCode, 'Check was successful', '
						<p>
							Indicates that something was checked and returned an
							expected result.
						</p>
					', -1);
                    $this->message($headCode, 'Warning!', '
						<p>
							Indicates that something may very well cause trouble
							and you should definitely look into it before
							proceeding.
							<br />
							This indicates a <em>potential</em> error.
						</p>
					', 2);
                    $this->message($headCode, 'Error!', '
						<p>
							Indicates that something is definitely wrong and
							that TYPO3 will most likely not perform as expected
							if this problem is not solved.
							<br />
							This indicates an actual error.
						</p>
					', 3);
                    $this->output($this->outputWrapper($this->printAll()));
                    break;
            }
        }
    }