Ejemplo n.º 1
0
 /**
  * @param array $array
  */
 public static function viewArray($array)
 {
     if (class_exists('t3lib_utility_Debug') && is_callable('t3lib_utility_Debug::viewArray')) {
         t3lib_utility_Debug::viewArray($array);
     } else {
         t3lib_div::view_array($array);
     }
 }
 public function user_getParams($PA, $fobj)
 {
     $params = unserialize($PA['itemFormElValue']);
     return '<input
             readonly="readonly" style="display:none" 
             name="' . $PA['itemFormElName'] . '"
             value="' . htmlspecialchars($PA['itemFormElValue']) . '"
             onchange="' . htmlspecialchars(implode('', $PA['fieldChangeFunc'])) . '"
             ' . $PA['onFocus'] . '/>' . t3lib_div::view_array($params);
 }
 public function outputDebugLog()
 {
     $out = '';
     foreach ($this->debugLog as $section => $logData) {
         $out .= Tx_Formhandler_Globals::$cObj->wrap($section, $this->settings['sectionHeaderWrap']);
         $sectionContent = '';
         foreach ($logData as $messageData) {
             $message = str_replace("\n", '<br />', $messageData['message']);
             $message = Tx_Formhandler_Globals::$cObj->wrap($message, $this->settings['severityWrap.'][$messageData['severity']]);
             $sectionContent .= Tx_Formhandler_Globals::$cObj->wrap($message, $this->settings['messageWrap']);
             if ($messageData['data']) {
                 if (t3lib_div::int_from_ver(TYPO3_branch) < t3lib_div::int_from_ver('4.5')) {
                     $sectionContent .= t3lib_div::view_array($messageData['data']);
                 } else {
                     $sectionContent .= t3lib_utility_Debug::viewArray($messageData['data']);
                 }
                 $sectionContent .= '<br />';
             }
         }
         $out .= Tx_Formhandler_Globals::$cObj->wrap($sectionContent, $this->settings['sectionWrap']);
     }
     print $out;
 }
    /**
     * The main method of the PlugIn
     *
     * @param	string		$content: The PlugIn content
     * @param	array		$conf: The PlugIn configuration
     * @return	The content that is displayed on the website
     */
    function main($content, $conf)
    {
        return 'Hello World!<HR>
			Here is the TypoScript passed to the method:' . t3lib_div::view_array($conf);
    }
Ejemplo n.º 5
0
 /**
  * Find the best service and check if it works.
  * Returns object of the service class.
  *
  * @param	string		Type of service (service key).
  * @param	string		Sub type like file extensions or similar. Defined by the service.
  * @param	mixed		List of service keys which should be exluded in the search for a service. Array or comma list.
  * @return	object		The service object or an array with error info's.
  * @author	René Fritz <*****@*****.**>
  */
 function &makeInstanceService($serviceType, $serviceSubType = '', $excludeServiceKeys = array())
 {
     global $T3_SERVICES, $T3_VAR, $TYPO3_CONF_VARS;
     $error = FALSE;
     if (!is_array($excludeServiceKeys)) {
         $excludeServiceKeys = t3lib_div::trimExplode(',', $excludeServiceKeys, 1);
     }
     while ($info = t3lib_extMgm::findService($serviceType, $serviceSubType, $excludeServiceKeys)) {
         // Check persistent object and if found, call directly and exit.
         if (is_object($GLOBALS['T3_VAR']['makeInstanceService'][$info['className']])) {
             // reset service and return object
             $T3_VAR['makeInstanceService'][$info['className']]->reset();
             return $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']];
             // include file and create object
         } else {
             $requireFile = t3lib_div::getFileAbsFileName($info['classFile']);
             if (@is_file($requireFile)) {
                 require_once $requireFile;
                 $obj = t3lib_div::makeInstance($info['className']);
                 if (is_object($obj)) {
                     if (!@is_callable(array($obj, 'init'))) {
                         // use silent logging??? I don't think so.
                         die('Broken service:' . t3lib_div::view_array($info));
                     }
                     $obj->info = $info;
                     if ($obj->init()) {
                         // service available?
                         // create persistent object
                         $T3_VAR['makeInstanceService'][$info['className']] =& $obj;
                         // needed to delete temp files
                         register_shutdown_function(array(&$obj, '__destruct'));
                         return $obj;
                         // object is passed as reference by function definition
                     }
                     $error = $obj->getLastErrorArray();
                     unset($obj);
                 }
             }
         }
         // deactivate the service
         t3lib_extMgm::deactivateService($info['serviceType'], $info['serviceKey']);
     }
     return $error;
 }
