| @@ 436-680 (lines=245) @@ | ||
| 433 | /** |
|
| 434 | * @param int $showCreate |
|
| 435 | */ |
|
| 436 | public static function showArticles($showCreate = 0) |
|
| 437 | { |
|
| 438 | global $xoopsGTicket; |
|
| 439 | global $xoopsModuleConfig, $xoopsModule; |
|
| 440 | $myts = MyTextSanitizer::getInstance(); |
|
| 441 | ||
| 442 | $pathIcon16 = Xmf\Module\Admin::iconUrl('', 16); |
|
| 443 | require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 444 | require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 445 | require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
| 446 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/cleantags.php'; |
|
| 447 | ||
| 448 | $module_id = $xoopsModule->getVar('mid'); |
|
| 449 | $startart = isset($_GET['startart']) ? (int)$_GET['startart'] : 0; |
|
| 450 | if (isset($_POST['entries'])) { |
|
| 451 | $entries = (int)$_POST['entries']; |
|
| 452 | } else { |
|
| 453 | $entries = isset($_GET['entries']) ? (int)$_GET['entries'] : 0; |
|
| 454 | } |
|
| 455 | //---GET view sort -- |
|
| 456 | $sortname = isset($_GET['sortname']) ? strtolower(trim(strip_tags($myts->stripSlashesGPC($_GET['sortname'])))) : 'datesub'; |
|
| 457 | if (!in_array($sortname, array('datesub', 'weight', 'counter', 'rating', 'headline'))) { |
|
| 458 | $sortname = 'datesub'; |
|
| 459 | } |
|
| 460 | $sortorder = isset($_GET['sortorder']) ? strtoupper(trim(strip_tags($myts->stripSlashesGPC($_GET['sortorder'])))) : 'DESC'; |
|
| 461 | if (!in_array($sortorder, array('ASC', 'DESC'))) { |
|
| 462 | $sortorder = 'DESC'; |
|
| 463 | } |
|
| 464 | //--------------- |
|
| 465 | /* Code to show existing articles */ |
|
| 466 | echo "<h3 style='color: #2F5376; margin: 0 0 4px 0;'>" . _AM_SOAPBOX_SHOWARTS . '</h3>'; |
|
| 467 | echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SOAPBOX_ARTSTEXT . '</span>'; |
|
| 468 | ||
| 469 | // if ($showCreate == 1) { |
|
| 470 | // echo |
|
| 471 | // "<a style='border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 1em; padding: 4px 8px; text-align:center;' href='article.php'>" |
|
| 472 | // . _AM_SOAPBOX_CREATEART . "</a><br><br>"; |
|
| 473 | // } |
|
| 474 | // Articles count |
|
| 475 | $entrydataHandler = xoops_getModuleHandler('entrydata', $xoopsModule->dirname()); |
|
| 476 | //---------------------------- |
|
| 477 | $criteria = new CriteriaCompo(); |
|
| 478 | $criteria->add(new Criteria('submit', 0)); |
|
| 479 | $criteria->add(new Criteria('offline', 0)); |
|
| 480 | $tot_published = $entrydataHandler->getArticleCount($criteria); |
|
| 481 | unset($criteria); |
|
| 482 | //---------------------------- |
|
| 483 | $criteria = new CriteriaCompo(); |
|
| 484 | $criteria->add(new Criteria('submit', 0)); |
|
| 485 | $criteria->add(new Criteria('offline', 1)); |
|
| 486 | $tot_offline = $entrydataHandler->getArticleCount($criteria); |
|
| 487 | unset($criteria); |
|
| 488 | //---------------------------- |
|
| 489 | $criteria = new CriteriaCompo(); |
|
| 490 | $criteria->add(new Criteria('submit', 1)); |
|
| 491 | $tot_submitted = $entrydataHandler->getArticleCount($criteria); |
|
| 492 | unset($criteria); |
|
| 493 | //---------------------------- |
|
| 494 | $tot_all = $entrydataHandler->getArticleCount(); |
|
| 495 | //---------------------------- |
|
| 496 | $criteria = new CriteriaCompo(); |
|
| 497 | $criteria->add(new Criteria('submit', 0)); |
|
| 498 | $tot_ok = $entrydataHandler->getArticleCount($criteria); |
|
| 499 | unset($criteria); |
|
| 500 | //---------------------------- |
|
| 501 | ||
| 502 | // Prepare string for table head |
|
| 503 | if ($entries === 0) { |
|
| 504 | $string = _AM_SOAPBOX_SHWALL; |
|
| 505 | } |
|
| 506 | if ($entries === 1) { |
|
| 507 | $string = _AM_SOAPBOX_SHWONL; |
|
| 508 | } |
|
| 509 | if ($entries === 2) { |
|
| 510 | $string = _AM_SOAPBOX_SHWOFF; |
|
| 511 | } |
|
| 512 | if ($entries === 3) { |
|
| 513 | $string = _AM_SOAPBOX_SHWSUB; |
|
| 514 | } |
|
| 515 | if ($entries === 4) { |
|
| 516 | $string = _AM_SOAPBOX_SHWAPV; |
|
| 517 | } |
|
| 518 | ||
| 519 | /* Code to show selected articles */ |
|
| 520 | echo "<form name='pick' id='pick' action='" . $myts->htmlSpecialChars(xoops_getenv('PHP_SELF')) . "' method='POST' style='margin: 0;'>"; ?> |
|
| 521 | <table width='100%' cellspacing='1' cellpadding='2' border='0' |
|
| 522 | style='border-left: 1px solid silver; border-top: 1px solid silver; border-right: 1px solid silver;'> |
|
| 523 | <tr> |
|
| 524 | <td class='odd'><span style='font-weight: bold; font-variant: small-caps;'><?php echo $string ?></span></td> |
|
| 525 | <td class='odd' width='40%' align='right'><?php echo _AM_SOAPBOX_SELECTSTATUS; ?> |
|
| 526 | <select name='entries' onchange='submit()'> |
|
| 527 | <option value='0' |
|
| 528 | <?php |
|
| 529 | if ($entries === 0) { |
|
| 530 | echo 'selected'; |
|
| 531 | } ?>> |
|
| 532 | <?php echo _AM_SOAPBOX_SELALL; ?> |
|
| 533 | [<?php echo $tot_all; ?>] |
|
| 534 | </option> |
|
| 535 | <option value='1' <?php if ($entries === 1) { |
|
| 536 | echo 'selected'; |
|
| 537 | } ?>><?php echo _AM_SOAPBOX_SELONL; ?> |
|
| 538 | [<?php echo $tot_published; ?>] |
|
| 539 | </option> |
|
| 540 | <option value='2' <?php if ($entries === 2) { |
|
| 541 | echo 'selected'; |
|
| 542 | } ?>> |
|
| 543 | <?php echo _AM_SOAPBOX_SELOFF; ?> |
|
| 544 | [<?php echo $tot_offline; ?>] |
|
| 545 | </option> |
|
| 546 | <option value='3' <?php if ($entries === 3) { |
|
| 547 | echo 'selected'; |
|
| 548 | } ?>> |
|
| 549 | <?php echo _AM_SOAPBOX_SELSUB; ?> |
|
| 550 | [<?php echo $tot_submitted; ?>] |
|
| 551 | </option> |
|
| 552 | <option value='4' <?php if ($entries === 4) { |
|
| 553 | echo 'selected'; |
|
| 554 | } ?>><?php echo _AM_SOAPBOX_SELAPV; ?> |
|
| 555 | [<?php echo $tot_ok; ?>] |
|
| 556 | </option> |
|
| 557 | </select> |
|
| 558 | </td> |
|
| 559 | </tr> |
|
| 560 | </table> |
|
| 561 | </form> |
|
| 562 | <?php |
|
| 563 | ||
| 564 | //---------------------------- |
|
| 565 | // Put column names in an array, to avoid a query in the while loop further ahead |
|
| 566 | switch ($entries) { |
|
| 567 | case 1: |
|
| 568 | $submit = 0; |
|
| 569 | $offline = 0; |
|
| 570 | break; |
|
| 571 | case 2: |
|
| 572 | //---------------------------- |
|
| 573 | $submit = 0; |
|
| 574 | $offline = 1; |
|
| 575 | break; |
|
| 576 | case 3: |
|
| 577 | //---------------------------- |
|
| 578 | $submit = 1; |
|
| 579 | $offline = null; |
|
| 580 | break; |
|
| 581 | case 4: |
|
| 582 | //---------------------------- |
|
| 583 | $submit = 0; |
|
| 584 | break; |
|
| 585 | case 0: |
|
| 586 | default: |
|
| 587 | $submit = null; |
|
| 588 | $offline = null; |
|
| 589 | break; |
|
| 590 | } |
|
| 591 | // function &getArticlesAllPermcheck( |
|
| 592 | // $limit=0, $start=0, |
|
| 593 | // $checkRight = true, $published = true, $submit = 0, $offline = 0, $block = null , |
|
| 594 | // $sortname = 'datesub', $sortorder = 'DESC', |
|
| 595 | // $select_sbcolumns = null , $NOTarticleIDs = null , |
|
| 596 | // $approve_submit = false , |
|
| 597 | // $id_as_key = false ) |
|
| 598 | //------------------------------------- |
|
| 599 | $_entryob_arr = $entrydataHandler->getArticlesAllPermcheck((int)$xoopsModuleConfig['perpage'], $startart, false, false, $submit, $offline, null, $sortname, $sortorder, null, null, false, true); |
|
| 600 | // Get number of articles in the selected condition ($cond) |
|
| 601 | $numrows = $entrydataHandler->total_getArticlesAllPermcheck; |
|
| 602 | if ($numrows > 0) { |
|
| 603 | echo '<form action="article.php" method="post" name="reorderarticles\">'; |
|
| 604 | } |
|
| 605 | echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; |
|
| 606 | echo '<tr>'; |
|
| 607 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTID . '</b></td>'; |
|
| 608 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_WEIGHT . '</b></td>'; |
|
| 609 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTCOLNAME . '</b></td>'; |
|
| 610 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTHEADLINE . '</b></td>'; |
|
| 611 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTCREATED . '</b></td>'; |
|
| 612 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_STATUS . '</b></td>'; |
|
| 613 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ACTION . '</b></td>'; |
|
| 614 | echo '</tr>'; |
|
| 615 | ||
| 616 | if ($numrows > 0) { // That is, if there ARE articles in the said condition |
|
| 617 | // Retrieve rows for those items |
|
| 618 | ||
| 619 | $colarray = array(); |
|
| 620 | $cont = 0; |
|
| 621 | ||
| 622 | foreach ($_entryob_arr as $key => $_entryob) { |
|
| 623 | //get vars |
|
| 624 | ++$cont; |
|
| 625 | //------------------------------------- |
|
| 626 | $articles = $_entryob->toArray(); |
|
| 627 | //-------------------- |
|
| 628 | $colname = !empty($_entryob->_sbcolumns) ? $_entryob->_sbcolumns->getVar('name') : ''; |
|
| 629 | //-------------------- |
|
| 630 | $created = $myts->htmlSpecialChars(formatTimestamp($articles['datesub'], $xoopsModuleConfig['dateformat'])); |
|
| 631 | $modify = "<a href='article.php?op=mod&articleID=" . $articles['articleID'] . "'><img src='" . $pathIcon16 . "/edit.png' ALT='" . _AM_SOAPBOX_EDITART . "'></a>"; |
|
| 632 | $delete = "<a href='article.php?op=del&articleID=" . $articles['articleID'] . "'><img src='" . $pathIcon16 . "/delete.png' ALT='" . _AM_SOAPBOX_DELETEART . "'></a>"; |
|
| 633 | ||
| 634 | //if ($offline == 0) { |
|
| 635 | if ($articles['offline'] === 0) { |
|
| 636 | $status = "<img src='" . $pathIcon16 . "/1.png' alt='" . _AM_SOAPBOX_ARTISON . "'>"; |
|
| 637 | } else { |
|
| 638 | //if ($offline == 1 && $submit == 0) { |
|
| 639 | if ($submit === 0 && $articles['offline'] === 1) { |
|
| 640 | $status = "<img src='" . $pathIcon16 . "/0.png' alt='" . _AM_SOAPBOX_ARTISOFF . "'>"; |
|
| 641 | } else { |
|
| 642 | if ($submit === 1) { |
|
| 643 | $status = '<img src=' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/sub.gif alt='" . _AM_SOAPBOX_ARTISSUB . "'>"; |
|
| 644 | } |
|
| 645 | } |
|
| 646 | } |
|
| 647 | ||
| 648 | //mb ---------------------------- |
|
| 649 | //echo $cont.' - '.$offline.': '.$status.'</br>'; |
|
| 650 | ||
| 651 | $style = (($cont % 2) === 0) ? 'even' : 'odd'; |
|
| 652 | echo '<tr class="' . $style . '">'; |
|
| 653 | echo '<td align="center"><a href="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?articleID=' . $articles['articleID'] . '" title="' . $articles['headline'] . '" target="_blank">' . $articles['articleID'] . '</a></td>'; |
|
| 654 | echo '<td class="txtcenter"><input type="text" name="articleweight[' . $articles['articleID'] . ']" value="' . $articles['weight'] . '" size="3" maxlength="3" style="text-align: center;"></td>'; |
|
| 655 | echo '<td class="txtcenter">' . $colname . '</td>'; |
|
| 656 | echo '<td>' . $articles['headline'] . '</td>'; |
|
| 657 | echo '<td class="txtcenter">' . $created . '</td>'; |
|
| 658 | echo '<td class="txtcenter">' . $status . '</td>'; |
|
| 659 | echo '<td class="txtcenter">' . $modify . $delete . '</td>'; |
|
| 660 | echo '</tr>'; |
|
| 661 | } |
|
| 662 | } else { // that is, $numrows = 0, there's no columns yet |
|
| 663 | echo '<tr>'; |
|
| 664 | echo "<td class='head' align='center' colspan= '7'>" . _AM_SOAPBOX_NOARTS . '</td>'; |
|
| 665 | echo '</tr>'; |
|
| 666 | } |
|
| 667 | echo "</table>\n"; |
|
| 668 | $pagenav = new XoopsPageNav($numrows, (int)$xoopsModuleConfig['perpage'], $startart, 'startart', 'entries=' . $entries . '&sortname=' . $sortname . '&sortorder=' . $sortorder); |
|
| 669 | echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 670 | ||
| 671 | if ($numrows > 0) { |
|
| 672 | echo "<input type='hidden' name='op' value='reorder' />"; |
|
| 673 | //-------------------- |
|
| 674 | echo $xoopsGTicket->getTicketHtml(__LINE__); |
|
| 675 | //-------------------- |
|
| 676 | echo '<div style="margin-bottom: 18px;"><input type="submit" name="submit" class="formButton" value="' . _AM_SOAPBOX_REORDERART . '" /></div>'; |
|
| 677 | echo '</form>'; |
|
| 678 | } |
|
| 679 | echo "<br>\n"; |
|
| 680 | } |
|
| 681 | ||
| 682 | public static function showSubmissions() |
|
| 683 | { |
|
| @@ 321-565 (lines=245) @@ | ||
| 318 | /** |
|
| 319 | * @param int $showCreate |
|
| 320 | */ |
|
| 321 | function showArticles($showCreate = 0) |
|
| 322 | { |
|
| 323 | global $xoopsGTicket; |
|
| 324 | global $xoopsModuleConfig, $xoopsModule; |
|
| 325 | $myts = MyTextSanitizer::getInstance(); |
|
| 326 | ||
| 327 | $pathIcon16 = Xmf\Module\Admin::iconUrl('', 16); |
|
| 328 | require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 329 | require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 330 | require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
| 331 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/cleantags.php'; |
|
| 332 | ||
| 333 | $module_id = $xoopsModule->getVar('mid'); |
|
| 334 | $startart = isset($_GET['startart']) ? (int)$_GET['startart'] : 0; |
|
| 335 | if (isset($_POST['entries'])) { |
|
| 336 | $entries = (int)$_POST['entries']; |
|
| 337 | } else { |
|
| 338 | $entries = isset($_GET['entries']) ? (int)$_GET['entries'] : 0; |
|
| 339 | } |
|
| 340 | //---GET view sort -- |
|
| 341 | $sortname = isset($_GET['sortname']) ? strtolower(trim(strip_tags($myts->stripSlashesGPC($_GET['sortname'])))) : 'datesub'; |
|
| 342 | if (!in_array($sortname, array('datesub', 'weight', 'counter', 'rating', 'headline'))) { |
|
| 343 | $sortname = 'datesub'; |
|
| 344 | } |
|
| 345 | $sortorder = isset($_GET['sortorder']) ? strtoupper(trim(strip_tags($myts->stripSlashesGPC($_GET['sortorder'])))) : 'DESC'; |
|
| 346 | if (!in_array($sortorder, array('ASC', 'DESC'))) { |
|
| 347 | $sortorder = 'DESC'; |
|
| 348 | } |
|
| 349 | //--------------- |
|
| 350 | /* Code to show existing articles */ |
|
| 351 | echo "<h3 style='color: #2F5376; margin: 0 0 4px 0;'>" . _AM_SOAPBOX_SHOWARTS . '</h3>'; |
|
| 352 | echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SOAPBOX_ARTSTEXT . '</span>'; |
|
| 353 | ||
| 354 | // if ($showCreate == 1) { |
|
| 355 | // echo |
|
| 356 | // "<a style='border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 1em; padding: 4px 8px; text-align:center;' href='article.php'>" |
|
| 357 | // . _AM_SOAPBOX_CREATEART . "</a><br><br>"; |
|
| 358 | // } |
|
| 359 | // Articles count |
|
| 360 | $entrydataHandler = xoops_getModuleHandler('entrydata', $xoopsModule->dirname()); |
|
| 361 | //---------------------------- |
|
| 362 | $criteria = new CriteriaCompo(); |
|
| 363 | $criteria->add(new Criteria('submit', 0)); |
|
| 364 | $criteria->add(new Criteria('offline', 0)); |
|
| 365 | $tot_published = $entrydataHandler->getArticleCount($criteria); |
|
| 366 | unset($criteria); |
|
| 367 | //---------------------------- |
|
| 368 | $criteria = new CriteriaCompo(); |
|
| 369 | $criteria->add(new Criteria('submit', 0)); |
|
| 370 | $criteria->add(new Criteria('offline', 1)); |
|
| 371 | $tot_offline = $entrydataHandler->getArticleCount($criteria); |
|
| 372 | unset($criteria); |
|
| 373 | //---------------------------- |
|
| 374 | $criteria = new CriteriaCompo(); |
|
| 375 | $criteria->add(new Criteria('submit', 1)); |
|
| 376 | $tot_submitted = $entrydataHandler->getArticleCount($criteria); |
|
| 377 | unset($criteria); |
|
| 378 | //---------------------------- |
|
| 379 | $tot_all = $entrydataHandler->getArticleCount(); |
|
| 380 | //---------------------------- |
|
| 381 | $criteria = new CriteriaCompo(); |
|
| 382 | $criteria->add(new Criteria('submit', 0)); |
|
| 383 | $tot_ok = $entrydataHandler->getArticleCount($criteria); |
|
| 384 | unset($criteria); |
|
| 385 | //---------------------------- |
|
| 386 | ||
| 387 | // Prepare string for table head |
|
| 388 | if ($entries === 0) { |
|
| 389 | $string = _AM_SOAPBOX_SHWALL; |
|
| 390 | } |
|
| 391 | if ($entries === 1) { |
|
| 392 | $string = _AM_SOAPBOX_SHWONL; |
|
| 393 | } |
|
| 394 | if ($entries === 2) { |
|
| 395 | $string = _AM_SOAPBOX_SHWOFF; |
|
| 396 | } |
|
| 397 | if ($entries === 3) { |
|
| 398 | $string = _AM_SOAPBOX_SHWSUB; |
|
| 399 | } |
|
| 400 | if ($entries === 4) { |
|
| 401 | $string = _AM_SOAPBOX_SHWAPV; |
|
| 402 | } |
|
| 403 | ||
| 404 | /* Code to show selected articles */ |
|
| 405 | echo "<form name='pick' id='pick' action='" . $myts->htmlSpecialChars(xoops_getenv('PHP_SELF')) . "' method='POST' style='margin: 0;'>"; ?> |
|
| 406 | <table width='100%' cellspacing='1' cellpadding='2' border='0' |
|
| 407 | style='border-left: 1px solid silver; border-top: 1px solid silver; border-right: 1px solid silver;'> |
|
| 408 | <tr> |
|
| 409 | <td class='odd'><span style='font-weight: bold; font-variant: small-caps;'><?php echo $string ?></span></td> |
|
| 410 | <td class='odd' width='40%' align='right'><?php echo _AM_SOAPBOX_SELECTSTATUS; ?> |
|
| 411 | <select name='entries' onchange='submit()'> |
|
| 412 | <option value='0' |
|
| 413 | <?php |
|
| 414 | if ($entries === 0) { |
|
| 415 | echo 'selected'; |
|
| 416 | } ?>> |
|
| 417 | <?php echo _AM_SOAPBOX_SELALL; ?> |
|
| 418 | [<?php echo $tot_all; ?>] |
|
| 419 | </option> |
|
| 420 | <option value='1' <?php if ($entries === 1) { |
|
| 421 | echo 'selected'; |
|
| 422 | } ?>><?php echo _AM_SOAPBOX_SELONL; ?> |
|
| 423 | [<?php echo $tot_published; ?>] |
|
| 424 | </option> |
|
| 425 | <option value='2' <?php if ($entries === 2) { |
|
| 426 | echo 'selected'; |
|
| 427 | } ?>> |
|
| 428 | <?php echo _AM_SOAPBOX_SELOFF; ?> |
|
| 429 | [<?php echo $tot_offline; ?>] |
|
| 430 | </option> |
|
| 431 | <option value='3' <?php if ($entries === 3) { |
|
| 432 | echo 'selected'; |
|
| 433 | } ?>> |
|
| 434 | <?php echo _AM_SOAPBOX_SELSUB; ?> |
|
| 435 | [<?php echo $tot_submitted; ?>] |
|
| 436 | </option> |
|
| 437 | <option value='4' <?php if ($entries === 4) { |
|
| 438 | echo 'selected'; |
|
| 439 | } ?>><?php echo _AM_SOAPBOX_SELAPV; ?> |
|
| 440 | [<?php echo $tot_ok; ?>] |
|
| 441 | </option> |
|
| 442 | </select> |
|
| 443 | </td> |
|
| 444 | </tr> |
|
| 445 | </table> |
|
| 446 | </form> |
|
| 447 | <?php |
|
| 448 | ||
| 449 | //---------------------------- |
|
| 450 | // Put column names in an array, to avoid a query in the while loop further ahead |
|
| 451 | switch ($entries) { |
|
| 452 | case 1: |
|
| 453 | $submit = 0; |
|
| 454 | $offline = 0; |
|
| 455 | break; |
|
| 456 | case 2: |
|
| 457 | //---------------------------- |
|
| 458 | $submit = 0; |
|
| 459 | $offline = 1; |
|
| 460 | break; |
|
| 461 | case 3: |
|
| 462 | //---------------------------- |
|
| 463 | $submit = 1; |
|
| 464 | $offline = null; |
|
| 465 | break; |
|
| 466 | case 4: |
|
| 467 | //---------------------------- |
|
| 468 | $submit = 0; |
|
| 469 | break; |
|
| 470 | case 0: |
|
| 471 | default: |
|
| 472 | $submit = null; |
|
| 473 | $offline = null; |
|
| 474 | break; |
|
| 475 | } |
|
| 476 | // function &getArticlesAllPermcheck( |
|
| 477 | // $limit=0, $start=0, |
|
| 478 | // $checkRight = true, $published = true, $submit = 0, $offline = 0, $block = null , |
|
| 479 | // $sortname = 'datesub', $sortorder = 'DESC', |
|
| 480 | // $select_sbcolumns = null , $NOTarticleIDs = null , |
|
| 481 | // $approve_submit = false , |
|
| 482 | // $id_as_key = false ) |
|
| 483 | //------------------------------------- |
|
| 484 | $_entryob_arr = $entrydataHandler->getArticlesAllPermcheck((int)$xoopsModuleConfig['perpage'], $startart, false, false, $submit, $offline, null, $sortname, $sortorder, null, null, false, true); |
|
| 485 | // Get number of articles in the selected condition ($cond) |
|
| 486 | $numrows = $entrydataHandler->total_getArticlesAllPermcheck; |
|
| 487 | if ($numrows > 0) { |
|
| 488 | echo '<form action="article.php" method="post" name="reorderarticles\">'; |
|
| 489 | } |
|
| 490 | echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; |
|
| 491 | echo '<tr>'; |
|
| 492 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTID . '</b></td>'; |
|
| 493 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_WEIGHT . '</b></td>'; |
|
| 494 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTCOLNAME . '</b></td>'; |
|
| 495 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTHEADLINE . '</b></td>'; |
|
| 496 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ARTCREATED . '</b></td>'; |
|
| 497 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_STATUS . '</b></td>'; |
|
| 498 | echo '<th class="txtcenter"><b>' . _AM_SOAPBOX_ACTION . '</b></td>'; |
|
| 499 | echo '</tr>'; |
|
| 500 | ||
| 501 | if ($numrows > 0) { // That is, if there ARE articles in the said condition |
|
| 502 | // Retrieve rows for those items |
|
| 503 | ||
| 504 | $colarray = array(); |
|
| 505 | $cont = 0; |
|
| 506 | ||
| 507 | foreach ($_entryob_arr as $key => $_entryob) { |
|
| 508 | //get vars |
|
| 509 | ++$cont; |
|
| 510 | //------------------------------------- |
|
| 511 | $articles = $_entryob->toArray(); |
|
| 512 | //-------------------- |
|
| 513 | $colname = !empty($_entryob->_sbcolumns) ? $_entryob->_sbcolumns->getVar('name') : ''; |
|
| 514 | //-------------------- |
|
| 515 | $created = $myts->htmlSpecialChars(formatTimestamp($articles['datesub'], $xoopsModuleConfig['dateformat'])); |
|
| 516 | $modify = "<a href='article.php?op=mod&articleID=" . $articles['articleID'] . "'><img src='" . $pathIcon16 . "/edit.png' ALT='" . _AM_SOAPBOX_EDITART . "'></a>"; |
|
| 517 | $delete = "<a href='article.php?op=del&articleID=" . $articles['articleID'] . "'><img src='" . $pathIcon16 . "/delete.png' ALT='" . _AM_SOAPBOX_DELETEART . "'></a>"; |
|
| 518 | ||
| 519 | //if ($offline == 0) { |
|
| 520 | if ($articles['offline'] === 0) { |
|
| 521 | $status = "<img src='" . $pathIcon16 . "/1.png' alt='" . _AM_SOAPBOX_ARTISON . "'>"; |
|
| 522 | } else { |
|
| 523 | //if ($offline == 1 && $submit == 0) { |
|
| 524 | if ($submit === 0 && $articles['offline'] === 1) { |
|
| 525 | $status = "<img src='" . $pathIcon16 . "/0.png' alt='" . _AM_SOAPBOX_ARTISOFF . "'>"; |
|
| 526 | } else { |
|
| 527 | if ($submit === 1) { |
|
| 528 | $status = '<img src=' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/sub.gif alt='" . _AM_SOAPBOX_ARTISSUB . "'>"; |
|
| 529 | } |
|
| 530 | } |
|
| 531 | } |
|
| 532 | ||
| 533 | //mb ---------------------------- |
|
| 534 | //echo $cont.' - '.$offline.': '.$status.'</br>'; |
|
| 535 | ||
| 536 | $style = (($cont % 2) === 0) ? 'even' : 'odd'; |
|
| 537 | echo '<tr class="' . $style . '">'; |
|
| 538 | echo '<td align="center"><a href="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?articleID=' . $articles['articleID'] . '" title="' . $articles['headline'] . '" target="_blank">' . $articles['articleID'] . '</a></td>'; |
|
| 539 | echo '<td class="txtcenter"><input type="text" name="articleweight[' . $articles['articleID'] . ']" value="' . $articles['weight'] . '" size="3" maxlength="3" style="text-align: center;"></td>'; |
|
| 540 | echo '<td class="txtcenter">' . $colname . '</td>'; |
|
| 541 | echo '<td>' . $articles['headline'] . '</td>'; |
|
| 542 | echo '<td class="txtcenter">' . $created . '</td>'; |
|
| 543 | echo '<td class="txtcenter">' . $status . '</td>'; |
|
| 544 | echo '<td class="txtcenter">' . $modify . $delete . '</td>'; |
|
| 545 | echo '</tr>'; |
|
| 546 | } |
|
| 547 | } else { // that is, $numrows = 0, there's no columns yet |
|
| 548 | echo '<tr>'; |
|
| 549 | echo "<td class='head' align='center' colspan= '7'>" . _AM_SOAPBOX_NOARTS . '</td>'; |
|
| 550 | echo '</tr>'; |
|
| 551 | } |
|
| 552 | echo "</table>\n"; |
|
| 553 | $pagenav = new XoopsPageNav($numrows, (int)$xoopsModuleConfig['perpage'], $startart, 'startart', 'entries=' . $entries . '&sortname=' . $sortname . '&sortorder=' . $sortorder); |
|
| 554 | echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 555 | ||
| 556 | if ($numrows > 0) { |
|
| 557 | echo "<input type='hidden' name='op' value='reorder' />"; |
|
| 558 | //-------------------- |
|
| 559 | echo $xoopsGTicket->getTicketHtml(__LINE__); |
|
| 560 | //-------------------- |
|
| 561 | echo '<div style="margin-bottom: 18px;"><input type="submit" name="submit" class="formButton" value="' . _AM_SOAPBOX_REORDERART . '" /></div>'; |
|
| 562 | echo '</form>'; |
|
| 563 | } |
|
| 564 | echo "<br>\n"; |
|
| 565 | } |
|
| 566 | ||
| 567 | function showSubmissions() |
|
| 568 | { |
|