style.xslt 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  15. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  16. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  17. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  18. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  19. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  20. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  21. xmlns:out="dummy-uri"
  22. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  23. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  24. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb">
  25. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  26. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  27. <xsl:template match="rdb:mypages">
  28. <xsl:variable name="mode" select="@mode"/>
  29. <!-- When in properties mode, find out if this dialog should be read-only. -->
  30. <out:variable name="readOnly" select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:permissions and not(contains(concat(' ',/root/cm:queryResponse/cm:queryReply[1]/*/cm:permissions,' '),' write '))"/>
  31. <!-- The language that will be in focus in the dropdown -->
  32. <out:variable name="currentLang">
  33. <out:choose>
  34. <out:when test="env/param[@name='m_mp_language']">
  35. <out:value-of select="env/param[@name='m_mp_language']"/>
  36. </out:when>
  37. <out:otherwise>
  38. <out:value-of select="user/param[@name='contentLocale']"/>
  39. </out:otherwise>
  40. </out:choose>
  41. </out:variable>
  42. <out:variable name="titleControlName" select="concat('m_mp_mlt_title_', $currentLang)"/>
  43. <out:variable name="instructionControlName" select="concat('m_mp_mlt_instructions_', $currentLang)"/>
  44. <!-- Common script -->
  45. <script language="JavaScript">
  46. var cmdForm = null;
  47. var title = null;
  48. var instructions = null;
  49. var g_initTitleControls = <out:value-of select="not(key('env-param', 'm_mp_titleStyle')) or key('env-param', 'm_mp_titleStyle') = 'custom' or key('env-param', 'm_mp_titleStyle') = ''"/>;
  50. var g_initInstructionsControls = <out:value-of select="not(key('env-param', 'm_mp_instructionsStyle')) or key('env-param', 'm_mp_instructionsStyle') = 'custom' or key('env-param', 'm_mp_instructionsStyle') = ''"/>;
  51. var g_readOnly = <out:value-of select="$readOnly"/>;
  52. var isBidiEnabled = <out:value-of select="boolean($isBidiEnabled='true')"/>;
  53. function initTextControls()
  54. {
  55. cmdForm = document.pform;
  56. title = cmdForm.elements['<out:value-of select="xtsext:javascriptencode($titleControlName)"/>'];
  57. instructions = cmdForm.elements['<out:value-of select="xtsext:javascriptencode($instructionControlName)"/>'];
  58. if (!g_readOnly)
  59. {
  60. // Update title styles:
  61. if (g_initTitleControls)
  62. updateTitleText();
  63. // Update instructions styles:
  64. if (g_initInstructionsControls )
  65. updateInstructionsText();
  66. }
  67. }
  68. function updateTitleText()
  69. {
  70. if (cmdForm.m_mp_titleFont.selectedIndex != -1) {
  71. title.style.fontFamily = cmdForm.m_mp_titleFont.options[cmdForm.m_mp_titleFont.selectedIndex].value;
  72. title.style.fontSize = cmdForm.m_mp_titleFontSize.options[cmdForm.m_mp_titleFontSize.selectedIndex].value;
  73. }
  74. if (cmdForm.m_mp_titleColour.value != '' &amp;&amp; cmdForm.m_mp_titleColour.value != 'default')
  75. title.style.color = cmdForm.m_mp_titleColour.value;
  76. title.style.fontWeight = (cmdForm.m_mp_titleBold.value == "true") ? "bold" : "normal" ;
  77. if (cmdForm.m_mp_titleBold.value == "true")
  78. press_titleStyle('title_bold');
  79. title.style.fontStyle = (cmdForm.m_mp_titleItalic.value == "true") ? "italic" : "normal" ;
  80. if (cmdForm.m_mp_titleItalic.value == "true")
  81. press_titleStyle('title_italic');
  82. title.style.textDecoration = (cmdForm.m_mp_titleUnderline.value == "true") ? "underline" : "none" ;
  83. if (cmdForm.m_mp_titleUnderline.value == "true")
  84. press_titleStyle('title_underline');
  85. title.style.textAlign = cmdForm.m_mp_titleAlign.value;
  86. if (cmdForm.m_mp_titleAlign.value != '')
  87. eval("press_titleStyle('title_align_" + cmdForm.m_mp_titleAlign.value + "')");
  88. if (isBidiEnabled){
  89. title.dir = ((bidi.baseTextDirection == "ltr" || bidi.baseTextDirection == "rtl") ? bidi.baseTextDirection : bidi.resolveStrBtd(title.value));
  90. if (bidi.baseTextDirection == "auto"){
  91. title.onkeyup = function() {bidi.onkeyup(title);};
  92. }
  93. }
  94. }
  95. function updateInstructionsText()
  96. {
  97. if (cmdForm.m_mp_instructionsFont.selectedIndex != -1) {
  98. instructions.style.fontFamily = cmdForm.m_mp_instructionsFont.options[cmdForm.m_mp_instructionsFont.selectedIndex].value;
  99. instructions.style.fontSize = cmdForm.m_mp_instructionsFontSize.options[cmdForm.m_mp_instructionsFontSize.selectedIndex].value;
  100. }
  101. instructions.style.fontWeight = (cmdForm.m_mp_instructionsBold.value == "true") ? "bold" : "normal" ;
  102. if (cmdForm.m_mp_instructionsBold.value == "true")
  103. press_tbInstructionsStyle('i_bold');
  104. instructions.style.fontStyle = (cmdForm.m_mp_instructionsItalic.value == "true") ? "italic" : "normal" ;
  105. if (cmdForm.m_mp_instructionsItalic.value == "true")
  106. press_tbInstructionsStyle('i_italic');
  107. instructions.style.textDecoration = (cmdForm.m_mp_instructionsUnderline.value == "true") ? "underline" : "none" ;
  108. if (cmdForm.m_mp_instructionsUnderline.value == "true")
  109. press_tbInstructionsStyle('i_underline');
  110. if (cmdForm.m_mp_instructionsColour.value != '' &amp;&amp; cmdForm.m_mp_instructionsColour.value != 'default')
  111. instructions.style.color = cmdForm.m_mp_instructionsColour.value;
  112. instructions.style.textAlign = cmdForm.m_mp_instructionsAlign.value;
  113. if (cmdForm.m_mp_instructionsAlign.value != ''){
  114. eval("press_tbInstructionsStyle('i_align_" + cmdForm.m_mp_instructionsAlign.value + "')");
  115. }
  116. if (isBidiEnabled){
  117. instructions.dir = ((bidi.baseTextDirection == "ltr" || bidi.baseTextDirection == "rtl") ? bidi.baseTextDirection : bidi.resolveStrBtd(instructions.value));
  118. if (bidi.baseTextDirection == "auto"){
  119. instructions.onkeyup = function() {bidi.onkeyup(instructions);};
  120. }
  121. }
  122. }
  123. <!-- clears the styles of a given text field -->
  124. function clearCustomStyles(tf)
  125. {
  126. tf.color = '';
  127. tf.fontFamily = '';
  128. tf.fontSize = '';
  129. tf.fontWeight = '';
  130. tf.fontStyle = '';
  131. tf.textDecoration = '';
  132. tf.textAlign = '';
  133. }
  134. </script>
  135. <xsl:choose>
  136. <xsl:when test="$mode = 'properties'">
  137. <lyt:layout style="2" width="100%" border="yes" title="IDS_MEW_PAGE_STYLE_HEADING1" intro="IDS_MEW_PAGE_STYLE_HEADING1_INTRO">
  138. <lyt:section>
  139. <out:variable name="selectedLangs" select="''"/>
  140. <dp:input>
  141. <dp:section1>
  142. <xts:string id="IDS_PROP_LANGUAGE"/>
  143. </dp:section1>
  144. <dp:section2>
  145. <out:choose>
  146. <out:when test="not($readOnly)">
  147. <out:variable name="selectedLangs_list">
  148. <out:for-each select="/root/SelectedLanguages/lang">
  149. <out:value-of select="concat(' ', ., ' ')"/>
  150. </out:for-each>
  151. </out:variable>
  152. <script language="JavaScript">
  153. function changeLang(lang, index)
  154. {
  155. if (lang == '')
  156. {
  157. var liistSize = document.pform.m_mp_language.options.length
  158. if (liistSize &gt; index+1)
  159. document.pform.m_mp_language.options[index+1].selected = true;
  160. else if (liistSize == index+1)
  161. document.pform.m_mp_language.options[index-1].selected = true;
  162. }
  163. document.pform.m_mp_cmd.value = "change_language";
  164. document.pform.m.value = "<out:value-of select="$mname"/>";
  165. document.pform.submit();
  166. }
  167. function remove_lang()
  168. {
  169. document.pform.m_mp_cmd.value = "remove_language";
  170. document.pform.m.value = "<out:value-of select="$mname"/>";
  171. document.pform.submit();
  172. }
  173. </script>
  174. <utml:select name="m_mp_language" onchange="changeLang(this.options[this.selectedIndex].value, this.selectedIndex)">
  175. <utml:default-value>
  176. <out:value-of select="$currentLang"/>
  177. </utml:default-value>
  178. <out:for-each select="/root/SelectedLanguages/lang">
  179. <out:variable name="z" select="."/>
  180. <utml:option>
  181. <utml:value><out:value-of select="."/></utml:value>
  182. <out:value-of select="/root/config/param[@name='locale']/locale[@type='contentLocale' and id = $z]/displayName"/>
  183. </utml:option>
  184. <out:if test="position()=last()">
  185. <utml:option>
  186. <utml:value></utml:value>
  187. <out:value-of select="'--------------------------------------'"/>
  188. </utml:option>
  189. </out:if>
  190. </out:for-each>
  191. <out:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale']">
  192. <out:if test="not(contains($selectedLangs_list, concat(' ', id, ' ')))">
  193. <utml:option>
  194. <utml:value><out:value-of select="id"/></utml:value>
  195. <out:value-of select="displayName"/>
  196. </utml:option>
  197. </out:if>
  198. </out:for-each>
  199. </utml:select>
  200. &#160;&#160;
  201. <out:if test="count(/root/SelectedLanguages/lang) &gt; 1">
  202. <a href="javascript:remove_lang()"><xts:string id="IDS_MEW_PAGE_STYLE_SREMOVE_LANGUAGE"/></a>
  203. </out:if>
  204. <!-- command -->
  205. <utml:input type="hidden" name="m_mp_cmd" utml:update="false"/>
  206. <!-- store the language now in focus in the lang dropdown -->
  207. <utml:input type="hidden" name="m_mp_langToSave" utml:update="false">
  208. <out:attribute name="value"><out:value-of select="$currentLang"/></out:attribute>
  209. </utml:input>
  210. </out:when>
  211. <out:otherwise>
  212. <out:value-of select="$currentLang"/>
  213. </out:otherwise>
  214. </out:choose>
  215. </dp:section2>
  216. </dp:input>
  217. </lyt:section>
  218. </lyt:layout>
  219. </xsl:when>
  220. <xsl:otherwise>
  221. <utml:input type="hidden" name="m_mp_language">
  222. <out:attribute name="value">
  223. <out:value-of select="$currentLang"/>
  224. </out:attribute>
  225. </utml:input>
  226. </xsl:otherwise>
  227. </xsl:choose>
  228. <out:variable name="fontUnit" select="/root/system/param[@name='myPages']/param[@name='fontUnit']"/>
  229. <xsl:variable name="fontSizeChoice">
  230. <utml:option><utml:value><out:value-of select="concat('8',$fontUnit)"/></utml:value>8</utml:option>
  231. <utml:option><utml:value><out:value-of select="concat('9',$fontUnit)"/></utml:value>9</utml:option>
  232. <utml:option><utml:value><out:value-of select="concat('10',$fontUnit)"/></utml:value>10</utml:option>
  233. <utml:option><utml:value><out:value-of select="concat('11',$fontUnit)"/></utml:value>11</utml:option>
  234. <utml:option><utml:value><out:value-of select="concat('12',$fontUnit)"/></utml:value>12</utml:option>
  235. <utml:option><utml:value><out:value-of select="concat('14',$fontUnit)"/></utml:value>14</utml:option>
  236. <utml:option><utml:value><out:value-of select="concat('16',$fontUnit)"/></utml:value>16</utml:option>
  237. <utml:option><utml:value><out:value-of select="concat('18',$fontUnit)"/></utml:value>18</utml:option>
  238. <utml:option><utml:value><out:value-of select="concat('20',$fontUnit)"/></utml:value>20</utml:option>
  239. <utml:option><utml:value><out:value-of select="concat('22',$fontUnit)"/></utml:value>22</utml:option>
  240. <utml:option><utml:value><out:value-of select="concat('24',$fontUnit)"/></utml:value>24</utml:option>
  241. <utml:option><utml:value><out:value-of select="concat('26',$fontUnit)"/></utml:value>26</utml:option>
  242. <utml:option><utml:value><out:value-of select="concat('28',$fontUnit)"/></utml:value>28</utml:option>
  243. <utml:option><utml:value><out:value-of select="concat('36',$fontUnit)"/></utml:value>36</utml:option>
  244. <utml:option><utml:value><out:value-of select="concat('48',$fontUnit)"/></utml:value>48</utml:option>
  245. <utml:option><utml:value><out:value-of select="concat('72',$fontUnit)"/></utml:value>72</utml:option>
  246. </xsl:variable>
  247. <xsl:variable name="fontSizeChoiceInPercent">
  248. <utml:option value="50%">50</utml:option>
  249. <utml:option value="80%">80</utml:option>
  250. <utml:option value="100%">100</utml:option>
  251. <utml:option value="110%">110</utml:option>
  252. <utml:option value="120%">120</utml:option>
  253. <utml:option value="140%">140</utml:option>
  254. <utml:option value="160%">160</utml:option>
  255. <utml:option value="180%">180</utml:option>
  256. <utml:option value="200%">200</utml:option>
  257. <utml:option value="220%">220</utml:option>
  258. <utml:option value="240%">240</utml:option>
  259. <utml:option value="280%">280</utml:option>
  260. <utml:option value="300%">300</utml:option>
  261. <utml:option value="350%">350</utml:option>
  262. <utml:option value="400%">400</utml:option>
  263. </xsl:variable>
  264. <xsl:variable name="fontFaceChoice">
  265. <out:choose>
  266. <out:when test="fonts/configuration/property/font">
  267. <out:for-each select="fonts/configuration/property/font">
  268. <utml:option>
  269. <utml:value><out:value-of select="id"/></utml:value>
  270. <out:value-of select="id"/>
  271. </utml:option>
  272. </out:for-each>
  273. </out:when>
  274. <out:otherwise>
  275. <!-- note: for simplicity, we use the default title font as the default here -->
  276. <utml:option>
  277. <utml:value><out:value-of select="/root/system/param[@name='myPages']/param[@name='defaultTitleFontFace']"/></utml:value>
  278. <out:value-of select="/root/system/param[@name='myPages']/param[@name='defaultTitleFontFace']"/>
  279. </utml:option>
  280. </out:otherwise>
  281. </out:choose>
  282. </xsl:variable>
  283. <!-- Title -->
  284. <!-- ======================================= -->
  285. <lyt:layout style="2" width="100%">
  286. <lyt:section>
  287. <dp:section>
  288. <dp:input>
  289. <dp:section1>
  290. <xts:string id="IDS_MEW_PAGE_STYLE_TITLE"/>
  291. </dp:section1>
  292. <dp:section2>
  293. <out:choose>
  294. <out:when test="not($readOnly)">
  295. <table cellpadding="0" cellspacing="0" border="0" style="width:610px;">
  296. <tr>
  297. <td width="100%" nowrap="nowrap" class="formLink" align="right">
  298. <script language="JavaScript">
  299. function setTitleStyle(mode)
  300. {
  301. if (mode == 'default')
  302. {
  303. document.getElementById('divTitleFormat').style.display = 'none';
  304. document.getElementById('divTitleFormatControlDefault').style.display = 'none';
  305. document.getElementById('divTitleFormatControlCustom').style.display = 'inline';
  306. document.pform.m_mp_titleStyle.value = "default";
  307. clearCustomStyles(title.style);
  308. title.className = 'defaultTitleText';
  309. }
  310. else
  311. {
  312. document.getElementById('divTitleFormat').style.display = 'inline';
  313. document.getElementById('divTitleFormatControlDefault').style.display = 'inline';
  314. document.getElementById('divTitleFormatControlCustom').style.display = 'none';
  315. document.pform.m_mp_titleStyle.value = "custom";
  316. updateTitleText();
  317. }
  318. }
  319. </script>
  320. <div id="divTitleFormatControlCustom">
  321. <out:attribute name="style">
  322. <out:choose>
  323. <out:when test="key('env-param', 'm_mp_titleStyle') = 'default'">display:inline;</out:when>
  324. <out:otherwise>display:none;</out:otherwise>
  325. </out:choose>
  326. </out:attribute>
  327. <img src="{'{$skin_images}'}prompt_option_to_left.gif" style="margin-right:5px;" align="absbottom"/>
  328. <a href="javascript:setTitleStyle('custom')"><xts:string id="IDS_MEW_PAGE_STYLE_CUSTOM_FORMAT"/></a>
  329. </div>
  330. <div id="divTitleFormatControlDefault">
  331. <out:attribute name="style">
  332. <out:choose>
  333. <out:when test="key('env-param', 'm_mp_titleStyle') = 'default'">display:none;</out:when>
  334. <out:otherwise>display:inline;</out:otherwise>
  335. </out:choose>
  336. </out:attribute>
  337. <a href="javascript:setTitleStyle('default')"><xts:string id="IDS_MEW_PAGE_STYLE_DEFAULT_FORMAT"/></a>
  338. <img src="{'{$skin_images}'}prompt_option_to_right.gif" style="margin-left:5px;margin-right:10px;" align="absbottom"/>
  339. </div>
  340. </td>
  341. <td height="30">
  342. <div id="divTitleFormat">
  343. <out:attribute name="style">
  344. <out:choose>
  345. <out:when test="key('env-param', 'm_mp_titleStyle') = 'default'">display:none;</out:when>
  346. <out:otherwise>display:inline;</out:otherwise>
  347. </out:choose>
  348. </out:attribute>
  349. <table cellpadding="2" cellspacing="0" border="0" style="width:100%">
  350. <tr>
  351. <td width="100%" align="right" nowrap="nowrap">
  352. <utml:select name="m_mp_titleFont" onchange="setTitleFont(this.options[this.selectedIndex].value)">
  353. <utml:default-value>
  354. <out:value-of select="/root/system/param[@name='myPages']/param[@name='defaultTitleFontFace']"/>
  355. </utml:default-value>
  356. <xsl:copy-of select="$fontFaceChoice"/>
  357. </utml:select>
  358. <script language="JavaScript">
  359. function setTitleFont(font)
  360. {
  361. title.style.fontFamily = font;
  362. }
  363. </script>
  364. </td>
  365. <td>
  366. <utml:select name="m_mp_titleFontSize" onchange="setTitleFontSize(this.options[this.selectedIndex].value)">
  367. <utml:default-value><out:value-of select="concat(/root/system/param[@name='myPages']/param[@name='defaultTitleFontSize'],$fontUnit)"/></utml:default-value>
  368. <out:choose>
  369. <out:when test="$fontUnit = '%'">
  370. <xsl:copy-of select="$fontSizeChoiceInPercent"/>
  371. </out:when>
  372. <out:otherwise>
  373. <xsl:copy-of select="$fontSizeChoice"/>
  374. </out:otherwise>
  375. </out:choose>
  376. </utml:select>
  377. <script language="JavaScript">
  378. function setTitleFontSize(size)
  379. {
  380. title.style.fontSize = size;
  381. }
  382. </script>
  383. </td>
  384. <td>
  385. <script language="JavaScript">
  386. function setTitleColour(color)
  387. {
  388. title.style.color = color;
  389. cmdForm.m_mp_titleColour.value = color;
  390. }
  391. function setTitleTextAlign(align)
  392. {
  393. releaseAllTitleAlign();
  394. eval("press_titleStyle('title_align_" + align + "')");
  395. title.style.textAlign = align;
  396. cmdForm.m_mp_titleAlign.value = align;
  397. }
  398. function releaseAllTitleAlign()
  399. {
  400. release_titleStyle('title_align_left');
  401. release_titleStyle('title_align_center');
  402. release_titleStyle('title_align_right');
  403. release_titleStyle('title_align_justify');
  404. }
  405. function title_bold()
  406. {
  407. if (isPressed_title_bold())
  408. {
  409. release_titleStyle('title_bold');
  410. cmdForm.m_mp_titleBold.value = "false";
  411. title.style.fontWeight = "normal";
  412. }
  413. else
  414. {
  415. press_titleStyle('title_bold');
  416. cmdForm.m_mp_titleBold.value = "true";
  417. title.style.fontWeight = "bold";
  418. }
  419. }
  420. function title_italic()
  421. {
  422. if (isPressed_title_italic())
  423. {
  424. release_titleStyle('title_italic');
  425. cmdForm.m_mp_titleItalic.value = "false";
  426. title.style.fontStyle = "normal";
  427. }
  428. else
  429. {
  430. press_titleStyle('title_italic');
  431. cmdForm.m_mp_titleItalic.value = "true";
  432. title.style.fontStyle = "italic";
  433. }
  434. }
  435. function title_underline()
  436. {
  437. if (isPressed_title_underline())
  438. {
  439. release_titleStyle('title_underline');
  440. cmdForm.m_mp_titleUnderline.value = "false";
  441. title.style.textDecoration = "none";
  442. }
  443. else
  444. {
  445. press_titleStyle('title_underline');
  446. cmdForm.m_mp_titleUnderline.value = "true";
  447. title.style.textDecoration = "underline";
  448. }
  449. }
  450. </script>
  451. <utml:input type="hidden" name="m_mp_titleStyle" value="custom"/>
  452. <utml:input type="hidden" name="m_mp_titleColour" value="#000000"/>
  453. <utml:input type="hidden" name="m_mp_titleAlign" value=""/>
  454. <utml:input type="hidden" name="m_mp_titleBold" value="true"/>
  455. <utml:input type="hidden" name="m_mp_titleItalic" value="false"/>
  456. <utml:input type="hidden" name="m_mp_titleUnderline" value="false"/>
  457. <out:variable name="titleToolBar">
  458. <toolbar id="titleStyle">
  459. <!-- Colour -->
  460. <toolbarButton id="title_colour">
  461. <param name="image">action_font_color.gif</param>
  462. <param name="onclick">showColourSelectionDlg('setTitleColour'); event.cancelBubble = true;</param>
  463. <param name="title"><xts:string id="IDS_MP_COLOUR"/></param>
  464. </toolbarButton>
  465. <toolbarSeparator style="space"/>
  466. <!-- Bold -->
  467. <toolbarButton id="title_bold">
  468. <param name="text"><span class="toolbarTextBold"><xts:string id="IDS_BOLD"/></span></param>
  469. <param name="onclick">title_bold()</param>
  470. <param name="title"><xts:string id="IDS_MP_BOLD"/></param>
  471. </toolbarButton>
  472. <!-- Italic -->
  473. <toolbarButton id="title_italic">
  474. <param name="text"><span class="toolbarTextItalic"><xts:string id="IDS_ITALIC"/></span></param>
  475. <param name="onclick">title_italic()</param>
  476. <param name="title"><xts:string id="IDS_MP_ITALIC"/></param>
  477. </toolbarButton>
  478. <!-- Underline -->
  479. <toolbarButton id="title_underline">
  480. <param name="text"><span class="toolbarTextUnderline"><xts:string id="IDS_UNDERLINE"/></span></param>
  481. <param name="onclick">title_underline()</param>
  482. <param name="title"><xts:string id="IDS_MP_UNDERLINE"/></param>
  483. </toolbarButton>
  484. <toolbarSeparator style="space"/>
  485. <!-- Align left -->
  486. <toolbarButton id="title_align_left">
  487. <param name="image">action_align_left.gif</param>
  488. <param name="onclick">setTitleTextAlign('left')</param>
  489. <param name="title"><xts:string id="IDS_MP_LEFT"/></param>
  490. </toolbarButton>
  491. <!-- Align center -->
  492. <toolbarButton id="title_align_center">
  493. <param name="image">action_align_center.gif</param>
  494. <param name="onclick">setTitleTextAlign('center')</param>
  495. <param name="title"><xts:string id="IDS_MP_CENTER"/></param>
  496. </toolbarButton>
  497. <!-- Align right -->
  498. <toolbarButton id="title_align_right">
  499. <param name="image">action_align_right.gif</param>
  500. <param name="onclick">setTitleTextAlign('right')</param>
  501. <param name="title"><xts:string id="IDS_MP_RIGHT"/></param>
  502. </toolbarButton>
  503. <!-- Align justify -->
  504. <toolbarButton id="title_align_justify">
  505. <param name="image">action_justify.gif</param>
  506. <param name="onclick">setTitleTextAlign('justify')</param>
  507. <param name="title"><xts:string id="IDS_MP_JUSTIFIED"/></param>
  508. </toolbarButton>
  509. </toolbar>
  510. </out:variable>
  511. <!-- Render the toolbar -->
  512. <out:call-template name="renderToolBar">
  513. <out:with-param name="toolbarXML">
  514. <out:copy-of select="$titleToolBar"/>
  515. </out:with-param>
  516. </out:call-template>
  517. </td>
  518. </tr>
  519. </table>
  520. </div>
  521. </td>
  522. </tr>
  523. </table>
  524. <!-- Title text -->
  525. <table cellpadding="0" cellspacing="0" border="0" style="width:610px;">
  526. <tr>
  527. <td colspan="2">
  528. <input id="titleText" type="text" style="width:610px;" class="defaultTitleText" maxlength="65536">
  529. <out:attribute name="name">
  530. <out:value-of select="concat('m_mp_mlt_title_', $currentLang)"/>
  531. </out:attribute>
  532. <out:variable name="initValue">
  533. <out:value-of select="env/param[@name=concat('m_mp_mlt_title_', $currentLang)]"/>
  534. </out:variable>
  535. <out:attribute name="value">
  536. <out:value-of select="$initValue"/>
  537. </out:attribute>
  538. <out:call-template name="add-bidi-onfocus-event">
  539. <out:with-param name="value" select="$initValue"/>
  540. </out:call-template>
  541. </input>
  542. </td>
  543. </tr>
  544. </table>
  545. </out:when>
  546. <out:otherwise>
  547. <out:value-of select="env/param[@name=concat('m_mp_mlt_title_', $currentLang)]"/>
  548. </out:otherwise>
  549. </out:choose>
  550. </dp:section2>
  551. </dp:input>
  552. </dp:section>
  553. <dp:choice>
  554. <dp:section1>
  555. <utml:input type="checkbox" name="m_mp_hideTitle" value="true">
  556. <out:if test="$readOnly">
  557. <out:attribute name="disabled">disabled</out:attribute>
  558. </out:if>
  559. </utml:input>
  560. </dp:section1>
  561. <dp:section2>
  562. <xts:string id="IDS_MEW_PAGE_STYLE_HIDE_TITLE"/>
  563. </dp:section2>
  564. </dp:choice>
  565. </lyt:section>
  566. </lyt:layout>
  567. <!-- Instructions -->
  568. <!-- ======================================= -->
  569. <lyt:layout style="2" width="100%">
  570. <lyt:section>
  571. <dp:section>
  572. <dp:input>
  573. <dp:section1>
  574. <xts:string id="IDS_MEW_PAGE_STYLE_INSTRUCTIONS"/>
  575. </dp:section1>
  576. <dp:section2>
  577. <out:choose>
  578. <out:when test="not($readOnly)">
  579. <table cellpadding="0" cellspacing="0" border="0" style="width:610px;">
  580. <tr>
  581. <td width="100%" nowrap="nowrap" class="formLink" align="right">
  582. <script language="JavaScript">
  583. function setInstructionsStyle(mode)
  584. {
  585. if (mode == 'default')
  586. {
  587. document.getElementById('divInstructionsFormat').style.display = 'none';
  588. document.getElementById('divInstructionsFormatControlDefault').style.display = 'none';
  589. document.getElementById('divInstructionsFormatControlCustom').style.display = 'inline';
  590. document.pform.m_mp_instructionsStyle.value = "default";
  591. clearCustomStyles(instructions.style);
  592. instructions.className = 'defaultInstructionsText';
  593. }
  594. else
  595. {
  596. document.getElementById('divInstructionsFormat').style.display = 'inline';
  597. document.getElementById('divInstructionsFormatControlDefault').style.display = 'inline';
  598. document.getElementById('divInstructionsFormatControlCustom').style.display = 'none';
  599. document.pform.m_mp_instructionsStyle.value = "custom";
  600. updateInstructionsText();
  601. }
  602. }
  603. </script>
  604. <div id="divInstructionsFormatControlCustom">
  605. <out:attribute name="style">
  606. <out:choose>
  607. <out:when test="key('env-param', 'm_mp_instructionsStyle') = 'default'">display:inline;</out:when>
  608. <out:otherwise>display:none;</out:otherwise>
  609. </out:choose>
  610. </out:attribute>
  611. <img src="{'{$skin_images}'}prompt_option_to_left.gif" style="margin-right:5px;" align="absbottom"/>
  612. <a href="javascript:setInstructionsStyle('custom')"><xts:string id="IDS_MEW_PAGE_STYLE_CUSTOM_FORMAT"/></a>
  613. </div>
  614. <div id="divInstructionsFormatControlDefault">
  615. <out:attribute name="style">
  616. <out:choose>
  617. <out:when test="key('env-param', 'm_mp_instructionsStyle') = 'default'">display:none;</out:when>
  618. <out:otherwise>display:inline;</out:otherwise>
  619. </out:choose>
  620. </out:attribute>
  621. <a href="javascript:setInstructionsStyle('default')"><xts:string id="IDS_MEW_PAGE_STYLE_DEFAULT_FORMAT"/></a>
  622. <img src="{'{$skin_images}'}prompt_option_to_right.gif" style="margin-left:5px;margin-right:10px;" align="absbottom"/>
  623. </div>
  624. </td>
  625. <td height="30">
  626. <div id="divInstructionsFormat">
  627. <out:attribute name="style">
  628. <out:choose>
  629. <out:when test="key('env-param', 'm_mp_instructionsStyle') = 'default'">display:none;</out:when>
  630. <out:otherwise>display:inline;</out:otherwise>
  631. </out:choose>
  632. </out:attribute>
  633. <table cellpadding="2" cellspacing="0" border="0">
  634. <tr>
  635. <td width="100%" align="right" nowrap="nowrap">
  636. <utml:select name="m_mp_instructionsFont" onchange="setInstructionsFont(this.options[this.selectedIndex].value)">
  637. <utml:default-value>
  638. <out:value-of select="/root/system/param[@name='myPages']/param[@name='defaultInstructionsFontFace']"/>
  639. </utml:default-value>
  640. <xsl:copy-of select="$fontFaceChoice"/>
  641. </utml:select>
  642. <script language="JavaScript">
  643. function setInstructionsFont(font)
  644. {
  645. instructions.style.fontFamily = font;
  646. }
  647. </script>
  648. </td>
  649. <td>
  650. <utml:select name="m_mp_instructionsFontSize" onchange="setInstructionsFontSize(this.options[this.selectedIndex].value)">
  651. <utml:default-value><out:value-of select="concat(/root/system/param[@name='myPages']/param[@name='defaultInstructionsFontSize'], $fontUnit)"/></utml:default-value>
  652. <out:choose>
  653. <out:when test="$fontUnit = '%'">
  654. <xsl:copy-of select="$fontSizeChoiceInPercent"/>
  655. </out:when>
  656. <out:otherwise>
  657. <xsl:copy-of select="$fontSizeChoice"/>
  658. </out:otherwise>
  659. </out:choose>
  660. </utml:select>
  661. <script language="JavaScript">
  662. function setInstructionsFontSize(size)
  663. {
  664. instructions.style.fontSize = size;
  665. }
  666. </script>
  667. </td>
  668. <td>
  669. <script language="JavaScript">
  670. function setInstructionsColour(color)
  671. {
  672. instructions.style.color = color;
  673. cmdForm.m_mp_instructionsColour.value = color;
  674. }
  675. function instructions_bold()
  676. {
  677. if (isPressed_i_bold())
  678. {
  679. release_tbInstructionsStyle('i_bold');
  680. cmdForm.m_mp_instructionsBold.value = "false";
  681. instructions.style.fontWeight = "normal";
  682. }
  683. else
  684. {
  685. press_tbInstructionsStyle('i_bold');
  686. cmdForm.m_mp_instructionsBold.value = "true";
  687. instructions.style.fontWeight = "bold";
  688. }
  689. }
  690. function instructions_italic()
  691. {
  692. if (isPressed_i_italic())
  693. {
  694. release_tbInstructionsStyle('i_italic');
  695. cmdForm.m_mp_instructionsItalic.value = "false";
  696. instructions.style.fontStyle = "normal";
  697. }
  698. else
  699. {
  700. press_tbInstructionsStyle('i_italic');
  701. cmdForm.m_mp_instructionsItalic.value = "true";
  702. instructions.style.fontStyle = "italic";
  703. }
  704. }
  705. function instructions_underline()
  706. {
  707. if (isPressed_i_underline())
  708. {
  709. release_tbInstructionsStyle('i_underline');
  710. cmdForm.m_mp_instructionsUnderline.value = "false";
  711. instructions.style.textDecoration = "none";
  712. }
  713. else
  714. {
  715. press_tbInstructionsStyle('i_underline');
  716. cmdForm.m_mp_instructionsUnderline.value = "true";
  717. instructions.style.textDecoration = "underline";
  718. }
  719. }
  720. function setInstructionsTextAlign(align)
  721. {
  722. releaseAllInstructionsAlign();
  723. eval("press_tbInstructionsStyle('i_align_" + align + "')");
  724. instructions.style.textAlign = align;
  725. cmdForm.m_mp_instructionsAlign.value = align;
  726. }
  727. function releaseAllInstructionsAlign()
  728. {
  729. release_tbInstructionsStyle('i_align_left');
  730. release_tbInstructionsStyle('i_align_center');
  731. release_tbInstructionsStyle('i_align_right');
  732. release_tbInstructionsStyle('i_align_justify');
  733. }
  734. </script>
  735. <utml:input type="hidden" name="m_mp_instructionsStyle" value="custom"/>
  736. <utml:input type="hidden" name="m_mp_instructionsColour" value="#000000"/>
  737. <utml:input type="hidden" name="m_mp_instructionsBold" value="false"/>
  738. <utml:input type="hidden" name="m_mp_instructionsItalic" value="false"/>
  739. <utml:input type="hidden" name="m_mp_instructionsUnderline" value="false"/>
  740. <utml:input type="hidden" name="m_mp_instructionsAlign" value=""/>
  741. <out:variable name="instructionsToolBar">
  742. <toolbar id="tbInstructionsStyle">
  743. <!-- Colour -->
  744. <toolbarButton id="i_colour">
  745. <param name="image">action_font_color.gif</param>
  746. <param name="onclick">showColourSelectionDlg('setInstructionsColour'); event.cancelBubble = true;</param>
  747. <param name="title"><xts:string id="IDS_MP_COLOUR"/></param>
  748. </toolbarButton>
  749. <toolbarSeparator style="space"/>
  750. <!-- Bold -->
  751. <toolbarButton id="i_bold">
  752. <param name="text"><span class="toolbarTextBold"><xts:string id="IDS_BOLD"/></span></param>
  753. <param name="onclick">instructions_bold()</param>
  754. <param name="title"><xts:string id="IDS_MP_BOLD"/></param>
  755. </toolbarButton>
  756. <!-- Italic -->
  757. <toolbarButton id="i_italic">
  758. <param name="text"><span class="toolbarTextItalic"><xts:string id="IDS_ITALIC"/></span></param>
  759. <param name="onclick">instructions_italic()</param>
  760. <param name="title"><xts:string id="IDS_MP_ITALIC"/></param>
  761. </toolbarButton>
  762. <!-- Underline -->
  763. <toolbarButton id="i_underline">
  764. <param name="text"><span class="toolbarTextUnderline"><xts:string id="IDS_UNDERLINE"/></span></param>
  765. <param name="onclick">instructions_underline()</param>
  766. <param name="title"><xts:string id="IDS_MP_UNDERLINE"/></param>
  767. </toolbarButton>
  768. <toolbarSeparator style="space"/>
  769. <!-- Align left -->
  770. <toolbarButton id="i_align_left">
  771. <param name="image">action_align_left.gif</param>
  772. <param name="onclick">setInstructionsTextAlign('left')</param>
  773. <param name="title"><xts:string id="IDS_MP_LEFT"/></param>
  774. </toolbarButton>
  775. <!-- Align center -->
  776. <toolbarButton id="i_align_center">
  777. <param name="image">action_align_center.gif</param>
  778. <param name="onclick">setInstructionsTextAlign('center')</param>
  779. <param name="title"><xts:string id="IDS_MP_CENTER"/></param>
  780. </toolbarButton>
  781. <!-- Align right -->
  782. <toolbarButton id="i_align_right">
  783. <param name="image">action_align_right.gif</param>
  784. <param name="onclick">setInstructionsTextAlign('right')</param>
  785. <param name="title"><xts:string id="IDS_MP_RIGHT"/></param>
  786. </toolbarButton>
  787. <!-- Align justify -->
  788. <toolbarButton id="i_align_justify">
  789. <param name="image">action_justify.gif</param>
  790. <param name="onclick">setInstructionsTextAlign('justify')</param>
  791. <param name="title"><xts:string id="IDS_MP_JUSTIFIED"/></param>
  792. </toolbarButton>
  793. </toolbar>
  794. </out:variable>
  795. <out:call-template name="renderToolBar">
  796. <out:with-param name="toolbarXML">
  797. <out:copy-of select="$instructionsToolBar"/>
  798. </out:with-param>
  799. </out:call-template>
  800. </td>
  801. </tr>
  802. </table>
  803. </div>
  804. </td>
  805. </tr>
  806. <!-- Instructions text -->
  807. <tr>
  808. <td colspan="2">
  809. <!-- Ensure that the amount of text in this textarea does not exceed the caf limit. The defined limit comes from the dynvariable:
  810. dynvariable name="dyn_m_mp_mlt" maxlen="65536"
  811. in cafrules.xml.
  812. Validation is manual because the generated client side validation does not support dynvariables.
  813. -->
  814. <script language="javascript" src="{'{$webRoot}'}/cr1/caf.js"/>
  815. <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/validation.js"/>
  816. <script language="JavaScript">
  817. var cafInvalidLength = &quot;<xts:string id="IDS_VAL_ERR_MAXIMUM_LENGTH" encode="javascript"/>&quot;;
  818. function caf_dyn_m_mp_mlt(field)
  819. {
  820. if (window.CAFReportValidationError)
  821. {
  822. var value = field.value;
  823. var highlight = null;
  824. if (value.length &gt; 65536)
  825. {
  826. CAFReportValidationError(cafInvalidLength);
  827. highlight=value;
  828. }
  829. if (highlight != null)
  830. {
  831. CAFSelectText(field, highlight);
  832. }
  833. }
  834. }
  835. </script>
  836. <textarea style="width:100%; height:100px;" class="defaultInstructionsText" onblur="javascript:caf_dyn_m_mp_mlt(this);">
  837. <out:attribute name="name">
  838. <out:value-of select="concat('m_mp_mlt_instructions_', $currentLang)"/>
  839. </out:attribute>
  840. <out:variable name="initValue">
  841. <out:value-of select="env/param[@name=concat('m_mp_mlt_instructions_', $currentLang)]"/>
  842. </out:variable>
  843. <out:call-template name="add-bidi-onfocus-event">
  844. <out:with-param name="value" select="$initValue"/>
  845. </out:call-template>
  846. <out:value-of select="$initValue"/>
  847. </textarea>
  848. </td>
  849. </tr>
  850. </table>
  851. </out:when>
  852. <out:otherwise>
  853. <out:value-of select="env/param[@name=concat('m_mp_mlt_instructions_', $currentLang)]"/>
  854. </out:otherwise>
  855. </out:choose>
  856. </dp:section2>
  857. </dp:input>
  858. </dp:section>
  859. <dp:choice>
  860. <dp:section1>
  861. <utml:input type="checkbox" name="m_mp_hideInstructions" value="true">
  862. <out:if test="$readOnly">
  863. <out:attribute name="disabled">disabled</out:attribute>
  864. </out:if>
  865. </utml:input>
  866. </dp:section1>
  867. <dp:section2>
  868. <xts:string id="IDS_MEW_PAGE_STYLE_HIDE_INSTRUCTIONS"/>
  869. </dp:section2>
  870. </dp:choice>
  871. </lyt:section>
  872. </lyt:layout>
  873. <!-- Portlet styles -->
  874. <lyt:layout style="2" width="100%" border="yes" title="IDS_MEW_PAGE_STYLE_HEADING2">
  875. <lyt:section>
  876. <dp:choice>
  877. <dp:section1>
  878. <utml:input type="checkbox" name="m_mp_hideBorders" value="true">
  879. <out:if test="$readOnly">
  880. <out:attribute name="disabled">disabled</out:attribute>
  881. </out:if>
  882. </utml:input>
  883. <utml:default-value>true</utml:default-value>
  884. </dp:section1>
  885. <dp:section2>
  886. <xts:string id="IDS_MEW_PAGE_STYLE_HIDE_BORDERS"/>
  887. </dp:section2>
  888. <dp:section1>
  889. <script language="JavaScript">
  890. function setTitleBarOption(bState)
  891. {
  892. if(bState)
  893. {
  894. document.pform.m_mp_hideEditMode.checked = true;
  895. document.pform.m_mp_hideEditMode.disabled = true;
  896. }
  897. else
  898. {
  899. document.pform.m_mp_hideEditMode.disabled = false;
  900. }
  901. }
  902. </script>
  903. <utml:input type="checkbox" name="m_mp_hideTitleBars" value="true" onclick="setTitleBarOption(this.checked)">
  904. <out:if test="$readOnly">
  905. <out:attribute name="disabled">disabled</out:attribute>
  906. </out:if>
  907. </utml:input>
  908. </dp:section1>
  909. <dp:section2>
  910. <xts:string id="IDS_MEW_PAGE_STYLE_HIDE_TITLE_BARS"/>
  911. </dp:section2>
  912. <dp:section1>
  913. &#160;&#160;&#160;<utml:input type="checkbox" name="m_mp_hideEditMode" value="true">
  914. <out:if test="$readOnly or key('env-param', 'm_mp_hideTitleBars')">
  915. <out:attribute name="disabled">disabled</out:attribute>
  916. </out:if>
  917. <out:if test="key('env-param', 'm_mp_hideTitleBars')">
  918. <out:attribute name="checked">checked</out:attribute>
  919. </out:if>
  920. </utml:input>
  921. </dp:section1>
  922. <dp:section2>
  923. &#160;&#160;&#160;<xts:string id="IDS_MEW_PAGE_STYLE_HIDE_EDIT_BUTTONS"/>
  924. </dp:section2>
  925. </dp:choice>
  926. </lyt:section>
  927. </lyt:layout>
  928. </xsl:template>
  929. <xsl:template match="*">
  930. <xsl:copy>
  931. <xsl:copy-of select="@*"/>
  932. <xsl:apply-templates/>
  933. </xsl:copy>
  934. </xsl:template>
  935. </xsl:stylesheet>