Ejemplo n.º 6
0
function user_renderint($content, $conf)
{
    $key = t3lib_div::_GET('key');
    $identifier = t3lib_div::_GET('identifier');
    if (empty($key) || empty($identifier)) {
        header('X-TYPO3-DISABLE-VARNISHCACHE: true');
        echo 'Missing GET parameters, can\'t proceed.';
        exit;
    }
    // Find records in "cache_pages" which have the the requested $key set in cache_data[INTincScript].
    if (TYPO3_UseCachingFramework) {
        // Caching framework access
        $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
        $row = $pageCache->get($identifier);
        $data = unserialize($row['cache_data']);
    } else {
        // Traditional database cache
        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'cache_pages', 'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($identifier, 'cache_pages'));
        if (count($rows) === 1) {
            $row = $rows[0];
            $data = unserialize($row['cache_data']);
        }
    }
    //Copied from tslib_fe
    if ($data['INTincScript'][$key]) {
        $INTiS_cObj = unserialize($data['INTincScript'][$key]['cObj']);
        /* @var $INTiS_cObj tslib_cObj */
        $INTiS_cObj->INT_include = 1;
        switch ($data['INTincScript'][$key]['type']) {
            case 'SCRIPT':
                $incContent = $INTiS_cObj->PHP_SCRIPT($data['INTincScript'][$key]['conf']);
                break;
            case 'COA':
                $incContent = $INTiS_cObj->COBJ_ARRAY($data['INTincScript'][$key]['conf']);
                break;
            case 'FUNC':
                $incContent = $INTiS_cObj->USER($data['INTincScript'][$key]['conf']);
                break;
            case 'POSTUSERFUNC':
                $incContent = $INTiS_cObj->callUserFunction($data['INTincScript'][$key]['postUserFunc'], $data['INTincScript'][$key]['conf'], $data['INTincScript'][$key]['content']);
                break;
        }
        header('X-ESI-RESPONSE: 1');
        $EXTconfArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['moc_varnish']);
        $conf = $data['INTincScript'][$key]['conf'];
        $max_age = $INTiS_cObj->stdWrap($conf['max_age'], $conf['max_age.']);
        if ($max_age) {
            header('Cache-control: max-age=' . intval($max_age));
        } elseif (intval($EXTconfArr['userINT_forceTTL']) > 0) {
            header('Cache-control: max-age=' . intval($EXTconfArr['userINT_forceTTL']));
        }
        return $incContent;
    } else {
        header('X-TYPO3-DISABLE-VARNISHCACHE: true');
        print date('d/m-Y H:m:i') . ': Cache for page found, but there is no configuration for USER_INT with hash ' . $key . ' in cache record...' . t3lib_div::view_array($data);
        exit;
    }
    // @TODO: Somehow tell Varnish, that this content is not available, or somehow render it...
    header('X-TYPO3-DISABLE-VARNISHCACHE: true');
    print date('d/m-Y H:m:i') . ': Unable to find cache for page';
    exit;
}
    /**
     * Call gui item functions and return the output
     *
     * @param	string		Type name: header, footer
     * @param	string		List of item function which should be called instead of the default defined
     * @return	string		Items output
     */
    function getOutput($type = 'footer', $itemList = '')
    {
        if (is_null($itemList)) {
            return;
        }
        if ($itemList) {
            $itemListArr = t3lib_div::trimExplode(',', $itemList, 1);
        } else {
            $type = 'items_' . $type;
            if (!is_array($this->{$type})) {
                return;
            }
            $itemListArr = array_keys($this->{$type});
        }
        $elementList =& $this->{$type};
        $out = '';
        foreach ($itemListArr as $item) {
            $content = $this->items_callFunc($elementList[$item]);
            $out .= '
				<!-- GUI element section: ' . htmlspecialchars($item) . ' -->
					' . $content . '
				<!-- GUI element section end -->';
        }
        if ($type === 'items_footer' and is_array($GLOBALS['SOBE']->debugContent) and tx_dam::config_getValue('setup.devel')) {
            $content = '<div class="itemsFooter">' . '<h4>GUI Elements</h4>' . t3lib_div::view_array($GLOBALS['SOBE']->develAvailableGuiItems) . '</div>';
            $content .= '<div class="itemsFooter">' . '<h4>Options</h4>' . t3lib_div::view_array($GLOBALS['SOBE']->develAvailableOptions) . '</div>';
            $content .= '<div class="itemsFooter">' . '<h4>Registered actions (all)</h4>' . t3lib_div::view_array(array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dam']['actionClasses'])) . '</div>';
            $out .= $GLOBALS['SOBE']->buttonToggleDisplay('devel', 'Module Info', $content);
            $content = '<div class="itemsFooter">' . implode('', $GLOBALS['SOBE']->debugContent) . '</div>';
            $out .= $GLOBALS['SOBE']->buttonToggleDisplay('debug', 'Debug output', $content);
        }
        return $out;
    }
Ejemplo n.º 8
0
    /**
     * Renders the hierarchical display for a Data Structure.
     * Calls itself recursively
     *
     * @param	array		Part of Data Structure (array of elements)
     * @param	boolean		If true, the Data Structure table will show links for mapping actions. Otherwise it will just layout the Data Structure visually.
     * @param	array		Part of Current mapping information corresponding to the $dataStruct array - used to evaluate the status of mapping for a certain point in the structure.
     * @param	array		Array of HTML paths
     * @param	array		Options for mapping mode control (INNER, OUTER etc...)
     * @param	array		Content from template file splitted by current mapping info - needed to evaluate whether mapping information for a certain level actually worked on live content!
     * @param	integer		Recursion level, counting up
     * @param	array		Accumulates the table rows containing the structure. This is the array returned from the function.
     * @param	string		Form field prefix. For each recursion of this function, two [] parts are added to this prefix
     * @param	string		HTML path. For each recursion a section (divided by "|") is added.
     * @param	boolean		If true, the "Map" link can be shown, otherwise not. Used internally in the recursions.
     * @return	array		Table rows as an array of <tr> tags, $tRows
     */
    function drawDataStructureMap($dataStruct, $mappingMode = 0, $currentMappingInfo = array(), $pathLevels = array(), $optDat = array(), $contentSplittedByMapping = array(), $level = 0, $tRows = array(), $formPrefix = '', $path = '', $mapOK = 1)
    {
        $bInfo = t3lib_div::clientInfo();
        $multilineTooltips = $bInfo['BROWSER'] == 'msie';
        // Data Structure array must be ... and array of course...
        if (is_array($dataStruct)) {
            foreach ($dataStruct as $key => $value) {
                if ($key == 'meta') {
                    // Do not show <meta> information in mapping interface!
                    continue;
                }
                if (is_array($value)) {
                    // The value of each entry must be an array.
                    // ********************
                    // Making the row:
                    // ********************
                    $rowCells = array();
                    // Icon:
                    if ($value['type'] == 'array') {
                        if (!$value['section']) {
                            $t = 'co';
                            $tt = 'Container: ';
                        } else {
                            $t = 'sc';
                            $tt = 'Sections: ';
                        }
                    } elseif ($value['type'] == 'attr') {
                        $t = 'at';
                        $tt = 'Attribute: ';
                    } else {
                        $t = 'el';
                        $tt = 'Element: ';
                    }
                    $icon = '<img src="item_' . $t . '.gif" width="24" height="16" border="0" alt="" title="' . $tt . $key . '" style="margin-right: 5px;" class="absmiddle" />';
                    // Composing title-cell:
                    if (preg_match('/^LLL:/', $value['tx_templavoila']['title'])) {
                        $translatedTitle = $GLOBALS['LANG']->sL($value['tx_templavoila']['title']);
                        $translateIcon = '<sup title="This title is translated!">*</sup>';
                    } else {
                        $translatedTitle = $value['tx_templavoila']['title'];
                        $translateIcon = '';
                    }
                    $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['title'] = $icon . '<strong>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($translatedTitle, 30)) . '</strong>' . $translateIcon;
                    $rowCells['title'] = '<img src="clear.gif" width="' . $level * 16 . '" height="1" alt="" />' . $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['title'];
                    // Description:
                    $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['description'] = $rowCells['description'] = htmlspecialchars($value['tx_templavoila']['description']);
                    // In "mapping mode", render HTML page and Command links:
                    if ($mappingMode) {
                        // HTML-path + CMD links:
                        $isMapOK = 0;
                        if ($currentMappingInfo[$key]['MAP_EL']) {
                            // If mapping information exists...:
                            if (isset($contentSplittedByMapping['cArray'][$key])) {
                                // If mapping of this information also succeeded...:
                                $cF = implode(chr(10), t3lib_div::trimExplode(chr(10), $contentSplittedByMapping['cArray'][$key], 1));
                                if (strlen($cF) > 200) {
                                    $cF = t3lib_div::fixed_lgd_cs($cF, 90) . ' ' . t3lib_div::fixed_lgd_cs($cF, -90);
                                }
                                // Render HTML path:
                                list($pI) = $this->markupObj->splitPath($currentMappingInfo[$key]['MAP_EL']);
                                $rowCells['htmlPath'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_ok2.gif" width="18" height="16" border="0" alt="" title="' . htmlspecialchars($cF ? 'Content found (' . strlen($contentSplittedByMapping['cArray'][$key]) . ' chars)' . ($multilineTooltips ? ':' . chr(10) . chr(10) . $cF : '') : 'Content empty.') . '" class="absmiddle" />' . '<img src="../html_tags/' . $pI['el'] . '.gif" height="9" border="0" alt="" hspace="3" class="absmiddle" title="---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($currentMappingInfo[$key]['MAP_EL'], -80)) . '" />' . ($pI['modifier'] ? $pI['modifier'] . ($pI['modifier_value'] ? ':' . ($pI['modifier'] != 'RANGE' ? $pI['modifier_value'] : '...') : '') : '');
                                //#
                                //### Mansoor Ahmad - Change of PHP 5.3 support
                                //#
                                $rowCells['htmlPath'] = '<a href="' . $this->linkThisScript(array('htmlPath' => $path . ($path ? '|' : '') . preg_replace('/\\/[^ ]*$/', '', $currentMappingInfo[$key]['MAP_EL']), 'showPathOnly' => 1)) . '">' . $rowCells['htmlPath'] . '</a>';
                                // CMD links, default content:
                                $rowCells['cmdLinks'] = '<span class="nobr"><input type="submit" value="Re-Map" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'])) . '\';return false;" title="Map this DS element to another HTML element in template file." />' . '<input type="submit" value="Ch.Mode" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path . ($path ? '|' : '') . $pI['path'], 'doMappingOfPath' => 1)) . '\';return false;" title="Change mapping mode, eg. from INNER to OUTER etc." /></span>';
                                // If content mapped ok, set flag:
                                $isMapOK = 1;
                            } else {
                                // Issue warning if mapping was lost:
                                $rowCells['htmlPath'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_warning.gif" width="18" height="16" border="0" alt="" title="No content found!" class="absmiddle" />' . htmlspecialchars($currentMappingInfo[$key]['MAP_EL']);
                            }
                        } else {
                            // For non-mapped cases, just output a no-break-space:
                            $rowCells['htmlPath'] = '&nbsp;';
                        }
                        // CMD links; Content when current element is under mapping, then display control panel or message:
                        if ($this->mapElPath == $formPrefix . '[' . $key . ']') {
                            if ($this->doMappingOfPath) {
                                // Creating option tags:
                                $lastLevel = end($pathLevels);
                                $tagsMapping = $this->explodeMappingToTagsStr($value['tx_templavoila']['tags']);
                                $mapDat = is_array($tagsMapping[$lastLevel['el']]) ? $tagsMapping[$lastLevel['el']] : $tagsMapping['*'];
                                unset($mapDat['']);
                                if (is_array($mapDat) && !count($mapDat)) {
                                    unset($mapDat);
                                }
                                // Create mapping options:
                                $didSetSel = 0;
                                $opt = array();
                                foreach ($optDat as $k => $v) {
                                    list($pI) = $this->markupObj->splitPath($k);
                                    if ($value['type'] == 'attr' && $pI['modifier'] == 'ATTR' || $value['type'] != 'attr' && $pI['modifier'] != 'ATTR') {
                                        if ((!$this->markupObj->tags[$lastLevel['el']]['single'] || $pI['modifier'] != 'INNER') && (!is_array($mapDat) || $pI['modifier'] != 'ATTR' && isset($mapDat[strtolower($pI['modifier'] ? $pI['modifier'] : 'outer')]) || $pI['modifier'] == 'ATTR' && (isset($mapDat['attr']['*']) || isset($mapDat['attr'][$pI['modifier_value']])))) {
                                            if ($k == $currentMappingInfo[$key]['MAP_EL']) {
                                                $sel = ' selected="selected"';
                                                $didSetSel = 1;
                                            } else {
                                                $sel = '';
                                            }
                                            $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
                                        }
                                    }
                                }
                                // Finally, put together the selector box:
                                $rowCells['cmdLinks'] = '<img src="../html_tags/' . $lastLevel['el'] . '.gif" height="9" border="0" alt="" class="absmiddle" title="---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($lastLevel['path'], -80)) . '" /><br />
									<select name="dataMappingForm' . $formPrefix . '[' . $key . '][MAP_EL]">
										' . implode('
										', $opt) . '
										<option value=""></option>
									</select>
									<br />
									<input type="submit" name="_save_data_mapping" value="Set" />
									<input type="submit" name="_" value="Cancel" />';
                                $rowCells['cmdLinks'] .= $this->cshItem('xMOD_tx_templavoila', 'mapping_modeset', $this->doc->backPath, '', FALSE, 'margin-bottom: 0px;');
                            } else {
                                $rowCells['cmdLinks'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_note.gif" width="18" height="16" border="0" alt="" class="absmiddle" /><strong>Click a tag-icon in the window below to map this element.</strong>';
                                $rowCells['cmdLinks'] .= '<br />
										<input type="submit" value="Cancel" name="_" onclick="document.location=\'' . $this->linkThisScript(array()) . '\';return false;" />';
                            }
                        } elseif (!$rowCells['cmdLinks'] && $mapOK && $value['type'] != 'no_map') {
                            $rowCells['cmdLinks'] = '
										<input type="submit" value="Map" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'])) . '\';return false;" />';
                        }
                    }
                    // Display mapping rules:
                    $rowCells['tagRules'] = implode('<br />', t3lib_div::trimExplode(',', strtolower($value['tx_templavoila']['tags']), 1));
                    if (!$rowCells['tagRules']) {
                        $rowCells['tagRules'] = '(ALL)';
                    }
                    // Display edit/delete icons:
                    if ($this->editDataStruct) {
                        $editAddCol = '<a href="' . $this->linkThisScript(array('DS_element' => $formPrefix . '[' . $key . ']')) . '">' . '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/edit2.gif" width="11" height="12" hspace="2" border="0" alt="" title="Edit entry" />' . '</a>';
                        $editAddCol .= '<a href="' . $this->linkThisScript(array('DS_element_DELETE' => $formPrefix . '[' . $key . ']')) . '">' . '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/garbage.gif" width="11" height="12" hspace="2" border="0" alt="" title="DELETE entry" onclick=" return confirm(\'Are you sure to delete this Data Structure entry?\');" />' . '</a>';
                        $editAddCol = '<td nowrap="nowrap">' . $editAddCol . '</td>';
                    } else {
                        $editAddCol = '';
                    }
                    // Description:
                    if ($this->_preview) {
                        $rowCells['description'] = is_array($value['tx_templavoila']['sample_data']) ? t3lib_div::view_array($value['tx_templavoila']['sample_data']) : '[No sample data]';
                    }
                    // Put row together
                    if (!$this->mapElPath || $this->mapElPath == $formPrefix . '[' . $key . ']') {
                        $tRows[] = '

							<tr class="bgColor4">
							<td nowrap="nowrap" valign="top">' . $rowCells['title'] . '</td>
							' . ($this->editDataStruct ? '<td nowrap="nowrap">' . $key . '</td>' : '') . '
							<td>' . $rowCells['description'] . '</td>
							' . ($mappingMode ? '<td nowrap="nowrap">' . $rowCells['htmlPath'] . '</td>
								<td>' . $rowCells['cmdLinks'] . '</td>' : '') . '
							<td>' . $rowCells['tagRules'] . '</td>
							' . $editAddCol . '
						</tr>';
                    }
                    // Getting editing row, if applicable:
                    list($addEditRows, $placeBefore) = $this->drawDataStructureMap_editItem($formPrefix, $key, $value, $level);
                    // Add edit-row if found and destined to be set BEFORE:
                    if ($addEditRows && $placeBefore) {
                        $tRows[] = $addEditRows;
                    }
                    // Recursive call:
                    if ($value['type'] == 'array') {
                        $tRows = $this->drawDataStructureMap($value['el'], $mappingMode, $currentMappingInfo[$key]['el'], $pathLevels, $optDat, $contentSplittedByMapping['sub'][$key], $level + 1, $tRows, $formPrefix . '[' . $key . '][el]', $path . ($path ? '|' : '') . $currentMappingInfo[$key]['MAP_EL'], $isMapOK);
                    }
                    // Add edit-row if found and destined to be set AFTER:
                    if ($addEditRows && !$placeBefore) {
                        $tRows[] = $addEditRows;
                    }
                }
            }
        }
        return $tRows;
    }
 function quickDBlookUp()
 {
     $output = 'Enter [table]:[uid]:[fieldlist (optional)] <input name="table_uid" value="' . htmlspecialchars(t3lib_div::_POST('table_uid')) . '" />';
     $output .= '<input type="submit" name="_" value="REFRESH" /><br />';
     // Show record:
     if (t3lib_div::_POST('table_uid')) {
         list($table, $uid, $fieldName) = t3lib_div::trimExplode(':', t3lib_div::_POST('table_uid'), 1);
         if ($GLOBALS['TCA'][$table]) {
             $rec = t3lib_BEfunc::getRecordRaw($table, 'uid=' . intval($uid), $fieldName ? $fieldName : '*');
             if (count($rec)) {
                 if (t3lib_div::_POST('_EDIT')) {
                     $output .= '<hr />Edit:<br /><br />';
                     foreach ($rec as $field => $value) {
                         $output .= htmlspecialchars($field) . '<br /><input name="record[' . $table . '][' . $uid . '][' . $field . ']" value="' . htmlspecialchars($value) . '" /><br />';
                     }
                     $output .= '<input type="submit" name="_SAVE" value="SAVE" />';
                 } elseif (t3lib_div::_POST('_SAVE')) {
                     $incomingData = t3lib_div::_POST('record');
                     $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($uid), $incomingData[$table][$uid]);
                     $output .= '<br />Updated ' . $table . ':' . $uid . '...';
                     $this->updateRefIndex($table, $uid);
                 } else {
                     if (t3lib_div::_POST('_DELETE')) {
                         $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'uid=' . intval($uid));
                         $output .= '<br />Deleted ' . $table . ':' . $uid . '...';
                         $this->updateRefIndex($table, $uid);
                     } else {
                         $output .= '<input type="submit" name="_EDIT" value="EDIT" />';
                         $output .= '<input type="submit" name="_DELETE" value="DELETE" onclick="return confirm(\'Are you sure you wish to delete?\');" />';
                         $output .= t3lib_div::view_array($rec);
                         $output .= md5(implode($rec));
                     }
                 }
             } else {
                 $output .= 'No record existed!';
             }
         }
     }
     return $output;
 }
Ejemplo n.º 10
0
 function moduleContent()
 {
     switch ((string) $this->MOD_SETTINGS["function"]) {
         case 1:
             $content = "<div align=center><strong>Hello World!</strong></div><BR>\n\t\t\t\t\tThe 'Kickstarter' has made this module automatically, it contains a default framework for a backend module but apart from it does nothing useful until you open the script '" . substr(t3lib_extMgm::extPath("fab_form_mail"), strlen(PATH_site)) . "tx_fabformmail_abonne_comment/index.php' and edit it!\n\t\t\t\t\t<HR>\n\t\t\t\t\t<BR>This is the GET/POST vars sent to the script:<BR>" . "GET:" . t3lib_div::view_array($GLOBALS["HTTP_GET_VARS"]) . "<BR>" . "POST:" . t3lib_div::view_array($GLOBALS["HTTP_POST_VARS"]) . "<BR>" . "";
             $this->content .= $this->doc->section("Message #1:", $content, 0, 1);
             break;
         case 2:
             $content = "<div align=center><strong>Menu item #2...</strong></div>";
             $this->content .= $this->doc->section("Message #2:", $content, 0, 1);
             break;
         case 3:
             $content = "<div align=center><strong>Menu item #3...</strong></div>";
             $this->content .= $this->doc->section("Message #3:", $content, 0, 1);
             break;
     }
 }
