Bug #14984 » editpanels-javascript-dialog-charset-fix.diff

Administrator Admin, 2005-09-21 12:57

View differences:

t3lib/class.t3lib_tsfebeuserauth.php 21 Sep 2005 10:42:07 -0000
870 870
	 * IF the global variable $LOCAL_LANG is NOT an array (yet) then this function loads the global $LOCAL_LANG array with the content of "sysext/lang/locallang_tsfe.php" so that the values therein can be used for labels in the Admin Panel
871 871
	 *
872 872
	 * @param	string		Key for a label in the $LOCAL_LANG array of "sysext/lang/locallang_tsfe.php"
873
	 * @param	boolean		If set, the string won't be converted to utf-8 entities, but left in the current users charSet
873 874
	 * @return	string		The value for the $key
874 875
	 */
875
	function extGetLL($key)	{
876
	function extGetLL($key,$noConvert=0)	{
876 877
		global $LOCAL_LANG;
877 878
		if (!is_array($LOCAL_LANG))	{
878 879
			$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_tsfe.php');
......
882 883

  
883 884
		$labelStr = htmlspecialchars($GLOBALS['LANG']->getLL($key));	// Label string in the default backend output charset.
884 885

  
885
			// Convert to utf-8, then to entities:
886
		if ($GLOBALS['LANG']->charSet!='utf-8')	{
887
			$labelStr = $GLOBALS['LANG']->csConvObj->utf8_encode($labelStr,$GLOBALS['LANG']->charSet);
886
		if (!$noConvert)	{
887
				// Convert to utf-8, then to entities:
888
			if ($GLOBALS['LANG']->charSet!='utf-8')	{
889
				$labelStr = $GLOBALS['LANG']->csConvObj->utf8_encode($labelStr,$GLOBALS['LANG']->charSet);
890
			}
891
			$labelStr = $GLOBALS['LANG']->csConvObj->utf8_to_entities($labelStr);
888 892
		}
889
		$labelStr = $GLOBALS['LANG']->csConvObj->utf8_to_entities($labelStr);
890 893

  
891 894
			// Return the result:
892 895
		return $labelStr;
typo3/sysext/cms/tslib/class.tslib_content.php 21 Sep 2005 10:42:08 -0000
6613 6662
						if ($dataArr[$hideField])	{
6614 6663
							$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/button_unhide.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_unhide').'" align="top" alt="" title="" />',$formName,'unhide');
6615 6664
						} else {
6616
							$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/button_hide.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_hide').'" align="top" alt="" title="" />',$formName,'hide','',$BE_USER->extGetLL('p_hideConfirm'));
6665
							$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/button_hide.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_hide').'" align="top" alt="" title="" />',$formName,'hide','',$BE_USER->extGetLL('p_hideConfirm', 1));
6617 6666
						}
6618 6667
					}
6619 6668
					if (isset($allow['new']))	{
......
6623 6672
							$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/new_record.gif" width="16" height="12" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_newRecordAfter').'" align="top" alt="" title="" />',$formName,'new',$currentRecord);
6624 6673
						}
6625 6674
					}
6626
					if (isset($allow['delete']))		{$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/delete_record.gif" width="12" height="12" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_delete').'" align="top" alt="" title="" />',$formName,'delete','',$BE_USER->extGetLL('p_deleteConfirm'));	}
6675
					if (isset($allow['delete']))		{$panel.=$this->editPanelLinkWrap('<img src="t3lib/gfx/delete_record.gif" width="12" height="12" vspace="1" hspace="2" border="0" title="'.$BE_USER->extGetLL('p_delete').'" align="top" alt="" title="" />',$formName,'delete','',$BE_USER->extGetLL('p_deleteConfirm', 1));	}
6627 6676

  
6628 6677
						//	Final
6629 6678
					$labelTxt = $this->stdWrap($conf['label'],$conf['label.']);
......
6754 6803
			}
6755 6804
		} else {
6756 6805
			if ($confirm)	{
6757
				$cf1="if (confirm(unescape('".t3lib_div::rawurlencodeJS($confirm)."'))){";
6806
				$cf1="if (confirm(".$GLOBALS['LANG']->JScharCode($confirm).")){";
6758 6807
				$cf2='}';
6759 6808
			} else {
6760 6809
				$cf1=$cf2='';
(1-1/3)