当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_div::formatForTextarea方法代码示例

本文整理汇总了PHP中t3lib_div::formatForTextarea方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::formatForTextarea方法的具体用法?PHP t3lib_div::formatForTextarea怎么用?PHP t3lib_div::formatForTextarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_div的用法示例。


在下文中一共展示了t3lib_div::formatForTextarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drawRTE

 /**
  * 	 * Adds the tinymce_rte to a textarea
  *
  * @param	object		$parentObject 	Reference to parent object, which is an instance of the TCEforms.
  * @param	string		$table 			The table name
  * @param	string		$field			The field name
  * @param	array		$row			The current row from which field is being rendered
  * @param	array		$PA				Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
  * @param	array		$specConf		"special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
  * @param	array		$thisConfig		Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
  * @param	string		$RTEtypeVal		Record "type" field value.
  * @param	string		$RTErelPath		Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
  * @param	integer		$thePidValue	PID value of record (true parent page id)
  * @return	string		HTML code for tinymce_rte
  */
 function drawRTE($parentObject, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)
 {
     $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig($GLOBALS['TSFE']->id);
     $localRteId = $parentObject->RTEcounter . '.';
     $rteConfig = $pageTSConfig['RTE.']['default.']['FE.'];
     if (is_array($parentObject->conf['tinymce_rte.'][$localRteId])) {
         $tmpConf = $this->array_merge_recursive_override($rteConfig, $parentObject->conf['tinymce_rte.'][$localRteId]);
     } elseif (is_array($parentObject->conf['tinymce_rte.']['1.'])) {
         $tmpConf = $this->array_merge_recursive_override($rteConfig, $parentObject->conf['tinymce_rte.']['1.']);
     } else {
         $tmpConf = $rteConfig;
     }
     // set a uniq rte id.
     $this->rteId = $parentObject->cObj->data['uid'] . $parentObject->RTEcounter;
     $config = $this->init($tmpConf, $this->rteId);
     $row = array('pid' => $GLOBALS['TSFE']->page['uid'], 'ISOcode' => $this->language);
     $config = $this->fixTinyMCETemplates($config, $row);
     if ($parentObject->RTEcounter == 1) {
         $GLOBALS['TSFE']->additionalHeaderData['tinymce_rte'] = $this->getCoreScript($config);
     }
     $code .= $this->getInitScript($config['init.']);
     //loads the current Value and create the textarea
     $value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
     $code .= $this->triggerField($PA['itemFormElName']);
     $code .= '<textarea id="RTEarea' . $this->rteId . '" class="tinymce_rte" name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="30" cols="100">' . t3lib_div::formatForTextarea($value) . '</textarea>';
     return $code;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:42,代码来源:class.tx_tinymce_rte_pi1.php

示例2: main

 /**
  * The main function in the class
  *
  * @return	string		HTML content
  */
 function main()
 {
     $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)) {
                 $pidOfRecord = $rec['pid'];
                 $output .= '<input type="checkbox" name="show_path" value="1"' . (t3lib_div::_POST('show_path') ? ' checked="checked"' : '') . '/> Show path and rootline of record<br/>';
                 if (t3lib_div::_POST('show_path')) {
                     $output .= '<br/>Path of PID ' . $pidOfRecord . ': <em>' . t3lib_BEfunc::getRecordPath($pidOfRecord, '', 30) . '</em><br/>';
                     $output .= 'RL:' . Tx_Extdeveval_Compatibility::viewArray(t3lib_BEfunc::BEgetRootLine($pidOfRecord)) . '<br/>';
                     $output .= 'FLAGS:' . ($rec['deleted'] ? ' <b>DELETED</b>' : '') . ($rec['pid'] == -1 ? ' <b>OFFLINE VERSION of ' . $rec['t3ver_oid'] . '</b>' : '') . '<br/><hr/>';
                 }
                 if (t3lib_div::_POST('_EDIT')) {
                     $output .= '<hr/>Edit:<br/><br/>';
                     $output .= '<input type="submit" name="_SAVE" value="SAVE" /><br/>';
                     foreach ($rec as $field => $value) {
                         $output .= '<b>' . htmlspecialchars($field) . ':</b><br/>';
                         if (count(explode(chr(10), $value)) > 1) {
                             $output .= '<textarea name="record[' . $table . '][' . $uid . '][' . $field . ']" cols="100" rows="10">' . t3lib_div::formatForTextarea($value) . '</textarea><br/>';
                         } else {
                             $output .= '<input name="record[' . $table . '][' . $uid . '][' . $field . ']" value="' . htmlspecialchars($value) . '" size="100" /><br/>';
                         }
                     }
                 } 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 .= '<br/>' . md5(implode($rec));
                         $output .= Tx_Extdeveval_Compatibility::viewArray($rec);
                     }
                 }
             } else {
                 $output .= 'No record existed!';
             }
         }
     }
     return $output;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:57,代码来源:class.tx_extdeveval_rawedit.php

示例3: getTextarea

    function getTextarea($parentObject, $PA, $value, $config)
    {
        $code = $this->triggerField($PA['itemFormElName']);
        $code .= '<textarea id="RTEarea' . $parentObject->RTEcounter . '" class="tinymce_rte" name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="30" cols="100">' . t3lib_div::formatForTextarea($value) . '</textarea>';
        if (!$config['useFEediting']) {
            $config['init.']['window'] = 'self';
            $config['init.']['element_id'] = 'RTEarea' . $parentObject->RTEcounter;
            $config['init.']['reAddCss'] = 'true';
            $code .= '
				<script type="text/javascript">
					top.tinyMCE.execCommand("mceAddFrameControl", false, ' . $this->parseConfig($config['init.']) . ');
				</script>
			';
        } else {
            $code .= $this->getCoreScript($config);
            $code .= $this->getInitScript($config['init.']);
        }
        return $code;
    }
开发者ID:sercagil,项目名称:TYPO3-tinymce_rte,代码行数:19,代码来源:class.tx_tinymce_rte_base.php