Ejemplo n.º 11
0
    /**
     * Shows the log of indexed URLs
     *
     * @return	string		HTML output
     */
    function drawLog()
    {
        global $BACK_PATH;
        $output = '';
        // Init:
        $this->crawlerObj = t3lib_div::makeInstance('tx_crawler_lib');
        $this->crawlerObj->setAccessMode('gui');
        $this->crawlerObj->setID = t3lib_div::md5int(microtime());
        $this->CSVExport = t3lib_div::_POST('_csv');
        // Read URL:
        if (t3lib_div::_GP('qid_read')) {
            $this->crawlerObj->readUrl(intval(t3lib_div::_GP('qid_read')), TRUE);
        }
        // Look for set ID sent - if it is, we will display contents of that set:
        $showSetId = intval(t3lib_div::_GP('setID'));
        // Show details:
        if (t3lib_div::_GP('qid_details')) {
            // Get entry record:
            list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid=' . intval(t3lib_div::_GP('qid_details')));
            // Explode values:
            $resStatus = $this->getResStatus($q_entry);
            $q_entry['parameters'] = unserialize($q_entry['parameters']);
            $q_entry['result_data'] = unserialize($q_entry['result_data']);
            if (is_array($q_entry['result_data'])) {
                $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
            }
            if (!$this->pObj->MOD_SETTINGS['log_resultLog']) {
                unset($q_entry['result_data']['content']['log']);
            }
            // Print rudimentary details:
            $output .= '
				<br /><br />
				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" />
				<input type="hidden" value="' . $this->pObj->id . '" name="id" />
				<input type="hidden" value="' . $showSetId . '" name="setID" />
				<br />
				Current server time: ' . date('H:i:s', time()) . '<br />' . 'Status: ' . $resStatus . '<br />' . (version_compare(TYPO3_version, '4.5.0', '<') ? t3lib_div::view_array($q_entry) : t3lib_utility_Debug::viewArray($q_entry));
        } else {
            // Show list:
            // If either id or set id, show list:
            if ($this->pObj->id || $showSetId) {
                if ($this->pObj->id) {
                    // Drawing tree:
                    $tree = t3lib_div::makeInstance('t3lib_pageTree');
                    $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                    $tree->init('AND ' . $perms_clause);
                    // Set root row:
                    $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pObj->pageinfo);
                    $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pObj->pageinfo);
                    $tree->tree[] = array('row' => $this->pObj->pageinfo, 'HTML' => $HTML);
                    // Get branch beneath:
                    if ($this->pObj->MOD_SETTINGS['depth']) {
                        $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
                    }
                    // Traverse page tree:
                    $code = '';
                    $count = 0;
                    foreach ($tree->tree as $data) {
                        $code .= $this->drawLog_addRows($data['row'], $data['HTML'] . t3lib_BEfunc::getRecordTitle('pages', $data['row'], TRUE), intval($this->pObj->MOD_SETTINGS['itemsPerPage']));
                        if (++$count == 1000) {
                            break;
                        }
                    }
                } else {
                    $code = '';
                    $code .= $this->drawLog_addRows($showSetId, 'Set ID: ' . $showSetId);
                }
                if ($code) {
                    $output .= '
						<br /><br />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist') . '" name="_reload" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv') . '" name="_csv" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue') . '" name="_flush" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue') . '" name="_flush_all" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" />
						<input type="hidden" value="' . $this->pObj->id . '" name="id" />
						<input type="hidden" value="' . $showSetId . '" name="setID" />
						<br />
						' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', time()) . '
						<br /><br />


						<table class="lrPadding c-list crawlerlog">' . $this->drawLog_printTableHeader() . $code . '</table>';
                }
            } else {
                // Otherwise show available sets:
                $setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('set_id, count(*) as count_value, scheduled', 'tx_crawler_queue', '', 'set_id, scheduled', 'scheduled DESC');
                $code = '
					<tr class="bgColor5 tableheader">
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td>
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . 't:</td>
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time') . ':</td>
					</tr>
				';
                $cc = 0;
                foreach ($setList as $set) {
                    $code .= '
						<tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '">
							<td><a href="' . htmlspecialchars('index.php?setID=' . $set['set_id']) . '">' . $set['set_id'] . '</a></td>
							<td>' . $set['count_value'] . '</td>
							<td>' . t3lib_BEfunc::dateTimeAge($set['scheduled']) . '</td>
						</tr>
					';
                    $cc++;
                }
                $output .= '
					<br /><br />
					<table class="lrPadding c-list">' . $code . '</table>';
            }
        }
        if ($this->CSVExport) {
            $this->outputCsvFile();
        }
        // Return output
        return $output;
    }
Ejemplo n.º 12
0
    /**
     * [Describe function...]
     *
     * @return	[type]		...
     */
    function moduleContent()
    {
        switch ((string) $this->MOD_SETTINGS['function']) {
            case 1:
                $content = '<div align=center><strong>Hello World!</strong></div><br />
					The "Kickstarter" has made this module automatically, it contains a default framework for a backend module but apart from that it does nothing useful until you open the script "' . substr(t3lib_extMgm::extPath('listfeusers'), strlen(PATH_site)) . $pathSuffix . index . php . '" and edit it!
					<hr />
					<br />This is the GET/POST vars sent to the script:<br />' . 'GET:' . t3lib_div::view_array($_GET) . '<br />' . 'POST:' . t3lib_div::view_array($_POST) . '<br />' . '';
                $this->content .= $this->doc->section('Message #1:', $content, 0, 1);
                break;
            case 2:
                $content = '<div align=center><strong>Menu item #2...</strong></div>';
                $this->content .= $this->doc->section('Message #2:', $content, 0, 1);
                break;
            case 3:
                $content = '<div align=center><strong>Menu item #3...</strong></div>';
                $this->content .= $this->doc->section('Message #3:', $content, 0, 1);
                break;
        }
    }
 /**
  * Prints the debug output of an array
  *
  * Compatibility wrapper for obsolete Core methods
  *
  * @param array $array Array to output
  * @return string
  */
 protected function debugArray($array)
 {
     if (class_exists('t3lib_utility_Debug')) {
         return t3lib_utility_Debug::viewArray($array);
     } else {
         t3lib_div::view_array($array);
     }
 }
