Преглед изворни кода

Support of formatted case log edition (with inline images) in the legacy portal.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4225 a333f486-631f-4898-b8df-5754b55c2be0
dflaven пре 9 година
родитељ
комит
d2c5185ad1
3 измењених фајлова са 20 додато и 2 уклоњено
  1. 1 1
      application/portalwebpage.class.inc.php
  2. 16 1
      portal/index.php
  3. 3 0
      portal/portal.css

+ 1 - 1
application/portalwebpage.class.inc.php

@@ -170,7 +170,7 @@ try
 	});
 
 	//$('.resizable').resizable(); // Make resizable everything that claims to be resizable !
-	$('.caselog_header').click( function () { $(this).toggleClass('open').next('.caselog_entry').toggle(); });
+	$('.caselog_header').click( function () { $(this).toggleClass('open').next('.caselog_entry_html').toggle(); });
 			
 	$(document).ajaxSend(function(event, jqxhr, options) {
 		jqxhr.setRequestHeader('X-Combodo-Ajax', 'true');

+ 16 - 1
portal/index.php

@@ -1122,6 +1122,20 @@ EOF
 		$oP->add('<h1>'.$aEditFields[$sLogAttCode]['label'].'</h1>');
 		$oP->add($aEditFields[$sLogAttCode]['value']);
 		$oP->add('</div>');
+		// Replace the text area with CKEditor
+		// To change the default settings of the editor,
+		// a) edit the file /js/ckeditor/config.js
+		// b) or override some of the configuration settings, using the second parameter of ckeditor()
+		$aConfig = array();
+		$sLanguage = strtolower(trim(UserRights::GetUserLanguage()));
+		$aConfig['font_style'] = $sLanguage;
+		$aConfig['language'] = $sLanguage;
+		$aConfig['contentsLanguage'] = $sLanguage;
+		$aConfig['extraPlugins'] = 'disabler';
+		$aConfig['placeholder'] = Dict::S('UI:CaseLogTypeYourTextHere');
+		$sConfigJS = json_encode($aConfig);
+		
+		$oP->add_ready_script("$('#input_$sLogAttCode').ckeditor(function() { /* callback code */ }, $sConfigJS);"); // Transform $iId into a CKEdit
 	}
 	else
 	{
@@ -1133,7 +1147,8 @@ EOF
 
 	$oP->add('</table>');
 	$oP->add('</div>');
-
+	
+	$oP->add_ready_script(InlineImage::EnableCKEditorImageUpload($oObj, 'zzzzz'));
 	$oP->WizardFormEnd();
 	$oP->add('</div>');
 }

+ 3 - 0
portal/portal.css

@@ -232,3 +232,6 @@ div.edit_item span div table tbody tr td textarea{
 div#ticket_shortcuts form {
 	display: inline-block;
 }
+.cke_contents {
+	border: 1px #C8C9CA solid !important;
+}