示例4: renderTextareaBox

 /**
  * renders a textarea with default value
  *
  * @param	string		field prefix
  * @param	string		default value
  * @return	string		the complete textarea
  */
 function renderTextareaBox($prefix, $value)
 {
     $onCP = $this->getOnChangeParts($prefix);
     return $this->wopText($prefix) . $onCP[0] . '<textarea name="' . $this->piFieldName('wizArray_upd') . $prefix . '" style="width:600px;" rows="10" wrap="off" onchange="' . $onCP[1] . '" title="' . htmlspecialchars('WOP:' . $prefix) . '"' . $this->wop($prefix) . '>' . t3lib_div::formatForTextarea($value) . '</textarea>';
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:12,代码来源:class.tx_kickstarter_sectionbase.php

示例5: wizard_step5


//.........这里部分代码省略.........
lib.' . $menuType . '.1.NO.wrap = ' . $this->makeWrap($menu_normal) . ($menu_normal['I-class'] ? '
lib.' . $menuType . '.1.NO.imgParams = class="' . htmlspecialchars($menu_normal['I-class']) . '" ' : '') . '
lib.' . $menuType . '.1.NO {
	XY = ' . ($menu_normal['I-width'] ? $menu_normal['I-width'] : 150) . ',' . ($menu_normal['I-height'] ? $menu_normal['I-height'] : 25) . '
	backColor = ' . ($menu_normal['backColorGuess'] ? $menu_normal['backColorGuess'] : '#FFFFFF') . '
	10 = TEXT
	10.text.field = title // nav_title
	10.fontColor = #333333
	10.fontSize = 12
	10.offset = 15,15
	10.fontFace = t3lib/fonts/nimbus.ttf
}
	';
                if ($mouseOver) {
                    $typoScript .= '
lib.' . $menuType . '.1.RO < lib.' . $menuType . '.1.NO
lib.' . $menuType . '.1.RO = 1
lib.' . $menuType . '.1.RO {
	backColor = ' . t3lib_div::modifyHTMLColorAll($menu_normal['backColorGuess'] ? $menu_normal['backColorGuess'] : '#FFFFFF', -20) . '
	10.fontColor = red
}
			';
                }
                if (is_array($menu_active)) {
                    $typoScript .= '
lib.' . $menuType . '.1.ACT < lib.' . $menuType . '.1.NO
lib.' . $menuType . '.1.ACT = 1
lib.' . $menuType . '.1.ACT.wrap = ' . $this->makeWrap($menu_active) . ($menu_active['I-class'] ? '
lib.' . $menuType . '.1.ACT.imgParams = class="' . htmlspecialchars($menu_active['I-class']) . '" ' : '') . '
lib.' . $menuType . '.1.ACT {
	backColor = ' . ($menu_active['backColorGuess'] ? $menu_active['backColorGuess'] : '#FFFFFF') . '
}
			';
                }
            } else {
                $typoScript = '
lib.' . $menuType . ' = HMENU
lib.' . $menuType . '.entryLevel = ' . $menuTypeEntryLevel . '
' . (count($totalWrap) ? 'lib.' . $menuType . '.wrap = ' . ereg_replace('[' . chr(10) . chr(13) . ']', '', implode('|', $totalWrap)) : '') . '
lib.' . $menuType . '.1 = TMENU
lib.' . $menuType . '.1.NO {
	allWrap = ' . $this->makeWrap($menu_normal) . ($menu_normal['A-class'] ? '
	ATagParams = class="' . htmlspecialchars($menu_normal['A-class']) . '"' : '') . '
}
	';
                if (is_array($menu_active)) {
                    $typoScript .= '
lib.' . $menuType . '.1.ACT = 1
lib.' . $menuType . '.1.ACT {
	allWrap = ' . $this->makeWrap($menu_active) . ($menu_active['A-class'] ? '
	ATagParams = class="' . htmlspecialchars($menu_active['A-class']) . '"' : '') . '
}
			';
                }
            }
            // Output:
            // HTML defaults:
            $outputString .= '
			<br/>
			<br/>
			Here is the HTML code from the Template that encapsulated the menu:
			<hr/>
			<pre>' . htmlspecialchars($menuPart_HTML) . '</pre>
			<hr/>
			<br/>';
            if (trim($menu_normal['wrap']) != '|') {
                $outputString .= 'It seems that the menu consists of menu items encapsulated with "' . htmlspecialchars(str_replace('|', ' ... ', $menu_normal['wrap'])) . '". ';
            } else {
                $outputString .= 'It seems that the menu consists of menu items not wrapped in any block tags except A-tags. ';
            }
            if (count($totalWrap)) {
                $outputString .= 'It also seems that the whole menu is wrapped in this tag: "' . htmlspecialchars(str_replace('|', ' ... ', implode('|', $totalWrap))) . '". ';
            }
            if ($menu_normal['bulletwrap']) {
                $outputString .= 'Between the menu elements there seems to be a visual division element with this HTML code: "' . htmlspecialchars($menu_normal['bulletwrap']) . '". That will be added between each element as well. ';
            }
            if ($GMENU) {
                $outputString .= 'The menu items were detected to be images - TYPO3 will try to generate graphical menu items automatically (GMENU). You will need to customize the look of these before it will match the originals! ';
            }
            if ($mouseOver) {
                $outputString .= 'It seems like a mouseover functionality has been applied previously, so roll-over effect has been applied as well.  ';
            }
            $outputString .= '<br/><br/>';
            $outputString .= 'Based on this analysis, this TypoScript configuration for the menu is suggested:
			<br/><br/>';
            $outputString .= '<hr/>' . $this->syntaxHLTypoScript($typoScript) . '<hr/><br/>';
            $outputString .= 'You can fine tune the configuration here before it is saved:<br/>';
            $outputString .= '<textarea name="CFG[menuCode]"' . $GLOBALS['TBE_TEMPLATE']->formWidthText() . ' rows="10">' . t3lib_div::formatForTextarea($typoScript) . '</textarea><br/><br/>';
            $outputString .= '<input type="hidden" name="SET[wiz_step]" value="' . $menuTypeNextStep . '" />';
            $outputString .= '<input type="submit" name="_" value="Write ' . $menuTypeText . ' TypoScript code" />';
        } else {
            $outputString .= '
				The basics of your website should be working now. It seems like you did not map the ' . $menuTypeText . ' to any element, so the menu configuration process will be skipped.<br/>
			';
            $outputString .= '<input type="hidden" name="SET[wiz_step]" value="' . $menuTypeNextStep . '" />';
            $outputString .= '<input type="submit" name="_" value="Next..." />';
        }
        // Add output:
        $this->content .= $this->doc->section('Step 5' . $menuTypeLetter . ': Trying to create dynamic menu', $outputString, 0, 1);
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:index.php