Ejemplo n.º 14
0
    /**
     * Printing the debug-log from the DBAL extension
     *
     * To enabled debugging, you will have to enabled it in the configuration!
     *
     * @return	string HTML content
     */
    protected function printLogMgm()
    {
        // Disable debugging in any case...
        $GLOBALS['TYPO3_DB']->debug = FALSE;
        // Get cmd:
        $cmd = (string) t3lib_div::_GP('cmd');
        switch ($cmd) {
            case 'flush':
                $res = $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('tx_dbal_debuglog');
                $res = $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('tx_dbal_debuglog_where');
                $outStr = 'Log FLUSHED!';
                break;
            case 'joins':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('table_join,exec_time,query,script', 'tx_dbal_debuglog', 'table_join!=\'\'', 'table_join,script,exec_time,query');
                // Init vars in which to pick up the query result:
                $tableIndex = array();
                $tRows = array();
                $tRows[] = '
					<tr>
						<td>Execution time</td>
						<td>Table joins</td>
						<td>Script</td>
						<td>Query</td>
					</tr>';
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    $tableArray = $GLOBALS['TYPO3_DB']->SQLparser->parseFromTables($row['table_join']);
                    // Create table name index:
                    foreach ($tableArray as $a) {
                        foreach ($tableArray as $b) {
                            if ($b['table'] != $a['table']) {
                                $tableIndex[$a['table']][$b['table']] = 1;
                            }
                        }
                    }
                    // Create output row
                    $tRows[] = '
						<tr>
							<td>' . htmlspecialchars($row['exec_time']) . '</td>
							<td>' . htmlspecialchars($row['table_join']) . '</td>
							<td>' . htmlspecialchars($row['script']) . '</td>
							<td>' . htmlspecialchars($row['query']) . '</td>
						</tr>';
                }
                // Printing direct joins:
                $outStr .= '<h4>Direct joins:</h4>' . t3lib_div::view_array($tableIndex);
                // Printing total dependencies:
                foreach ($tableIndex as $priTable => $a) {
                    foreach ($tableIndex as $tableN => $v) {
                        foreach ($v as $tableP => $vv) {
                            if ($tableP == $priTable) {
                                $tableIndex[$priTable] = array_merge($v, $a);
                            }
                        }
                    }
                }
                $outStr .= '<h4>Total dependencies:</h4>' . t3lib_div::view_array($tableIndex);
                // Printing data rows:
                $outStr .= '
					<table border="1" cellspacing="0">' . implode('', $tRows) . '
					</table>';
                break;
            case 'errors':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('serdata,exec_time,query,script', 'tx_dbal_debuglog', 'errorFlag>0', '', 'tstamp DESC');
                // Init vars in which to pick up the query result:
                $tRows = array();
                $tRows[] = '
					<tr>
						<td>Execution time</td>
						<td>Error data</td>
						<td>Script</td>
						<td>Query</td>
					</tr>';
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    // Create output row
                    $tRows[] = '
						<tr>
							<td>' . htmlspecialchars($row['exec_time']) . '</td>
							<td>' . t3lib_div::view_array(unserialize($row['serdata'])) . '</td>
							<td>' . htmlspecialchars($row['script']) . '</td>
							<td>' . htmlspecialchars($row['query']) . '</td>
						</tr>';
                }
                // Printing data rows:
                $outStr .= '
					<table border="1" cellspacing="0">' . implode('', $tRows) . '
					</table>';
                break;
            case 'parsing':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('query,serdata', 'tx_dbal_debuglog', 'errorFlag&2=2');
                $tRows = array();
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    // Create output row
                    $tRows[] = '
						<tr>
							<td>' . htmlspecialchars($row['query']) . '</td>
						</tr>';
                }
                // Printing data rows:
                $outStr .= '
					<table border="1" cellspacing="0">' . implode('', $tRows) . '
					</table>';
                break;
            case 'where':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script,tablename,whereclause', 'tx_dbal_debuglog_where', '', '', 'tstamp DESC');
                $tRows = array();
                $tRows[] = '
					<tr>
						<td>Time</td>
						<td>Script</td>
						<td>Table</td>
						<td>WHERE clause</td>
					</tr>';
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    $tRows[] = '
						<tr>
							<td>' . t3lib_BEfunc::datetime($row['tstamp']) . '</td>
							<td>' . htmlspecialchars($row['script']) . '</td>
							<td>' . htmlspecialchars($row['tablename']) . '</td>
								<td>' . str_replace(array('\'\'', '""', 'IS NULL', 'IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>', '<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['whereclause'])) . '</td>
						</tr>';
                }
                $outStr = '
					<table border="1" cellspacing="0">' . implode('', $tRows) . '
					</table>';
                break;
            default:
                // Look for request to view specific script exec:
                $specTime = t3lib_div::_GP('specTime');
                if ($specTime) {
                    $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('exec_time,errorFlag,table_join,serdata,query', 'tx_dbal_debuglog', 'tstamp=' . (int) $specTime);
                    $tRows = array();
                    $tRows[] = '
						<tr>
							<td>Execution time</td>
							<td>Error</td>
							<td>Table joins</td>
							<td>Data</td>
							<td>Query</td>
						</tr>';
                    while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $tRows[] = '
							<tr>
								<td>' . htmlspecialchars($row['exec_time']) . '</td>
								<td>' . ($row['errorFlag'] ? 1 : 0) . '</td>
								<td>' . htmlspecialchars($row['table_join']) . '</td>
								<td>' . t3lib_div::view_array(unserialize($row['serdata'])) . '</td>
								<td>' . str_replace(array('\'\'', '""', 'IS NULL', 'IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>', '<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['query'])) . '</td>
							</tr>';
                    }
                } else {
                    $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script, SUM(exec_time) as calc_sum, count(*) AS qrycount, MAX(errorFlag) as error', 'tx_dbal_debuglog', '', 'tstamp,script', 'tstamp DESC');
                    $tRows = array();
                    $tRows[] = '
						<tr>
							<td>Time</td>
							<td># of queries</td>
							<td>Error</td>
							<td>Time (ms)</td>
							<td>Script</td>
						</tr>';
                    while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $tRows[] = '
							<tr>
								<td>' . t3lib_BEfunc::datetime($row['tstamp']) . '</td>
								<td>' . htmlspecialchars($row['qrycount']) . '</td>
								<td>' . ($row['error'] ? '<strong style="color:#f00">ERR</strong>' : '') . '</td>
								<td>' . htmlspecialchars($row['calc_sum']) . '</td>
								<td><a href="' . $this->thisScript . '&amp;specTime=' . intval($row['tstamp']) . '">' . htmlspecialchars($row['script']) . '</a></td>
							</tr>';
                    }
                }
                $outStr = '
					<table border="1" cellspacing="0">' . implode('', $tRows) . '
					</table>';
                break;
        }
        $menu = '
					<a href="' . $this->thisScript . '&amp;cmd=flush">FLUSH LOG</a> -
					<a href="' . $this->thisScript . '&amp;cmd=joins">JOINS</a> -
					<a href="' . $this->thisScript . '&amp;cmd=errors">ERRORS</a> -
					<a href="' . $this->thisScript . '&amp;cmd=parsing">PARSING</a> -
					<a href="' . $this->thisScript . '">LOG</a> -
					<a href="' . $this->thisScript . '&amp;cmd=where">WHERE</a> -

					<a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" target="tx_debuglog">[New window]</a>
					<hr />
		';
        return $menu . $outStr;
    }
    /**
     * Re-indexing files/records attached to a page.
     *
     * @param	integer		Phash value
     * @param	integer		The page uid for the section record (file/url could appear more than one place you know...)
     * @return	string		HTML content
     */
    function reindexPhash($phash, $pageId)
    {
        // Query:
        list($resultRow) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('ISEC.*, IP.*', 'index_phash IP, index_section ISEC', 'IP.phash = ISEC.phash
						AND IP.phash = ' . intval($phash) . '
						AND ISEC.page_id = ' . intval($pageId));
        $content = '';
        if (is_array($resultRow)) {
            if ($resultRow['item_type'] && $resultRow['item_type'] !== '0') {
                // (Re)-Indexing file on page.
                $indexerObj = t3lib_div::makeInstance('tx_indexedsearch_indexer');
                $indexerObj->backend_initIndexer($pageId, 0, 0, '', $this->getUidRootLineForClosestTemplate($pageId));
                // URL or local file:
                if ($resultRow['externalUrl']) {
                    $indexerObj->indexExternalUrl($resultRow['data_filename']);
                } else {
                    $indexerObj->indexRegularDocument($resultRow['data_filename'], TRUE);
                }
                if ($indexerObj->file_phash_arr['phash'] != $resultRow['phash']) {
                    $content .= 'ERROR: phash (' . $indexerObj->file_phash_arr['phash'] . ') did NOT match ' . $resultRow['phash'] . ' for strange reasons!';
                }
                $content .= '<h4>Log for re-indexing of "' . htmlspecialchars($resultRow['data_filename']) . '":</h4>';
                $content .= t3lib_div::view_array($indexerObj->internal_log);
                $content .= '<h4>Hash-array, page:</h4>';
                $content .= t3lib_div::view_array($indexerObj->hash);
                $content .= '<h4>Hash-array, file:</h4>';
                $content .= t3lib_div::view_array($indexerObj->file_phash_arr);
            }
        }
        // Link back to list.
        $content .= $this->linkList();
        return $content;
    }
Ejemplo n.º 16
0
    /**
     * Create the rows for display of the page tree
     * For each page a number of rows are shown displaying GET variable configuration
     *
     * @param	array		Page row
     * @param	string		Page icon and title for row
     * @return	string		HTML <tr> content (one or more)
     */
    public function drawURLs_addRowsForPage(array $pageRow, $pageTitleAndIcon)
    {
        $skipMessage = '';
        // Get list of configurations
        $configurations = $this->getUrlsForPageRow($pageRow, $skipMessage);
        if (count($this->incomingConfigurationSelection) > 0) {
            // 	remove configuration that does not match the current selection
            foreach ($configurations as $confKey => $confArray) {
                if (!in_array($confKey, $this->incomingConfigurationSelection)) {
                    unset($configurations[$confKey]);
                }
            }
        }
        // Traverse parameter combinations:
        $c = 0;
        $cc = 0;
        $content = '';
        if (count($configurations)) {
            foreach ($configurations as $confKey => $confArray) {
                // Title column:
                if (!$c) {
                    $titleClm = '<td rowspan="' . count($configurations) . '">' . $pageTitleAndIcon . '</td>';
                } else {
                    $titleClm = '';
                }
                if (!in_array($pageRow['uid'], $this->expandExcludeString($confArray['subCfg']['exclude']))) {
                    // URL list:
                    $urlList = $this->urlListFromUrlArray($confArray, $pageRow, $this->scheduledTime, $this->reqMinute, $this->submitCrawlUrls, $this->downloadCrawlUrls, $this->duplicateTrack, $this->downloadUrls, $this->incomingProcInstructions);
                    // Expanded parameters:
                    $paramExpanded = '';
                    $calcAccu = array();
                    $calcRes = 1;
                    foreach ($confArray['paramExpanded'] as $gVar => $gVal) {
                        $paramExpanded .= '
							<tr>
								<td class="bgColor4-20">' . htmlspecialchars('&' . $gVar . '=') . '<br/>' . '(' . count($gVal) . ')' . '</td>
								<td class="bgColor4" nowrap="nowrap">' . nl2br(htmlspecialchars(implode(chr(10), $gVal))) . '</td>
							</tr>
						';
                        $calcRes *= count($gVal);
                        $calcAccu[] = count($gVal);
                    }
                    $paramExpanded = '<table class="lrPadding c-list param-expanded">' . $paramExpanded . '</table>';
                    $paramExpanded .= 'Comb: ' . implode('*', $calcAccu) . '=' . $calcRes;
                    // Options
                    $optionValues = '';
                    if ($confArray['subCfg']['userGroups']) {
                        $optionValues .= 'User Groups: ' . $confArray['subCfg']['userGroups'] . '<br/>';
                    }
                    if ($confArray['subCfg']['baseUrl']) {
                        $optionValues .= 'Base Url: ' . $confArray['subCfg']['baseUrl'] . '<br/>';
                    }
                    if ($confArray['subCfg']['procInstrFilter']) {
                        $optionValues .= 'ProcInstr: ' . $confArray['subCfg']['procInstrFilter'] . '<br/>';
                    }
                    // Compile row:
                    $content .= '
						<tr class="bgColor' . ($c % 2 ? '-20' : '-10') . '">
							' . $titleClm . '
							<td>' . htmlspecialchars($confKey) . '</td>
							<td>' . nl2br(htmlspecialchars(rawurldecode(trim(str_replace('&', chr(10) . '&', t3lib_div::implodeArrayForUrl('', $confArray['paramParsed'])))))) . '</td>
							<td>' . $paramExpanded . '</td>
							<td nowrap="nowrap">' . $urlList . '</td>
							<td nowrap="nowrap">' . $optionValues . '</td>
							<td nowrap="nowrap">' . (version_compare(TYPO3_version, '4.5.0', '<') ? t3lib_div::view_array($confArray['subCfg']['procInstrParams.']) : t3lib_utility_Debug::viewArray($confArray['subCfg']['procInstrParams.'])) . '</td>
						</tr>';
                } else {
                    $content .= '<tr class="bgColor' . ($c % 2 ? '-20' : '-10') . '">
							' . $titleClm . '
							<td>' . htmlspecialchars($confKey) . '</td>
							<td colspan="5"><em>No entries</em> (Page is excluded in this configuration)</td>
						</tr>';
                }
                $c++;
            }
        } else {
            $message = !empty($skipMessage) ? ' (' . $skipMessage . ')' : '';
            // Compile row:
            $content .= '
				<tr class="bgColor-20" style="border-bottom: 1px solid black;">
					<td>' . $pageTitleAndIcon . '</td>
					<td colspan="6"><em>No entries</em>' . $message . '</td>
				</tr>';
        }
        return $content;
    }
Ejemplo n.º 17
0
	/**
	 * Show meta data part of Data Structure
	 *
	 * @param	[type]		$DSstring: ...
	 * @return	[type]		...
	 */
	function DSdetails($DSstring)	{
		$DScontent = t3lib_div::xml2array($DSstring);

		$inputFields = 0;
		$referenceFields = 0;
		$rootelements = 0;
		if (is_array ($DScontent) && is_array($DScontent['ROOT']['el']))	{
			foreach($DScontent['ROOT']['el'] as $elKey => $elCfg)	{
				$rootelements++;
				if (isset($elCfg['TCEforms']))	{

						// Assuming that a reference field for content elements is recognized like this, increment counter. Otherwise assume input field of some sort.
					if ($elCfg['TCEforms']['config']['type']==='group' && $elCfg['TCEforms']['config']['allowed']==='tt_content')	{
						$referenceFields++;
					} else {
						$inputFields++;
					}
				}
				if (isset($elCfg['el'])) $elCfg['el'] = '...';
				unset($elCfg['tx_templavoila']['sample_data']);
				unset($elCfg['tx_templavoila']['tags']);
				unset($elCfg['tx_templavoila']['eType']);

				if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000){
					$rootElementsHTML.='<b>'.$elCfg['tx_templavoila']['title'].'</b>'.t3lib_div::view_array($elCfg);
				} else {
					$rootElementsHTML.='<b>'.$elCfg['tx_templavoila']['title'].'</b>'.t3lib_utility_Debug::viewArray($elCfg);
				}
			}
		}

	/*	$DScontent = array('meta' => $DScontent['meta']);	*/

		$languageMode = '';
		if (is_array($DScontent['meta'])) {
		if ($DScontent['meta']['langDisable'])	{
			$languageMode = 'Disabled';
		} elseif ($DScontent['meta']['langChildren']) {
			$languageMode = 'Inheritance';
		} else {
			$languageMode = 'Separate';
		}
		}

		return array(
			'HTML' => /*t3lib_div::view_array($DScontent).'Language Mode => "'.$languageMode.'"<hr/>
						Root Elements = '.$rootelements.', hereof ref/input fields = '.($referenceFields.'/'.$inputFields).'<hr/>
						'.$rootElementsHTML*/ $this->renderDSdetails($DScontent),
			'languageMode' => $languageMode,
			'rootelements' => $rootelements,
			'inputFields' => $inputFields,
			'referenceFields' => $referenceFields
		);
	}
 /**
  * [Describe function...]
  *
  * @param	[type]		$mQ: ...
  * @param	[type]		$res: ...
  * @param	[type]		$table: ...
  * @return	[type]		...
  */
 function getQueryResultCode($mQ, $res, $table)
 {
     global $TCA;
     $output = '';
     $cPR = array();
     switch ($mQ) {
         case 'count':
             $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
             $cPR['header'] = 'Count';
             $cPR['content'] = '<BR><strong>' . $row[0] . '</strong> records selected.';
             break;
         case 'all':
             $rowArr = array();
             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 $rowArr[] = $this->resultRowDisplay($row, $TCA[$table], $table);
                 $lrow = $row;
             }
             if (is_array($this->hookArray['beforeResultTable'])) {
                 foreach ($this->hookArray['beforeResultTable'] as $_funcRef) {
                     $out .= t3lib_div::callUserFunction($_funcRef, $GLOBALS['SOBE']->MOD_SETTINGS, $this);
                 }
             }
             if (count($rowArr)) {
                 $out .= '<table border="0" cellpadding="2" cellspacing="1" width="100%">' . $this->resultRowTitles($lrow, $TCA[$table], $table) . implode(LF, $rowArr) . '</table>';
             }
             if (!$out) {
                 $out = '<em>No rows selected!</em>';
             }
             $cPR['header'] = 'Result';
             $cPR['content'] = $out;
             break;
         case 'csv':
             $rowArr = array();
             $first = 1;
             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 if ($first) {
                     $rowArr[] = $this->csvValues(array_keys($row), ',', '');
                     $first = 0;
                 }
                 $rowArr[] = $this->csvValues($row, ',', '"', $TCA[$table], $table);
             }
             if (count($rowArr)) {
                 $out .= '<textarea name="whatever" rows="20" wrap="off"' . $GLOBALS['SOBE']->doc->formWidthText($this->formW, '', 'off') . ' class="fixed-font">' . t3lib_div::formatForTextarea(implode(LF, $rowArr)) . '</textarea>';
                 if (!$this->noDownloadB) {
                     $out .= '<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\'' . $this->downloadScript . '\';">';
                     // document.forms[0].target=\'_blank\';
                 }
                 // Downloads file:
                 if (t3lib_div::_GP('download_file')) {
                     $filename = 'TYPO3_' . $table . '_export_' . date('dmy-Hi') . '.csv';
                     $mimeType = 'application/octet-stream';
                     header('Content-Type: ' . $mimeType);
                     header('Content-Disposition: attachment; filename=' . $filename);
                     echo implode(CRLF, $rowArr);
                     exit;
                 }
             }
             if (!$out) {
                 $out = '<em>No rows selected!</em>';
             }
             $cPR['header'] = 'Result';
             $cPR['content'] = $out;
             break;
         case 'xml':
             $xmlObj = t3lib_div::makeInstance('t3lib_xml', 'typo3_export');
             $xmlObj->includeNonEmptyValues = 1;
             $xmlObj->renderHeader();
             $first = 1;
             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 if ($first) {
                     $xmlObj->setRecFields($table, implode(',', array_keys($row)));
                     //				debug($xmlObj->XML_recFields);
                     $first = 0;
                 }
                 $valueArray = $row;
                 if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
                     foreach ($valueArray as $key => $val) {
                         $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, $conf, ',');
                     }
                 }
                 $xmlObj->addRecord($table, $valueArray);
             }
             $xmlObj->renderFooter();
             if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
                 $xmlData = $xmlObj->getResult();
                 $out .= '<textarea name="whatever" rows="20" wrap="off"' . $GLOBALS['SOBE']->doc->formWidthText($this->formW, '', 'off') . ' class="fixed-font">' . t3lib_div::formatForTextarea($xmlData) . '</textarea>';
                 if (!$this->noDownloadB) {
                     $out .= '<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\'' . $this->downloadScript . '\';">';
                     // document.forms[0].target=\'_blank\';
                 }
                 // Downloads file:
                 if (t3lib_div::_GP('download_file')) {
                     $filename = 'TYPO3_' . $table . '_export_' . date('dmy-Hi') . '.xml';
                     $mimeType = 'application/octet-stream';
                     header('Content-Type: ' . $mimeType);
                     header('Content-Disposition: attachment; filename=' . $filename);
                     echo $xmlData;
                     exit;
                 }
             }
             if (!$out) {
                 $out = '<em>No rows selected!</em>';
             }
             $cPR['header'] = 'Result';
             $cPR['content'] = $out;
             break;
         case 'explain':
         default:
             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 $out .= '<BR>' . t3lib_div::view_array($row);
             }
             $cPR['header'] = 'Explain SQL query';
             $cPR['content'] = $out;
             break;
     }
     return $cPR;
 }
 /**
  * Show Info of extension record
  *
  * @param  array $record
  * @return string
  */
 public function showRemoteExtInfo($record)
 {
     return t3lib_div::view_array(array($record, $this->settings));
 }
 function xmlFunc($content, $conf)
 {
     $this->init($conf);
     $this->pi_initPIflexForm();
     // Init FlexForm configuration for plugin
     $postvars = t3lib_div::_GP('tx_rggooglemap_pi1');
     if ($postvars['detail'] != '') {
         return $this->poiContent($postvars['detail'], 1, $postvars['table']);
         // debug
         $content = '<div style="width:120px">Marker #' . $postvars['detail'] . '<br />' . time() . '<hr />' . t3lib_div::view_array($this->conf['poi.']) . '</div>';
         return $content;
     } else {
         // categories
         $cat = $postvars['cat'];
         if ($cat) {
             // cat selected
             if ($cat != 9999) {
                 // nothing selected
                 $catList = explode(',', $cat);
             }
         } else {
             // nothing selected means 1st call!!
             $catList = explode(',', $this->config['categories']);
         }
         // category image
         $table = 'tx_rggooglemap_cat';
         $field = 'uid,image,parent_uid';
         $where = 'deleted = 0 AND hidden=0 ';
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field, $table, $where, $groupBy = '', $orderBy, $limit = '');
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             if ($row['image'] == '') {
                 // get image of parent category
                 $whereTemp = 'deleted = 0 AND hidden=0 AND uid = ' . $row['parent_uid'];
                 $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field, $table, $whereTemp);
                 $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);
                 $catImg[$row['uid']] = $row2['image'];
             } else {
                 $catImg[$row['uid']] = $row['image'];
             }
         }
         $this->renderHeader();
         if ($catList) {
             $table = $this->config['tables'];
             $field = '*';
             $where = 'hidden= 0 AND deleted = 0 AND pid IN(' . $this->config['pid_list'] . ') AND lng!=\'\' AND lat!=\'\' ';
             if (strlen($postvars['area']) > 5) {
                 $areaArr = array();
                 $areaArr = preg_split('/, /', $postvars['area']);
                 $where .= ' AND lng between ' . $areaArr[1] . ' AND ' . $areaArr[3] . '
 				        AND	lat between ' . $areaArr[0] . ' AND ' . $areaArr[2];
             }
             // category selection
             #      $catList = ($cat!=0) ? explode(',',$cat) : explode(',',$this->config['categories']);
             $catTmp = false;
             foreach ($catList as $key => $value) {
                 if ($value) {
                     $catTmp = true;
                     $where2 .= ' FIND_IN_SET(' . $value . ',rggmcat) OR';
                 }
             }
             $where .= $catTmp ? ' AND ( ' . substr($where2, 0, -3) . ' ) ' : '';
             $limit = '';
             if ($this->conf['extraquery'] == 1) {
                 $extraquery = $GLOBALS["TSFE"]->fe_user->getKey('ses', 'rggmttnews2');
                 if ($extraquery != '') {
                     $where .= ' AND uid IN (' . $extraquery . ') ';
                 }
             }
             //x2      $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$where,$groupBy='',$orderBy,$limit);
             //x2       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             #$limit = '0,100';
             $res = $this->generic->exec_SELECTquery($field, $table, $where, $groupBy, $orderBy, $limit);
             while ($row = array_shift($res)) {
                 $catDivider = strpos($row['rggmcat'], ',');
                 if ($catDivider == false) {
                     if (!$catImg[$row['rggmcat']]) {
                         if (!file_exists('uploads/tx_rggooglemap/dot.png')) {
                             copy($this->conf['defaultPOIIcon'], 'uploads/tx_rggooglemap/dot.png');
                         }
                         $catImg[$row['rggmcat']] = 'dot.png';
                     }
                     $img = $catImg[$row['rggmcat']];
                     #
                 } else {
                     $firstCat = substr($row['rggmcat'], 0, $catDivider);
                     $img = $catImg[$firstCat];
                 }
                 $test = '';
                 #          $conf['recursive'] = 2;
                 $this->addRecord($table, $row, $conf, $img, $test);
             }
         }
         $this->renderFooter();
         return $this->getResult();
     }
 }
Ejemplo n.º 21
0
 /**
  * Checks if $this->path is a path under one of the filemounts
  *
  * @param string $path If set this path will be set as current
  * @return	void
  * @see init()
  * @todo check path access in modules or set path to a valid path?
  */
 function checkOrSetPath($path = '')
 {
     global $FILEMOUNTS;
     if ($path) {
         $this->path = $path;
     }
     if (!$this->path) {
         reset($FILEMOUNTS);
         $fmount = current($FILEMOUNTS);
         $path = $fmount['path'];
     } else {
         $path = tx_dam::path_makeAbsolute($this->path);
     }
     $pathInfo = tx_dam::path_compileInfo($path);
     if ($this->checkPathAccess($pathInfo)) {
         $this->path = $pathInfo['dir_path_relative'];
         $this->pathInfo = $pathInfo;
         $this->pathAccess = true;
     } else {
         $this->path = $path;
         $this->pathInfo = $pathInfo;
         $this->pathAccess = false;
     }
     $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, array('tx_dam_folder' => $this->path), $this->MCONF['name'], 'ses');
     if (tx_dam::config_getValue('setup.devel')) {
         $this->debugContent['pathInfo'] = '<h4>pathInfo</h4>' . t3lib_div::view_array($this->pathInfo);
     }
 }
 /**
  * defaultValues():  process the values from the pi_flexform field.
  *          Process each sheet. Allocates values to TypoScript.
  *
  * @return  void
  * @version 0.0.1
  * @since 0.0.1
  */
 public function defaultValues()
 {
     //////////////////////////////////////////////////////////////////////
     //
     // Development
     // Display values from pi_flexform as an tree
     if (1 == 0) {
         $treeDat = $this->pObj->cObj->data['pi_flexform'];
         var_dump(__METHOD__ . ': ' . __LINE__, $treeDat, t3lib_div::view_array($treeDat));
         $treeDat = t3lib_div::resolveAllSheetsInDS($treeDat);
         var_dump(__METHOD__ . ': ' . __LINE__, $treeDat, t3lib_div::view_array($treeDat));
     }
     //var_dump(__METHOD__ . ': ' . __LINE__ , $this->pi_flexform);
     // Display values from pi_flexform as an tree
     // Development
     //////////////////////////////////////////////////////////////////////
     //
     // DRS - Development Reporting System
     if ($this->pObj->b_drs_flexform) {
         $str_header = $this->pObj->cObj->data['header'];
         $int_uid = $this->pObj->cObj->data['uid'];
         $int_pid = $this->pObj->cObj->data['pid'];
         t3lib_div::devlog('[INFO/FLEXFORM] \'' . $str_header . '\' (pid: ' . $int_pid . ', uid: ' . $int_uid . ')', $this->pObj->extKey, 0);
     }
     // DRS - Development Reporting System
     //////////////////////////////////////////////////////////////////////
     //
     // Init Language
     if (!$this->pObj->lang) {
         $this->pObj->objZz->initLang();
     }
     // Init Language
     //////////////////////////////////////////////////////////////////////
     //
     // Process the Sheets
     $this->sheet_addcontent();
     $this->sheet_debugging();
     $this->sheet_input();
     $this->sheet_properties();
     $this->sheet_output();
     $this->sheet_sDEF();
     // Process the Sheets
     //var_dump(__METHOD__ . ': ' . __LINE__ , $this->pi_flexform);
     //var_dump(__METHOD__ . ': ' . __LINE__ , $this->pObj->conf);
     return $this->arr_request;
 }
Ejemplo n.º 23
0
 function fetchServerEvents()
 {
     $aEvents = array();
     $aGrabbedEvents = $this->oForm->__getEventsInConf($this->aElement);
     reset($aGrabbedEvents);
     while (list(, $sEvent) = each($aGrabbedEvents)) {
         if (($mEvent = $this->_navConf("/" . $sEvent . "/")) !== FALSE) {
             //debug($mEvent);
             if (is_array($mEvent)) {
                 $sRunAt = trim(strtolower(array_key_exists("runat", $mEvent) && in_array($mEvent["runat"], array("inline", "client", "ajax", "server")) ? $mEvent["runat"] : "client"));
                 if (($iPos = strpos($sEvent, "-")) !== FALSE) {
                     $sEventName = substr($sEvent, 0, $iPos);
                 } else {
                     $sEventName = $sEvent;
                 }
                 if ($sRunAt === "server") {
                     $sEventId = $this->oForm->_getServerEventId($this->getAbsName(), array($sEventName => $mEvent));
                     // before any modif to get the *real* eventid
                     $aNeededParams = array();
                     if (array_key_exists("params", $mEvent)) {
                         if (is_string($mEvent["params"])) {
                             $aTemp = t3lib_div::trimExplode(",", $mEvent["params"]);
                             reset($aTemp);
                             while (list($sKey, ) = each($aTemp)) {
                                 $aNeededParams[] = array("get" => $aTemp[$sKey], "as" => FALSE);
                             }
                         } else {
                             // the new syntax
                             // <params><param get="uid" as="uid" /></params>
                             $aNeededParams = $mEvent["params"];
                         }
                     }
                     reset($aNeededParams);
                     $sWhen = $this->oForm->_navConf("/when", $mEvent);
                     if ($sWhen === FALSE) {
                         $sWhen = "end";
                     }
                     if (!in_array($sWhen, $this->oForm->aAvailableCheckPoints)) {
                         $this->oForm->mayday("SERVER EVENT on <b>" . $sEventName . " " . $this->getAbsName() . "</b>: defined checkpoint (when='" . $sWhen . "') does not exists; Available checkpoints are: <br /><br />" . t3lib_div::view_array($this->oForm->aAvailableCheckPoints));
                     }
                     $bEarlyBird = FALSE;
                     if (array_search($sWhen, $this->oForm->aAvailableCheckPoints) < array_search("after-init-renderlets", $this->oForm->aAvailableCheckPoints)) {
                         if ($sWhen === "start") {
                             #debug("ici");
                             $bEarlyBird = TRUE;
                         } else {
                             $this->oForm->mayday("SERVER EVENT on <b>" . $sEventName . " " . $this->getAbsName() . "</b>: defined checkpoint (when='" . $sWhen . "') triggers too early in the execution to be catchable by a server event.<br />The first checkpoint available for server event is <b>after-init-renderlets</b>. <br /><br />The full list of checkpoints is: <br /><br />" . t3lib_div::view_array($this->oForm->aAvailableCheckPoints));
                         }
                     }
                     $this->oForm->aServerEvents[$sEventId] = array("name" => $this->getAbsName(), "eventid" => $sEventId, "trigger" => $sEventName, "when" => $sWhen, "event" => $mEvent, "params" => $aNeededParams, "raw" => array($sEventName => $mEvent), "earlybird" => $bEarlyBird);
                 }
             }
         }
     }
 }
    /**
     * Print TypoScript parsing log
     *
     * @return	string		HTML table with the information about parsing times.
     * @see t3lib_tsfeBeUserAuth::extGetCategory_tsdebug()
     */
    public function printTSlog()
    {
        // Calculate times and keys for the tsStackLog
        foreach ($this->tsStackLog as $uniqueId => &$data) {
            $data['endtime'] = $this->getDifferenceToStarttime($data['endtime']);
            $data['starttime'] = $this->getDifferenceToStarttime($data['starttime']);
            $data['deltatime'] = $data['endtime'] - $data['starttime'];
            $data['key'] = implode($data['stackPointer'] ? '.' : '/', end($data['tsStack']));
        }
        // Create hierarchical array of keys pointing to the stack
        $arr = array();
        foreach ($this->tsStackLog as $uniqueId => $data) {
            $this->createHierarchyArray($arr, $data['level'], $uniqueId);
        }
        // Parsing the registeret content and create icon-html for the tree
        $this->tsStackLog[$arr['0.'][0]]['content'] = $this->fixContent($arr['0.']['0.'], $this->tsStackLog[$arr['0.'][0]]['content'], '', 0, $arr['0.'][0]);
        // Displaying the tree:
        $outputArr = array();
        $outputArr[] = $this->fw('TypoScript Key');
        $outputArr[] = $this->fw('Value');
        if ($this->printConf['allTime']) {
            $outputArr[] = $this->fw('Time');
            $outputArr[] = $this->fw('Own');
            $outputArr[] = $this->fw('Sub');
            $outputArr[] = $this->fw('Total');
        } else {
            $outputArr[] = $this->fw('Own');
        }
        $outputArr[] = $this->fw('Details');
        $out = '';
        foreach ($outputArr as $row) {
            $out .= '
				<th style="text-align:center; background:#ABBBB4;"><strong>' . $row . '</strong></th>';
        }
        $out = '<tr>' . $out . '</tr>';
        $flag_tree = $this->printConf['flag_tree'];
        $flag_messages = $this->printConf['flag_messages'];
        $flag_content = $this->printConf['flag_content'];
        $flag_queries = $this->printConf['flag_queries'];
        $keyLgd = $this->printConf['keyLgd'];
        $factor = $this->printConf['factor'];
        $col = $this->printConf['col'];
        $highlight_col = $this->printConf['highlight_col'];
        $c = 0;
        foreach ($this->tsStackLog as $uniqueId => $data) {
            $bgColor = ' background-color:' . ($c % 2 ? t3lib_div::modifyHTMLColor($col, $factor, $factor, $factor) : $col) . ';';
            if ($this->highlightLongerThan && intval($data['owntime']) > intval($this->highlightLongerThan)) {
                $bgColor = ' background-color:' . $highlight_col . ';';
            }
            $item = '';
            if (!$c) {
                // If first...
                $data['icons'] = '';
                $data['key'] = 'Script Start';
                $data['value'] = '';
            }
            // key label:
            $keyLabel = '';
            if (!$flag_tree && $data['stackPointer']) {
                $temp = array();
                foreach ($data['tsStack'] as $k => $v) {
                    $temp[] = t3lib_div::fixed_lgd_cs(implode($v, $k ? '.' : '/'), -$keyLgd);
                }
                array_pop($temp);
                $temp = array_reverse($temp);
                array_pop($temp);
                if (count($temp)) {
                    $keyLabel = '<br /><span style="color:#999999;">' . implode($temp, '<br />') . '</span>';
                }
            }
            if ($flag_tree) {
                $tmp = t3lib_div::trimExplode('.', $data['key'], 1);
                $theLabel = end($tmp);
            } else {
                $theLabel = $data['key'];
            }
            $theLabel = t3lib_div::fixed_lgd_cs($theLabel, -$keyLgd);
            $theLabel = $data['stackPointer'] ? '<span style="color:maroon;">' . $theLabel . '</span>' : $theLabel;
            $keyLabel = $theLabel . $keyLabel;
            $item .= '<td valign="top" style="text-align:left; white-space:nowrap; padding-left:2px;' . $bgColor . '">' . ($flag_tree ? $data['icons'] : '') . $this->fw($keyLabel) . '</td>';
            // key value:
            $keyValue = $data['value'];
            $item .= '<td valign="top" style="text-align:left; white-space:nowrap;' . $bgColor . '">' . $this->fw(htmlspecialchars($keyValue)) . '</td>';
            if ($this->printConf['allTime']) {
                $item .= '<td valign="top" style="text-align:right; white-space:nowrap;' . $bgColor . '"> ' . $this->fw($data['starttime']) . '</td>';
                $item .= '<td valign="top" style="text-align:right; white-space:nowrap;' . $bgColor . '"> ' . $this->fw($data['owntime']) . '</td>';
                $item .= '<td valign="top" style="text-align:left; white-space:nowrap;' . $bgColor . '"> ' . $this->fw($data['subtime'] ? '+' . $data['subtime'] : '') . '</td>';
                $item .= '<td valign="top" style="text-align:left; white-space:nowrap;' . $bgColor . '"> ' . $this->fw($data['subtime'] ? '=' . $data['deltatime'] : '') . '</td>';
            } else {
                $item .= '<td valign="top" style="text-align:right; white-space:nowrap;' . $bgColor . '"> ' . $this->fw($data['owntime']) . '</td>';
            }
            // messages:
            $msgArr = array();
            $msg = '';
            if ($flag_messages && is_array($data['message'])) {
                foreach ($data['message'] as $v) {
                    $msgArr[] = nl2br($v);
                }
            }
            if ($flag_queries && is_array($data['selectQuery'])) {
                $msgArr[] = t3lib_div::view_array($data['selectQuery']);
            }
            if ($flag_content && strcmp($data['content'], '')) {
                $maxlen = 120;
                if (preg_match_all('/(\\S{' . $maxlen . ',})/', $data['content'], $reg)) {
                    // Break lines which are too longer than $maxlen chars (can happen if content contains long paths...)
                    foreach ($reg[1] as $key => $match) {
                        $match = preg_replace('/(.{' . $maxlen . '})/', '$1 ', $match);
                        $data['content'] = str_replace($reg[0][$key], $match, $data['content']);
                    }
                }
                $msgArr[] = '<span style="color:#000066;">' . nl2br($data['content']) . '</span>';
            }
            if (count($msgArr)) {
                $msg = implode($msgArr, '<hr />');
            }
            $item .= '<td valign="top" style="text-align:left;' . $bgColor . '">' . $this->fw($msg) . '</td>';
            $out .= '<tr>' . $item . '</tr>';
            $c++;
        }
        $out = '<table border="0" cellpadding="0" cellspacing="0" summary="">' . $out . '</table>';
        return $out;
    }
 /**
  * Rendering
  * Called in SC_browse_links::main() when isValid() returns true;
  *
  * @param	string		$type Type: "file", ...
  * @param	object		$pObj Parent object.
  * @return	string		Rendered content
  * @see SC_browse_links::main()
  */
 function render($type, &$pObj)
 {
     global $LANG, $BE_USER;
     $this->pObj =& $pObj;
     // init class browse_links
     $this->init();
     $this->getModSettings();
     $this->processParams();
     $content = '';
     switch ((string) $this->mode) {
         case 'tx_dam_folder':
             $this->act = 'folder';
             // unused for now
             $content = $this->main_folder();
             break;
         default:
             break;
     }
     // debug output
     if (false) {
         $bparams = explode('|', $this->bparams);
         $debugArr = array('act' => $this->act, 'mode' => $this->mode, 'thisScript' => $this->thisScript, 'bparams' => $bparams, 'allowedTables' => $this->allowedTables, 'allowedFileTypes' => $this->allowedFileTypes, 'disallowedFileTypes' => $this->disallowedFileTypes, 'addParams' => $this->addParams);
         $content .= t3lib_div::view_array($debugArr);
     }
     return $content;
 }
