Committer: Apostolos Koutsoulelos <apostolos@desktop.(none)>
[arthrology.git] / admin.arthrology.html.php
blob3255fe692477d806f04cf58545f23c1a23a57941
1 <?php
3 /*
4 * Arthrology for Elxis CMS 2008.x and 2009.x+
6 * Backend HTML Event Handler
8 * @version 1.3
9 * @package Arthrology
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @authorurl http://www.bitcraft-labs.gr
12 * @copyright Copyright (C) 2009-2011 Apostolos Koutsoulelos. All rights reserved.
13 * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
15 * @link http://www.elxis-downloads.com/downloads/miscellaneous/204.html
18 // Prevent direct inclusion of this file
19 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
21 // Includes
23 /*****************************************************************************/
24 /* THE CLASS THAT WILL CONTAIN THE COMPONENT'S BACK-END HTML FUNCTIONALITY */
25 /*****************************************************************************/
26 class clsArthrologyAdminHTML {
28 // Initialize variables
30 /**********************************************************************************/
31 /* Display control panel CONTROL PANEL */
32 /**********************************************************************************/
33 static public function showControlPanelHTML() {
34 global $objArthrology, $mainframe, $adminLanguage; // Pass global variables and objects
36 // add custom CSS file
37 ?><script type="text/javascript">
38 var objheader = document.getElementsByTagName("head")[0];
39 var csslink = document.createElement("link");
41 csslink.setAttribute("rel", "stylesheet");
42 csslink.setAttribute("type", "text/css");
43 csslink.setAttribute("href", "<?php echo $objArthrology->live_apath;?>/css/arthrology.admin.css");
44 csslink.setAttribute("media", "all");
46 objheader.appendChild(csslink);
47 </script><?php
49 // Load core HTML library
50 mosCommonHTML::loadOverlib();
53 <!-- An empty form, just to serve the toolbar -->
54 <form action="index2.php" method="get" name="adminForm">
55 <input type="hidden" name="option" value="com_arthrology" />
56 <input type="hidden" name="task" value="" />
57 </form>
59 <!-- Screen header -->
60 <table class="adminheading" width="100%">
61 <tr>
62 <th width="100%" style="background:url(<?php echo $objArthrology->live_apath; ?>/images/arthrology.png) no-repeat" style="text-align:left;">
63 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_GEN_COMPONENT_TITLE; ?> <small>[<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP; ?>]</small>
64 </th>
65 </tr>
66 </table>
68 <table style="width: 100%;"><tr>
69 <td style="vertical-align: top; width: 600px;">
70 <div class="cp_option">
71 <a href="index2.php?option=com_arthrology&amp;task=list">
72 <img src="<?php echo $objArthrology->live_apath; ?>/images/arthrology_articles64.png" border="0" alt="<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_ARTICLES; ?>" />
73 </a><br />
74 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_ARTICLES; ?>
75 </div>
76 <div class="cp_option">
77 <a href="index2.php?option=com_categories&amp;section=com_arthrology">
78 <img src="<?php echo $objArthrology->live_apath; ?>/images/arthrology_magazines64.png" border="0" alt="<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_MAGAZINES; ?>" />
79 </a><br />
80 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_MAGAZINES; ?>
81 </div>
82 <div class="cp_option">
83 <a href="index2.php?option=com_arthrology&task=conf&hidemainmenu=1">
84 <img src="<?php echo $objArthrology->live_apath; ?>/images/arthrology_config64.png" border="0" alt="<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_CONFIG; ?>" />
85 </a><br />
86 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_CONFIG; ?>
87 </div>
88 </td><td style="width: 5px;">
89 </td><td style="color: #333333; font-size: 12px;">
90 <h2><?php echo $adminLanguage->A_CMP_ARTHROLOGY_GEN_COMPONENT_TITLE; ?> v1.3</h2>
91 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_DESCRIPTION; ?> <br />
92 <br />
93 <b><?php echo $adminLanguage->A_VERSION; ?>:</b> 1.3 <br/>
94 <b><?php echo $adminLanguage->A_AUTHOR; ?>:</b> <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_AUTHOR_NAME; ?> <br/>
95 <b><?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_LICENSE; ?>:</b> GNU/GPL <br/>
96 <br/>
97 <b><?php echo $adminLanguage->A_CMP_ARTHROLOGY_CP_COMPATIBILITY; ?>:</b> Elxis CMS 2008.x and 2009.x <br/>
98 <br/>
99 Copyright © 2009-2011 Apostolos Koutsoulelos. All rights reserved. <br/>
100 <br/>
101 </td>
102 </tr></table>
103 <br/>
104 <br/>
105 <?php
108 /***********************************************************************************/
109 /* Show Configuration Panel CONFIGURATION */
110 /***********************************************************************************/
111 static public function showConfigurationHTML( $config_values ) {
112 global $objArthrology, $adminLanguage; // Pass global variables and objects
114 // Load core HTML library
115 mosCommonHTML::loadOverlib(); ?>
117 <script type="text/javascript">
118 function submitbutton(task) {
119 var form = document.adminForm;
120 if (task == 'cp_cancel') {
121 submitform( task );
122 return;
125 if ( form.limit.value == "" ) {
126 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_GENERAL_ALERT_LIMIT; ?>');
127 } else {
128 submitform(task);
132 function checkImport() {
133 var form = document.importForm;
135 if ( form.cvs.value == "" ) {
136 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT_ALERT_NO_CVS; ?>');
137 return false;
138 } else if (form.catid.value == "0" ) {
139 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT_ALERT_NO_MAGAZINE; ?>');
140 return false;
141 } else {
142 return true;
145 </script>
147 <!-- Screen header -->
148 <table class="adminheading" width="100%">
149 <tr>
150 <th width="100%" style="text-align:left;">
151 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_GEN_COMPONENT_TITLE; ?> <small>[<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF; ?>]</small>
152 </th>
153 </tr>
154 </table>
156 <table class="adminform" style="height: 400px;">
157 <tr>
158 <td width="50%" valign="top">
159 <?php
160 $tabulator = new mosTabs( 0 );
161 $tabulator->startPane( "Configure" );
162 $tabulator->startTab( $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_GENERAL, "general" );
164 <form action="index2.php" method="post" name="adminForm">
165 <input type="hidden" name="option" value="com_arthrology" />
166 <input type="hidden" name="task" value="cp_save" />
168 <table>
169 <tr>
170 <td valign="top">
171 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_GENERAL_LIMIT; ?>:
172 </td>
173 <td valign="top"><?php
174 $length[] = mosHTML::makeOption( "15", "15" );
175 $length[] = mosHTML::makeOption( "25", "25");
176 $length[] = mosHTML::makeOption( "50", "50" );
177 echo mosHTML::selectList($length, "limit", "","value", "text", $config_values->get('limit', '25')); ?>
178 </td>
179 <td align="right" valign="top">
180 <?php echo mosToolTip( $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_GENERAL_LIMIT_TOOLTIP, $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_GENERAL_LIMIT ); ?>
181 </td>
182 </tr>
183 </table>
184 </form>
185 <?php
186 $tabulator->endTab();
187 $tabulator->startTab( $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT, "import" );
189 <form action="index2.php" method="post" name="importForm">
190 <input type="hidden" name="option" value="com_arthrology" />
191 <input type="hidden" name="task" value="cp_import" />
192 <table width="100%">
193 <tr>
194 <td valign="top" colspan="3">
195 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT_TEXT; ?>
196 </td>
197 </tr>
198 <tr>
199 <td valign="top">
200 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT_MAGAZINE; ?>:
201 </td>
202 <td valign="top" colspan="2">
203 <?php echo mosAdminMenus::ComponentCategory('catid','com_arthrology'); ?>
204 </td>
205 </tr>
206 <tr>
207 <td valign="top">
208 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT_CVS; ?>:
209 </td>
210 <td valign="top" colspan="2">
211 <textarea id="cvs" name="cvs" cols="100" rows="40" style="width:100%px; height:300px;"></textarea>
212 </td>
213 </tr>
214 <tr>
215 <td><?php echo $adminLanguage->A_PUBLISHED ?>:</td>
216 <td colspan="2">
217 <?php echo mosHTML::yesnoRadioList( 'published', '', 1 ); ?>
218 </td>
219 </tr>
220 <tr><td valign="top" colspan="3">
221 <input class="input" type="submit" name="submit" value="<?php echo $adminLanguage->A_CMP_ARTHROLOGY_CONF_TAB_IMPORT; ?>" onclick="return checkImport()"/>
222 </td></tr>
223 </table>
224 </form>
225 <?php
226 $tabulator->endTab();
227 $tabulator->endPane();
229 </td>
230 </tr>
231 </table>
232 <?php
235 /**************************************************************************/
236 /* Display article list EDIT */
237 /**************************************************************************/
238 static public function listArticlesHTML($results, $pageNav, $catlist) {
239 global $my, $adminLanguage, $objArthrology; // Pass global variables and objects
241 <form action="index2.php" method="get" name="adminForm">
242 <input type="hidden" name="option" value="com_arthrology" />
243 <input type="hidden" name="task" value="" />
244 <input type="hidden" name="boxchecked" value="0" />
245 <input type="hidden" name="field" value="<?php echo mosGetParam( $_REQUEST, "field", "") ?>" />
246 <input type="hidden" name="order" value="<?php echo mosGetParam( $_REQUEST, "order", "none") ?>" />
248 <script type="text/javascript" src="<?php echo $objArthrology->live_apath; ?>/arthrology.ajax.js"></script>
250 <table class="adminheading" width="100%">
251 <tr>
252 <th rowspan="2" style="background: url(<?php echo $objArthrology->live_apath; ?>/images/arthrology.png) no-repeat;">
253 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_GEN_COMPONENT_TITLE; ?> <span style="font-size: small;" dir="ltr"> [<?php echo $adminLanguage->A_CMP_ARTHROLOGY_LIST_ARTICLES ?>]</span>
254 </th>
256 <td align="right" valign="top"><?php echo $adminLanguage->A_FILTER ?>: &nbsp;</td>
257 <td valign="top">
258 <input name="search" value="<?php echo mosGetParam($_REQUEST, "search", "") ?>" class="inputbox" onchange="document.adminForm.submit();" type="text" />
259 </td>
260 <td align="right" valign="top">
261 <?php echo $catlist; ?>
262 </td>
263 </tr>
264 </table>
266 <table class="adminlist">
267 <tr>
268 <th width="2%">#</th>
269 <th width="2%"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($results); ?>);" /></th>
270 <th width="56%" align="left"><?php echo clsArthrologyAdminHTML::sortIcon("title") ?><?php echo $adminLanguage->A_TITLE ?></th>
271 <th width="5%"><nobr><?php echo clsArthrologyAdminHTML::sortIcon("published") ?><?php echo $adminLanguage->A_PUBLISHED ?></nobr></th>
272 <th width="7%"><?php echo $adminLanguage->A_ID ?></th>
273 <th width="20%" align="left"><nobr><?php echo clsArthrologyAdminHTML::sortIcon("catid") ?><?php echo $adminLanguage->A_CMP_ARTHROLOGY_LIST_MAGAZINE ?></nobr></th>
274 <th width="10%"><?php echo clsArthrologyAdminHTML::sortIcon("year") ?><?php echo $adminLanguage->A_CMP_ARTHROLOGY_LIST_YEAR ?></th>
275 </tr>
276 <?php
277 $toggle = true;
278 $count = -1;
279 $unpublished = 0;
281 foreach ($results AS $art) {
282 $count++;
283 $toggle = ($toggle)?false:true;
284 $cat_params = new mosParameters ($art->cat_params);
286 <tr class="<?php echo ($toggle)?"row0":"row1" ?>">
287 <td><?php echo $pageNav->rowNumber( $count ); ?></td>
288 <td><?php echo mosCommonHTML::CheckedOutProcessing( $art, $count ); ?></td>
289 <td>
290 <?php
291 if ( $art->checked_out && ( $art->checked_out != $my->id ) ) {
292 echo '<b>' . htmlspecialchars( $art->title, ENT_QUOTES ) . '</b>';
293 } else {
295 <a href="index2.php?option=com_arthrology&task=edit&hidemainmenu=1&cid=<?php echo $art->id ?>" title="<?php echo $adminLanguage->A_EDIT ?>">
296 <?php echo htmlspecialchars($art->title, ENT_QUOTES); ?>
297 </a>
298 <?php
301 </td>
302 <td align="center">
303 <?php if ($art->published == 1) {
304 $img = 'publish_g.png';
305 $alt = $adminLanguage->A_PUBLISHED;
306 } else if ($art->published == 0){
307 $img = 'publish_x.png';
308 $alt = $adminLanguage->A_UNPUBLISHED;
309 } else if ($art->published == -1) {
310 $img = 'publish_y.png';
311 $alt = $adminLanguage->A_UNPUBLISHED;
312 } ?>
313 <div id="constatus<?php echo $count; ?>">
314 <a href="javascript: void(0);" onclick="changeContentState('<?php echo $count; ?>', '<?php echo $art->id; ?>', '<?php echo (($art->published == 0) || ($art->published == -1)) ? 1 : 0; ?>'); return nd();">
315 <img src="images/<?php echo $img; ?>" width="12" height="12" border="0" alt="<?php echo $alt; ?>" />
316 </a>
317 </div>
319 </td>
320 <td align="center"><?php echo $art->id ?></td>
321 <td align="left"><?php echo $art->cat_name ?></td>
322 <td align="center"><?php echo $art->year ?></td>
323 </tr>
324 <?php
326 if ($unpublished) {
328 <tr>
329 <td colspan="10"></td>
330 </tr>
331 <?php
334 </table>
335 <?php
336 echo $pageNav->getListFooter();
338 </form>
339 <?php
342 /***********************************************************************************/
343 /* Display edit/add article CONFIGURATION */
344 /***********************************************************************************/
345 static public function editArticleHTML($article = null) {
346 global $objArthrology, $adminLanguage, $database, $mosConfig_lifetime, $my;
348 //CSRF prevention
349 $tokname = 'token'.$my->id;
350 $mytoken = md5(uniqid(rand(), TRUE));
351 $_SESSION[$tokname] = $mytoken;
353 mosCommonHTML::loadOverlib();
355 <script type="text/javascript">
356 function submitbutton(pressbutton, section) {
357 var form = document.adminForm;
358 if (pressbutton == 'cancel') {
359 submitform( pressbutton );
360 return;
363 if ( form.title.value == "" ) {
364 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_ALERT_NO_TITLE ?>');
365 } else if ( form.seotitle.value == "" ) {
366 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_ALERT_NO_SEOTITLE ?>');
367 } else if ( form.catid.value == "0" ) {
368 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_ALERT_NO_MAGAZINE ?>');
369 } else if ( form.author.value == "" ) {
370 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_ALERT_NO_AUTHOR ?>');
371 } else if ( form.year.value == "" ) {
372 alert('<?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_ALERT_NO_YEAR ?>');
373 } else {
374 submitform(pressbutton);
378 </script>
379 <!-- include AJAX scripts -->
380 <script type="text/javascript" src="<?php echo $objArthrology->live_apath; ?>/arthrology.ajax.js"></script>
382 <!-- include Countdown -->
383 <div class="countdown">
384 <?php echo $adminLanguage->A_TIMESESSEXP; ?>: <span id="countdown"></span>
385 </div>
387 <form action="index2.php" method="post" name="adminForm">
388 <input type="hidden" name="option" value="com_arthrology" />
389 <input type="hidden" name="task" value="" />
390 <input type="hidden" name="boxchecked" value="0" />
391 <input type="hidden" name="id" value="<?php echo (isset($article))?$article->id:""; ?>" />
392 <input type="hidden" name="<?php echo $tokname; ?>" value="<?php echo $mytoken; ?>" autocomplete="off" />
394 <table width="100%">
395 <tr>
396 <td colspan="2">
397 <table class="adminheading">
398 <tr>
399 <th>
400 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_GEN_COMPONENT_TITLE ?>:
401 <?php
402 switch ( $objArthrology->task ) {
403 case 'new':
404 echo $adminLanguage->A_NEW;
405 break;
406 case 'edit':
407 echo $adminLanguage->A_EDIT
408 .' <span style="font-size: small;" dir="ltr">[ '
409 .$adminLanguage->A_CATEGORY
410 .': '
411 .$article->category
412 .']</span>';
413 break;
414 } ?>
415 </th>
416 </tr>
417 </table>
418 </td>
419 </tr>
420 <tr valign="top">
421 <td width="60%">
422 <table class="adminform">
423 <tr>
424 <th colspan="3" class="title"><?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_DETAILS ?></th>
425 </tr>
426 <tr>
427 <td><?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_MAGAZINE; ?>:</td>
428 <td>
429 <?php
430 if (isset($article)) {
431 $active = $article->catid;
432 $cat_params = new mosParameters($article->cat_params);
433 } else {
434 $active = NULL;
436 echo mosAdminMenus::ComponentCategory('catid','com_arthrology', $active);
438 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_YEAR ?>: <input type="text" name="year" size="4" class="inputbox" value="<?php echo (isset($article))?htmlspecialchars( $article->year, ENT_QUOTES ):"" ?>" />
439 <?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_PAGE ?>: <input type="text" name="pages" size="10" class="inputbox" value="<?php echo (isset($article))?htmlspecialchars( $article->pages, ENT_QUOTES ):"" ?>" />
440 </td>
441 <td></td>
442 </tr>
443 <tr>
444 <td><?php echo $adminLanguage->A_TITLE; ?>:</td>
445 <td><input type="text" name="title" size="60" class="inputbox" value="<?php echo (isset($article))?htmlspecialchars( $article->title, ENT_QUOTES ):"" ?>" /></td>
446 <td></td>
447 </tr>
448 <tr>
449 <td valign="top"><?php echo $adminLanguage->A_SEOTITLE; ?>:</td>
450 <td>
451 <input type="text" name="seotitle" id="seotitle" dir="ltr" class="inputbox" value="<?php echo (isset($article))?$article->seotitle:""; ?>" size="30" maxlength="100" /><br />
452 <a href="javascript:;" onclick="suggestSEO()"><?php echo $adminLanguage->A_SEOTSUG; ?></a> &nbsp; | &nbsp;
453 <a href="javascript:;" onclick="validateSEO()"><?php echo $adminLanguage->A_SEOTVAL; ?></a><br />
454 <div id="valseo" style="height: 20px;"></div>
455 </td>
456 <td>
457 <?php echo mosToolTip($adminLanguage->A_SEOTHELP, $adminLanguage->A_SEOTITLE); ?>
458 </td>
459 </tr>
460 <tr>
461 <td><?php echo $adminLanguage->A_CMP_ARTHROLOGY_EDIT_AUTHOR; ?>:</td>
462 <td><input type="text" name="author" size="60" class="inputbox" value="<?php echo (isset($article))?htmlspecialchars( $article->author, ENT_QUOTES ):"" ?>" /></td>
463 </tr>
464 <tr>
465 <td><?php echo $adminLanguage->A_PUBLISHED ?>:</td>
466 <td colspan="2">
467 <?php echo mosHTML::yesnoRadioList( 'published', '', intval( isset($article) && $article->published ) ); ?>
468 </td>
469 </tr>
470 <tr>
471 <td valign="top"><?php echo $adminLanguage->A_DESCRIPTION ?>:</td>
472 <td colspan="2">
473 <?php
474 //parameters : areaname, content, hidden field, width, height, rows, cols
475 editorArea( 'editor1', ((isset($article))?$article->description:'') , 'description', '450', '300', '60', '20' );
477 </td>
478 </tr>
479 </table>
480 </td>
481 <td width="40%">
482 <?php
483 $tabulator = new mosTabs( 0 );
484 $tabulator->startPane( "Configure" );
485 $tabulator->startTab( $adminLanguage->A_CMP_ARTHROLOGY_EDIT_TAGS, "repeat" );
487 <table class="adminform">
488 <tr valign="top">
489 <td colspan="2"><input type="text" name="tags" size="60" class="inputbox" value="<?php echo (isset($article))?htmlspecialchars( $article->tags, ENT_QUOTES ):"" ?>" /></td>
490 <td>
491 <?php echo mosToolTip($adminLanguage->A_CMP_ARTHROLOGY_EDIT_TAGS_TOOLTIP, $adminLanguage->A_CMP_ARTHROLOGY_EDIT_TAGS) ?>
492 </td>
493 </tr>
494 </table>
495 </td>
496 </tr>
497 </table>
498 </form>
500 <script type="text/javascript">
501 //start session countdown
502 function sessioncountdown(secs) {
503 var cel = document.getElementById('countdown');
504 if (secs > 0) {
505 var dmins = Math.ceil(secs/60);
506 var text = '';
507 if (dmins > 1) {
508 text = '<strong>'+dmins+'</strong> <?php echo $adminLanguage->A_MINUTES; ?>';
509 } else if (secs == 60) {
510 text = '<strong>1</strong> <?php echo $adminLanguage->A_MINUTE; ?>';
511 } else if (secs > 30) {
512 text = '<strong>'+secs+'</strong> <?php echo $adminLanguage->A_SECONDS; ?>';
513 } else if (secs > 1) {
514 text = '<span style="color:red;"><strong>'+secs+'</strong> <?php echo $adminLanguage->A_SECONDS; ?></span>';
515 } else if (secs == 1) {
516 text = '<span style="color:red;"><strong>1</strong> <?php echo $adminLanguage->A_SECOND; ?></span>';
518 cel.innerHTML = text;
519 secs = secs -1;
520 setTimeout("sessioncountdown("+secs+")",1000);
521 } else {
522 cel.innerHTML = '<span style="color: red; font-weight: bold;"><?php echo $adminLanguage->A_SESSEXPIRED; ?></span>';
526 sessioncountdown('<?php echo $mosConfig_lifetime; ?>');
527 </script>
529 <?php }
531 /****************************************************************************/
532 /* Return the the source-code for a sort-icon HELPER */
533 /****************************************************************************/
534 function sortIcon( $field ) {
535 $valid_array = Array("option", "field", "state", "published", "catid");
537 if ( mosGetParam( $_REQUEST, "field", "") == $field)
538 $state = mosGetParam( $_REQUEST, "order", NULL);
540 $params = array_keys( $_REQUEST );
541 $base = "";
543 for ( $i=0; $i < count( $_REQUEST ); $i++ ) {
544 if ( in_array($params[$i], $valid_array) ) {
545 $base = $base . "&" . $params[$i] . "=" . $_REQUEST[$params[$i]];
549 $base = "index2.php?" . substr( $base, 1 );
551 if (isset($state)) {
552 return mosHTML::sortIcon( $base, $field, $state ) . "&nbsp;";
553 } else {
554 return mosHTML::sortIcon( $base, $field ) . "&nbsp;";
558 } ?>