示例6: makeSaveForm

    /**
     * Create configuration form
     *
     * @param	array		Form configurat data
     * @param	array		Table row accumulation variable. This is filled with table rows.
     * @return	void		Sets content in $this->content
     */
    function makeSaveForm($inData, &$row)
    {
        global $LANG;
        // Presets:
        $row[] = '
			<tr class="tableheader bgColor5">
				<td colspan="2">' . $LANG->getLL('makesavefo_presets', 1) . '</td>
			</tr>';
        $opt = array('');
        $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_impexp_presets', '(public>0 OR user_uid=' . intval($GLOBALS['BE_USER']->user['uid']) . ')' . ($inData['pagetree']['id'] ? ' AND (item_uid=' . intval($inData['pagetree']['id']) . ' OR item_uid=0)' : ''));
        if (is_array($presets)) {
            foreach ($presets as $presetCfg) {
                $opt[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']' . ($presetCfg['public'] ? ' [Public]' : '') . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? ' [Own]' : '');
            }
        }
        $row[] = '
				<tr class="bgColor4">
					<td><strong>' . $LANG->getLL('makesavefo_presets', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'presets', $GLOBALS['BACK_PATH'], '') . '</td>
					<td>
						' . $LANG->getLL('makesavefo_selectPreset', 1) . '<br/>
						' . $this->renderSelectBox('preset[select]', '', $opt) . '
						<br/>
						<input type="submit" value="' . $LANG->getLL('makesavefo_load', 1) . '" name="preset[load]" />
						<input type="submit" value="' . $LANG->getLL('makesavefo_save', 1) . '" name="preset[save]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
						<input type="submit" value="' . $LANG->getLL('makesavefo_delete', 1) . '" name="preset[delete]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
						<input type="submit" value="' . $LANG->getLL('makesavefo_merge', 1) . '" name="preset[merge]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
						<br/>
						' . $LANG->getLL('makesavefo_titleOfNewPreset', 1) . '
						<input type="text" name="tx_impexp[preset][title]" value="' . htmlspecialchars($inData['preset']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
						<label for="checkPresetPublic">' . $LANG->getLL('makesavefo_public', 1) . '</label>
						<input type="checkbox" name="tx_impexp[preset][public]" id="checkPresetPublic" value="1"' . ($inData['preset']['public'] ? ' checked="checked"' : '') . ' /><br/>
					</td>
				</tr>';
        // Output options:
        $row[] = '
			<tr class="tableheader bgColor5">
				<td colspan="2">' . $LANG->getLL('makesavefo_outputOptions', 1) . '</td>
			</tr>';
        // Meta data:
        $tempDir = $this->userTempFolder();
        if ($tempDir) {
            $thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg');
            array_unshift($thumbnails, '');
        } else {
            $thumbnails = FALSE;
        }
        $row[] = '
				<tr class="bgColor4">
					<td><strong>' . $LANG->getLL('makesavefo_metaData', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'metadata', $GLOBALS['BACK_PATH'], '') . '</td>
					<td>
							' . $LANG->getLL('makesavefo_title', 1) . ' <br/>
							<input type="text" name="tx_impexp[meta][title]" value="' . htmlspecialchars($inData['meta']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
							' . $LANG->getLL('makesavefo_description', 1) . ' <br/>
							<input type="text" name="tx_impexp[meta][description]" value="' . htmlspecialchars($inData['meta']['description']) . '"' . $this->doc->formWidth(30) . ' /><br/>
							' . $LANG->getLL('makesavefo_notes', 1) . ' <br/>
							<textarea name="tx_impexp[meta][notes]"' . $this->doc->formWidth(30, 1) . '>' . t3lib_div::formatForTextarea($inData['meta']['notes']) . '</textarea><br/>
							' . (is_array($thumbnails) ? '
							' . $LANG->getLL('makesavefo_thumbnail', 1) . '<br/>
							' . $this->renderSelectBox('tx_impexp[meta][thumbnail]', $inData['meta']['thumbnail'], $thumbnails) . '<br/>
							' . ($inData['meta']['thumbnail'] ? '<img src="' . $this->doc->backPath . '../' . substr($tempDir, strlen(PATH_site)) . $thumbnails[$inData['meta']['thumbnail']] . '" vspace="5" style="border: solid black 1px;" alt="" /><br/>' : '') . '
							' . $LANG->getLL('makesavefo_uploadThumbnail', 1) . '<br/>
							<input type="file" name="upload_1" ' . $this->doc->formWidth(30) . ' size="30" /><br/>
								<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($tempDir) . '" />
								<input type="hidden" name="file[upload][1][data]" value="1" /><br />
							' : '') . '
						</td>
				</tr>';
        // Add file options:
        $savePath = $this->userSaveFolder();
        $opt = array();
        if ($this->export->compress) {
            $opt['t3d_compressed'] = $LANG->getLL('makesavefo_t3dFileCompressed');
        }
        $opt['t3d'] = $LANG->getLL('makesavefo_t3dFile');
        $opt['xml'] = $LANG->getLL('makesavefo_xml');
        $row[] = '
				<tr class="bgColor4">
					<td><strong>' . $LANG->getLL('makesavefo_fileFormat', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'fileFormat', $GLOBALS['BACK_PATH'], '') . '</td>
					<td>' . $this->renderSelectBox('tx_impexp[filetype]', $inData['filetype'], $opt) . '<br/>
						' . $LANG->getLL('makesavefo_maxSizeOfFiles', 1) . '<br/>
						<input type="text" name="tx_impexp[maxFileSize]" value="' . htmlspecialchars($inData['maxFileSize']) . '"' . $this->doc->formWidth(10) . ' /><br/>
						' . ($savePath ? sprintf($LANG->getLL('makesavefo_filenameSavedInS', 1), substr($savePath, strlen(PATH_site))) . '<br/>
						<input type="text" name="tx_impexp[filename]" value="' . htmlspecialchars($inData['filename']) . '"' . $this->doc->formWidth(30) . ' /><br/>' : '') . '
					</td>
				</tr>';
        // Add buttons:
        $row[] = '
				<tr class="bgColor4">
					<td>&nbsp;</td>
					<td><input type="submit" value="' . $LANG->getLL('makesavefo_update', 1) . '" /> - <input type="submit" value="' . $LANG->getLL('makesavefo_downloadExport', 1) . '" name="tx_impexp[download_export]" />' . ($savePath ? ' - <input type="submit" value="' . $LANG->getLL('importdata_saveToFilename', 1) . '" name="tx_impexp[save_export]" />' : '') . '</td>
				</tr>';
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:99,代码来源:index.php

示例7: renderNote

    /**
     * Render the personal note including the form to save it again
     *
     * @return	string		The note
     */
    public function renderNote()
    {
        $content = '';
        $incoming = t3lib_div::_GP('data');
        // Saving / creating note:
        if (isset($incoming['note'])) {
            $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('success.message'));
            $content .= $flashMessage->render();
            $this->setQuickNote($incoming);
        }
        // get the note
        $note = $this->getQuickNote();
        // if encrypten is used, a password is required
        if ($this->confArr['encrypt'] == 1 && empty($incoming['password'])) {
            $content .= '<form method="post">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.password') . '<input type="text" name="data[password]" /><br /><br />
							<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:save', 1) . '" />
						</form>';
        } else {
            $passwordField = $passwordPrompt = '';
            // if encrypten is used, decrypt the note
            if ($this->confArr['encrypt'] == 1) {
                // decrypt only if there is a note available
                if ($note['note'] != '') {
                    $this->secure->setIV(base64_decode($note['securecode']));
                    $note['note'] = $this->secure->decrypt($incoming['password'], base64_decode($note['note']));
                }
                // additional password field if encryption is used
                $passwordField = $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:newPassword') . ': ' . '<input type="text" name="data[password]" /><br /><br />';
                $passwordPrompt = ' onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('remember_password') . '\')" ';
            }
            // Render textarea
            $styles = is_array($this->confArr) ? ' style="' . htmlspecialchars($this->confArr['styles']) . '" ' : '';
            $content .= '<form method="post">
					<textarea rows="30" cols="48"  name="data[note]"' . $styles . '>' . t3lib_div::formatForTextarea($note['note']) . '</textarea>
					<br /><br />
					' . $passwordField . '
					<input type="submit" ' . $passwordPrompt . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:save', 1) . '" />
					<input type="reset" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:cancel', 1) . '" />
				</form>';
        }
        return $content;
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:47,代码来源:class.tx_sysnotepad_task.php

