Ignore:
Timestamp:
08/26/08 15:34:37 (4 years ago)
Author:
hverton
Message:

added the WYSIWYG BBcode editor option to private messages and the user profile (to edit the users signature)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/templates/main.pm.post.tpl

    r1605 r1700  
    3333                {$locale.421}: 
    3434            </td> 
    35             <td class='tbl1' valign='top' style='white-space:nowrap'> 
     35            <td class='tbl1' valign='top'> 
    3636                <div style='display:none'> 
    3737                <select multiple="multiple" size='5' name='recipients[]' id='recipients' class='textbox' style='width:200px'> 
     
    6868                    {section name=id loop=$user_list} 
    6969                        {if $smarty.section.id.first} 
    70                         <select id='user_ids' name='user_ids' class='textbox'> 
    71                         {/if} 
    72                         <option value='{$user_list[id].user_id}'>{$user_list[id].user_name}</option> 
    73                         {if $smarty.section.id.last} 
    74                         </select> 
    75                         <input type='submit' name='select_user' value='{$locale.468}' class='button' onclick="AddUser();return false;" /> 
    76                         {if $allow_sendtoall}&nbsp; - &nbsp;{/if} 
     70                            <div id='user_dropdown' style='display:inline;'> 
     71                                <select id='user_ids' name='user_ids' class='textbox'> 
     72                                {/if} 
     73                                <option value='{$user_list[id].user_id}'>{$user_list[id].user_name}</option> 
     74                                {if $smarty.section.id.last} 
     75                                </select> 
     76                                <input type='submit' name='select_user' value='{$locale.468}' class='button' onclick="AddUser();return false;" /> 
     77                            </div> 
    7778                        {/if} 
    7879                    {/section} 
     
    8081                        {section name=id loop=$user_groups} 
    8182                            {if $smarty.section.id.first} 
    82                             <select id='group_ids' name='group_ids' class='textbox'> 
    83                             {/if} 
    84                             <option value='{$user_groups[id].0}'>{$user_groups[id].1}</option> 
    85                             {if $smarty.section.id.last} 
    86                             </select> 
    87                             <input type='submit' name='select_group' value='{$locale.469}' class='button' onclick="AddGroup();return false;" /> 
     83                            &nbsp; - &nbsp; 
     84                            <div id='group_dropdown' style='display:inline;'> 
     85                                <select id='group_ids' name='group_ids' class='textbox'> 
     86                                {/if} 
     87                                <option value='{$user_groups[id].0}'>{$user_groups[id].1}</option> 
     88                                {if $smarty.section.id.last} 
     89                                </select> 
     90                                <input type='submit' name='select_group' value='{$locale.469}' class='button' onclick="AddGroup();return false;" /> 
     91                            </div> 
    8892                            {/if} 
    8993                        {/section} 
     
    106110            </td> 
    107111            <td class='tbl1'> 
    108                 <div id='org_message' style='display:none'>{$reply_message}<br /></div> 
     112                <div id='org_message' class='textbox' style='display:none'>{$org_message|stripinput|nl2br}<br /></div> 
    109113            </td> 
    110114        </tr> 
     
    121125            </td> 
    122126            <td class='tbl1'> 
    123                 <textarea name='message' cols='80' rows='15' class='textbox' style='width:100%; height:{math equation='x/4' x=$smarty.const.BROWSER_HEIGHT format='%u'}px;'>{$message}</textarea> 
    124             </td> 
    125         </tr> 
     127                {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     128                    <textarea name='message' cols='80' rows='15' class='textbox' style='width:100%; height:{math equation="x/4" x=$smarty.const.BROWSER_HEIGHT format="%u"}px;'>{$message}</textarea> 
     129                {else} 
     130                    <style type='text/css'>@import url({$smarty.const.THEME}hoteditor/style.css);</style> 
     131                    <input type='hidden' id='message' name='message' value='{$message}' /> 
     132                    <script language="javascript" type="text/javascript"> 
     133                        var hoteditor_path = "{$smarty.const.INCLUDES}jscripts/hoteditor-4.2/"; 
     134                        var hoteditor_theme_path = "{$smarty.const.THEME}hoteditor"; 
     135                        var hoteditor_reply_to = "{$orgauthor|default:""}"; 
     136                    </script> 
     137                    <script language="javascript" type="text/javascript" src="{$smarty.const.INCLUDES}jscripts/hoteditor-4.2/editor__0001.js?version=4.2"></script>              
     138                    {literal} 
     139                    <script language="javascript" type="text/javascript"> 
     140                        var getdata = document.getElementById("message").value; 
     141                        Instantiate("max","editor", getdata , "100%", "250px"); 
     142                         
     143                        //For Vietnamese User. Edit file editor.js to enable vietnamese keyboard 
     144                        if(enable_vietnamese_keyboard==1){ 
     145                            document.write("<script language=\"JavaScript\" type=\"text/javascript\" src={/literal}{$smarty.const.INCLUDES}jscripts/hoteditor-4.2/avim.js{literal}><\/script>"); 
     146                            var hoteditor_avim_method = hot_readCookie("hoteditor_avim_method");var him_auto_checked="";var him_telex_checked="";var him_vni_checked="";var him_viqr_checked="";var him_viqr2_checked="";var him_off_checked="";if(hoteditor_avim_method=="0"){him_auto_checked="checked";}else if(hoteditor_avim_method=="1"){him_telex_checked="checked";}else if(hoteditor_avim_method=="2"){him_vni_checked="checked";}else if(hoteditor_avim_method=="3"){him_viqr_checked="checked";}else if(hoteditor_avim_method=="4"){him_viqr2_checked="checked";}else if(hoteditor_avim_method=="-1"){him_off_checked="checked";} 
     147                            document.write("<div style='width:100%;text-align:center;font-family:Verdana;font-size:11px;'><input "+him_auto_checked+" id=him_auto onclick=setMethod(0); type=radio name=viet_method> Auto :: <input "+him_telex_checked+" id=him_telex onclick=setMethod(1); type=radio name=viet_method> Telex :: <input "+him_vni_checked+" id=him_vni onclick=setMethod(2); type=radio name=viet_method> VNI :: <input "+him_viqr_checked+" id=him_viqr onclick=setMethod(3); type=radio name=viet_method> VIQR :: <input "+him_viqr2_checked+" id=him_viqr2 onclick=setMethod(4); type=radio name=viet_method> VIQR* :: <input "+him_off_checked+" id=him_off onclick=setMethod(-1); type=radio name=viet_method> Off<br><img src="+styles_folder_path+"/vietnamese_symbol.gif></div>"); 
     148                        } 
     149 
     150                        if(enable_vietnamese_keyboard==1){ 
     151                            var hoteditor_avim_method = hot_readCookie("hoteditor_avim_method");var him_auto_checked;var him_telex_checked;var him_vni_checked;var him_viqr_checked;var him_viqr2_checked;var him_off_checked;if(hoteditor_avim_method=="0"){him_auto_checked="checked";}else if(hoteditor_avim_method=="1"){him_telex_checked="checked";}else if(hoteditor_avim_method=="2"){him_vni_checked="checked";}else if(hoteditor_avim_method=="3"){him_viqr_checked="checked";}else if(hoteditor_avim_method=="4"){him_viqr2_checked="checked";}else if(hoteditor_avim_method=="-1"){him_off_checked="checked";} 
     152                            document.write("<script language=\"JavaScript\" type=\"text/javascript\" src={/literal}{$smarty.const.INCLUDES}jscripts/hoteditor-4.2/avim.js{literal}><\/script><div style='width:100%;text-align:center;font-family:Verdana;font-size:11px;'><input "+him_auto_checked+" id=him_auto onclick=setMethod(0); type=radio name=viet_method> Auto :: <input "+him_telex_checked+" id=him_telex onclick=setMethod(1); type=radio name=viet_method> Telex :: <input "+him_vni_checked+" id=him_vni onclick=setMethod(2); type=radio name=viet_method> VNI :: <input "+him_viqr_checked+" id=him_viqr onclick=setMethod(3); type=radio name=viet_method> VIQR :: <input "+him_viqr2_checked+" id=him_viqr2 onclick=setMethod(4); type=radio name=viet_method> VIQR* :: <input "+him_off_checked+" id=him_off onclick=setMethod(-1); type=radio name=viet_method> Off</div>"); 
     153                        } 
     154                        function get_hoteditor_data(){ 
     155                            setCodeOutput(); 
     156                            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode 
     157                            document.getElementById("message").value = bbcode_output; 
     158                        }                    
     159                    </script> 
     160                    {/literal} 
     161                {/if} 
     162            </td> 
     163        </tr> 
     164        {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
    126165        <tr> 
    127166            <td align='right' class='tbl2' valign='top'> 
     
    166205            </td> 
    167206        </tr> 
     207        {/if} 
    168208        {if $settings.attachments} 
    169209        <tr> 
     
    205245                <textarea name='attach_comment' cols='50' rows='2' class='textbox'>{$comments}</textarea> 
    206246                <br /> 
    207                 <input type='submit' name='upload' value='{$locale.473}' class='button' /> 
     247                {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     248                    <input type='submit' name='upload' value='{$locale.473}' class='button' /> 
     249                {else} 
     250                    <input type='submit' name='upload' value='{$locale.473}' class='button' onclick='javascript:get_hoteditor_data();' /> 
     251                {/if} 
    208252            </td> 
    209253        </tr> 
     
    220264                <input type='hidden' name='pmindex_to_id' value='{$pmindex_to_id}' /> 
    221265                <input type='submit' name='close' value='{$locale.435}' class='button' /> 
    222                 <input type='submit' name='send_preview' value='{$locale.429}' class='button' onclick="return ValidateForm()" /> 
    223                 <input type='submit' name='send_message' value='{$locale.430}' class='button' onclick="return ValidateForm()" /> 
     266                {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     267                    <input type='submit' name='send_preview' value='{$locale.429}' class='button' onclick="return ValidateForm()" /> 
     268                    <input type='submit' name='send_message' value='{$locale.430}' class='button' onclick="return ValidateForm()" /> 
     269                {else} 
     270                    <input type='submit' name='send_preview' value='{$locale.429}' class='button' onclick="javascript:get_hoteditor_data();return ValidateForm()" /> 
     271                    <input type='submit' name='send_message' value='{$locale.430}' class='button' onclick="javascript:get_hoteditor_data();return ValidateForm()" /> 
     272                {/if} 
    224273            </td> 
    225274        </tr> 
     
    247296        document.getElementById("recipients").options[listLength].selected = true; 
    248297        document.getElementById("user_ids").options[selItem] = null; 
     298        if (document.getElementById("user_ids").length == 0) {  
     299            document.getElementById("user_dropdown").style.display = 'none'; 
     300        } 
    249301 
    250302        UpdateDisplayedList(); 
     
    261313        document.getElementById("recipients").options[listLength].selected = true; 
    262314        document.getElementById("group_ids").options[selItem] = null; 
     315        if (document.getElementById("group_ids").length == 0) {  
     316            document.getElementById("group_dropdown").style.display = 'none'; 
     317        } 
    263318 
    264319        UpdateDisplayedList(); 
     
    297352        if (html == "") html = "-"; 
    298353        document.getElementById('to_list').innerHTML = html; 
     354 
     355        if (document.getElementById("group_ids").length > 0) {  
     356            document.getElementById("group_dropdown").style.display = 'inline'; 
     357        } 
     358        if (document.getElementById("user_ids").length > 0) {  
     359            document.getElementById("user_dropdown").style.display = 'inline'; 
     360        } 
    299361    } 
    300362//]]> 
Note: See TracChangeset for help on using the changeset viewer.