コード例 #1
0
ファイル: file.php プロジェクト: trabisdementia/publisher
/**
 * @param bool $showmenu
 * @param int  $fileid
 * @param int  $itemid
 */
function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
{
    $publisher =& PublisherPublisher::getInstance();
    include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
    // if there is a parameter, and the id exists, retrieve data: we're editing a file
    if ($fileid != 0) {
        // Creating the File object
        $fileObj =& $publisher->getHandler('file')->get($fileid);
        if ($fileObj->notLoaded()) {
            redirect_header('javascript:history.go(-1)', 1, _AM_PUBLISHER_NOFILESELECTED);
            //            exit();
        }
        if ($showmenu) {
            //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_EDITING);
        }
        echo "<br />\n";
        echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . '</span>';
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_EDITING_DSC . '</span>';
        publisherOpenCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
    } else {
        // there's no parameter, so we're adding an item
        $fileObj =& $publisher->getHandler('file')->create();
        $fileObj->setVar('itemid', $itemid);
        if ($showmenu) {
            //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_FILE_ADD);
        }
        echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . '</span>';
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_ADDING_DSC . '</span>';
        publisherOpenCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
    }
    // FILES UPLOAD FORM
    $uploadForm = $fileObj->getForm();
    $uploadForm->display();
    if ($fileid != 0) {
        publisherCloseCollapsableBar('editfile', 'editfileicon');
    } else {
        publisherCloseCollapsableBar('addfile', 'addfileicon');
    }
}
コード例 #2
0
 public static function search()
 {
     $publisher =& PublisherPublisher::getInstance();
     global $limit, $start, $imagearray, $aSearchBy, $aOrderBy, $aLimitBy, $aSortBy;
     if (XoopsRequest::getString('deleteMimes', '', 'POST')) {
         $aMimes = XoopsRequest::getArray('mimes', array(), 'POST');
         $crit = new Criteria('mime_id', '(' . implode($aMimes, ',') . ')', 'IN');
         if ($publisher->getHandler('mimetype')->deleteAll($crit)) {
             header('Location: ' . PUBLISHER_ADMIN_URL . "/mimetypes.php?limit={$limit}&start={$start}");
         } else {
             redirect_header(PUBLISHER_ADMIN_URL . "/mimetypes.php?limit={$limit}&start={$start}", 3, _AM_PUBLISHER_MESSAGE_DELETE_MIME_ERROR);
         }
     }
     if (XoopsRequest::getString('add_mime', '', 'POST')) {
         //        header("Location: " . PUBLISHER_ADMIN_URL . "/mimetypes.php?op=add&start=$start&limit=$limit");
         redirect_header(PUBLISHER_ADMIN_URL . "/mimetypes.php?op=add&start={$start}&limit={$limit}", 3, _AM_PUBLISHER_MIME_CREATEF);
         //        exit();
     }
     $order = XoopsRequest::getString('order', 'ASC', 'POST');
     $sort = XoopsRequest::getString('sort', 'mime_name', 'POST');
     publisherCpHeader();
     //publisher_adminMenu(4, _AM_PUBLISHER_MIMETYPES . " > " . _AM_PUBLISHER_BUTTON_SEARCH);
     publisherOpenCollapsableBar('mimemsearchtable', 'mimesearchicon', _AM_PUBLISHER_MIME_SEARCH);
     if (!XoopsRequest::getString('mime_search', '', 'POST')) {
         echo "<form action='mimetypes.php?op=search' method='post'>";
         echo "<table width='100%' cellspacing='1' class='outer'>";
         echo "<tr><th colspan='2'>" . _AM_PUBLISHER_TEXT_SEARCH_MIME . '</th></tr>';
         echo "<tr><td class='head' width='20%'>" . _AM_PUBLISHER_TEXT_SEARCH_BY . "</td>\n        <td class='even'>\n        <select name='search_by'>";
         foreach ($aSortBy as $value => $text) {
             echo "<option value='{$value}'>{$text}</option>";
         }
         unset($value, $text);
         echo '</select>
     </td>
     </tr>';
         echo "<tr><td class='head'>" . _AM_PUBLISHER_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_PUBLISHER_BUTTON_SEARCH . "' />\n        </td>\n        </tr>";
         echo '</table></form>';
     } else {
         $searchField = XoopsRequest::getString('search_by', '', 'POST');
         $searchText = XoopsRequest::getString('search_text', '', 'POST');
         $crit = new Criteria($searchField, "%{$searchText}%", 'LIKE');
         $crit->setSort($sort);
         $crit->setOrder($order);
         $crit->setLimit($limit);
         $crit->setStart($start);
         $mimeCount =& $publisher->getHandler('mimetype')->getCount($crit);
         $mimetypes =& $publisher->getHandler('mimetype')->getObjects($crit);
         $nav = new XoopsPageNav($mimeCount, $limit, $start, 'start', "op=search&amp;limit={$limit}&amp;order={$order}&amp;sort={$sort}&amp;mime_search=1&amp;search_by={$searchField}&amp;search_text={$searchText}");
         // Display results
         echo '<script type="text/javascript" src="' . PUBLISHER_URL . '/include/functions.js"></script>';
         echo "<table width='100%' cellspacing='1' class='outer'>";
         echo "<tr><td colspan='6' align='right'>";
         echo "<form action='" . PUBLISHER_ADMIN_URL . "/mimetypes.php?op=search' style='margin:0; padding:0;' method='post'>";
         echo '<table>';
         echo '<tr>';
         echo "<td align='right'>" . _AM_PUBLISHER_TEXT_SEARCH_BY . '</td>';
         echo "<td align='left'><select name='search_by'>";
         foreach ($aSearchBy as $value => $text) {
             $searchField == $value ? $selected = "selected='selected'" : ($selected = '');
             echo "<option value='{$value}' {$selected}>{$text}</option>";
         }
         unset($value, $text);
         echo '</select></td>';
         echo "<td align='right'>" . _AM_PUBLISHER_TEXT_SEARCH_TEXT . '</td>';
         echo "<td align='left'><input type='text' name='search_text' id='search_text' value='{$searchText}' /></td>";
         echo "<td><input type='submit' name='mime_search' id='mime_search' value='" . _AM_PUBLISHER_BUTTON_SEARCH . "' /></td>";
         echo '</tr></table></form></td></tr>';
         echo "<tr><td colspan='6'>";
         echo "<form action='" . PUBLISHER_ADMIN_URL . "/mimetypes.php?op=search' style='margin:0; padding:0;' method='post'>";
         echo "<table width='100%'>";
         echo "<tr><td align='right'>" . _AM_PUBLISHER_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>";
         }
         unset($value, $text);
         echo '</select>
     &nbsp;&nbsp;&nbsp;
     ' . _AM_PUBLISHER_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>";
         }
         unset($value, $text);
         echo '</select>
     &nbsp;&nbsp;&nbsp;
     ' . _AM_PUBLISHER_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>";
         }
         unset($value, $text);
         echo "</select>\n        <input type='submit' name='mime_sort' id='mime_sort' value='" . _AM_PUBLISHER_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='{$searchField}' />\n        <input type='hidden' name='search_text' id='search_text' value='{$searchText}' />\n        </td>\n        </tr>";
         echo '</table>';
         echo '</td></tr>';
         if (count($mimetypes) > 0) {
             echo "<tr><th colspan='6'>" . _AM_PUBLISHER_TEXT_SEARCH_MIME . '</th></tr>';
             echo "<tr class='head'>\n            <td>" . _AM_PUBLISHER_MIME_ID . '</td>
         <td>' . _AM_PUBLISHER_MIME_NAME . "</td>\n            <td align='center'>" . _AM_PUBLISHER_MIME_EXT . "</td>\n            <td align='center'>" . _AM_PUBLISHER_MIME_ADMIN . "</td>\n            <td align='center'>" . _AM_PUBLISHER_MIME_USER . "</td>\n            <td align='center'>" . _AM_PUBLISHER_MINDEX_ACTION . '</td>
         </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>
             <td>' . $mime->getVar('mime_name') . "</td>\n                <td align='center'>" . $mime->getVar('mime_ext') . "</td>\n                <td align='center'>\n                <a href='" . PUBLISHER_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 align='center'>\n                <a href='" . PUBLISHER_ADMIN_URL . '/mimetypes.php?op=updateMimeValue&amp;id=' . $mime->getVar('mime_id') . '&amp;mime_user='******'mime_user') . '&amp;limit=' . $limit . '&amp;start=' . $start . "'>\n                " . ($mime->getVar('mime_user') ? $imagearray['online'] : $imagearray['offline']) . "</a>\n                </td>\n                <td align='center'>\n                <a href='" . PUBLISHER_ADMIN_URL . '/mimetypes.php?op=edit&amp;id=' . $mime->getVar('mime_id') . '&amp;limit=' . $limit . '&amp;start=' . $start . "'>" . $imagearray['editimg'] . "</a>\n                <a href='" . PUBLISHER_ADMIN_URL . '/mimetypes.php?op=delete&amp;id=' . $mime->getVar('mime_id') . '&amp;limit=' . $limit . '&amp;start=' . $start . "'>" . $imagearray['deleteimg'] . '</a>
             </td>
             </tr>';
             }
             //                unset($mime);
             echo "<tr class='foot'>\n            <td colspan='6' valign='top'>\n            <a href='http://www.filext.com' style='float: right;' target='_blank'>" . _AM_PUBLISHER_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_PUBLISHER_BUTTON_DELETE . "' />\n            <input type='submit' name='add_mime' id='add_mime' value='" . _AM_PUBLISHER_MIME_CREATEF . "' class='formButton' />\n            </td>\n            </tr>";
         } else {
             echo '<tr><th>' . _AM_PUBLISHER_TEXT_SEARCH_MIME . '</th></tr>';
             echo "<tr class='even'>\n            <td>" . _AM_PUBLISHER_TEXT_NO_RECORDS . '</td>
         </tr>';
         }
         echo '</table>';
         echo "<div id='pagenav'>" . $nav->renderNav() . '</div>';
     }
     publisherCloseCollapsableBar('mimesearchtable', 'mimesearchicon');
     //        include_once __DIR__ . '/admin_footer.php';
     xoops_cp_footer();
 }