示例8: drawRTE

    /**
     * Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....)
     * Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
     *
     * @param	object		Reference to parent object, which is an instance of the TCEforms.
     * @param	string		The table name
     * @param	string		The field name
     * @param	array		The current row from which field is being rendered
     * @param	array		Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
     * @param	array		"special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
     * @param	array		Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
     * @param	string		Record "type" field value.
     * @param	string		Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
     * @param	integer		PID value of record (true parent page id)
     * @return	string		HTML code for RTE!
     */
    function drawRTE(&$pObj, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)
    {
        // Transform value:
        $value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
        // Create item:
        $item = '
			' . $this->triggerField($PA['itemFormElName']) . '
			<textarea name="' . htmlspecialchars($PA['itemFormElName']) . '"' . $pObj->formWidthText('48', 'off') . ' rows="20" wrap="off" style="background-color: #99eebb;">' . t3lib_div::formatForTextarea($value) . '</textarea>';
        // Return form item:
        return $item;
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:27,代码来源:class.t3lib_rteapi.php

示例9: drawRTE


//.........这里部分代码省略.........
                while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
                    $this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
                }
            }
        }
        $this->contentISOLanguage = $this->contentISOLanguage ? $this->contentISOLanguage : ($GLOBALS['TSFE']->sys_language_isocode ? $GLOBALS['TSFE']->sys_language_isocode : 'en');
        $this->contentTypo3Language = $this->contentTypo3Language ? $this->contentTypo3Language : $GLOBALS['TSFE']->lang;
        if ($this->contentTypo3Language == 'default') {
            $this->contentTypo3Language = 'en';
        }
        // Character set
        $this->charset = $TSFE->renderCharset;
        $this->OutputCharset = $TSFE->metaCharset ? $TSFE->metaCharset : $TSFE->renderCharset;
        // Set the charset of the content
        $this->contentCharset = $TSFE->csConvObj->charSetArray[$this->contentTypo3Language];
        $this->contentCharset = $this->contentCharset ? $this->contentCharset : 'iso-8859-1';
        $this->contentCharset = trim($TSFE->config['config']['metaCharset']) ? trim($TSFE->config['config']['metaCharset']) : $this->contentCharset;
        /* =======================================
         * TOOLBAR CONFIGURATION
         * =======================================
         */
        $this->initializeToolbarConfiguration();
        /* =======================================
         * SET STYLES
         * =======================================
         */
        $width = 460 + ($this->TCEform->docLarge ? 150 : 0);
        if (isset($this->thisConfig['RTEWidthOverride'])) {
            if (strstr($this->thisConfig['RTEWidthOverride'], '%')) {
                if ($this->client['browser'] != 'msie') {
                    $width = intval($this->thisConfig['RTEWidthOverride']) > 0 ? $this->thisConfig['RTEWidthOverride'] : '100%';
                }
            } else {
                $width = intval($this->thisConfig['RTEWidthOverride']) > 0 ? intval($this->thisConfig['RTEWidthOverride']) : $width;
            }
        }
        $RTEWidth = strstr($width, '%') ? $width : $width . 'px';
        $editorWrapWidth = strstr($width, '%') ? $width : $width + 2 . 'px';
        $height = 380;
        $RTEHeightOverride = intval($this->thisConfig['RTEHeightOverride']);
        $height = $RTEHeightOverride > 0 ? $RTEHeightOverride : $height;
        $RTEHeight = $height . 'px';
        $editorWrapHeight = $height + 2 . 'px';
        $this->RTEWrapStyle = $this->RTEWrapStyle ? $this->RTEWrapStyle : ($this->RTEdivStyle ? $this->RTEdivStyle : 'height:' . $editorWrapHeight . '; width:' . $editorWrapWidth . ';');
        $this->RTEdivStyle = $this->RTEdivStyle ? $this->RTEdivStyle : 'position:relative; left:0px; top:0px; height:' . $RTEHeight . '; width:' . $RTEWidth . '; border: 1px solid black;';
        /* =======================================
         * LOAD JS, CSS and more
         * =======================================
         */
        $pageRenderer = $this->getPageRenderer();
        // Preloading the pageStyle and including RTE skin stylesheets
        $this->addPageStyle();
        $this->addSkin();
        // Re-initialize the scripts array so that only the cumulative set of plugins of the last RTE on the page is used
        $this->cumulativeScripts[$this->TCEform->RTEcounter] = array();
        $this->includeScriptFiles($this->TCEform->RTEcounter);
        $this->buildJSMainLangFile($this->TCEform->RTEcounter);
        // Register RTE in JS:
        $this->TCEform->additionalJS_post[] = $this->wrapCDATA($this->registerRTEinJS($this->TCEform->RTEcounter, '', '', '', $textAreaId));
        // Set the save option for the RTE:
        $this->TCEform->additionalJS_submit[] = $this->setSaveRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
        // Loading ExtJs JavaScript files and inline code, if not configured in TS setup
        if (!$GLOBALS['TSFE']->isINTincScript() || !is_array($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.'])) {
            $pageRenderer->loadExtJs();
            $pageRenderer->enableExtJSQuickTips();
            if (!$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['enableCompressedScripts']) {
                $pageRenderer->enableExtJsDebug();
            }
        }
        $pageRenderer->addCssFile($this->siteURL . 't3lib/js/extjs/ux/resize.css');
        $pageRenderer->addJsFile($this->siteURL . 't3lib/js/extjs/ux/ext.resizable.js');
        $pageRenderer->addJsFile($this->siteURL . '/t3lib/js/extjs/notifications.js');
        if ($this->TCEform->RTEcounter == 1) {
            $this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->wrapCDATA($this->loadJScode($this->TCEform->RTEcounter));
        }
        $this->TCEform->additionalJS_initial = $this->loadJSfiles($this->TCEform->RTEcounter);
        if ($GLOBALS['TSFE']->isINTincScript()) {
            $GLOBALS['TSFE']->additionalHeaderData['rtehtmlarea'] = $pageRenderer->render();
        }
        /* =======================================
         * DRAW THE EDITOR
         * =======================================
         */
        // Transform value:
        $value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
        // Further content transformation by registered plugins
        foreach ($this->registeredPlugins as $pluginId => $plugin) {
            if ($this->isPluginEnabled($pluginId) && method_exists($plugin, "transformContent")) {
                $value = $plugin->transformContent($value);
            }
        }
        // draw the textarea
        $item = $this->triggerField($PA['itemFormElName']) . '
			<div id="pleasewait' . $textAreaId . '" class="pleasewait" style="display: block;" >' . $TSFE->csConvObj->conv($TSFE->getLLL('Please wait', $this->LOCAL_LANG), $this->charset, $TSFE->renderCharset) . '</div>
			<div id="editorWrap' . $textAreaId . '" class="editorWrap" style="visibility: hidden; ' . htmlspecialchars($this->RTEWrapStyle) . '">
			<textarea id="RTEarea' . $textAreaId . '" name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="0" cols="0" style="' . htmlspecialchars($this->RTEdivStyle) . '">' . t3lib_div::formatForTextarea($value) . '</textarea>
			</div>' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? '<div id="HTMLAreaLog"></div>' : '') . '
			';
        return $item;
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:class.tx_rtehtmlarea_pi2.php

示例10: FORM


//.........这里部分代码省略.........
                 }
                 if (strcmp('', $addParams)) {
                     $addParams = ' ' . $addParams;
                 }
             } else {
                 $addParams = '';
             }
             if ($conf['dontMd5FieldNames']) {
                 $fName = $confData['fieldname'];
             } else {
                 $fName = md5($confData['fieldname']);
             }
             // Accessibility: Set id = fieldname attribute:
             if ($conf['accessibility'] || $xhtmlStrict) {
                 $elementIdAttribute = ' id="' . $prefix . $fName . '"';
             } else {
                 $elementIdAttribute = '';
             }
             // Create form field based on configuration/type:
             switch ($confData['type']) {
                 case 'textarea':
                     $cols = trim($fParts[1]) ? intval($fParts[1]) : 20;
                     $compWidth = doubleval($conf['compensateFieldWidth'] ? $conf['compensateFieldWidth'] : $GLOBALS['TSFE']->compensateFieldWidth);
                     $compWidth = $compWidth ? $compWidth : 1;
                     $cols = t3lib_div::intInRange($cols * $compWidth, 1, 120);
                     $rows = trim($fParts[2]) ? t3lib_div::intInRange($fParts[2], 1, 30) : 5;
                     $wrap = trim($fParts[3]);
                     if ($conf['noWrapAttr'] || $wrap === 'disabled') {
                         $wrap = '';
                     } else {
                         $wrap = $wrap ? ' wrap="' . $wrap . '"' : ' wrap="virtual"';
                     }
                     $default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], str_replace('\\n', LF, trim($parts[2])));
                     $fieldCode = sprintf('<textarea name="%s"%s cols="%s" rows="%s"%s%s>%s</textarea>', $confData['fieldname'], $elementIdAttribute, $cols, $rows, $wrap, $addParams, t3lib_div::formatForTextarea($default));
                     break;
                 case 'input':
                 case 'password':
                     $size = trim($fParts[1]) ? intval($fParts[1]) : 20;
                     $compWidth = doubleval($conf['compensateFieldWidth'] ? $conf['compensateFieldWidth'] : $GLOBALS['TSFE']->compensateFieldWidth);
                     $compWidth = $compWidth ? $compWidth : 1;
                     $size = t3lib_div::intInRange($size * $compWidth, 1, 120);
                     $default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], trim($parts[2]));
                     if ($confData['type'] == 'password') {
                         $default = '';
                     }
                     $max = trim($fParts[2]) ? ' maxlength="' . t3lib_div::intInRange($fParts[2], 1, 1000) . '"' : "";
                     $theType = $confData['type'] == 'input' ? 'text' : 'password';
                     $fieldCode = sprintf('<input type="%s" name="%s"%s size="%s"%s value="%s"%s />', $theType, $confData['fieldname'], $elementIdAttribute, $size, $max, htmlspecialchars($default), $addParams);
                     break;
                 case 'file':
                     $size = trim($fParts[1]) ? t3lib_div::intInRange($fParts[1], 1, 60) : 20;
                     $fieldCode = sprintf('<input type="file" name="%s"%s size="%s"%s />', $confData['fieldname'], $elementIdAttribute, $size, $addParams);
                     break;
                 case 'check':
                     // alternative default value:
                     $default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], trim($parts[2]));
                     $checked = $default ? ' checked="checked"' : '';
                     $fieldCode = sprintf('<input type="checkbox" value="%s" name="%s"%s%s%s />', 1, $confData['fieldname'], $elementIdAttribute, $checked, $addParams);
                     break;
                 case 'select':
                     $option = '';
                     $valueParts = explode(',', $parts[2]);
                     // size
                     if (strtolower(trim($fParts[1])) == 'auto') {
                         $fParts[1] = count($valueParts);
                     }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:67,代码来源:class.tslib_content.php

示例11: updateDat


//.........这里部分代码省略.........
                    $clines = array();
                    $cc = 0;
                    foreach ($newAnalyser->fileInfo as $part) {
                        // Adding the function/class name to list:
                        if (is_array($part['sectionText']) && count($part['sectionText'])) {
                            $clines[] = '';
                            $clines[] = str_replace(' ', '&nbsp;', htmlspecialchars('      SECTION: ' . $part['sectionText'][0]));
                        }
                        if ($part['class']) {
                            $clines[] = '';
                            $clines[] = '';
                        }
                        // Add function / class header:
                        $line = $part['parentClass'] && !$part['class'] ? '    ' : '';
                        $line .= preg_replace('#\\{$#', '', trim($part['header']));
                        $line = str_replace(' ', '&nbsp;', htmlspecialchars($line));
                        // Only selected files can be analysed:
                        if (is_array($newDatArray['files'][$lFile_MD5])) {
                            // This will analyse the comment applied to the function and create a status of quality.
                            $status = $this->checkCommentQuality($part['cDat'], $part['class'] ? 1 : 0);
                            // Wrap in color if a warning applies!
                            $color = '';
                            switch ($status[2]) {
                                case 1:
                                    $color = '#666666';
                                    break;
                                case 2:
                                    $color = '#ff6600';
                                    break;
                                case 3:
                                    $color = 'red';
                                    break;
                            }
                            if ($color) {
                                $line = '<span style="color:' . $color . '; font-weight: bold;">' . $line . '</span><div style="margin-left: 50px; background-color: ' . $color . '; padding: 2px 2px 2px 2px;">' . htmlspecialchars(implode(chr(10), $status[0])) . '</div>';
                            }
                            // Another analysis to do is usage count for functions:
                            $uCountKey = 'H_' . t3lib_div::shortMD5($part['header']);
                            if ($doWrite && $gp_options['usageCount'] && is_array($newDatArray['files'][$lFile_MD5])) {
                                $newDatArray['files'][$lFile_MD5]['usageCount'][$uCountKey] = $this->countFunctionUsage($part['header'], $extPhpFiles, $extDir);
                            }
                            // If any usage is detected:
                            if (is_array($datArray['files'][$lFile_MD5]['usageCount'])) {
                                if ($datArray['files'][$lFile_MD5]['usageCount'][$uCountKey]['ALL']['TOTAL']) {
                                    $line .= '<div style="margin-left: 50px; background-color: #cccccc; padding: 2px 2px 2px 2px; font-weight: bold; ">Usage: ' . $datArray['files'][$lFile_MD5]['usageCount'][$uCountKey]['ALL']['TOTAL'] . '</div>';
                                    foreach ($datArray['files'][$lFile_MD5]['usageCount'][$uCountKey] as $fileKey => $fileStat) {
                                        if (substr($fileKey, 0, 4) == 'MD5_') {
                                            $line .= '<div style="margin-left: 75px; background-color: #999999; padding: 1px 2px 1px 2px;">File: ' . htmlspecialchars($fileStat['TOTAL'] . ' - ' . $fileStat['fileName']) . '</div>';
                                        }
                                    }
                                } else {
                                    $line .= '<div style="margin-left: 50px; background-color: red; padding: 2px 2px 2px 2px; font-weight: bold; ">NO USAGE COUNT!</div>';
                                }
                            }
                        }
                        $clines[] = $line;
                    }
                    // Make HTML table row:
                    $lines[] = '<tr' . (is_array($datArray['files'][$lFile_MD5]) ? ' class="bgColor5"' : ' class="nonSelectedRows"') . '>
						<td><input type="checkbox" name="selectThisFile[]" value="' . htmlspecialchars($lFile) . '"' . (is_array($datArray['files'][$lFile_MD5]) ? ' checked="checked"' : '') . ' /></td>
						<td nowrap="nowrap" valign="top">' . htmlspecialchars($lFile) . '</td>
						<td nowrap="nowrap" valign="top">' . t3lib_div::formatSize(filesize($extDir . $lFile)) . '</td>
						<td nowrap="nowrap">' . nl2br(implode(chr(10), $clines)) . '</td>
					</tr>';
                }
            }
            $content .= '
			<br /><br /><p><strong>PHP/INC files from extension:</strong></p>
			<table border="0" cellspacing="1" cellpadding="0">' . implode('', $lines) . '</table>';
            $content .= '
				<br />
				<strong>Package Title:</strong><br />
				<input type="text" name="title_of_collection" value="' . htmlspecialchars($datArray['meta']['title']) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth() . ' /><br />
				<strong>Package Description:</strong><br />
				<textarea name="descr_of_collection"' . $GLOBALS['TBE_TEMPLATE']->formWidthText() . ' rows="5">' . t3lib_div::formatForTextarea($datArray['meta']['descr']) . '</textarea><br />

				<input type="checkbox" name="options[usageCount]" value="1"' . ($datArray['meta']['options']['usageCount'] ? ' checked="checked"' : '') . ' /> Perform an internal usage count of functions and classes (can be VERY time consuming!)<br />
				<input type="checkbox" name="options[includeCodeAbstract]" value="1"' . ($datArray['meta']['options']['includeCodeAbstract'] ? ' checked="checked"' : '') . ' /> Include ' . $this->includeContent . ' bytes abstraction of functions (can be VERY space consuming)<br />

				<input type="submit" value="' . htmlspecialchars('Write/Update "ext_php_api.dat" file') . '" name="WRITE" />
			';
            #			$content.='<p>'.md5(serialize($datArray)).' MD5 - from current ext_php_api.dat file</p>';
            #			$content.='<p>'.md5(serialize($newDatArray)).' MD5 - new, from the selected files</p>';
            if ($doWrite) {
                $newDatArray['meta']['title'] = t3lib_div::_GP('title_of_collection');
                $newDatArray['meta']['descr'] = t3lib_div::_GP('descr_of_collection');
                $newDatArray['meta']['options']['usageCount'] = $gp_options['usageCount'];
                $newDatArray['meta']['options']['includeCodeAbstract'] = $gp_options['includeCodeAbstract'];
                t3lib_div::writeFile($extDir . 'ext_php_api.dat', serialize($newDatArray));
                $content = '<hr />';
                $content .= '<p><strong>ext_php_api.dat file written to extension directory, "' . $extDir . '"</strong></p>';
                $content .= '
					<input type="submit" value="Return..." name="_" />
				';
            }
        } else {
            $content = '<p>No PHP/INC files found extension directory.</p>';
        }
        return $content;
    }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:101,代码来源:class.tx_extdeveval_phpdoc.php

