Beispiel #1
0
     }
     echo "<br />";
     if ($error == true) {
         $endMsg = _AM_SSECTION_IMPORT_ERROR;
     } else {
         $endMsg = _AM_SSECTION_IMPORT_SUCCESS;
     }
     echo $endMsg;
     echo "<br /><br />";
     echo "<a href='import.php'>" . _AM_SSECTION_IMPORT_BACK . "</a>";
     echo "<br /><br />";
     break;
 case "default":
 default:
     $importfile = 'none';
     smartsection_xoops_cp_header();
     smartsection_adminMenu(-1, _AM_SSECTION_IMPORT);
     smartsection_collapsableBar('import', 'importicon', _AM_SSECTION_IMPORT_TITLE, _AM_SSECTION_IMPORT_INFO);
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $module_handler =& xoops_gethandler('module');
     // WF-Section
     $moduleObj = $module_handler->getByDirname('wfsection');
     if ($moduleObj) {
         $from_module_version = round($moduleObj->getVar('version') / 100, 2);
         if ($from_module_version == 1.5 || $from_module_version == 1.04 || $from_module_version == 1.01 || $from_module_version == 2.07 || $from_module_version == 2.06) {
             $importfile_select_array["wfsection"] = "WF-Section " . $from_module_version;
             $wfs_version = $from_module_version;
         }
     }
     // News
     $moduleObj = $module_handler->getByDirname('news');
