Changeset 15110
- Timestamp:
- May 19, 2012, 12:07:43 AM (12 years ago)
- Location:
- extensions/SmiliesSupport
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmiliesSupport/admin.php
r14526 r15110 17 17 { 18 18 // the smilies.txt file is not saved if the directory is changed 19 if (isset($_POST[' text1']) AND $_POST['text1'] != $conf_smiliessupport['folder'])19 if (isset($_POST['folder']) AND $_POST['folder'] != $conf_smiliessupport['folder']) 20 20 { 21 21 $not_save_file = true; 22 22 23 $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['text1']); 24 $i = 0; 25 while (false !== ($file = readdir($handle))) 23 if (!file_exists(SMILIES_PATH.'smilies/'.$_POST['folder'].'/'.$_POST['representant'])) 26 24 { 27 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) ) 25 $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['folder']); 26 $i = 0; 27 while (false !== ($file = readdir($handle))) 28 28 { 29 $_POST['text3'] = $file; 30 closedir($handle); 31 break; 29 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) ) 30 { 31 $_POST['representant'] = $file; 32 closedir($handle); 33 break; 34 } 32 35 } 33 36 } … … 36 39 // new configuration 37 40 $conf_smiliessupport = array( 38 'folder' => isset($_POST[' text1']) ? $_POST['text1'] : 'crystal',39 'cols' => isset($_POST[' text2']) ? $_POST['text2'] : '6',40 'representant' => isset($_POST[' text3']) ? $_POST['text3'] : 'smile.png',41 'folder' => isset($_POST['folder']) ? $_POST['folder'] : 'crystal', 42 'cols' => isset($_POST['cols']) ? $_POST['cols'] : '6', 43 'representant' => isset($_POST['representant']) ? $_POST['representant'] : 'smile.png', 41 44 ); 42 if (empty($_POST['text'])) $_POST['text'] = ' :) smile.png';45 if (empty($_POST['text'])) $_POST['text'] = ''; 43 46 44 47 conf_update_param('smiliessupport', serialize($conf_smiliessupport)); … … 97 100 98 101 $template->assign(array( 99 ' TEXT1_VALUE' => $conf_smiliessupport['folder'],100 ' TEXT2_VALUE' => $conf_smiliessupport['cols'],101 ' TEXT3_VALUE' => $conf_smiliessupport['representant'],102 'FOLDER' => $conf_smiliessupport['folder'], 103 'COLS' => $conf_smiliessupport['cols'], 104 'REPRESENTANT' => $conf_smiliessupport['representant'], 102 105 'sets' => $sets, 103 106 'smiliesfiles' => $smilies_table, … … 107 110 // get the content of definitions file 108 111 $smilies_file = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt'; 109 if (file_exists($smilies_file)) { 112 if (file_exists($smilies_file)) 113 { 110 114 $content_file = file_get_contents($smilies_file); 111 115 $template->assign(array('CONTENT_FILE' => $content_file)); -
extensions/SmiliesSupport/template/markitup/style.markitup.css
r11294 r15110 1 1 /* common */ 2 .markItUp {3 display:inline-block;4 }5 2 .markItUp * { 6 3 margin:0px; padding:0px; … … 13 10 } 14 11 .markItUp textarea { 12 margin-top:0 !important; 15 13 display:block; 16 14 } … … 26 24 .markItUpFooter { 27 25 display:none; 26 } 27 .markItUpHeader { 28 display:inline-block; 28 29 } 29 30 -
extensions/SmiliesSupport/template/smiliessupport_admin.tpl
r14526 r15110 38 38 <li> 39 39 <span class="property">{'Smileys\' folder'|@translate}</span> 40 <select name=" text1">41 {html_options options=$sets selected=$ TEXT1_VALUE}40 <select name="folder"> 41 {html_options options=$sets selected=$FOLDER} 42 42 </select> 43 43 </li> 44 44 <li> 45 45 <span class="property">{'Nb. columns'|@translate}</span> 46 <input type="text" size="3" name=" text2" value="{$TEXT2_VALUE}" />46 <input type="text" size="3" name="cols" value="{$COLS}" /> 47 47 </li> 48 48 <li> 49 49 <span class="property">{'Representative'|@translate}</span> 50 <select name=" text3">51 {html_options options=$smilies selected=$ TEXT3_VALUE}50 <select name="representant"> 51 {html_options options=$smilies selected=$REPRESENTANT} 52 52 </select> 53 53 </li> -
extensions/SmiliesSupport/template/smiliessupport_page.tpl
r14526 r15110 1 {if not isset($BBCODE_PATH)} 1 2 {combine_script id="markitup" require='jquery' path=$SMILIES_PATH|@cat:"template/markitup/jquery.markitup.js"} 2 3 {combine_css path=$SMILIES_PATH|@cat:"template/markitup/style.markitup.css"} 4 {/if} 3 5 4 6 {footer_script require='jquery'} … … 28 30 29 31 <ul id="smiliesdiv"> 30 <li><table><tr> 32 <li><table><tr>{strip} 31 33 {foreach from=$smiliesfiles item=smileyfile} 32 34 <td><a href="{$smileyfile.TITLE}"><img src="{$smileyfile.PATH}"/></a></td> 33 35 {$smileyfile.TR} 34 36 {/foreach} 35 </tr></table></li>37 {/strip}</tr></table></li> 36 38 </ul> 37 39 </li>
Note: See TracChangeset
for help on using the changeset viewer.