示例12: main

    /**
     * The main function in the class
     *
     * @return	string		HTML content
     */
    function main()
    {
        $inputCode = t3lib_div::_GP('input_code');
        $content = '';
        $content .= '
		<textarea rows="15" name="input_code" wrap="off"' . $GLOBALS['TBE_TEMPLATE']->formWidthText(48, 'width:98%;', 'off') . '>' . t3lib_div::formatForTextarea($inputCode) . '</textarea>
		<br />
		<input type="submit" name="highlight_php" value="PHP" />
		<input type="submit" name="highlight_ts" value="TypoScript" />
		<input type="submit" name="highlight_xml" value="XML" />
		<input type="submit" name="highlight_xml2array" value="xml2array()" />
		<br />
		<input type="checkbox" name="option_linenumbers" value="1"' . (t3lib_div::_GP('option_linenumbers') ? ' checked="checked"' : '') . ' /> Linenumbers (TS/PHP)<br />
		<input type="checkbox" name="option_blockmode" value="1"' . (t3lib_div::_GP('option_blockmode') ? ' checked="checked"' : '') . ' /> Blockmode (TS)<br />
		<input type="checkbox" name="option_analytic" value="1"' . (t3lib_div::_GP('option_analytic') ? ' checked="checked"' : '') . ' /> Analytic style (TS/XML)<br />
		<input type="checkbox" name="option_showparsed" value="1"' . (t3lib_div::_GP('option_showparsed') ? ' checked="checked"' : '') . ' /> Show parsed structure (TS/XML)<br />

		';
        if (trim($inputCode)) {
            // Highlight PHP
            if (t3lib_div::_GP('highlight_php')) {
                if (substr(trim($inputCode), 0, 2) != '<?') {
                    $inputCode = '<?php' . chr(10) . chr(10) . chr(10) . $inputCode . chr(10) . chr(10) . chr(10) . '?>';
                }
                $formattedContent = highlight_string($inputCode, 1);
                if (t3lib_div::_GP('option_linenumbers')) {
                    $lines = explode('<br />', $formattedContent);
                    foreach ($lines as $k => $v) {
                        $lines[$k] = '<font color="black">' . str_pad($k - 2, 4, ' ', STR_PAD_LEFT) . ':</font> ' . $v;
                    }
                    $formattedContent = implode('<br />', $lines);
                }
                // Remove regular linebreaks
                $formattedContent = preg_replace('#[' . chr(10) . chr(13) . ']#', '', $formattedContent);
                // Wrap in <pre> tags
                $content .= '<hr /><pre class="ts-hl">' . $formattedContent . '</pre>';
            }
            // Highlight TypoScript
            if (t3lib_div::_GP('highlight_ts')) {
                $tsparser = t3lib_div::makeInstance("t3lib_TSparser");
                if (t3lib_div::_GP('option_analytic')) {
                    $tsparser->highLightStyles = $this->highLightStyles_analytic;
                    $tsparser->highLightBlockStyles_basecolor = '';
                    $tsparser->highLightBlockStyles = $this->highLightBlockStyles;
                } else {
                    $tsparser->highLightStyles = $this->highLightStyles;
                }
                $tsparser->lineNumberOffset = 0;
                $formattedContent = $tsparser->doSyntaxHighlight($inputCode, t3lib_div::_GP('option_linenumbers') ? array($tsparser->lineNumberOffset) : '', t3lib_div::_GP('option_blockmode'));
                $content .= '<hr />' . $formattedContent;
                #debug($inputCode);
                #$tsparser->xmlToTypoScriptStruct($inputCode);
                if (t3lib_div::_GP('option_showparsed')) {
                    $content .= '<hr />' . Tx_Extdeveval_Compatibility::viewArray($tsparser->setup);
                    /*
                    ob_start();
                    print_r($tsparser->setup);
                    $content.='<hr /><pre>'.ob_get_contents().'</pre>';
                    ob_end_clean();
                    */
                }
            }
            // Highlight XML
            if (t3lib_div::_GP('highlight_xml')) {
                $formattedContent = $this->xmlHighLight($inputCode, t3lib_div::_GP('option_analytic') ? $this->highLightStyles_analytic : $this->highLightStyles);
                $content .= '<hr /><em>Notice: This highlighted version of the above XML data is parsed and then re-formatted. Therefore comments are not included and a 100% similarity with the source is not guaranteed. However the content should be just as valid XML as the source (except CDATA which is not detected as such!!!).</em><br><br>' . $formattedContent;
                if (t3lib_div::_GP('option_showparsed')) {
                    $treeDat = t3lib_div::xml2tree($inputCode);
                    $content .= '<hr />';
                    $content .= 'MD5: ' . md5(serialize($treeDat));
                    $content .= Tx_Extdeveval_Compatibility::viewArray($treeDat);
                }
            }
            // Highlight XML content parsable with xml2array()
            if (t3lib_div::_GP('highlight_xml2array')) {
                $formattedContent = $this->xml2arrayHighLight($inputCode);
                $content .= '<hr /><br>' . $formattedContent;
                if (t3lib_div::_GP('option_showparsed')) {
                    $treeDat = t3lib_div::xml2array($inputCode);
                    $content .= '<hr />';
                    $content .= 'MD5: ' . md5(serialize($treeDat));
                    $content .= Tx_Extdeveval_Compatibility::viewArray($treeDat);
                }
            }
        }
        return $content;
    }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:92,代码来源:class.tx_extdeveval_highlight.php

示例13: main

	function main($dir,$item,&$pObj) {

		global $LANG;


		if(!t3quixplorer_div::get_is_file($dir, $item)) t3quixplorer_div::showError($item.": ".$LANG->getLL("error.fileexists"));
		if(!t3quixplorer_div::get_show_item($dir, $item)) t3quixplorer_div::showError($item.": ".$LANG->getLL("error.accessfile"));
		$fname = t3quixplorer_div::get_abs_item($dir, $item);
		$fileinfo = t3lib_div::split_fileref($fname);
		$ext = $fileinfo['fileext'];
		$theight = ($GLOBALS["T3Q_VARS"]["textarea_height"] && is_numeric($GLOBALS["T3Q_VARS"]["textarea_height"]))?$GLOBALS["T3Q_VARS"]["textarea_height"]:20;


		$pObj->doc->JScode = '
<script id="prototype-script" type="text/javascript" src="../../t3scodehighlight/contrib/prototype/prototype.js">
</script>
<script src="../../t3scodehighlight/contrib/codepress/codepress.js" type="text/javascript" id="cp-script" lang="en-us"></script>
<link type="text/css" rel="stylesheet" href="../../t3scodehighlight/contrib/codepress/t3codepress.css">
</link>
<script src="../../t3scodehighlight/contrib/codepress/content/en-us.js" type="text/javascript" id="cp-script" lang="en-us"></script>
<script src="../../t3scodehighlight/contrib/codepress/t3codepress_t3lib_tceforms.js" type="text/javascript" id="t3codepress-t3libtceforms-script"></script>

				<script type="text/javascript">

					function closeDoc(){
						window.location=\''.t3quixplorer_div::make_link("list",$dir,NULL).'\';
					}
				</script>

			';

		$content= array();

		if(t3lib_div::_POST("dosave") && t3lib_div::_POST("dosave")=="yes") {
			// Save / Save As
			$item=basename(stripslashes(t3lib_div::_POST("fname")));
			$fname2=t3quixplorer_div::get_abs_item($dir, $item);
			if(!isset($item) || $item=="") t3quixplorer_div::showError($LANG->getLL("error.miscnoname"));
			if($fname!=$fname2 && @file_exists($fname2)) t3quixplorer_div::showError($item.": ".$LANG->getLL("error.itemdoesexist"));
			$this->savefile($fname2);
			$fname=$fname2;
		}

		// open file
		$fp = @fopen($fname, "r");
		if($fp===false) t3quixplorer_div::showError($item.": ".$LANG->getLL("error.openfile"));
		@fclose($fp);

		$fileContent = t3lib_div::getUrl($fname);

		// header
		$s_item=t3quixplorer_div::get_rel_item($dir,$item);	if(strlen($s_item)>50) $s_item="...".substr($s_item,-47);



		//$content[]=$s_item;

		//changed to absolute filename as of version 1.7 ... any complaints?
		$content[] = $fname;

		//$onkeydown = $GLOBALS['T3Q_VARS']['disable_tab'] ? '' : ' onkeydown="return catchTab(this,event)" ';

		$fileinfo = t3lib_div::split_fileref(t3quixplorer_div::get_abs_item($dir,$item));
		$lang = t3lib_div::_GP("highlight_lang");
		$ext = $fileinfo['fileext'];


        $readme = $this->getReadme($dir);
        if(strlen(trim($readme))){
        	$readme = '<div style="border: 1px solid red; background-color: yellow; padding: 10px; display:block;">'.$readme.'</div>';
        }else{
        	$readme = '';
        }
		if(!$lang){
			$lang = $ext;
		}
     if($item == 'setup.txt' || $item == 'config.txt'|| $item == 'constants.txt'){
		$content[]= $readme.'
		  <br />
		    <form id="editform" name="editform" method="post" action="'.t3quixplorer_div::make_link("edit",$dir,$item).'" >
		    <input type="hidden" name="dosave" value="yes"> '.
          '<code id="content" wrap="off" title=".ts" class="cp hideLanguage" style="height: 500px; color: silver; visibility: visible;">'.t3lib_div::formatForTextarea($fileContent).'</code>'
			.'<textarea id="content_ta" name="content_ta" rows="'.$theight.'" wrap="off" style="width: 460px; display: none;" class="cp fixed-font enable-tab">'.t3lib_div::formatForTextarea($fileContent).'</textarea>';

      }else{
		$content[]= $readme.'
		  <br />
		    <form id="editform" name="editform" method="post" action="'.t3quixplorer_div::make_link("edit",$dir,$item).'" >
		    <input type="hidden" name="dosave" value="yes"> '.
          '<code id="content" wrap="off" title=".'.$lang.'" class="cp hideLanguage" style="height: 500px; color: silver; visibility: visible;">'.t3lib_div::formatForTextarea($fileContent).'</code>'
			.'<textarea id="content_ta" name="content_ta" rows="'.$theight.'" wrap="off" style="width: 460px; display: none;" class="cp fixed-font enable-tab">'.t3lib_div::formatForTextarea($fileContent).'</textarea>';

      }



		$content[]= '
			  <br />
		      <table>
			    	<tr>
//.........这里部分代码省略.........
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:101,代码来源:ux_t3quixplorer_edit.php

示例14: drawCodeText

    /**
     * userfunc to call from flexform and init t3editor field or textarea with tab support
     *
     * @param array $PA
     * @param t3lib_TCEforms $fobj
     * @return string
     */
    public function drawCodeText($PA, &$fobj)
    {
        $this->_parameters['defaultExtras'] = $PA['fieldConf']['defaultExtras'];
        $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['typoscript_code']);
        $outCode = '';
        if ($extensionConfiguration['enable_t3editor'] && t3lib_extMgm::isLoaded('t3editor')) {
            $outCode = $this->_buildT3EditorCode($GLOBALS['SOBE'], $PA['itemFormElName'], $PA['itemFormElValue']);
        }
        if ($outCode == '') {
            $outCode = '<textarea
				name="' . $PA['itemFormElName'] . '"
				rows="' . $this->_parameters['numberOfRows'] . '"
				cols="' . $this->_parameters['numberOfCols'] . '"
				wrap="off"
				class="' . $this->_parameters['defaultExtras'] . '"
				style="width: 98%; height: 60%;"
				onchange="' . htmlspecialchars(implode('', $PA['fieldChangeFunc'])) . '"' . $PA['onFocus'] . '>' . t3lib_div::formatForTextarea($PA['itemFormElValue']) . '</textarea>';
        }
        return $outCode;
    }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:27,代码来源:class.tx_typoscriptcode_TCAform.php