Beispiel #2
0
function search()
{
    global $oAdminButton, $hMime, $limit, $start, $imagearray, $aSearchBy, $aOrderBy, $aLimitBy, $aSortBy;
    if (isset($_POST['deleteMimes'])) {
        $aMimes = $_POST['mimes'];
        $crit = new Criteria('mime_id', "(" . implode($aMimes, ',') . ")", "IN");
        if ($hMime->deleteAll($crit)) {
            header("Location: " . SMARTSECTION_ADMIN_URL . "/mimetypes.php?limit={$limit}&start={$start}");
        } else {
            redirect_header(SMARTSECTION_ADMIN_URL . "/mimetypes.php?limit={$limit}&start={$start}", 3, _AM_SSECTION_MESSAGE_DELETE_MIME_ERROR);
        }
    }
    if (isset($_POST['add_mime'])) {
        header("Location: " . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=add&start={$start}&limit={$limit}");
        exit;
    }
    if (isset($_REQUEST['order'])) {
        $order = $_REQUEST['order'];
    } else {
        $order = "ASC";
    }
    if (isset($_REQUEST['sort'])) {
        $sort = $_REQUEST['sort'];
    } else {
        $sort = "mime_name";
    }
    smartsection_xoops_cp_header();
    smartsection_adminMenu(4, _AM_SSECTION_MIMETYPES . " > " . _AM_SSECTION_BUTTON_SEARCH);
    smartsection_collapsableBar('mimemsearchtable', 'mimesearchicon', _AM_SSECTION_MIME_SEARCH);
    if (!isset($_REQUEST['mime_search'])) {
        echo "<form action='mimetypes.php?op=search' method='post'>";
        echo "<table width='100%' cellspacing='1' class='outer'>";
        echo "<tr><th colspan='2'>" . _AM_SSECTION_TEXT_SEARCH_MIME . "</th></tr>";
        echo "<tr><td class='head' width='20%'>" . _AM_SSECTION_TEXT_SEARCH_BY . "</td>\n                  <td class='even'>\n                      <select name='search_by'>";
        foreach ($aSortBy as $value => $text) {
            echo "<option value='{$value}'>{$text}</option>";
        }
        echo "</select>\n                  </td>\n              </tr>";
        echo "<tr><td class='head'>" . _AM_SSECTION_TEXT_SEARCH_TEXT . "</td>\n                  <td class='even'>\n                      <input type='text' name='search_text' id='search_text' value='' />\n                  </td>\n              </tr>";
        echo "<tr class='foot'>\n                  <td colspan='2'>\n                      <input type='submit' name='mime_search' id='mime_search' value='" . _AM_SSECTION_BUTTON_SEARCH . "' />\n                  </td>\n              </tr>";
        echo "</table></form>";
    } else {
        $search_field = $_REQUEST['search_by'];
        $search_text = $_REQUEST['search_text'];
        $crit = new Criteria($search_field, "%{$search_text}%", 'LIKE');
        $crit->setSort($sort);
        $crit->setOrder($order);
        $crit->setLimit($limit);
        $crit->setStart($start);
        $mime_count =& $hMime->getCount($crit);
        $mimetypes =& $hMime->getObjects($crit);
        $nav = new XoopsPageNav($mime_count, $limit, $start, 'start', "op=search&amp;limit={$limit}&amp;order={$order}&amp;sort={$sort}&amp;mime_search=1&amp;search_by={$search_field}&amp;search_text={$search_text}");
        // Display results
        echo '<script type="text/javascript" src="' . SMARTSECTION_URL . '/include/functions.js"></script>';
        echo "<table width='100%' cellspacing='1' class='outer'>";
        echo "<tr><td colspan='6' align='right'>";
        echo "<form action='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=search' style='margin:0; padding:0;' method='post'>";
        echo "<table>";
        echo "<tr>";
        echo "<td align='right'>" . _AM_SSECTION_TEXT_SEARCH_BY . "</td>";
        echo "<td align='left'><select name='search_by'>";
        foreach ($aSearchBy as $value => $text) {
            $search_field == $value ? $selected = "selected='selected'" : ($selected = '');
            echo "<option value='{$value}' {$selected}>{$text}</option>";
        }
        echo "</select></td>";
        echo "<td align='right'>" . _AM_SSECTION_TEXT_SEARCH_TEXT . "</td>";
        echo "<td align='left'><input type='text' name='search_text' id='search_text' value='{$search_text}' /></td>";
        echo "<td><input type='submit' name='mime_search' id='mime_search' value='" . _AM_SSECTION_BUTTON_SEARCH . "' /></td>";
        echo "</tr></table></form></td></tr>";
        echo "<tr><td colspan='6'>";
        echo "<form action='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=search' style='margin:0; padding:0;' method='post'>";
        echo "<table width='100%'>";
        echo "<tr><td align='right'>" . _AM_SSECTION_TEXT_SORT_BY . " \n                  <select name='sort'>";
        foreach ($aSortBy as $value => $text) {
            $sort == $value ? $selected = "selected='selected'" : ($selected = '');
            echo "<option value='{$value}' {$selected}>{$text}</option>";
        }
        echo "</select>\n                &nbsp;&nbsp;&nbsp;\n                  " . _AM_SSECTION_TEXT_ORDER_BY . "\n                  <select name='order'>";
        foreach ($aOrderBy as $value => $text) {
            $order == $value ? $selected = "selected='selected'" : ($selected = '');
            echo "<option value='{$value}' {$selected}>{$text}</option>";
        }
        echo "</select>\n                  &nbsp;&nbsp;&nbsp;\n                  " . _AM_SSECTION_TEXT_NUMBER_PER_PAGE . "\n                  <select name='limit'>";
        foreach ($aLimitBy as $value => $text) {
            $limit == $value ? $selected = "selected='selected'" : ($selected = '');
            echo "<option value='{$value}' {$selected}>{$text}</option>";
        }
        echo "</select>\n                  <input type='submit' name='mime_sort' id='mime_sort' value='" . _AM_SSECTION_BUTTON_SUBMIT . "' />\n                  <input type='hidden' name='mime_search' id='mime_search' value='1' />\n                  <input type='hidden' name='search_by' id='search_by' value='{$search_field}' />\n                  <input type='hidden' name='search_text' id='search_text' value='{$search_text}' />\n              </td>\n          </tr>";
        echo "</table>";
        echo "</td></tr>";
        if (count($mimetypes) > 0) {
            echo "<tr><th colspan='6'>" . _AM_SSECTION_TEXT_SEARCH_MIME . "</th></tr>";
            echo "<tr class='head'>\n                      <td>" . _AM_SSECTION_MIME_ID . "</td>\n                      <td>" . _AM_SSECTION_MIME_NAME . "</td>\n                      <td>" . _AM_SSECTION_MIME_EXT . "</td>\n                      <td>" . _AM_SSECTION_MIME_ADMIN . "</td>\n                      <td>" . _AM_SSECTION_MIME_USER . "</td>\n                      <td>" . _AM_SSECTION_MINDEX_ACTION . "</td>\n                  </tr>";
            foreach ($mimetypes as $mime) {
                echo "<tr class='even'>\n                          <td><input type='checkbox' name='mimes[]' value='" . $mime->getVar('mime_id') . "' />" . $mime->getVar('mime_id') . "</td>\n                          <td>" . $mime->getVar('mime_name') . "</td>\n                          <td>" . $mime->getVar('mime_ext') . "</td>\n                          <td>\n                              <a href='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=updateMimeValue&amp;id=" . $mime->getVar('mime_id') . "&amp;mime_admin=" . $mime->getVar('mime_admin') . "&amp;limit=" . $limit . "&amp;start=" . $start . "'>\n                              " . ($mime->getVar('mime_admin') ? $imagearray['online'] : $imagearray['offline']) . "</a>\n                          </td>\n                          <td>\n                              <a href='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=updateMimeValue&amp;id=" . $mime->getVar('mime_id') . "&amp;mime_user="******"&amp;limit=" . $limit . "&amp;start=" . $start . "'>\n                              " . ($mime->getVar('mime_user') ? $imagearray['online'] : $imagearray['offline']) . "</a>\n                          </td>\n                          <td>\n                              <a href='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=edit&amp;id=" . $mime->getVar('mime_id') . "&amp;limit=" . $limit . "&amp;start=" . $start . "'>" . $imagearray['editimg'] . "</a>\n                              <a href='" . SMARTSECTION_ADMIN_URL . "/mimetypes.php?op=delete&amp;id=" . $mime->getVar('mime_id') . "&amp;limit=" . $limit . "&amp;start=" . $start . "'>" . $imagearray['deleteimg'] . "</a>\n                          </td>\n                      </tr>";
            }
            echo "<tr class='foot'>\n                      <td colspan='6' valign='top'>\n                          <a href='http://www.filext.com' style='float: right' target='_blank'>" . _AM_SSECTION_MIME_FINDMIMETYPE . "</a>\n                          <input type='checkbox' name='checkAllMimes' value='0' onclick='selectAll(this.form,\"mimes[]\",this.checked);' />\n                          <input type='submit' name='deleteMimes' id='deleteMimes' value='" . _AM_SSECTION_BUTTON_DELETE . "' />\n                          <input type='submit' name='add_mime' id='add_mime' value='" . _AM_SSECTION_MIME_CREATEF . "' class='formButton' />\n                      </td>\n                  </tr>";
        } else {
            echo "<tr><th>" . _AM_SSECTION_TEXT_SEARCH_MIME . "</th></tr>";
            echo "<tr class='even'>\n                      <td>" . _AM_SSECTION_TEXT_NO_RECORDS . "</td>\n                  </tr>";
        }
        echo "</table>";
        echo "<div id='pagenav'>" . $nav->renderNav() . "</div>";
    }
    smartsection_close_collapsable('mimesearchtable', 'mimesearchicon');
    xoops_cp_footer();
}