コード例 #3
0
            $newpid = $newCatArray[$oldpid]['newid'];
        }
        $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria);
        unset($criteria);
    }
    unset($oldid, $newCat);
    // Looping through the comments to link them to the new articles and module
    echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br />';
    $publisher_module_id = $publisher->getModule()->mid();
    $commentHandler =& xoops_getHandler('comment');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('com_modid', $smartsection_module_id));
    $comments = $commentHandler->getObjects($criteria);
    foreach ($comments as $comment) {
        $comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
        $comment->setVar('com_modid', $publisher_module_id);
        $comment->setNew();
        if (!$commentHandler->insert($comment)) {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '<br />';
        } else {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '<br />';
        }
    }
    //    unset($comment);
    echo '<br/><br/>Done.<br/>';
    echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br/>';
    echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '<br/>';
    echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '</a><br/>';
    publisherCloseCollapsableBar('newsimportgo', 'newsimportgoicon');
    xoops_cp_footer();
}
コード例 #4
0
ファイル: import.php プロジェクト: trabisdementia/publisher
            $importfile_tray->setDescription(_AM_PUBLISHER_IMPORT_SELECT_FILE_DSC);
            $sform->addElement($importfile_tray);
            // Buttons
            $button_tray = new XoopsFormElementTray('', '');
            $hidden = new XoopsFormHidden('op', 'importExecute');
            $button_tray->addElement($hidden);
            $butt_import = new XoopsFormButton('', '', _AM_PUBLISHER_IMPORT, 'submit');
            $butt_import->setExtra('onclick="this.form.elements.op.value=\'importExecute\'"');
            $button_tray->addElement($butt_import);
            $butt_cancel = new XoopsFormButton('', '', _AM_PUBLISHER_CANCEL, 'button');
            $butt_cancel->setExtra('onclick="history.go(-1)"');
            $button_tray->addElement($butt_cancel);
            $sform->addElement($button_tray);
            /*$sform->addElement(new XoopsFormHidden('xfs_version', $xfs_version));
              $sform->addElement(new XoopsFormHidden('wfs_version', $wfs_version));*/
            $sform->addElement(new XoopsFormHidden('news_version', $news_version));
            $sform->addElement(new XoopsFormHidden('xnews_version', $xnews_version));
            $sform->addElement(new XoopsFormHidden('ams_version', $ams_version));
            $sform->addElement(new XoopsFormHidden('cjaycontent_version', $cjaycontent_version));
            $sform->addElement(new XoopsFormHidden('smartsection_version', $smartsection_version));
            $sform->display();
            unset($hidden);
        } else {
            echo "<span style='color: #567; margin: 3px 0 12px 0; font-weight: bold; font-size: small; display: block;'>" . _AM_PUBLISHER_IMPORT_NO_MODULE . '</span>';
        }
        // End of collapsable bar
        publisherCloseCollapsableBar('import', 'importicon');
        break;
}
//xoops_cp_footer();
include_once __DIR__ . '/admin_footer.php';
コード例 #5
0
    foreach ($newCatArray as $oldid => $CatIds) {
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('categoryid', $CatIds['newid']));
        $oldpid = $CatIds['oldpid'];
        $newpid = 0 == $oldpid ? $parentId : $newCatArray[$oldpid]['newid'];
        $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria);
        unset($criteria);
    }
    unset($oldid, $CatIds);
    // Looping through the comments to link them to the new articles and module
    echo _AM_PUBLISHER_IMPORT_COMMENTS . "<br />\n";
    $publisher_module_id = $publisher->getModule()->mid();
    $commentHandler =& xoops_getHandler('comment');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('com_modid', $fm_module_id));
    $comments = $commentHandler->getObjects($criteria);
    foreach ($comments as $comment) {
        $comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
        $comment->setVar('com_modid', $publisher_module_id);
        $comment->setNew();
        if (!$commentHandler->insert($comment)) {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "<br />\n";
        } else {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "<br />\n";
        }
    }
    //    unset($comment);
    echo '<br /><br />' . _AM_PUBLISHER_IMPORT_DONE . "<br />\n" . '' . sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "<br />\n" . '' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "<br />\n" . "<br/>\n<a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "</a><br />\n";
    publisherCloseCollapsableBar('fmimportgo', 'fmimportgoicon');
    xoops_cp_footer();
}
コード例 #6
0
ファイル: item.php プロジェクト: trabisdementia/publisher
/**
 * @param bool $showmenu
 * @param int  $itemid
 * @param bool $clone
 */
function publisher_editItem($showmenu = false, $itemid = 0, $clone = false)
{
    $publisher =& PublisherPublisher::getInstance();
    global $publisherCurrentPage;
    xoops_load('XoopsFormLoader');
    $formTpl = new XoopsTpl();
    //publisher_submit.html
    // if there is a parameter, and the id exists, retrieve data: we're editing a item
    if ($itemid != 0) {
        // Creating the ITEM object
        $itemObj =& $publisher->getHandler('item')->get($itemid);
        if (!$itemObj) {
            redirect_header('item.php', 1, _AM_PUBLISHER_NOITEMSELECTED);
            //            exit();
        }
        if ($clone) {
            $itemObj->setNew();
            $itemObj->setVar('itemid', 0);
            $itemObj->setVar('status', PublisherConstants::PUBLISHER_STATUS_NOTSET);
            $itemObj->setVar('datesub', time());
        }
        switch ($itemObj->status()) {
            case PublisherConstants::PUBLISHER_STATUS_SUBMITTED:
                $breadcrumbAction1 = _CO_PUBLISHER_SUBMITTED;
                $breadcrumbAction2 = _AM_PUBLISHER_APPROVING;
                $pageTitle = _AM_PUBLISHER_SUBMITTED_TITLE;
                $pageInfo = _AM_PUBLISHER_SUBMITTED_INFO;
                $buttonCaption = _AM_PUBLISHER_APPROVE;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_PUBLISHED:
                $breadcrumbAction1 = _CO_PUBLISHER_PUBLISHED;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_PUBLISHEDEDITING;
                $pageInfo = _AM_PUBLISHER_PUBLISHEDEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_OFFLINE:
                $breadcrumbAction1 = _CO_PUBLISHER_OFFLINE;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_OFFLINEEDITING;
                $pageInfo = _AM_PUBLISHER_OFFLINEEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_OFFLINE;
                break;
            case PublisherConstants::PUBLISHER_STATUS_REJECTED:
                $breadcrumbAction1 = _CO_PUBLISHER_REJECTED;
                $breadcrumbAction2 = _AM_PUBLISHER_REJECTED;
                $pageTitle = _AM_PUBLISHER_REJECTED_EDIT;
                $pageInfo = _AM_PUBLISHER_REJECTED_EDIT_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_REJECTED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_NOTSET:
                // Then it's a clone...
                $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
                $breadcrumbAction2 = _AM_PUBLISHER_CLONE_NEW;
                $buttonCaption = _AM_PUBLISHER_CREATE;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                $pageTitle = _AM_PUBLISHER_ITEM_DUPLICATING;
                $pageInfo = _AM_PUBLISHER_ITEM_DUPLICATING_DSC;
                break;
            case 'default':
            default:
                $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_PUBLISHEDEDITING;
                $pageInfo = _AM_PUBLISHER_PUBLISHEDEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
        }
        $categoryObj = $itemObj->getCategory();
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumbAction1 . " > " . $breadcrumbAction2);
        }
        echo "<br />\n";
        publisherOpenCollapsableBar('edititemtable', 'edititemicon', $pageTitle, $pageInfo);
        if ($clone) {
            echo "<form><div style=\"margin-bottom: 10px;\">";
            echo "<input type='button' name='button' onclick=\"location='item.php?op=clone&itemid=" . $itemObj->itemid() . "'\" value='" . _AM_PUBLISHER_CLONE_ITEM . "'>&nbsp;&nbsp;";
            echo '</div></form>';
        }
    } else {
        // there's no parameter, so we're adding an item
        $itemObj =& $publisher->getHandler('item')->create();
        $itemObj->setVarsFromRequest();
        $categoryObj =& $publisher->getHandler('category')->create();
        $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
        $breadcrumbAction2 = _AM_PUBLISHER_CREATINGNEW;
        $buttonCaption = _AM_PUBLISHER_CREATE;
        $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumbAction1 . " > " . $breadcrumbAction2);
        }
        $categoryObj->setVar('categoryid', XoopsRequest::getInt('categoryid', 0, 'GET'));
        publisherOpenCollapsableBar('createitemtable', 'createitemicon', _AM_PUBLISHER_ITEM_CREATING, _AM_PUBLISHER_ITEM_CREATING_DSC);
    }
    $sform = $itemObj->getForm(_AM_PUBLISHER_ITEMS);
    $sform->assign($formTpl);
    $formTpl->display('db:publisher_submit.tpl');
    publisherCloseCollapsableBar('edititemtable', 'edititemicon');
    publisherOpenCollapsableBar('pagewraptable', 'pagewrapicon', _AM_PUBLISHER_PAGEWRAP, _AM_PUBLISHER_PAGEWRAPDSC);
    $dir = publisherGetUploadDir(true, 'content');
    if (false !== strpos(decoct(fileperms($dir)), '755')) {
        echo "<span style='color:#ff0000;'><h4>" . _AM_PUBLISHER_PERMERROR . '</h4></span>';
    }
    // Upload File
    echo "<form name='form_name2' id='form_name2' action='pw_upload_file.php' method='post' enctype='multipart/form-data'>";
    echo "<table cellspacing='1' width='100%' class='outer'>";
    echo "<tr><th colspan='2'>" . _AM_PUBLISHER_UPLOAD_FILE . '</th></tr>';
    echo "<tr valign='top' align='left'><td class='head'>" . _AM_PUBLISHER_SEARCH_PW . "</td><td class='even'><input type='file' name='fileupload' id='fileupload' size='30' /></td></tr>";
    echo "<tr valign='top' align='left'><td class='head'><input type='hidden' name='MAX_FILE_SIZE' id='op' value='500000' /></td><td class='even'><input type='submit' name='submit' value='" . _AM_PUBLISHER_UPLOAD . "' /></td></tr>";
    echo "<input type='hidden' name='backto' value='{$publisherCurrentPage}'/>";
    echo '</table>';
    echo '</form>';
    // Delete File
    $form = new XoopsThemeForm(_CO_PUBLISHER_DELETEFILE, 'form_name', 'pw_delete_file.php');
    $pWrapSelect = new XoopsFormSelect(publisherGetUploadDir(true, 'content'), 'address');
    $folder = dir($dir);
    while (($file = $folder->read()) !== false) {
        if ($file !== '.' && $file !== '..') {
            $pWrapSelect->addOption($file, $file);
        }
    }
    $folder->close();
    $form->addElement($pWrapSelect);
    $delfile = 'delfile';
    $form->addElement(new XoopsFormHidden('op', $delfile));
    $submit = new XoopsFormButton('', 'submit', _AM_PUBLISHER_BUTTON_DELETE, 'submit');
    $form->addElement($submit);
    $form->addElement(new XoopsFormHidden('backto', $publisherCurrentPage));
    $form->display();
    publisherCloseCollapsableBar('pagewraptable', 'pagewrapicon');
}
コード例 #7
0
        unset($criteria);
    }
    unset($oldid, $newCat);
    // Looping through the comments to link them to the new articles and module
    echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br />';
    $moduleHandler =& xoops_getHandler('module');
    $moduleObj = $moduleHandler->getByDirname('wfsection');
    $news_module_id = $moduleObj->getVar('mid');
    $publisher_module_id = $publisher->getModule()->mid();
    $commentHandler =& xoops_getHandler('comment');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('com_modid', $news_module_id));
    $comments = $commentHandler->getObjects($criteria);
    foreach ($comments as $comment) {
        $comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
        $comment->setVar('com_modid', $publisher_module_id);
        $comment->setNew();
        if (!$commentHandler->insert($comment)) {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '<br />';
        } else {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '<br />';
        }
    }
    //    unset($comment);
    echo '<br/><br/>Done.<br/>';
    echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br/>';
    echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '<br/>';
    echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '</a><br/>';
    publisherCloseCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon');
    xoops_cp_footer();
}
コード例 #8
0
        $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
        ${$formCat}->addElement($ele);
        ${$formCat}->addElement($hidden);
        unset($ele, $hidden);
    }
    publisherCpHeader();
    //publisher_adminMenu(5, _PREFERENCES);
    foreach ($config_cats as $formCat => $info) {
        if ($formCat === 'others' && !$cat_others_used) {
            continue;
        }
        ${$formCat}->addElement(new XoopsFormHidden('op', 'save'));
        ${$formCat}->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
        publisherOpenCollapsableBar($formCat . '_table', $formCat . '_icon', $info['name'], $info['description']);
        ${$formCat}->display();
        publisherCloseCollapsableBar($formCat . '_table', $formCat . '_icon');
    }
    unset($formCat, $info);
    xoops_cp_footer();
    exit;
}
if ($op === 'save') {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header($module->getInfo('adminindex'), 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
    }
    $count = count($confIds);
    $configHandler =& xoops_getHandler('config');
    if ($count > 0) {
        for ($i = 0; $i < $count; ++$i) {
            $config = $configHandler->getConfig($confIds[$i]);
            $newValue =& ${$config->getVar('conf_name')};
コード例 #9
0
 /**
  * @param bool $showmenu
  * @param int  $categoryId
  * @param int  $nbSubCats
  * @param null $categoryObj
  */
 public static function editCategory($showmenu = false, $categoryId = 0, $nbSubCats = 4, $categoryObj = null)
 {
     $publisher =& PublisherPublisher::getInstance();
     // if there is a parameter, and the id exists, retrieve data: we're editing a category
     if ($categoryId != 0) {
         // Creating the category object for the selected category
         $categoryObj =& $publisher->getHandler('category')->get($categoryId);
         if ($categoryObj->notLoaded()) {
             redirect_header('category.php', 1, _AM_PUBLISHER_NOCOLTOEDIT);
             //            exit();
         }
     } else {
         if (!$categoryObj) {
             $categoryObj =& $publisher->getHandler('category')->create();
         }
     }
     if ($categoryId != 0) {
         if ($showmenu) {
             //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING);
         }
         echo "<br />\n";
         publisherOpenCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO);
     } else {
         if ($showmenu) {
             //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW);
         }
         publisherOpenCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO);
     }
     $sform = $categoryObj->getForm($nbSubCats);
     $sform->display();
     if (!$categoryId) {
         publisherCloseCollapsableBar('createtable', 'createtableicon');
     } else {
         publisherCloseCollapsableBar('edittable', 'edittableicon');
     }
     //Added by fx2024
     if ($categoryId) {
         $selCat = $categoryId;
         publisherOpenCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC);
         // Get the total number of sub-categories
         $categoriesObj =& $publisher->getHandler('category')->get($selCat);
         $totalsubs =& $publisher->getHandler('category')->getCategoriesCount($selCat);
         // creating the categories objects that are published
         $subcatsObj =& $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid());
         $totalSCOnPage = count($subcatsObj);
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
         echo '<tr>';
         echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . '</strong></td>';
         echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATCOLNAME . '</strong></td>';
         echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_SUBDESCRIPT . '</strong></td>';
         echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . '</strong></td>';
         echo '</tr>';
         if ($totalsubs > 0) {
             foreach ($subcatsObj as $subcat) {
                 $modify = "<a href='category.php?op=mod&amp;categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . '/modules/' . $publisher->getModule()->dirname() . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>";
                 $delete = "<a href='category.php?op=del&amp;categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . '/modules/' . $publisher->getModule()->dirname() . "/assets/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>";
                 echo '<tr>';
                 echo "<td class='head' align='left'>" . $subcat->categoryid() . '</td>';
                 echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $publisher->getModule()->dirname() . '/category.php?categoryid=' . $subcat->categoryid() . '&amp;parentid=' . $subcat->parentid() . "'>" . $subcat->name() . '</a></td>';
                 echo "<td class='even' align='left'>" . $subcat->description() . '</td>';
                 echo "<td class='even' align='right'> {$modify} {$delete} </td>";
                 echo '</tr>';
             }
             //                unset($subcat);
         } else {
             echo '<tr>';
             echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOSUBCAT . '</td>';
             echo '</tr>';
         }
         echo "</table>\n";
         echo "<br />\n";
         publisherCloseCollapsableBar('subcatstable', 'subcatsicon');
         publisherOpenCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC);
         $startitem = XoopsRequest::getInt('startitem');
         // Get the total number of published ITEMS
         $totalitems =& $publisher->getHandler('item')->getItemsCount($selCat, array(PublisherConstants::PUBLISHER_STATUS_PUBLISHED));
         // creating the items objects that are published
         $itemsObj =& $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $selCat);
         $totalitemsOnPage = count($itemsObj);
         $allcats =& $publisher->getHandler('category')->getObjects(null, true);
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
         echo '<tr>';
         echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . '</strong></td>';
         echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCOLNAME . '</strong></td>';
         echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMDESC . '</strong></td>';
         echo "<td width='90' class='bg3' align='center'><strong>" . _AM_PUBLISHER_CREATED . '</strong></td>';
         echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . '</strong></td>';
         echo '</tr>';
         if ($totalitems > 0) {
             for ($i = 0; $i < $totalitemsOnPage; ++$i) {
                 $categoryObj = $allcats[$itemsObj[$i]->categoryid()];
                 $modify = "<a href='item.php?op=mod&amp;itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . '/modules/' . $publisher->getModule()->dirname() . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>";
                 $delete = "<a href='item.php?op=del&amp;itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . '/modules/' . $publisher->getModule()->dirname() . "/assets/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>";
                 echo '<tr>';
                 echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . '</td>';
                 echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
                 echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . '</td>';
                 echo "<td class='even' align='center'>" . $itemsObj[$i]->getDatesub('s') . '</td>';
                 echo "<td class='even' align='center'> {$modify} {$delete} </td>";
                 echo '</tr>';
             }
         } else {
             $itemid = -1;
             echo '<tr>';
             echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . '</td>';
             echo '</tr>';
         }
         echo "</table>\n";
         echo "<br />\n";
         $parentid = XoopsRequest::getInt('parentid', 0, 'GET');
         $pagenavExtraArgs = "op=mod&categoryid={$selCat}&parentid={$parentid}";
         xoops_load('XoopsPageNav');
         $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenavExtraArgs);
         echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
         echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $selCat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'>&nbsp;&nbsp;";
         echo '</div>';
     }
     //end of fx2024 code
 }
コード例 #10
0
ファイル: main.php プロジェクト: trabisdementia/publisher
        echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . '</td>';
        echo "<td class='even' align='left'>" . $categoryObj->getCategoryLink() . '</td>';
        echo "<td class='even' align='left'>" . $itemsObj[$i]->getItemLink() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->getDatesub() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->weight() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->counter() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->rating() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->votes() . '</td>';
        echo "<td class='even' align='center'>" . $itemsObj[$i]->comments() . '</td>';
        echo "<td class='even' align='center'>" . $statustxt . '</td>';
        echo "<td class='even' align='center'> " . $approve . $clone . $modify . $delete . '</td>';
        echo '</tr>';
    }
} else {
    // that is, $numrows = 0, there's no entries yet
    echo '<tr>';
    echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMSSEL . '</td>';
    echo '</tr>';
}
echo "</table>\n";
echo "<span style=\"color: #567; margin: 3px 0 18px 0; font-size: small; display: block; \">{$status_explaination}</span>";
$pagenav = new XoopsPageNav($numrows, $publisher->getConfig('idxcat_perpage'), $startentry, 'startentry', "statussel={$statussel}&amp;sortsel={$sortsel}&amp;ordersel={$ordersel}");
if ($publisher->getConfig('format_image_nav') == 1) {
    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>';
} else {
    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>';
}
// ENDs code to show active entries
publisherCloseCollapsableBar('allitemstable', 'allitemsicon');
// Close the collapsable div
include_once __DIR__ . '/admin_footer.php';
コード例 #11
0
        } else {
            $newArticleArray[$arrArticle['id']] = $itemObj->itemid();
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->getTitle()) . '<br />';
            ++$cnt_imported_articles;
        }
    }
    echo '<br/>';
    // Looping through the comments to link them to the new articles and module
    echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br />';
    $publisher_module_id = $publisher->getModule()->mid();
    $commentHandler =& xoops_getHandler('comment');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('com_modid', $cjaycontent_module_id));
    $comments = $commentHandler->getObjects($criteria);
    foreach ($comments as $comment) {
        $comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
        $comment->setVar('com_modid', $publisher_module_id);
        $comment->setNew();
        if (!$commentHandler->insert($comment)) {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '<br />';
        } else {
            echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '<br />';
        }
    }
    //    unset($comment);
    echo '<br/><br/>Done.<br/>';
    echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '<br/>';
    echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '</a><br/>';
    publisherCloseCollapsableBar('cjaycontentimportgo', 'cjaycontentimportgoicon');
    xoops_cp_footer();
}
コード例 #12
0
ファイル: pagewrap.php プロジェクト: trabisdementia/publisher
publisherOpenCollapsableBar('pagewraptable', 'pagewrapicon', _AM_PUBLISHER_PAGEWRAP, _AM_PUBLISHER_PAGEWRAPDSC);
$dir = publisherGetUploadDir(true, 'content');
if (false !== strpos(decoct(fileperms($dir)), '777')) {
    echo "<span style='color:#ff0000;'><h4>" . _AM_PUBLISHER_PERMERROR . '</h4></span>';
}
// Upload File
echo "<form name='form_name2' id='form_name2' action='pw_upload_file.php' method='post' enctype='multipart/form-data'>";
echo "<table cellspacing='1' width='100%' class='outer'>";
echo "<tr><th colspan='2'>" . _AM_PUBLISHER_UPLOAD_FILE . '</th></tr>';
echo "<tr valign='top' align='left'><td class='head'>" . _AM_PUBLISHER_SEARCH . "</td><td class='even'><input type='file' name='fileupload' id='fileupload' size='30' /></td></tr>";
echo "<tr valign='top' align='left'><td class='head'><input type='hidden' name='MAX_FILE_SIZE' id='op' value='500000' /></td><td class='even'><input type='submit' name='submit' value='" . _AM_PUBLISHER_UPLOAD . "' /></td></tr>";
echo '</table>';
echo '</form>';
// Delete File
$form = new XoopsThemeForm(_CO_PUBLISHER_DELETEFILE, 'form_name', 'pw_delete_file.php');
$pWrapSelect = new XoopsFormSelect(publisherGetUploadDir(true, 'content'), 'address');
$folder = dir($dir);
while ($file == $folder->read()) {
    if ($file !== '.' && $file !== '..') {
        $pWrapSelect->addOption($file, $file);
    }
}
$folder->close();
$form->addElement($pWrapSelect);
$delfile = 'delfile';
$form->addElement(new XoopsFormHidden('op', $delfile));
$submit = new XoopsFormButton('', 'submit', _AM_PUBLISHER_BUTTON_DELETE, 'submit');
$form->addElement($submit);
$form->display();
publisherCloseCollapsableBar('pagewraptable', 'pagewrapicon');
include_once __DIR__ . '/admin_footer.php';
コード例 #13
0
ファイル: clone.php プロジェクト: trabisdementia/publisher
    } else {
        $msg .= _AM_PUBLISHER_CLONE_FAIL;
    }
    echo $msg;
} else {
    include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
    $form = new XoopsThemeForm(sprintf(_AM_PUBLISHER_CLONE_TITLE, $publisher->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true);
    $clone = new XoopsFormText(_AM_PUBLISHER_CLONE_NAME, 'clone', 20, 20, '');
    $clone->setDescription(_AM_PUBLISHER_CLONE_NAME_DSC);
    $form->addElement($clone, true);
    $form->addElement(new XoopsFormHidden('op', 'submit'));
    $form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
    $form->display();
}
// End of collapsable bar
publisherCloseCollapsableBar('clone', 'cloneicon');
include_once __DIR__ . '/admin_footer.php';
// work around for PHP < 5.0.x
/*
if (!function_exists('file_put_contents')) {
    function file_put_contents($filename, $data, $file_append = false)
    {
        if ($fp == fopen($filename, (!$file_append ? 'w+' : 'a+'))) {
            fputs($fp, $data);
            fclose($fp);
        }
    }
}
*/
/**
 * Class PublisherClone
コード例 #14
0
$form_options = array(PublisherConstants::PUBLISHER_SUMMARY => _AM_PUBLISHER_SUMMARY, PublisherConstants::PUBLISHER_AVAILABLE_PAGE_WRAP => _CO_PUBLISHER_AVAILABLE_PAGE_WRAP, PublisherConstants::PUBLISHER_ITEM_TAG => _AM_PUBLISHER_ITEM_TAG, PublisherConstants::PUBLISHER_IMAGE_ITEM => _AM_PUBLISHER_IMAGE_ITEM, PublisherConstants::PUBLISHER_ITEM_UPLOAD_FILE => _CO_PUBLISHER_ITEM_UPLOAD_FILE, PublisherConstants::PUBLISHER_UID => _CO_PUBLISHER_UID, PublisherConstants::PUBLISHER_DATESUB => _CO_PUBLISHER_DATESUB, PublisherConstants::PUBLISHER_STATUS => _CO_PUBLISHER_STATUS, PublisherConstants::PUBLISHER_ITEM_SHORT_URL => _CO_PUBLISHER_ITEM_SHORT_URL, PublisherConstants::PUBLISHER_ITEM_META_KEYWORDS => _CO_PUBLISHER_ITEM_META_KEYWORDS, PublisherConstants::PUBLISHER_ITEM_META_DESCRIPTION => _CO_PUBLISHER_ITEM_META_DESCRIPTION, PublisherConstants::PUBLISHER_WEIGHT => _CO_PUBLISHER_WEIGHT, PublisherConstants::PUBLISHER_ALLOWCOMMENTS => _CO_PUBLISHER_ALLOWCOMMENTS, PublisherConstants::PUBLISHER_DOHTML => _CO_PUBLISHER_DOHTML, PublisherConstants::PUBLISHER_DOSMILEY => _CO_PUBLISHER_DOSMILEY, PublisherConstants::PUBLISHER_DOXCODE => _CO_PUBLISHER_DOXCODE, PublisherConstants::PUBLISHER_DOIMAGE => _CO_PUBLISHER_DOIMAGE, PublisherConstants::PUBLISHER_DOLINEBREAK => _CO_PUBLISHER_DOLINEBREAK, PublisherConstants::PUBLISHER_NOTIFY => _AM_PUBLISHER_NOTIFY, PublisherConstants::PUBLISHER_SUBTITLE => _CO_PUBLISHER_SUBTITLE, PublisherConstants::PUBLISHER_AUTHOR_ALIAS => _CO_PUBLISHER_AUTHOR_ALIAS);
$form_submit = new XoopsGroupPermForm('', $publisher->getModule()->mid(), 'form_view', '', 'admin/permissions.php');
foreach ($form_options as $key => $value) {
    $form_submit->addItem($key, $value);
}
unset($key, $value);
echo $form_submit->render();
publisherCloseCollapsableBar('permissionstable_form', 'permissionsicon_form');
// Editors permissions
echo "<br />\n";
publisherOpenCollapsableBar('permissionstable_editors', 'permissions_editors', _AM_PUBLISHER_PERMISSIONS_EDITORS, _AM_PUBLISHER_PERMISSIONS_EDITORS_DSC);
$editors = publisherGetEditors();
$form_submit = new XoopsGroupPermForm('', $publisher->getModule()->mid(), 'editors', '', 'admin/permissions.php');
foreach ($editors as $key => $value) {
    $form_submit->addItem($key, $value['title']);
}
unset($key, $value);
echo $form_submit->render();
publisherCloseCollapsableBar('permissionstable_editors', 'permissionsicon_editors');
// Global permissions
echo "<br />\n";
publisherOpenCollapsableBar('permissionstable_global', 'permissionsicon_global', _AM_PUBLISHER_PERMISSIONS_GLOBAL, _AM_PUBLISHER_PERMISSIONS_GLOBAL_DSC);
$form_options = array(PublisherConstants::PUBLISHER_SEARCH => _AM_PUBLISHER_SEARCH, PublisherConstants::PUBLISHER_RATE => _AM_PUBLISHER_RATE);
$form_submit = new XoopsGroupPermForm('', $publisher->getModule()->mid(), 'global', '', 'admin/permissions.php');
foreach ($form_options as $key => $value) {
    $form_submit->addItem($key, $value);
}
unset($key, $value);
echo $form_submit->render();
publisherCloseCollapsableBar('permissionstable_global', 'permissionsicon_global');
include_once __DIR__ . '/admin_footer.php';
コード例 #15
0
ファイル: category.php プロジェクト: trabisdementia/publisher
        publisherOpenCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC);
        echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
        echo '<tr>';
        echo "<th width='20' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMCATEGORY_ID . '</strong></td>';
        echo "<th class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCATEGORYNAME . '</strong></td>';
        echo "<th width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . '</strong></td>';
        echo "<th width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . '</strong></td>';
        echo '</tr>';
        $totalCategories =& $publisher->getHandler('category')->getCategoriesCount(0);
        if (count($categoriesObj) > 0) {
            foreach ($categoriesObj as $key => $thiscat) {
                PublisherUtilities::displayCategory($thiscat);
            }
            unset($key, $thiscat);
        } else {
            echo '<tr>';
            echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOCAT . '</td>';
            echo '</tr>';
            $categoryid = '0';
        }
        echo "</table>\n";
        include_once $GLOBALS['xoops']->path('class/pagenav.php');
        $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory');
        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
        echo '<br />';
        publisherCloseCollapsableBar('createdcategories', 'createdcategoriesicon');
        echo '<br>';
        //editcat(false);
        break;
}
include_once __DIR__ . '/admin_footer.php';