ManageSmileys.template.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2011 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. // Editing the smiley sets.
  13. function template_editsets()
  14. {
  15. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  16. echo '
  17. <div id="admincenter">';
  18. template_show_list('smiley_set_list');
  19. echo '
  20. <br />
  21. <div class="cat_bar">
  22. <h3 class="catbg">', $txt['smiley_sets_latest'], '</h3>
  23. </div>
  24. <div class="windowbg">
  25. <span class="topslice"><span></span></span>
  26. <div class="content">
  27. <div id="smileysLatest">', $txt['smiley_sets_latest_fetch'], '</div>
  28. </div>
  29. <span class="botslice"><span></span></span>
  30. </div>
  31. </div>
  32. <br class="clear" />
  33. <script type="text/javascript"><!-- // --><![CDATA[
  34. window.smfForum_scripturl = "', $scripturl, '";
  35. window.smfForum_sessionid = "', $context['session_id'], '";
  36. window.smfForum_sessionvar = "', $context['session_var'], '";
  37. // ]]></script>';
  38. if (empty($modSettings['disable_smf_js']))
  39. echo '
  40. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-smileys.js"></script>';
  41. echo '
  42. <script type="text/javascript"><!-- // --><![CDATA[
  43. function smfSetLatestSmileys()
  44. {
  45. if (typeof(window.smfLatestSmileys) != "undefined")
  46. setInnerHTML(document.getElementById("smileysLatest"), window.smfLatestSmileys);';
  47. if (!empty($context['selected_set']))
  48. echo '
  49. changeSet("', $context['selected_set'], '");';
  50. if (!empty($context['selected_smiley']))
  51. echo '
  52. loadSmiley(', $context['selected_smiley'], ');';
  53. echo '
  54. }';
  55. // Oh well, could be worse - at least it's only IE4.
  56. if ($context['browser']['is_ie4'])
  57. echo '
  58. addLoadEvent(smfSetLatestSmileys);';
  59. else
  60. echo '
  61. smfSetLatestSmileys();';
  62. echo '
  63. // ]]></script>';
  64. }
  65. // Modifying a smiley set.
  66. function template_modifyset()
  67. {
  68. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  69. echo '
  70. <div id="admincenter">
  71. <form action="', $scripturl, '?action=admin;area=smileys;sa=editsets" method="post" accept-charset="', $context['character_set'], '">
  72. <div class="cat_bar">
  73. <h3 class="catbg">
  74. ', $context['current_set']['is_new'] ? $txt['smiley_set_new'] : $txt['smiley_set_modify_existing'], '
  75. </h3>
  76. </div>';
  77. // If this is an existing set, and there are still un-added smileys - offer an import opportunity.
  78. if (!empty($context['current_set']['can_import']))
  79. {
  80. echo '
  81. <div class="information">
  82. ', $context['current_set']['can_import'] == 1 ? $txt['smiley_set_import_single'] : $txt['smiley_set_import_multiple'], ' <a href="', $scripturl, '?action=admin;area=smileys;sa=import;set=', $context['current_set']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['here'], '</a> ', $context['current_set']['can_import'] == 1 ? $txt['smiley_set_to_import_single'] : $txt['smiley_set_to_import_multiple'], '
  83. </div>';
  84. }
  85. echo '
  86. <div class="windowbg">
  87. <span class="topslice"><span></span></span>
  88. <div class="content">
  89. <dl class="settings">
  90. <dt>
  91. <strong><label for="smiley_sets_name">', $txt['smiley_sets_name'], '</label>: </strong>
  92. </dt>
  93. <dd>
  94. <input type="text" name="smiley_sets_name" id="smiley_sets_name" value="', $context['current_set']['name'], '" class="input_text" />
  95. </dd>
  96. <dt>
  97. <strong><label for="smiley_sets_path">', $txt['smiley_sets_url'], '</label>: </strong>
  98. </dt>
  99. <dd>
  100. ', $modSettings['smileys_url'], '/';
  101. if ($context['current_set']['id'] == 'default')
  102. echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default" />';
  103. elseif (empty($context['smiley_set_dirs']))
  104. echo '
  105. <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '" class="input_text" /> ';
  106. else
  107. {
  108. echo '
  109. <select name="smiley_sets_path" id="smiley_sets_path">';
  110. foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
  111. echo '
  112. <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected="selected"' : '', $smiley_set_dir['selectable'] ? '' : ' disabled="disabled"', '>', $smiley_set_dir['id'], '</option>';
  113. echo '
  114. </select> ';
  115. }
  116. echo '
  117. /..
  118. </dd>
  119. <dt>
  120. <strong><label for="smiley_sets_default">', $txt['smiley_set_select_default'], '</label>: </strong>
  121. </dt>
  122. <dd>
  123. <input type="checkbox" name="smiley_sets_default" id="smiley_sets_default" value="1"', $context['current_set']['selected'] ? ' checked="checked"' : '', ' class="input_check" />
  124. </dd>';
  125. // If this is a new smiley set they have the option to import smileys already in the directory.
  126. if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
  127. echo '
  128. <dt>
  129. <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
  130. </dt>
  131. <dd>
  132. <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1" class="input_check" />
  133. </dd>';
  134. echo '
  135. </dl>
  136. <input type="submit" value="', $txt['smiley_sets_save'], '" class="button_submit" />
  137. </div>
  138. <span class="botslice"><span></span></span>
  139. </div>
  140. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  141. <input type="hidden" name="set" value="', $context['current_set']['id'], '" />
  142. </form>
  143. </div>
  144. <br class="clear" />';
  145. }
  146. // Editing an individual smiley
  147. function template_modifysmiley()
  148. {
  149. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  150. echo '
  151. <div id="admincenter">
  152. <form action="', $scripturl, '?action=admin;area=smileys;sa=editsmileys" method="post" accept-charset="', $context['character_set'], '" name="smileyForm" id="smileyForm">
  153. <div class="cat_bar">
  154. <h3 class="catbg">', $txt['smiley_modify_existing'], '</h3>
  155. </div>
  156. <div class="windowbg">
  157. <span class="topslice"><span></span></span>
  158. <div class="content">
  159. <dl class="settings">
  160. <dt>
  161. <strong>', $txt['smiley_preview'], ': </strong>
  162. </dt>
  163. <dd>
  164. <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt="" /> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">';
  165. foreach ($context['smiley_sets'] as $smiley_set)
  166. echo '
  167. <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected="selected"' : '', '>', $smiley_set['name'], '</option>';
  168. echo '
  169. </select>)
  170. </dd>
  171. <dt>
  172. <strong><label for="smiley_code">', $txt['smileys_code'], '</label>: </strong>
  173. </dt>
  174. <dd>
  175. <input type="text" name="smiley_code" id="smiley_code" value="', $context['current_smiley']['code'], '" class="input_text" />
  176. </dd>
  177. <dt>
  178. <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
  179. </dt>
  180. <dd>';
  181. if (empty($context['filenames']))
  182. echo '
  183. <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" class="input_text" />';
  184. else
  185. {
  186. echo '
  187. <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
  188. foreach ($context['filenames'] as $filename)
  189. echo '
  190. <option value="', $filename['id'], '"', $filename['selected'] ? ' selected="selected"' : '', '>', $filename['id'], '</option>';
  191. echo '
  192. </select>';
  193. }
  194. echo '
  195. </dd>
  196. <dt>
  197. <strong><label for="smiley_description">', $txt['smileys_description'], '</label>: </strong>
  198. </dt>
  199. <dd>
  200. <input type="text" name="smiley_description" id="smiley_description" value="', $context['current_smiley']['description'], '" class="input_text" />
  201. </dd>
  202. <dt>
  203. <strong><label for="smiley_location">', $txt['smileys_location'], '</label>: </strong>
  204. </dt>
  205. <dd>
  206. <select name="smiley_location" id="smiley_location">
  207. <option value="0"', $context['current_smiley']['location'] == 0 ? ' selected="selected"' : '', '>
  208. ', $txt['smileys_location_form'], '
  209. </option>
  210. <option value="1"', $context['current_smiley']['location'] == 1 ? ' selected="selected"' : '', '>
  211. ', $txt['smileys_location_hidden'], '
  212. </option>
  213. <option value="2"', $context['current_smiley']['location'] == 2 ? ' selected="selected"' : '', '>
  214. ', $txt['smileys_location_popup'], '
  215. </option>
  216. </select>
  217. </dd>
  218. </dl>
  219. <input type="submit" value="', $txt['smileys_save'], '" class="button_submit" />
  220. <input type="submit" name="deletesmiley" value="', $txt['smileys_delete'], '" onclick="return confirm(\'', $txt['smileys_delete_confirm'], '\');" class="button_submit" />
  221. </div>
  222. <span class="botslice"><span></span></span>
  223. </div>
  224. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  225. <input type="hidden" name="smiley" value="', $context['current_smiley']['id'], '" />
  226. </form>
  227. </div>
  228. <br class="clear" />
  229. <script type="text/javascript"><!-- // --><![CDATA[
  230. function updatePreview()
  231. {
  232. var currentImage = document.getElementById("preview");
  233. currentImage.src = "', $modSettings['smileys_url'], '/" + document.forms.smileyForm.set.value + "/" + document.forms.smileyForm.smiley_filename.value;
  234. }
  235. // ]]></script>';
  236. }
  237. // Adding a new smiley.
  238. function template_addsmiley()
  239. {
  240. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  241. echo '
  242. <script type="text/javascript"><!-- // --><![CDATA[
  243. function switchType()
  244. {
  245. document.getElementById("ul_settings").style.display = document.getElementById("method-existing").checked ? "none" : "";
  246. document.getElementById("ex_settings").style.display = document.getElementById("method-upload").checked ? "none" : "";
  247. }
  248. function swapUploads()
  249. {
  250. document.getElementById("uploadMore").style.display = document.getElementById("uploadSmiley").disabled ? "none" : "";
  251. document.getElementById("uploadSmiley").disabled = !document.getElementById("uploadSmiley").disabled;
  252. }
  253. function selectMethod(element)
  254. {
  255. document.getElementById("method-existing").checked = element != "upload";
  256. document.getElementById("method-upload").checked = element == "upload";
  257. }
  258. // ]]></script>
  259. <div id="admincenter">
  260. <form action="', $scripturl, '?action=admin;area=smileys;sa=addsmiley" method="post" accept-charset="', $context['character_set'], '" name="smileyForm" id="smileyForm" enctype="multipart/form-data">
  261. <div class="cat_bar">
  262. <h3 class="catbg">', $txt['smileys_add_method'], '</h3>
  263. </div>
  264. <div class="windowbg">
  265. <span class="topslice"><span></span></span>
  266. <div class="content">
  267. <ul class="reset">
  268. <li>
  269. <label for="method-existing"><input type="radio" onclick="switchType();" name="method" id="method-existing" value="existing" checked="checked" class="input_radio" /> ', $txt['smileys_add_existing'], '</label>
  270. </li>
  271. <li>
  272. <label for="method-upload"><input type="radio" onclick="switchType();" name="method" id="method-upload" value="upload" class="input_radio" /> ', $txt['smileys_add_upload'], '</label>
  273. </li>
  274. </ul>
  275. <br />
  276. <fieldset id="ex_settings">
  277. <dl class="settings">
  278. <dt>
  279. <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['filenames'][0]['id'], '" id="preview" alt="" />
  280. </dt>
  281. <dd>
  282. ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">
  283. ';
  284. foreach ($context['smiley_sets'] as $smiley_set)
  285. echo '
  286. <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected="selected"' : '', '>', $smiley_set['name'], '</option>';
  287. echo '
  288. </select>
  289. </dd>
  290. <dt>
  291. <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
  292. </dt>
  293. <dd>';
  294. if (empty($context['filenames']))
  295. echo '
  296. <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');" class="input_text" />';
  297. else
  298. {
  299. echo '
  300. <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
  301. foreach ($context['filenames'] as $filename)
  302. echo '
  303. <option value="', $filename['id'], '"', $filename['selected'] ? ' selected="selected"' : '', '>', $filename['id'], '</option>';
  304. echo '
  305. </select>';
  306. }
  307. echo '
  308. </dd>
  309. </dl>
  310. </fieldset>
  311. <fieldset id="ul_settings" style="display: none;">
  312. <dl class="settings">
  313. <dt>
  314. <strong>', $txt['smileys_add_upload_choose'], ':</strong><br />
  315. <span class="smalltext">', $txt['smileys_add_upload_choose_desc'], '</span>
  316. </dt>
  317. <dd>
  318. <input type="file" name="uploadSmiley" id="uploadSmiley" onchange="selectMethod(\'upload\');" class="input_file" />
  319. </dd>
  320. <dt>
  321. <strong><label for="sameall">', $txt['smileys_add_upload_all'], ':</label></strong>
  322. </dt>
  323. <dd>
  324. <input type="checkbox" name="sameall" id="sameall" checked="checked" class="input_check" onclick="swapUploads(); selectMethod(\'upload\');" />
  325. </dd>
  326. </dl>
  327. </fieldset>
  328. <dl id="uploadMore" style="display: none;" class="settings">';
  329. foreach ($context['smiley_sets'] as $smiley_set)
  330. echo '
  331. <dt>
  332. ', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ':
  333. </dt>
  334. <dd>
  335. <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');" class="input_file" />
  336. </dd>';
  337. echo '
  338. </dl>
  339. </div>
  340. <span class="botslice"><span></span></span>
  341. </div>
  342. <br />
  343. <div class="cat_bar">
  344. <h3 class="catbg">', $txt['smiley_new'], '</h3>
  345. </div>
  346. <div class="windowbg">
  347. <span class="topslice"><span></span></span>
  348. <div class="content">
  349. <dl class="settings">
  350. <dt>
  351. <strong><label for="smiley_code">', $txt['smileys_code'], '</label>: </strong>
  352. </dt>
  353. <dd>
  354. <input type="text" name="smiley_code" id="smiley_code" value="" class="input_text" />
  355. </dd>
  356. <dt>
  357. <strong><label for="smiley_description">', $txt['smileys_description'], '</label>: </strong>
  358. </dt>
  359. <dd>
  360. <input type="text" name="smiley_description" id="smiley_description" value="" class="input_text" />
  361. </dd>
  362. <dt>
  363. <strong><label for="smiley_location">', $txt['smileys_location'], '</label>: </strong>
  364. </dt>
  365. <dd>
  366. <select name="smiley_location" id="smiley_location">
  367. <option value="0" selected="selected">
  368. ', $txt['smileys_location_form'], '
  369. </option>
  370. <option value="1">
  371. ', $txt['smileys_location_hidden'], '
  372. </option>
  373. <option value="2">
  374. ', $txt['smileys_location_popup'], '
  375. </option>
  376. </select>
  377. </dd>
  378. </dl>
  379. <input type="submit" value="', $txt['smileys_save'], '" class="button_submit" />
  380. </div>
  381. <span class="botslice"><span></span></span>
  382. </div>
  383. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  384. </form>
  385. </div>
  386. <br class="clear" />
  387. <script type="text/javascript"><!-- // --><![CDATA[
  388. function updatePreview()
  389. {
  390. var currentImage = document.getElementById("preview");
  391. currentImage.src = "', $modSettings['smileys_url'], '/" + document.forms.smileyForm.set.value + "/" + document.forms.smileyForm.smiley_filename.value;
  392. }
  393. // ]]></script>';
  394. }
  395. // Ordering smileys.
  396. function template_setorder()
  397. {
  398. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  399. echo '
  400. <div id="admincenter">';
  401. foreach ($context['smileys'] as $location)
  402. {
  403. echo '
  404. <form action="', $scripturl, '?action=admin;area=smileys;sa=editsmileys" method="post" accept-charset="', $context['character_set'], '">
  405. <div class="cat_bar">
  406. <h3 class="catbg">', $location['title'], '</h3>
  407. </div>
  408. <div class="information">
  409. ', $location['description'], '
  410. </div>
  411. <div class="windowbg">
  412. <span class="topslice"><span></span></span>
  413. <div class="content">
  414. <strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br />';
  415. foreach ($location['rows'] as $row)
  416. {
  417. if (!empty($context['move_smiley']))
  418. echo '
  419. <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/smiley_select_spot.gif" alt="', $txt['smileys_move_here'], '" /></a>';
  420. foreach ($row as $smiley)
  421. {
  422. if (empty($context['move_smiley']))
  423. echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '" /></a>';
  424. else
  425. echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: ', $smiley['selected'] ? '2px solid red' : '0px solid black', ';" alt="', $smiley['description'], '" /><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><img src="', $settings['images_url'], '/smiley_select_spot.gif" alt="', $txt['smileys_move_here'], '" /></a>';
  426. }
  427. echo '
  428. <br />';
  429. }
  430. if (!empty($context['move_smiley']))
  431. echo '
  432. <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/smiley_select_spot.gif" alt="', $txt['smileys_move_here'], '" /></a>';
  433. echo '
  434. </div>
  435. <span class="botslice"><span></span></span>
  436. </div>
  437. <input type="hidden" name="reorder" value="1" />
  438. </form>
  439. <br />';
  440. }
  441. echo '
  442. </div>
  443. <br class="clear" />';
  444. }
  445. // Editing Message Icons
  446. function template_editicons()
  447. {
  448. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  449. template_show_list('message_icon_list');
  450. }
  451. // Editing an individual message icon
  452. function template_editicon()
  453. {
  454. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  455. echo '
  456. <div id="admincenter">
  457. <form action="', $scripturl, '?action=admin;area=smileys;sa=editicon;icon=', $context['new_icon'] ? '0' : $context['icon']['id'], '" method="post" accept-charset="', $context['character_set'], '">
  458. <div class="cat_bar">
  459. <h3 class="catbg">
  460. ', $context['new_icon'] ? $txt['icons_new_icon'] : $txt['icons_edit_icon'], '
  461. </h3>
  462. </div>
  463. <div class="windowbg">
  464. <span class="topslice"><span></span></span>
  465. <div class="content">
  466. <dl class="settings">';
  467. if (!$context['new_icon'])
  468. echo '
  469. <dt>
  470. <strong>', $txt['smiley_preview'], ': </strong>
  471. </dt>
  472. <dd>
  473. <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '" />
  474. </dd>';
  475. echo '
  476. <dt>
  477. <strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br /><span class="smalltext">', $txt['icons_filename_all_gif'], '</span>
  478. </dt>
  479. <dd>
  480. <input type="text" name="icon_filename" id="icon_filename" value="', !empty($context['icon']['filename']) ? $context['icon']['filename'] . '.gif' : '', '" class="input_text" />
  481. </dd>
  482. <dt>
  483. <strong><label for="icon_description">', $txt['smileys_description'], '</label>: </strong>
  484. </dt>
  485. <dd>
  486. <input type="text" name="icon_description" id="icon_description" value="', !empty($context['icon']['title']) ? $context['icon']['title'] : '', '" class="input_text" />
  487. </dd>
  488. <dt>
  489. <strong><label for="icon_board_select">', $txt['icons_board'], '</label>: </strong>
  490. </dt>
  491. <dd>
  492. <select name="icon_board" id="icon_board_select">
  493. <option value="0"', empty($context['icon']['board_id']) ? ' selected="selected"' : '', '>', $txt['icons_edit_icons_all_boards'], '</option>';
  494. foreach ($context['categories'] as $category)
  495. {
  496. echo '
  497. <optgroup label="', $category['name'], '">';
  498. foreach ($category['boards'] as $board)
  499. echo '
  500. <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
  501. echo '
  502. </optgroup>';
  503. }
  504. echo '
  505. </select>
  506. </dd>
  507. <dt>
  508. <strong><label for="icon_location">', $txt['smileys_location'], '</label>: </strong>
  509. </dt>
  510. <dd>
  511. <select name="icon_location" id="icon_location">
  512. <option value="0"', empty($context['icon']['after']) ? ' selected="selected"' : '', '>', $txt['icons_location_first_icon'], '</option>';
  513. // Print the list of all the icons it can be put after...
  514. foreach ($context['icons'] as $id => $data)
  515. if (empty($context['icon']['id']) || $id != $context['icon']['id'])
  516. echo '
  517. <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected="selected"' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
  518. echo '
  519. </select>
  520. </dd>
  521. </dl>';
  522. if (!$context['new_icon'])
  523. echo '
  524. <input type="hidden" name="icon" value="', $context['icon']['id'], '" />';
  525. echo '
  526. <input type="submit" value="', $txt['smileys_save'], '" class="button_submit" />
  527. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  528. </div>
  529. <span class="botslice"><span></span></span>
  530. </div>
  531. </form>
  532. </div>
  533. <br class="clear" />';
  534. }
  535. ?>