示例15: renderOverview

    /**
     * Render the module content in HTML
     *
     * @param	array		Translation data for configuration
     * @param	integer		Sys language uid
     * @param	array		Configuration record
     * @return	string		HTML content
     */
    function renderOverview()
    {
        global $LANG;
        $sysLang = $this->sysLang;
        $accumObj = $this->l10ncfgObj->getL10nAccumulatedInformationsObjectForLanguage($sysLang);
        $accum = $accumObj->getInfoArray();
        $l10ncfg = $this->l10ncfg;
        $output = '';
        $showSingle = t3lib_div::_GET('showSingle');
        if ($l10ncfg['displaymode'] > 0) {
            $showSingle = $showSingle ? $showSingle : 'NONE';
            if ($l10ncfg['displaymode'] == 2) {
                $noAnalysis = TRUE;
            }
        } else {
            $noAnalysis = FALSE;
        }
        // Traverse the structure and generate HTML output:
        foreach ($accum as $pId => $page) {
            $output .= '<h3>' . $page['header']['icon'] . htmlspecialchars($page['header']['title']) . ' [' . $pId . ']</h3>';
            $tableRows = array();
            foreach ($accum[$pId]['items'] as $table => $elements) {
                foreach ($elements as $elementUid => $data) {
                    if (is_array($data['fields'])) {
                        $FtableRows = array();
                        $flags = array();
                        if (!$noAnalysis || $showSingle === $table . ':' . $elementUid) {
                            foreach ($data['fields'] as $key => $tData) {
                                if (is_array($tData)) {
                                    list(, $uidString, $fieldName) = explode(':', $key);
                                    list($uidValue) = explode('/', $uidString);
                                    $diff = '';
                                    $edit = TRUE;
                                    $noChangeFlag = !strcmp(trim($tData['diffDefaultValue']), trim($tData['defaultValue']));
                                    if ($uidValue === 'NEW') {
                                        $diff = '<em>' . $LANG->getLL('render_overview.new.message') . '</em>';
                                        $flags['new']++;
                                    } elseif (!isset($tData['diffDefaultValue'])) {
                                        $diff = '<em>' . $LANG->getLL('render_overview.nodiff.message') . '</em>';
                                        $flags['unknown']++;
                                    } elseif ($noChangeFlag) {
                                        $diff = $LANG->getLL('render_overview.nochange.message');
                                        $edit = TRUE;
                                        $flags['noChange']++;
                                    } else {
                                        $diff = $this->diffCMP($tData['diffDefaultValue'], $tData['defaultValue']);
                                        $flags['update']++;
                                    }
                                    if (!$this->modeOnlyChanged || !$noChangeFlag) {
                                        $fieldCells = array();
                                        $fieldCells[] = '<b>' . htmlspecialchars($fieldName) . '</b>' . ($tData['msg'] ? '<br/><em>' . htmlspecialchars($tData['msg']) . '</em>' : '');
                                        $fieldCells[] = nl2br(htmlspecialchars($tData['defaultValue']));
                                        $fieldCells[] = $edit && $this->modeWithInlineEdit ? $tData['fieldType'] === 'text' ? '<textarea name="' . htmlspecialchars('translation[' . $table . '][' . $elementUid . '][' . $key . ']') . '" cols="60" rows="5">' . t3lib_div::formatForTextarea($tData['translationValue']) . '</textarea>' : '<input name="' . htmlspecialchars('translation[' . $table . '][' . $elementUid . '][' . $key . ']') . '" value="' . htmlspecialchars($tData['translationValue']) . '" size="60" />' : nl2br(htmlspecialchars($tData['translationValue']));
                                        $fieldCells[] = $diff;
                                        if ($page['header']['prevLang']) {
                                            reset($tData['previewLanguageValues']);
                                            $fieldCells[] = nl2br(htmlspecialchars(current($tData['previewLanguageValues'])));
                                        }
                                        $FtableRows[] = '<tr class="db_list_normal"><td>' . implode('</td><td>', $fieldCells) . '</td></tr>';
                                    }
                                }
                            }
                        }
                        if (count($FtableRows) || $noAnalysis) {
                            // Link:
                            if ($this->modeShowEditLinks) {
                                reset($data['fields']);
                                list(, $uidString) = explode(':', key($data['fields']));
                                if (substr($uidString, 0, 3) !== 'NEW') {
                                    $editId = is_array($data['translationInfo']['translations'][$sysLang]) ? $data['translationInfo']['translations'][$sysLang]['uid'] : $data['translationInfo']['uid'];
                                    $editLink = ' - <a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[' . $data['translationInfo']['translation_table'] . '][' . $editId . ']=edit', $this->doc->backPath)) . '"><em>[' . $LANG->getLL('render_overview.clickedit.message') . ']</em></a>';
                                } else {
                                    $editLink = ' - <a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $data['translationInfo']['uid'] . '][localize]=' . $sysLang)) . '"><em>[' . $LANG->getLL('render_overview.clicklocalize.message') . ']</em></a>';
                                }
                            } else {
                                $editLink = '';
                            }
                            $tableRows[] = '<tr class="t3-row-header">
								<td colspan="2" style="width:300px;"><a href="' . htmlspecialchars('index.php?id=' . t3lib_div::_GET('id') . '&showSingle=' . rawurlencode($table . ':' . $elementUid)) . '">' . htmlspecialchars($table . ':' . $elementUid) . '</a>' . $editLink . '</td>
								<td colspan="3" style="width:200px;">' . htmlspecialchars(t3lib_div::arrayToLogString($flags)) . '</td>
							</tr>';
                            if (!$showSingle || $showSingle === $table . ':' . $elementUid) {
                                $tableRows[] = '<tr class="bgColor-20 tableheader">
									<td>Fieldname:</td>
									<td width="25%">Default:</td>
									<td width="25%">Translation:</td>
									<td width="25%">Diff:</td>
									' . ($page['header']['prevLang'] ? '<td width="25%">PrevLang:</td>' : '') . '
								</tr>';
                                $tableRows = array_merge($tableRows, $FtableRows);
                            }
                        }
//.........这里部分代码省略.........
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:101,代码来源:class.tx_l10nmgr_l10nHTMLListView.php


注:本文中的t3lib_div::formatForTextarea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。