Ejemplo n.º 26
0
    /**
     * Prints a row with data for the various extension listings
     *
     * @param	string		Extension key
     * @param	array		Extension information array
     * @param	array		Preset table cells, eg. install/uninstall icons.
     * @param	string		<tr> tag class
     * @param	array		Array with installed extension keys (as keys)
     * @param	boolean		If set, the list is coming from remote server.
     * @param	string		Alternative link URL
     * @return	string		HTML <tr> content
     */
    function extensionListRow($extKey, $extInfo, $cells, $bgColorClass = '', $inst_list = array(), $import = 0, $altLinkUrl = '')
    {
        // Icon:
        $imgInfo = @getImageSize($this->getExtPath($extKey, $extInfo['type']) . '/ext_icon.gif');
        if (is_array($imgInfo)) {
            $cells[] = '<td><img src="' . $GLOBALS['BACK_PATH'] . $this->typeRelPaths[$extInfo['type']] . $extKey . '/ext_icon.gif' . '" ' . $imgInfo[3] . ' alt="" /></td>';
        } elseif ($extInfo['_ICON']) {
            $cells[] = '<td>' . $extInfo['_ICON'] . '</td>';
        } else {
            $cells[] = '<td><img src="clear.gif" width="1" height="1" alt="" /></td>';
        }
        // Extension title:
        $cells[] = '<td nowrap="nowrap"><a href="' . htmlspecialchars($altLinkUrl ? $altLinkUrl : 'index.php?CMD[showExt]=' . $extKey . '&SET[singleDetails]=info') . '" title="' . htmlspecialchars($extInfo['EM_CONF']['description']) . '">' . t3lib_div::fixed_lgd_cs($extInfo['EM_CONF']['title'] ? htmlspecialchars($extInfo['EM_CONF']['title']) : '<em>' . $extKey . '</em>', 40) . '</a></td>';
        // Based on the display mode you will see more or less details:
        if (!$this->MOD_SETTINGS['display_details']) {
            $cells[] = '<td>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($extInfo['EM_CONF']['description'], 400)) . '<br /><img src="clear.gif" width="300" height="1" alt="" /></td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['author_email'] ? '<a href="mailto:' . htmlspecialchars($extInfo['EM_CONF']['author_email']) . '">' : '') . htmlspecialchars($extInfo['EM_CONF']['author']) . (htmlspecialchars($extInfo['EM_CONF']['author_email']) ? '</a>' : '') . ($extInfo['EM_CONF']['author_company'] ? '<br />' . htmlspecialchars($extInfo['EM_CONF']['author_company']) : '') . '</td>';
        } elseif ($this->MOD_SETTINGS['display_details'] == 2) {
            $cells[] = '<td nowrap="nowrap">' . $extInfo['EM_CONF']['priority'] . '</td>';
            $cells[] = '<td nowrap="nowrap">' . implode('<br />', t3lib_div::trimExplode(',', $extInfo['EM_CONF']['modify_tables'], 1)) . '</td>';
            $cells[] = '<td nowrap="nowrap">' . $extInfo['EM_CONF']['module'] . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['clearCacheOnLoad'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['internal'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['shy'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
        } elseif ($this->MOD_SETTINGS['display_details'] == 3) {
            $techInfo = $this->makeDetailedExtensionAnalysis($extKey, $extInfo);
            $cells[] = '<td>' . $this->extInformationArray_dbReq($techInfo) . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['TSfiles']) ? implode('<br />', $techInfo['TSfiles']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['flags']) ? implode('<br />', $techInfo['flags']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['moduleNames']) ? implode('<br />', $techInfo['moduleNames']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($techInfo['conf'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td>' . $GLOBALS['TBE_TEMPLATE']->rfw((t3lib_extMgm::isLoaded($extKey) && $techInfo['tables_error'] ? '<strong>' . $GLOBALS['LANG']->getLL('extInfoArray_table_error') . '</strong><br />' . $GLOBALS['LANG']->getLL('extInfoArray_missing_fields') : '') . (t3lib_extMgm::isLoaded($extKey) && $techInfo['static_error'] ? '<strong>' . $GLOBALS['LANG']->getLL('extInfoArray_static_table_error') . '</strong><br />' . $GLOBALS['LANG']->getLL('extInfoArray_static_tables_missing_empty') : '')) . '</td>';
        } elseif ($this->MOD_SETTINGS['display_details'] == 4) {
            $techInfo = $this->makeDetailedExtensionAnalysis($extKey, $extInfo, 1);
            $cells[] = '<td>' . (is_array($techInfo['locallang']) ? implode('<br />', $techInfo['locallang']) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['classes']) ? implode('<br />', $techInfo['classes']) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['errors']) ? $GLOBALS['TBE_TEMPLATE']->rfw(implode('<hr />', $techInfo['errors'])) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['NSerrors']) ? !t3lib_div::inList($this->nameSpaceExceptions, $extKey) ? t3lib_div::view_array($techInfo['NSerrors']) : $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('extInfoArray_exception')) : '') . '</td>';
        } elseif ($this->MOD_SETTINGS['display_details'] == 5) {
            $currentMd5Array = $this->serverExtensionMD5Array($extKey, $extInfo);
            $affectedFiles = '';
            $msgLines = array();
            $msgLines[] = $GLOBALS['LANG']->getLL('listRow_files') . ' ' . count($currentMd5Array);
            if (strcmp($extInfo['EM_CONF']['_md5_values_when_last_written'], serialize($currentMd5Array))) {
                $msgLines[] = $GLOBALS['TBE_TEMPLATE']->rfw('<br /><strong>' . $GLOBALS['LANG']->getLL('extInfoArray_difference_detected') . '</strong>');
                $affectedFiles = $this->findMD5ArrayDiff($currentMd5Array, unserialize($extInfo['EM_CONF']['_md5_values_when_last_written']));
                if (count($affectedFiles)) {
                    $msgLines[] = '<br /><strong>' . $GLOBALS['LANG']->getLL('extInfoArray_modified_files') . '</strong><br />' . $GLOBALS['TBE_TEMPLATE']->rfw(implode('<br />', $affectedFiles));
                }
            }
            $cells[] = '<td>' . implode('<br />', $msgLines) . '</td>';
        } else {
            // Default view:
            $verDiff = $inst_list[$extKey] && $this->versionDifference($extInfo['EM_CONF']['version'], $inst_list[$extKey]['EM_CONF']['version'], $this->versionDiffFactor);
            $cells[] = '<td nowrap="nowrap"><em>' . $extKey . '</em></td>';
            $cells[] = '<td nowrap="nowrap">' . ($verDiff ? '<strong>' . $GLOBALS['TBE_TEMPLATE']->rfw(htmlspecialchars($extInfo['EM_CONF']['version'])) . '</strong>' : $extInfo['EM_CONF']['version']) . '</td>';
            if (!$import) {
                // Listing extension on LOCAL server:
                // Extension Download:
                $cells[] = '<td nowrap="nowrap"><a href="' . htmlspecialchars('index.php?CMD[doBackup]=1&SET[singleDetails]=backup&CMD[showExt]=' . $extKey) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:download') . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-download') . '</a></td>';
                // Manual download
                $fileP = PATH_site . $this->typePaths[$extInfo['type']] . $extKey . '/doc/manual.sxw';
                $cells[] = '<td nowrap="nowrap">' . ($this->typePaths[$extInfo['type']] && @is_file($fileP) ? '<a href="' . htmlspecialchars(t3lib_div::resolveBackPath($this->doc->backPath . '../' . $this->typePaths[$extInfo['type']] . $extKey . '/doc/manual.sxw')) . '" target="_blank" title="' . $GLOBALS['LANG']->getLL('listRow_local_manual') . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-documentation') . '</a>' : '') . '</td>';
                // Double installation (inclusion of an extension in more than one of system, global or local scopes)
                $doubleInstall = '';
                if (strlen($extInfo['doubleInstall']) > 1) {
                    // Separate the "SL" et al. string into an array and replace L by Local, G by Global etc.
                    $doubleInstallations = str_replace(array('S', 'G', 'L'), array($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:sysext'), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:globalext'), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:localext')), str_split($extInfo['doubleInstall']));
                    // Last extension is the one actually used
                    $usedExtension = array_pop($doubleInstallations);
                    // Next extension is overridden
                    $overriddenExtensions = array_pop($doubleInstallations);
                    // If the array is not yet empty, the extension is actually installed 3 times (SGL)
                    if (count($doubleInstallations) > 0) {
                        $lastExtension = array_pop($doubleInstallations);
                        $overriddenExtensions .= ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:and') . ' ' . $lastExtension;
                    }
                    $doubleInstallTitle = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:double_inclusion'), $usedExtension, $overriddenExtensions);
                    $doubleInstall = ' <strong><abbr title="' . $doubleInstallTitle . '">' . $GLOBALS['TBE_TEMPLATE']->rfw($extInfo['doubleInstall']) . '</abbr></strong>';
                }
                $cells[] = '<td nowrap="nowrap">' . $this->typeLabels[$extInfo['type']] . $doubleInstall . '</td>';
            } else {
                // Listing extensions from REMOTE repository:
                $inst_curVer = $inst_list[$extKey]['EM_CONF']['version'];
                if (isset($inst_list[$extKey])) {
                    if ($verDiff) {
                        $inst_curVer = '<strong>' . $GLOBALS['TBE_TEMPLATE']->rfw($inst_curVer) . '</strong>';
                    }
                }
                $cells[] = '<td nowrap="nowrap">' . t3lib_befunc::date($extInfo['EM_CONF']['lastuploaddate']) . '</td>';
                $cells[] = '<td nowrap="nowrap">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($extInfo['EM_CONF']['author'], $GLOBALS['BE_USER']->uc[titleLen])) . '</td>';
                $cells[] = '<td nowrap="nowrap">' . $inst_curVer . '</td>';
                $cells[] = '<td nowrap="nowrap">' . $this->typeLabels[$inst_list[$extKey]['type']] . (strlen($inst_list[$extKey]['doubleInstall']) > 1 ? '<strong> ' . $GLOBALS['TBE_TEMPLATE']->rfw($inst_list[$extKey]['doubleInstall']) . '</strong>' : '') . '</td>';
                $cells[] = '<td nowrap="nowrap">' . ($extInfo['downloadcounter_all'] ? $extInfo['downloadcounter_all'] : '&nbsp;&nbsp;') . '/' . ($extInfo['downloadcounter'] ? $extInfo['downloadcounter'] : '&nbsp;') . '</td>';
            }
            $cells[] = '<td nowrap="nowrap" class="extstate" style="background-color:' . $this->stateColors[$extInfo['EM_CONF']['state']] . ';">' . $this->states[$extInfo['EM_CONF']['state']] . '</td>';
        }
        // show a different background through a different class for insecure (-1) extensions,
        // for unreviewed (0) an reviewed extensions (1), just use the regular class
        if ($this->xmlhandler->getReviewState($extKey, $extInfo['EM_CONF']['version']) < 0) {
            $bgclass = ' class="unsupported-ext"';
        } else {
            $bgclass = ' class="' . ($bgColorClass ? $bgColorClass : 'em-listbg1') . '"';
        }
        return '
			<tr' . $bgclass . '>
				' . implode('
				', $cells) . '
			</tr>';
    }
Ejemplo n.º 27
0
    /**
     * Generates the module content
     *
     * @return	void
     */
    protected function getModuleContent()
    {
        $pageRoot = (string) $this->MOD_SETTINGS['function'];
        $content = '<div align="center"><strong>Hello World!</strong></div><br />
			The "Kickstarter" has made this module automatically, it contains a default framework for a backend module but apart from that it does nothing useful until you open the script ' . substr(t3lib_extMgm::extPath('solr'), strlen(PATH_site)) . 'mod_admin/index.php and edit it!
			<hr />
			<br />This is the GET/POST vars sent to the script:<br />' . 'GET:' . t3lib_div::view_array($_GET) . '<br />' . 'POST:' . t3lib_div::view_array($_POST) . '<br />' . '';
        $this->content .= $this->doc->section('Currently active tab name', $content, false, true);
    }
Ejemplo n.º 28
0
	/**
	 * Renders the hierarchical display for a Data Structure.
	 * Calls itself recursively
	 *
	 * @param	array		Part of Data Structure (array of elements)
	 * @param	boolean		If true, the Data Structure table will show links for mapping actions. Otherwise it will just layout the Data Structure visually.
	 * @param	array		Part of Current mapping information corresponding to the $dataStruct array - used to evaluate the status of mapping for a certain point in the structure.
	 * @param	array		Array of HTML paths
	 * @param	array		Options for mapping mode control (INNER, OUTER etc...)
	 * @param	array		Content from template file splitted by current mapping info - needed to evaluate whether mapping information for a certain level actually worked on live content!
	 * @param	integer		Recursion level, counting up
	 * @param	array		Accumulates the table rows containing the structure. This is the array returned from the function.
	 * @param	string		Form field prefix. For each recursion of this function, two [] parts are added to this prefix
	 * @param	string		HTML path. For each recursion a section (divided by "|") is added.
	 * @param	boolean		If true, the "Map" link can be shown, otherwise not. Used internally in the recursions.
	 * @return	array		Table rows as an array of <tr> tags, $tRows
	 */
	function drawDataStructureMap($dataStruct,$mappingMode=0,$currentMappingInfo=array(),$pathLevels=array(),$optDat=array(),$contentSplittedByMapping=array(),$level=0,$tRows=array(),$formPrefix='',$path='',$mapOK=1)	{

		$bInfo = t3lib_div::clientInfo();
		$multilineTooltips = ($bInfo['BROWSER'] == 'msie');
		$rowIndex = -1;

			// Data Structure array must be ... and array of course...
		if (is_array($dataStruct))	{
			foreach($dataStruct as $key => $value)	{
				$rowIndex++;

				if ($key == 'meta') {
					// Do not show <meta> information in mapping interface!
					continue;
				}

				if (is_array($value))	{	// The value of each entry must be an array.

						// ********************
						// Making the row:
						// ********************
					$rowCells=array();

						// Icon:
					$info = $this->dsTypeInfo($value);
					$icon = '<img'.$info[2].' alt="" title="'.$info[1].$key.'" class="absmiddle" />';

						// Composing title-cell:
					if (preg_match('/^LLL:/', $value['tx_templavoila']['title'])) {
						$translatedTitle = $GLOBALS['LANG']->sL($value['tx_templavoila']['title']);
						$translateIcon = '<sup title="' . $GLOBALS['LANG']->getLL('displayDSTitleTranslated') . '">*</sup>';
					}
					else {
						$translatedTitle = $value['tx_templavoila']['title'];
						$translateIcon = '';
					}
					$this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['title'] = $icon.'<strong>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($translatedTitle, 30)).'</strong>'.$translateIcon;
					$rowCells['title'] = '<img src="clear.gif" width="'.($level*16).'" height="1" alt="" />'.$this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['title'];

						// Description:
					$this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['description'] = $rowCells['description'] = htmlspecialchars($value['tx_templavoila']['description']);


						// In "mapping mode", render HTML page and Command links:
					if ($mappingMode)	{

							// HTML-path + CMD links:
						$isMapOK = 0;
						if ($currentMappingInfo[$key]['MAP_EL'])	{	// If mapping information exists...:

							$mappingElement = str_replace('~~~', ' ', $currentMappingInfo[$key]['MAP_EL']);
							if (isset($contentSplittedByMapping['cArray'][$key]))	{	// If mapping of this information also succeeded...:
								$cF = implode(chr(10),t3lib_div::trimExplode(chr(10),$contentSplittedByMapping['cArray'][$key],1));

								if (strlen($cF)>200)	{
									$cF = t3lib_div::fixed_lgd_cs($cF,90).' '.t3lib_div::fixed_lgd_cs($cF,-90);
								}

									// Render HTML path:
								list($pI) = $this->markupObj->splitPath($currentMappingInfo[$key]['MAP_EL']);

								$tagIcon = t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_extMgm::extRelPath('templavoila') . 'html_tags/' . $pI['el'] . '.gif', 'height="17"') . ' alt="" border="0"';

								$okTitle = htmlspecialchars($cF ? sprintf($GLOBALS['LANG']->getLL('displayDSContentFound'), strlen($contentSplittedByMapping['cArray'][$key])) . ($multilineTooltips ? ':' . chr(10) . chr(10) . $cF : '') : $GLOBALS['LANG']->getLL('displayDSContentEmpty'));

								$rowCells['htmlPath'] = t3lib_iconWorks::getSpriteIcon('status-dialog-ok', array('title' => $okTitle)).
														tx_templavoila_htmlmarkup::getGnyfMarkup($pI['el'], '---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($mappingElement, -80)) ).
														($pI['modifier'] ? $pI['modifier'] . ($pI['modifier_value'] ? ':' . ($pI['modifier'] != 'RANGE' ? $pI['modifier_value'] : '...') : '') : '');
								$rowCells['htmlPath'] = '<a href="'.$this->linkThisScript(array(
																							'htmlPath'=>$path.($path?'|':'').preg_replace('/\/[^ ]*$/','',$currentMappingInfo[$key]['MAP_EL']),
																							'showPathOnly'=>1,
																							'DS_element' => t3lib_div::_GP('DS_element')
																						)).'">'.$rowCells['htmlPath'].'</a>';

									// CMD links, default content:
								$rowCells['cmdLinks'] = '<span class="nobr"><input type="submit" value="Re-Map" name="_" onclick="document.location=\'' .
														$this->linkThisScript(array(
																				'mapElPath' => $formPrefix . '[' . $key . ']',
																				'htmlPath' => $path,
																				'mappingToTags' => $value['tx_templavoila']['tags'],
																				'DS_element' => t3lib_div::_GP('DS_element')
																				)) . '\';return false;" title="' . $GLOBALS['LANG']->getLL('buttonRemapTitle') . '" />' .
														'<input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonChangeMode') . '" name="_" onclick="document.location=\'' .
														$this->linkThisScript(array(
																				'mapElPath' => $formPrefix . '[' . $key . ']',
																				'htmlPath' => $path . ($path ? '|' :'') . $pI['path'],
																				'doMappingOfPath' => 1,
																				'DS_element' => t3lib_div::_GP('DS_element')
																				)) . '\';return false;" title="' . $GLOBALS['LANG']->getLL('buttonChangeMode') . '" /></span>';

									// If content mapped ok, set flag:
								$isMapOK=1;
							} else {	// Issue warning if mapping was lost:
								$rowCells['htmlPath'] =  t3lib_iconWorks::getSpriteIcon('status-dialog-warning', array('title' => $GLOBALS['LANG']->getLL('msgNoContentFound'))) . htmlspecialchars($mappingElement);
							}
						} else {	// For non-mapped cases, just output a no-break-space:
							$rowCells['htmlPath'] = '&nbsp;';
						}

							// CMD links; Content when current element is under mapping, then display control panel or message:
						if ($this->mapElPath == $formPrefix.'['.$key.']')	{
							if ($this->doMappingOfPath)	{

									// Creating option tags:
								$lastLevel = end($pathLevels);
								$tagsMapping = $this->explodeMappingToTagsStr($value['tx_templavoila']['tags']);
								$mapDat = is_array($tagsMapping[$lastLevel['el']]) ? $tagsMapping[$lastLevel['el']] : $tagsMapping['*'];
								unset($mapDat['']);
								if (is_array($mapDat) && !count($mapDat))	unset($mapDat);

									// Create mapping options:
								$didSetSel=0;
								$opt=array();
								foreach($optDat as $k => $v)	{
									list($pI) = $this->markupObj->splitPath($k);

									if (($value['type']=='attr' && $pI['modifier']=='ATTR') || ($value['type']!='attr' && $pI['modifier']!='ATTR'))	{
										if (
												(!$this->markupObj->tags[$lastLevel['el']]['single'] || $pI['modifier']!='INNER') &&
												(!is_array($mapDat) || ($pI['modifier']!='ATTR' && isset($mapDat[strtolower($pI['modifier']?$pI['modifier']:'outer')])) || ($pI['modifier']=='ATTR' && (isset($mapDat['attr']['*']) || isset($mapDat['attr'][$pI['modifier_value']]))))

											)	{

											if($k==$currentMappingInfo[$key]['MAP_EL'])	{
												$sel = ' selected="selected"';
												$didSetSel=1;
											} else {
												$sel = '';
											}
											$opt[]='<option value="'.htmlspecialchars($k).'"'.$sel.'>'.htmlspecialchars($v).'</option>';
										}
									}
								}

									// Finally, put together the selector box:
								$rowCells['cmdLinks'] = tx_templavoila_htmlmarkup::getGnyfMarkup($pI['el'], '---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($lastLevel['path'], -80)) ).
									'<br /><select name="dataMappingForm'.$formPrefix.'['.$key.'][MAP_EL]">
										'.implode('
										',$opt).'
										<option value=""></option>
									</select>
									<br />
									<input type="submit" name="_save_data_mapping" value="' . $GLOBALS['LANG']->getLL('buttonSet') . '" />
									<input type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('buttonCancel') . '" />';
								$rowCells['cmdLinks'].=
									$this->cshItem('xMOD_tx_templavoila','mapping_modeset',$this->doc->backPath,'',FALSE,'margin-bottom: 0px;');
							} else {
								$rowCells['cmdLinks'] = t3lib_iconWorks::getSpriteIcon('status-dialog-notification') . '
														<strong>' . $GLOBALS['LANG']->getLL('msgHowToMap') . '</strong>';
								$rowCells['cmdLinks'].= '<br />
										<input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonCancel') . '" name="_" onclick="document.location=\'' .
										$this->linkThisScript(array(
											'DS_element' => t3lib_div::_GP('DS_element')
										)) .'\';return false;" />';
							}
						} elseif (!$rowCells['cmdLinks'] && $mapOK && $value['type']!='no_map') {
							$rowCells['cmdLinks'] = '<input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonMap') . '" name="_" onclick="document.location=\'' .
													$this->linkThisScript(array(
																			'mapElPath' => $formPrefix . '[' . $key . ']',
																			'htmlPath' => $path,
																			'mappingToTags' => $value['tx_templavoila']['tags'],
																			'DS_element' => t3lib_div::_GP('DS_element')
																		)) . '\';return false;" />';
						}
					}

						// Display mapping rules:
					$rowCells['tagRules'] = implode('<br />', t3lib_div::trimExplode(',', strtolower($value['tx_templavoila']['tags']), 1));
					if (!$rowCells['tagRules'])	{
						$rowCells['tagRules'] = $GLOBALS['LANG']->getLL('all');
					}

						// Display edit/delete icons:
					if ($this->editDataStruct)	{
						$editAddCol = '<a href="' . $this->linkThisScript(array(
																		'DS_element' => $formPrefix . '[' . $key . ']'
																		)) . '">' .
										t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->getLL('editEntry'))).
										'</a>
										<a href="' . $this->linkThisScript(array(
																		'DS_element_DELETE' => $formPrefix . '[' . $key . ']'
																		)) . '"
											onClick="return confirm(' .  $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('confirmDeleteEntry')) . ');">' .
										t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->getLL('deleteEntry'))).
										'</a>';
						$editAddCol = '<td nowrap="nowrap">' . $editAddCol . '</td>';
					} else {
						$editAddCol = '';
					}

						// Description:
					if ($this->_preview)	{						
						if (!is_array($value['tx_templavoila']['sample_data'])) {
							$rowCells['description'] = '[' . $GLOBALS['LANG']->getLL('noSampleData') . ']';
						} elseif (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000){
							$rowCells['description'] = t3lib_div::view_array($value['tx_templavoila']['sample_data']);
						} else {
							$rowCells['description'] = t3lib_utility_Debug::viewArray($value['tx_templavoila']['sample_data']);
						}
					}

						// Getting editing row, if applicable:
					list($addEditRows, $placeBefore) = $this->dsEdit->drawDataStructureMap_editItem($formPrefix, $key, $value, $level, $rowCells);

						// Add edit-row if found and destined to be set BEFORE:
					if ($addEditRows && $placeBefore)	{
						$tRows[]= $addEditRows;
					}
					else

						// Put row together
					if (!$this->mapElPath || $this->mapElPath == $formPrefix.'['.$key.']')	{
						$tRows[]='

							<tr class="' . ($rowIndex % 2 ? 'bgColor4' : 'bgColor6') . '">
							<td nowrap="nowrap" valign="top">'.$rowCells['title'].'</td>
							'.($this->editDataStruct ? '<td nowrap="nowrap">'.$key.'</td>' : '').'
							<td>'.$rowCells['description'].'</td>
							'.($mappingMode
									?
								'<td nowrap="nowrap">'.$rowCells['htmlPath'].'</td>
								<td>'.$rowCells['cmdLinks'].'</td>'
									:
								''
							).'
							<td>'.$rowCells['tagRules'].'</td>
							'.$editAddCol.'
						</tr>';
					}

						// Recursive call:
					if (($value['type']=='array') ||
						($value['type']=='section')) {
						$tRows = $this->drawDataStructureMap(
							$value['el'],
							$mappingMode,
							$currentMappingInfo[$key]['el'],
							$pathLevels,
							$optDat,
							$contentSplittedByMapping['sub'][$key],
							$level+1,
							$tRows,
							$formPrefix.'['.$key.'][el]',
							$path.($path?'|':'').$currentMappingInfo[$key]['MAP_EL'],
							$isMapOK
						);
					}
						// Add edit-row if found and destined to be set AFTER:
					if ($addEditRows && !$placeBefore)	{
						$tRows[]= $addEditRows;
					}
				}
			}
		}

		return $tRows;
	}
	/**
	 * This method returns the additional data's content as HTML structure
	 *
	 * @param	array			$PA: information related to the field
	 * @param	t3lib_tceform	$fobj: reference to calling TCEforms object
	 *
	 * @return	string	The HTML for the form field
	 */
	public function displayAdditionalData($PA, $fobj) {
		if (empty($PA['row']['data_var'])) {
			$html = $GLOBALS['LANG']->sL('LLL:EXT:devlog/locallang_db.xml:tx_devlog.no_extra_data');
		}
		else {
			$data = unserialize($PA['row']['data_var']);
			$html = t3lib_div::view_array($data);
		}
		return $html;
	}
    /**
     * Shows detailed information for a single installation of TYPO3
     *
     * @param	string		KEY pointing to installation
     * @return	string		HTML content
     */
    function singleSite($exp)
    {
        $all = $this->globalSiteInfo[$exp];
        // General information:
        $content = '
			<h2>' . htmlspecialchars($all['siteInfo']['sitename'] . ' (DB: ' . $all['siteInfo']['TYPO3_db']) . ')</h2>
			<hr />

			<h3>Main details:</h3>

			LINKS: <a href="' . htmlspecialchars($all['siteInfo']['URL']) . '" target="' . $this->targetWindow . '">Site</a> / <a href="' . htmlspecialchars($all['siteInfo']['ADMIN_URL']) . '" target="' . $this->targetWindowAdmin . '">Admin</a> / <a href="' . htmlspecialchars($all['siteInfo']['INSTALL_URL']) . '" target="' . $this->targetWindowInstall . '">Install</a>
			<br /><br />';
        // Add all information in globalSiteInfo array:
        $content .= t3lib_div::view_array($all);
        // Last-login:
        $content .= '
			<h3>Login-Log for last month:</h3>';
        $content .= $this->loginLog($all['siteInfo']['TYPO3_db']);
        // Return content
        return $content;
    }