1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15:
16: $current_path = __DIR__;
17: if (DIRECTORY_SEPARATOR !== '/') {
18: $current_path = str_replace(DIRECTORY_SEPARATOR, '/', $current_path);
19: }
20: $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/'));
21: include_once $xoops_root_path . '/mainfile.php';
22: defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
23:
24:
25: include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
26:
27:
28: $admin = false;
29:
30: $gperm_handler = xoops_getHandler('groupperm');
31: $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
32: $admin = $gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_IMAGE, $groups);
33:
34:
35: $imgcat_handler = xoops_getHandler('imagecategory');
36: $catreadlist = $imgcat_handler->getList($groups, 'imgcat_read', 1);
37: $catwritelist = $imgcat_handler->getList($groups, 'imgcat_write', 1);
38:
39: $canbrowse = ($admin || !empty($catreadlist) || !empty($catwritelist)) ? true : false;
40:
41: echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
42: echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '">';
43: ?>
44: <head>
45: <title>{
46: <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
47: <script type="text/javascript" src="../../utils/mctabs.js"></script>
48: <script type="text/javascript" src="../../utils/form_utils.js"></script>
49: <script type="text/javascript" src="../../utils/validate.js"></script>
50: <script type="text/javascript" src="js/xoopsimagemanager.js"></script>
51: <link href="css/xoopsimagemanager.css" rel="stylesheet" type="text/css"/>
52: <base target="_self"/>
53: </head>
54:
55: <body id="xoopsimagemanager" style="display: none;">
56: <form onsubmit="XoopsimagemanagerDialog.insert();return false;" action="#">
57: <div class="tabs">
58: <ul>
59: <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');"
60: onmousedown="return false;">{
61: <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{
62: </li>
63: <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{
64: </li>
65: </ul>
66: </div>
67:
68: <div class="panel_wrapper">
69: <div id="general_panel" class="panel current">
70: <fieldset>
71: <legend>{
72: <table class="properties">
73: <tr>
74: <td class="column1">
75: <label id="srclabel" for="src">{
76: </td>
77: <td colspan="2">
78: <table border="0" cellspacing="0" cellpadding="0">
79: <tr>
80: <td>
81: <input name="src" type="text" id="src" value=""
82: onchange="XoopsimagemanagerDialog.showPreviewImage(this.value);"/>
83: <?php echo imageBrowser('src', $canbrowse); ?>
84: </td>
85: <td id="srcbrowsercontainer"> </td>
86: </tr>
87: </table>
88: </td>
89: </tr>
90: <tr>
91: <td><label for="src_list">{
92: <td><select id="src_list" name="src_list"
93: onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;XoopsimagemanagerDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select>
94: </td>
95: </tr>
96: <tr>
97: <td class="column1"><label id="altlabel" for="alt">{
98: <td colspan="2"><input id="alt" name="alt" type="text" value=""/></td>
99: </tr>
100: <tr>
101: <td class="column1"><label id="titlelabel" for="title">{
102: <td colspan="2"><input id="title" name="title" type="text" value=""/></td>
103: </tr>
104: </table>
105: </fieldset>
106:
107: <fieldset>
108: <legend>{
109: <div id="prev"></div>
110: </fieldset>
111: </div>
112:
113: <div id="appearance_panel" class="panel">
114: <fieldset>
115: <legend>{
116:
117: <table border="0" cellpadding="4" cellspacing="0">
118: <tr>
119: <td class="column1"><label id="alignlabel" for="align">{
120: <td>
121: <select id="align" name="align"
122: onchange="XoopsimagemanagerDialog.updateStyle('align');XoopsimagemanagerDialog.changeAppearance();">
123: <option value="">{
124: <option value="baseline">{
125: <option value="top">{
126: <option value="middle">{
127: <option value="bottom">{
128: <option value="text-top">{
129: <option value="text-bottom">{
130: <option value="left">{
131: <option value="right">{
132: </select>
133: </td>
134: <td rowspan="6" valign="top">
135: <div class="alignPreview">
136: <img id="alignSampleImg" src="img/sample.gif" alt="{#xoopsimagemanager_dlg.example_img}"/>
137: Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
138: nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
139: edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
140: erat volutpat.
141: </div>
142: </td>
143: </tr>
144:
145: <tr>
146: <td class="column1"><label id="widthlabel" for="width">{
147: <td nowrap="nowrap">
148: <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size"
149: onchange="XoopsimagemanagerDialog.changeHeight();"/> x
150: <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size"
151: onchange="XoopsimagemanagerDialog.changeWidth();"/> px
152: </td>
153: </tr>
154:
155: <tr>
156: <td> </td>
157: <td>
158: <table border="0" cellpadding="0" cellspacing="0">
159: <tr>
160: <td><input id="constrain" type="checkbox" name="constrain" class="checkbox"/></td>
161: <td><label id="constrainlabel" for="constrain">{
162: </tr>
163: </table>
164: </td>
165: </tr>
166:
167: <tr>
168: <td class="column1"><label id="vspacelabel" for="vspace">{
169: <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number"
170: onchange="XoopsimagemanagerDialog.updateStyle('vspace');XoopsimagemanagerDialog.changeAppearance();"
171: onblur="XoopsimagemanagerDialog.updateStyle('vspace');XoopsimagemanagerDialog.changeAppearance();"/>
172: </td>
173: </tr>
174:
175: <tr>
176: <td class="column1"><label id="hspacelabel" for="hspace">{
177: <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number"
178: onchange="XoopsimagemanagerDialog.updateStyle('hspace');XoopsimagemanagerDialog.changeAppearance();"
179: onblur="XoopsimagemanagerDialog.updateStyle('hspace');XoopsimagemanagerDialog.changeAppearance();"/></td>
180: </tr>
181:
182: <tr>
183: <td class="column1"><label id="borderlabel" for="border">{
184: <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number"
185: onchange="XoopsimagemanagerDialog.updateStyle('border');XoopsimagemanagerDialog.changeAppearance();"
186: onblur="XoopsimagemanagerDialog.updateStyle('border');XoopsimagemanagerDialog.changeAppearance();"/></td>
187: </tr>
188:
189: <tr>
190: <td><label for="class_list">{
191: <td><select id="class_list" name="class_list"></select></td>
192: </tr>
193:
194: <tr>
195: <td class="column1"><label id="stylelabel" for="style">{
196: <td colspan="2"><input id="style" name="style" type="text" value="" onchange="XoopsimagemanagerDialog.changeAppearance();"/>
197: </td>
198: </tr>
199:
200: <!-- <tr>
201: <td class="column1"><label id="classeslabel" for="classes">{
202: <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
203: </tr> -->
204: </table>
205: </fieldset>
206: </div>
207:
208: <div id="advanced_panel" class="panel">
209: <fieldset>
210: <legend>{
211:
212: <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox"
213: onclick="XoopsimagemanagerDialog.setSwapImage(this.checked);"/>
214: <label id="onmousemovechecklabel" for="onmousemovecheck">{
215:
216: <table border="0" cellpadding="4" cellspacing="0" width="100%">
217: <tr>
218: <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{
219: <td>
220: <table border="0" cellspacing="0" cellpadding="0">
221: <tr>
222: <td>
223: <input id="onmouseoversrc" name="onmouseoversrc" type="text" value=""/>
224: <?php echo imageBrowser('onmouseoversrc', $canbrowse); ?>
225: </td>
226: <td id="onmouseoversrccontainer"> </td>
227: </tr>
228: </table>
229: </td>
230: </tr>
231: <tr>
232: <td><label for="over_list">{
233: <td><select id="over_list" name="over_list"
234: onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
235: </tr>
236: <tr>
237: <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{
238: <td class="column2">
239: <table border="0" cellspacing="0" cellpadding="0">
240: <tr>
241: <td>
242: <input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value=""/>
243: <?php echo imageBrowser('onmouseoutsrc', $canbrowse); ?>
244: </td>
245: <td id="onmouseoutsrccontainer"> </td>
246: </tr>
247: </table>
248: </td>
249: </tr>
250: <tr>
251: <td><label for="out_list">{
252: <td><select id="out_list" name="out_list"
253: onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
254: </tr>
255: </table>
256: </fieldset>
257:
258: <fieldset>
259: <legend>{
260:
261: <table border="0" cellpadding="4" cellspacing="0">
262: <tr>
263: <td class="column1"><label id="idlabel" for="id">{
264: <td><input id="id" name="id" type="text" value=""/></td>
265: </tr>
266:
267: <tr>
268: <td class="column1"><label id="dirlabel" for="dir">{
269: <td>
270: <select id="dir" name="dir" onchange="XoopsimagemanagerDialog.changeAppearance();">
271: <option value="">{
272: <option value="ltr">{
273: <option value="rtl">{
274: </select>
275: </td>
276: </tr>
277:
278: <tr>
279: <td class="column1"><label id="langlabel" for="lang">{
280: <td>
281: <input id="lang" name="lang" type="text" value=""/>
282: </td>
283: </tr>
284:
285: <tr>
286: <td class="column1"><label id="usemaplabel" for="usemap">{
287: <td>
288: <input id="usemap" name="usemap" type="text" value=""/>
289: </td>
290: </tr>
291:
292: <tr>
293: <td class="column1"><label id="longdesclabel" for="longdesc">{
294: <td>
295: <table border="0" cellspacing="0" cellpadding="0">
296: <tr>
297: <td><input id="longdesc" name="longdesc" type="text" value=""/></td>
298: <td id="longdesccontainer"> </td>
299: </tr>
300: </table>
301: </td>
302: </tr>
303: </table>
304: </fieldset>
305: </div>
306: </div>
307:
308: <div class="mceActionPanel">
309: <div style="float: left;">
310: <input type="button" id="insert" name="insert" value="{#insert}" onclick="XoopsimagemanagerDialog.insert();"/>
311: </div>
312:
313: <div style="float: right;">
314: <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();"/>
315: </div>
316: </div>
317: </form>
318: </body>
319: </html>
320:
321: <?php
322: 323: 324: 325: 326: 327:
328: function imageBrowser($inputname = 'src', $canbrowse = false)
329: {
330: $html = '';
331: if ($canbrowse) {
332: $html = "<img title=\"{#xoopsimagebrowser.desc}\" class=\"xoopsimagebrowser\" src=\"img/xoopsimagemanager.png\"
333: onclick=\"javascript:XoopsImageBrowser('" . $inputname . "');\" />\n";
334: }
335:
336: return $html;
337: }
338:
339: ?>
340: