📄 category.php
字号:
<?php
/**
* $Id: brokendown.php v 1.03 06 july 2004 Catwolf Exp $
* Module: WF-Downloads
* Version: v2.0.5a
* Release Date: 26 july 2004
* Author: WF-Sections
* Licence: GNU
*/
include 'admin_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
$op = '';
if (isset($_POST))
{
foreach ($_POST as $k => $v)
{
${$k} = $v;
}
}
if (isset($_GET))
{
foreach ($_GET as $k => $v)
{
${$k} = $v;
}
}
function createcat($cid = 0)
{
include_once '../class/wfd_lists.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
global $xoopsDB, $myts, $xoopsModuleConfig, $totalcats, $xoopsModule;
$lid = 0;
$title = '';
$imgurl = '';
$description = '';
$summary = '';
$pid = '';
$weight = 0;
$nohtml = 0;
$nosmiley = 0;
$noxcodes = 0;
$noimages = 0;
$nobreak = 1;
$spotlighttop = 0;
$spotlighthis = 0;
$heading = _AM_WFD_CCATEGORY_CREATENEW;
$totalcats = wfd_totalcategory();
if ($cid)
{
$sql = "SELECT * FROM " . $xoopsDB -> prefix('wfdownloads_cat') . " WHERE cid=$cid";
$cat_arr = $xoopsDB -> fetchArray($xoopsDB -> query($sql));
$title = $myts -> htmlSpecialChars($cat_arr['title']);
$imgurl = $myts -> htmlSpecialChars($cat_arr['imgurl']);
$description = $myts -> htmlSpecialChars($cat_arr['description']);
$summary = $myts -> htmlSpecialChars($cat_arr['summary']);
$nohtml = intval($cat_arr['nohtml']);
$nosmiley = intval($cat_arr['nosmiley']);
$noxcodes = intval($cat_arr['noxcodes']);
$noimages = intval($cat_arr['noimages']);
$nobreak = intval($cat_arr['nobreak']);
$spotlighthis = intval($cat_arr['spotlighthis']);
$spotlighttop = intval($cat_arr['spotlighttop']);
$weight = $cat_arr['weight'];
$heading = _AM_WFD_CCATEGORY_MODIFY;
$member_handler = & xoops_gethandler('member');
$group_list = & $member_handler -> getGroupList();
$gperm_handler = & xoops_gethandler('groupperm');
$groups = $gperm_handler -> getGroupIds('WFDownCatPerm', $cid, $xoopsModule -> getVar('mid'));
$groups = $groups;
} else {
$groups = true;
}
$sform = new XoopsThemeForm($heading, "op", xoops_getenv('PHP_SELF'));
$sform -> setExtra('enctype="multipart/form-data"');
$sform -> addElement(new XoopsFormSelectGroup(_AM_WFD_FCATEGORY_GROUPPROMPT, "groups", true, $groups, 5, true));
if ($totalcats > 0)
{
$mytreechose = new XoopsTree($xoopsDB -> prefix("wfdownloads_cat"), "cid", "pid");
ob_start();
$mytreechose -> makeMySelBox("title", "title", 0 , 1, "pid");
$sform -> addElement(new XoopsFormLabel(_AM_WFD_FCATEGORY_SUBCATEGORY, ob_get_contents()));
ob_end_clean();
}
$sform -> addElement(new XoopsFormText(_AM_WFD_FCATEGORY_TITLE, 'title', 50, 80, $title), true);
$sform -> addElement(new XoopsFormText(_AM_WFD_FCATEGORY_WEIGHT, 'weight', 10, 80, $weight), false);
$graph_array = & WfsLists :: getListTypeAsArray(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['catimage'], $type = "images");
$indeximage_select = new XoopsFormSelect('', 'imgurl', $imgurl);
$indeximage_select -> addOptionArray($graph_array);
$indeximage_select -> setExtra("onchange='showImgSelected(\"image\", \"imgurl\", \"" . $xoopsModuleConfig['catimage'] . "\", \"\", \"" . XOOPS_URL . "\")'");
$indeximage_tray = new XoopsFormElementTray(_AM_WFD_FCATEGORY_CIMAGE, ' ');
$indeximage_tray -> addElement($indeximage_select);
if (!empty($imgurl))
{
$indeximage_tray -> addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['catimage'] . "/" . $imgurl . "' name='image' id='image' alt='' />"));
}
else
{
$indeximage_tray -> addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/uploads/blank.gif' name='image' id='image' alt='' />"));
}
$sform -> addElement($indeximage_tray);
$sform -> addElement(new XoopsFormDhtmlTextArea(_AM_WFD_FCATEGORY_DESCRIPTION, 'description', $description, 15, 60), true);
$sform -> addElement(new XoopsFormTextArea(_AM_WFD_FCATEGORY_SUMMARY, 'summary', $summary, 10, 60));
$options_tray = new XoopsFormElementTray(_AM_WFD_TEXTOPTIONS, '<br />');
$html_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
$html_checkbox -> addOption(1, _AM_WFD_DISABLEHTML);
$options_tray -> addElement($html_checkbox);
$smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
$smiley_checkbox -> addOption(1, _AM_WFD_DISABLESMILEY);
$options_tray -> addElement($smiley_checkbox);
$xcodes_checkbox = new XoopsFormCheckBox('', 'noxcodes', $noxcodes);
$xcodes_checkbox -> addOption(1, _AM_WFD_DISABLEXCODE);
$options_tray -> addElement($xcodes_checkbox);
$noimages_checkbox = new XoopsFormCheckBox('', 'noimages', $noimages);
$noimages_checkbox -> addOption(1, _AM_WFD_DISABLEIMAGES);
$options_tray -> addElement($noimages_checkbox);
$breaks_checkbox = new XoopsFormCheckBox('', 'nobreak', $nobreak);
$breaks_checkbox -> addOption(1, _AM_WFD_DISABLEBREAK);
$options_tray -> addElement($breaks_checkbox);
$sform -> addElement($options_tray);
$sform -> addElement(new XoopsFormHidden('cid', $cid));
$sform -> addElement(new XoopsFormHidden('spotlighttop', $cid));
$button_tray = new XoopsFormElementTray('', '');
$hidden = new XoopsFormHidden('op', 'save');
$button_tray -> addElement($hidden);
if (!$cid)
{
$butt_create = new XoopsFormButton('', '', _AM_WFD_BSAVE, 'submit');
$butt_create -> setExtra('onclick="this.form.elements.op.value=\'addCat\'"');
$button_tray -> addElement($butt_create);
$butt_clear = new XoopsFormButton('', '', _AM_WFD_BRESET, 'reset');
$button_tray -> addElement($butt_clear);
$butt_cancel = new XoopsFormButton('', '', _AM_WFD_BCANCEL, 'button');
$butt_cancel -> setExtra('onclick="history.go(-1)"');
$button_tray -> addElement($butt_cancel);
}
else
{
$butt_create = new XoopsFormButton('', '', _AM_WFD_BMODIFY, 'submit');
$butt_create -> setExtra('onclick="this.form.elements.op.value=\'addCat\'"');
$button_tray -> addElement($butt_create);
$butt_delete = new XoopsFormButton('', '', _AM_WFD_BDELETE, 'submit');
$butt_delete -> setExtra('onclick="this.form.elements.op.value=\'delCat\'"');
$button_tray -> addElement($butt_delete);
$butt_cancel = new XoopsFormButton('', '', _AM_WFD_BCANCEL, 'button');
$butt_cancel -> setExtra('onclick="history.go(-1)"');
$button_tray -> addElement($butt_cancel);
}
$sform -> addElement($button_tray);
$sform -> display();
$result2 = $xoopsDB -> query("SELECT COUNT(*) FROM " . $xoopsDB -> prefix("wfdownloads_cat") . "");
list($numrows) = $xoopsDB -> fetchRow($result2);
}
if (!isset($_POST['op']))
{
$op = isset($_GET['op']) ? $_GET['op'] : 'main';
}
else
{
$op = isset($_POST['op']) ? $_POST['op'] : 'main';
}
switch ($op)
{
case "move":
if (!isset($_POST['ok']))
{
$cid = (isset($_POST['cid'])) ? $_POST['cid'] : $_GET['cid'];
xoops_cp_header();
wfd_adminmenu(_AM_WFD_MCATEGORY);
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$mytree = new XoopsTree($xoopsDB -> prefix("wfdownloads_cat"), "cid", "pid");
$sform = new XoopsThemeForm(_AM_WFD_CCATEGORY_MOVE, "move", xoops_getenv('PHP_SELF'));
ob_start();
$mytree -> makeMySelBox("title", "title", 0 , 0, "target");
$sform -> addElement(new XoopsFormLabel(_AM_WFD_BMODIFY, ob_get_contents()));
ob_end_clean();
$create_tray = new XoopsFormElementTray('', '');
$create_tray -> addElement(new XoopsFormHidden('source', $cid));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -