Ejemplo n.º 1
0
function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null)
{
    global $xoopsDB, $smartsection_category_handler, $xoopsUser, $myts, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/modules/smartsection/class/form-editcategory.php';
    // 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 = $smartsection_category_handler->get($categoryid);
        if ($categoryObj->notLoaded()) {
            redirect_header("category.php", 1, _AM_SSECTION_NOCOLTOEDIT);
            exit;
        }
    } else {
        if (!$categoryObj) {
            $categoryObj = $smartsection_category_handler->create();
        }
    }
    if ($categoryid != 0) {
        if ($showmenu) {
            smartsection_adminMenu(1, _AM_SSECTION_CATEGORIES . " > " . _AM_SSECTION_EDITING);
        }
        echo "<br />\n";
        smartsection_collapsableBar('edittable', 'edittableicon', _AM_SSECTION_EDITCOL, _AM_SSECTION_CATEGORY_EDIT_INFO);
    } else {
        if ($showmenu) {
            smartsection_adminMenu(1, _AM_SSECTION_CATEGORIES . " > " . _AM_SSECTION_CREATINGNEW);
        }
        //echo "<br />\n";
        smartsection_collapsableBar('createtable', 'createtableicon', _AM_SSECTION_CATEGORY_CREATE, _AM_SSECTION_CATEGORY_CREATE_INFO);
    }
    $sform =& new SmartsectionForm_EditCategory($categoryObj, $nb_subcats);
    if (!$categoryid) {
        $sform->display();
        smartsection_close_collapsable('createtable', 'createtableicon');
    } else {
        $sform->display();
        smartsection_close_collapsable('edittable', 'edittableicon');
    }
    //Added by fx2024
    if ($categoryid) {
        include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/displaysubcats.php";
        include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/displayitems.php";
    }
    //end of fx2024 code
}
Ejemplo n.º 2
0
<?php

/**
* $Id: displayitems.php 331 2007-12-23 16:01:11Z malanciault $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartsection_item_handler;
$startitem = isset($_GET['startitem']) ? intval($_GET['startitem']) : 0;
$items_title = _AM_SSECTION_CAT_ITEMS;
$items_info = _AM_SSECTION_CAT_ITEMS_DSC;
$sel_cat = $categoryid;
smartsection_collapsableBar('bottomtable', 'bottomtableicon', $items_title, $items_info);
// Get the total number of published ITEMS
$totalitems = $smartsection_item_handler->getItemsCount($sel_cat, array(_SSECTION_STATUS_PUBLISHED));
// creating the items objects that are published
$itemsObj = $smartsection_item_handler->getAllPublished($xoopsModuleConfig['perpage'], $startitem, $sel_cat);
$totalitemsOnPage = count($itemsObj);
$allcats = $smartsection_category_handler->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'><b>" . _AM_SSECTION_ITEMID . "</b></td>";
echo "<td width='20%' class='bg3' align='left'><b>" . _AM_SSECTION_ITEMCOLNAME . "</b></td>";
echo "<td class='bg3' align='left'><b>" . _AM_SSECTION_ITEMDESC . "</b></td>";
echo "<td width='90' class='bg3' align='center'><b>" . _AM_SSECTION_CREATED . "</b></td>";
echo "<td width='60' class='bg3' align='center'><b>" . _AM_SSECTION_ACTION . "</b></td>";
echo "</tr>";
if ($totalitems > 0) {
    for ($i = 0; $i < $totalitemsOnPage; $i++) {
        $categoryObj =& $allcats[$itemsObj[$i]->categoryid()];
Ejemplo n.º 3
0
     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');
     if ($moduleObj) {
         $from_module_version = round($moduleObj->getVar('version') / 100, 2);
Ejemplo n.º 4
0
<?php

/**
* $Id: displaysubcats.php 331 2007-12-23 16:01:11Z malanciault $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule;
$sc_title = _AM_SSECTION_SUBCAT_CAT;
$sc_info = _AM_SSECTION_SUBCAT_CAT_DSC;
$sel_cat = $categoryid;
smartsection_collapsableBar('subcatstable', 'subcatsicon', $sc_title, $sc_info);
// Get the total number of sub-categories
$categoriesObj = $smartsection_category_handler->get($sel_cat);
$totalsubs = $smartsection_category_handler->getCategoriesCount($sel_cat);
// creating the categories objects that are published
$subcatsObj = $smartsection_category_handler->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'><b>" . _AM_SSECTION_CATID . "</b></td>";
echo "<td width='20%' class='bg3' align='left'><b>" . _AM_SSECTION_CATCOLNAME . "</b></td>";
echo "<td class='bg3' align='left'><b>" . _AM_SSECTION_SUBDESCRIPT . "</b></td>";
echo "<td width='60' class='bg3' align='right'><b>" . _AM_SSECTION_ACTION . "</b></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/" . $xoopsModule->dirname() . "/images/icon/edit.gif' title='" . _AM_SSECTION_MODIFY . "' alt='" . _AM_SSECTION_MODIFY . "' /></a>";
        $delete = "<a href='category.php?op=del&amp;categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' title='" . _AM_SSECTION_DELETE . "' alt='" . _AM_SSECTION_DELETE . "'/></a>";
        echo "<tr>";
Ejemplo n.º 5
0
smartsection_collapsableBar('inventorytable', 'inventoryicon', _AM_SSECTION_INVENTORY);
echo "<br />";
echo "<table width='100%' class='outer' cellspacing='1' cellpadding='3' border='0' ><tr>";
echo "<td class='head'>" . _AM_SSECTION_TOTALCAT . "</td><td align='center' class='even'>" . $totalcategories . "</td>";
echo "<td class='head'>" . _AM_SSECTION_TOTALSUBMITTED . "</td><td align='center' class='even'>" . $totalsubmitted . "</td>";
echo "<td class='head'>" . _AM_SSECTION_TOTALPUBLISHED . "</td><td align='center' class='even'>" . $totalpublished . "</td>";
echo "<td class='head'>" . _AM_SSECTION_TOTAL_OFFLINE . "</td><td align='center' class='even'>" . $totaloffline . "</td>";
echo "</tr></table>";
echo "<br />";
echo "<form><div style=\"margin-bottom: 12px;\">";
echo "<input type='button' name='button' onclick=\"location='category.php?op=mod'\" value='" . _AM_SSECTION_CATEGORY_CREATE . "'>&nbsp;&nbsp;";
echo "<input type='button' name='button' onclick=\"location='item.php?op=mod'\" value='" . _AM_SSECTION_CREATEITEM . "'>&nbsp;&nbsp;";
echo "</div></form>";
smartsection_close_collapsable('inventorytable', 'inventoryicon');
// Construction of lower table
smartsection_collapsableBar('allitemstable', 'allitemsicon', _AM_SSECTION_ALLITEMS, _AM_SSECTION_ALLITEMSMSG);
$showingtxt = '';
$selectedtxt = '';
$cond = "";
$selectedtxt0 = '';
$selectedtxt1 = '';
$selectedtxt2 = '';
$selectedtxt3 = '';
$selectedtxt4 = '';
$sorttxttitle = "";
$sorttxtcreated = "";
$sorttxtweight = "";
$sorttxtitemid = "";
$ordertxtasc = '';
$ordertxtdesc = '';
switch ($sortsel) {
Ejemplo n.º 6
0
function list_groups()
{
    global $target_mid, $target_mname, $block_arr;
    smartsection_collapsableBar('groupstable', 'groupsicon', _AM_SSECTION_GROUPS, _AM_SSECTION_GROUPSINFO);
    $item_list = array();
    foreach (array_keys($block_arr) as $i) {
        $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title");
    }
    $form = new MyXoopsGroupPermForm(_MD_AM_ADGS, 1, 'block_read', '');
    if ($target_mid > 1) {
        $form->addAppendix('module_admin', $target_mid, $target_mname . ' ' . _AM_ACTIVERIGHTS);
        $form->addAppendix('module_read', $target_mid, $target_mname . ' ' . _AM_ACCESSRIGHTS);
    }
    foreach ($item_list as $item_id => $item_name) {
        $form->addItem($item_id, $item_name);
    }
    echo $form->render();
    smartsection_close_collapsable('groupstable', 'groupsicon');
}
Ejemplo n.º 7
0
     while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
         $item_list_view['cid'] = $myrow_view['categoryid'];
         $item_list_view['title'] = $myrow_view['name'];
         $form_view = new XoopsGroupPermForm("", $xoopsModule->getVar('mid'), "category_read", "");
         $block_view[] = $item_list_view;
         foreach ($block_view as $itemlists) {
             $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title']));
         }
     }
     echo $form_view->render();
 } else {
     echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SSECTION_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SSECTION_NOPERMSSET . "</span>";
 }
 smartsection_close_collapsable('permissionstable', 'permissionsicon');
 echo "<br />\n";
 smartsection_collapsableBar('permissionstable_submit', 'permissions_tableicon', _AM_SSECTION_PERMISSIONS_CAT_SUBMIT, _AM_SSECTION_PERMISSIONS_CAT_SUBMIT_DSC);
 $result_view2 = $xoopsDB->query("SELECT categoryid, name FROM " . $xoopsDB->prefix("smartsection_categories") . " ");
 if ($xoopsDB->getRowsNum($result_view2)) {
     while ($myrow_view = $xoopsDB->fetcharray($result_view2)) {
         $item_list_view['cid'] = $myrow_view['categoryid'];
         $item_list_view['title'] = $myts->displayTarea($myrow_view['name']);
         $form_sumit = new XoopsGroupPermForm("", $xoopsModule->getVar('mid'), "item_submit", "");
         $block_submit[] = $item_list_view;
         foreach ($block_submit as $itemlists) {
             $form_sumit->addItem($itemlists['cid'], $itemlists['title']);
         }
     }
     echo $form_sumit->render();
 } else {
     echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SSECTION_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SSECTION_NOPERMSSET . "</span>";
 }
Ejemplo n.º 8
0
switch ($op) {
    case 'replacepermissions':
        $categoriesObj = $smartsection_category_handler->getObjects();
        $groups_read = isset($_POST['groups_read']) ? $_POST['groups_read'] : array();
        foreach ($categoriesObj as $categoryObj) {
            smartsection_saveCategory_Permissions($groups_read, $categoryObj->categoryid(), 'category_read');
            smartsection_overrideItemsPermissions($groups_read, $categoryObj->categoryid());
        }
        redirect_header("index.php", 3, _AM_SSECTION_PERMISSIONS_UPDATED);
        exit;
        break;
    case "default":
    default:
        smartsection_xoops_cp_header();
        smartsection_adminMenu(-1, _AM_SSECTION_TOOLS);
        smartsection_collapsableBar('tools1', 'tools1icon', _AM_SSECTION_CONFIGURE_READ_PERMISSIONS, _AM_SSECTION_CONFIGURE_READ_PERMISSIONS_EXP);
        include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
        $sform = new XoopsThemeForm(_AM_SSECTION_FULLACCESS, "form", xoops_getenv('PHP_SELF'));
        $sform->setExtra('enctype="multipart/form-data"');
        // READ PERMISSIONS
        $groups_read_checkbox = new XoopsFormCheckBox(_AM_SSECTION_PERMISSIONS_CAT_READ, 'groups_read[]');
        $member_handler =& xoops_gethandler('member');
        foreach ($member_handler->getGroupList() as $group_id => $group_name) {
            if ($group_id != XOOPS_GROUP_ADMIN) {
                $groups_read_checkbox->addOption($group_id, $group_name);
            }
        }
        $sform->addElement($groups_read_checkbox);
        $button_tray = new XoopsFormElementTray('', '');
        $button_tray->addElement(new XoopsFormButton('', 'replacepermissions', _AM_SSECTION_REPLACE_PERMISSIONS, 'submit'));
        $sform->addElement($button_tray);
Ejemplo n.º 9
0
function editfile($showmenu = false, $fileid = 0, $itemid = 0)
{
    global $smartsection_file_handler, $xoopsModule;
    include_once XOOPS_ROOT_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 = new smartsectionfile($fileid);
        if ($fileObj->notLoaded()) {
            redirect_header("javascript:history.go(-1)", 1, _AM_SSECTION_NOFILESELECTED);
            exit;
        }
        if ($showmenu) {
            smartsection_adminMenu(2, _AM_SSECTION_FILE . " > " . _AM_SSECTION_EDITING);
        }
        echo "<br />\n";
        echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_SSECTION_FILE_EDITING . "</span>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SSECTION_FILE_EDITING_DSC . "</span>";
        smartsection_collapsableBar('editfile', 'editfileicon', _AM_SSECTION_FILE_INFORMATIONS);
    } else {
        // there's no parameter, so we're adding an item
        $fileObj =& $smartsection_file_handler->create();
        $fileObj->setVar('itemid', $itemid);
        if ($showmenu) {
            smartsection_adminMenu(2, _AM_SSECTION_FILE . " > " . _AM_SSECTION_FILE_ADD);
        }
        echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_SSECTION_FILE_ADDING . "</span>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SSECTION_FILE_ADDING_DSC . "</span>";
        smartsection_collapsableBar('addfile', 'addfileicon', _AM_SSECTION_FILE_INFORMATIONS);
    }
    // FILES UPLOAD FORM
    $files_form = new XoopsThemeForm(_AM_SSECTION_UPLOAD_FILE, "files_form", xoops_getenv('PHP_SELF'));
    $files_form->setExtra("enctype='multipart/form-data'");
    // NAME
    $name_text = new XoopsFormText(_AM_SSECTION_FILE_NAME, 'name', 50, 255, $fileObj->name());
    $name_text->setDescription(_AM_SSECTION_FILE_NAME_DSC);
    $files_form->addElement($name_text, true);
    // DESCRIPTION
    $description_text = new XoopsFormTextArea(_AM_SSECTION_FILE_DESCRIPTION, 'description', $fileObj->description());
    $description_text->setDescription(_AM_SSECTION_FILE_DESCRIPTION_DSC);
    $files_form->addElement($description_text, 7, 60);
    // FILE TO UPLOAD
    if ($fileid == 0) {
        $file_box = new XoopsFormFile(_AM_SSECTION_FILE_TO_UPLOAD, "userfile", 0);
        $file_box->setExtra("size ='50'");
        $files_form->addElement($file_box);
    }
    $status_select = new XoopsFormRadioYN(_AM_SSECTION_FILE_STATUS, 'file_status', $fileObj->status());
    $status_select->setDescription(_AM_SSECTION_FILE_STATUS_DSC);
    $files_form->addElement($status_select);
    $files_button_tray = new XoopsFormElementTray('', '');
    $files_hidden = new XoopsFormHidden('op', 'uploadfile');
    $files_button_tray->addElement($files_hidden);
    if ($fileid == 0) {
        $files_butt_create = new XoopsFormButton('', '', _AM_SSECTION_UPLOAD, 'submit');
        $files_butt_create->setExtra('onclick="this.form.elements.op.value=\'uploadfile\'"');
        $files_button_tray->addElement($files_butt_create);
        $files_butt_another = new XoopsFormButton('', '', _AM_SSECTION_FILE_UPLOAD_ANOTHER, 'submit');
        $files_butt_another->setExtra('onclick="this.form.elements.op.value=\'uploadanother\'"');
        $files_button_tray->addElement($files_butt_another);
    } else {
        $files_butt_create = new XoopsFormButton('', '', _AM_SSECTION_MODIFY, 'submit');
        $files_butt_create->setExtra('onclick="this.form.elements.op.value=\'modify\'"');
        $files_button_tray->addElement($files_butt_create);
    }
    $files_butt_clear = new XoopsFormButton('', '', _AM_SSECTION_CLEAR, 'reset');
    $files_button_tray->addElement($files_butt_clear);
    $butt_cancel = new XoopsFormButton('', '', _AM_SSECTION_CANCEL, 'button');
    $butt_cancel->setExtra('onclick="history.go(-1)"');
    $files_button_tray->addElement($butt_cancel);
    $files_form->addElement($files_button_tray);
    // fileid
    $files_form->addElement(new XoopsFormHidden('fileid', $fileid));
    // itemid
    $files_form->addElement(new XoopsFormHidden('itemid', $itemid));
    $files_form->display();
    if ($fileid != 0) {
        smartsection_close_collapsable('editfile', 'editfileicon');
    } else {
        smartsection_close_collapsable('addfile', 'addfileicon');
    }
}
Ejemplo n.º 10
0
<?php

/**
* $Id: pagewrap.php 331 2007-12-23 16:01:11Z malanciault $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Credits : TinyContent developped by Tobias Liegl (AKA CHAPI) (http://www.chapi.de)
* Licence: GNU
*/
include_once "admin_header.php";
smartsection_xoops_cp_header();
smartsection_adminMenu(-1, _AM_SSECTION_ITEMS . " > " . _AM_SSECTION_PAGEWRAP);
smartsection_collapsableBar('pagewraptable', 'pagewrapicon', _AM_SSECTION_PAGEWRAP, _AM_SSECTION_PAGEWRAPDSC);
$dir = smartsection_getUploadDir(true, 'content');
if (!eregi("777", decoct(fileperms($dir)))) {
    echo "<font color='FF0000'><h4>" . _AM_SSECTION_PERMERROR . "</h4></font>";
}
// 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_SSECTION_UPLOAD_FILE . "</th></tr>";
echo "<tr valign='top' align='left'><td class='head'>" . _AM_SSECTION_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_SSECTION_UPLOAD . "' /></td></tr>";
echo "</table>";
echo "</form>";
// Delete File
$form = new XoopsThemeForm(_AM_SSECTION_DELETEFILE, "form_name", "pw_delete_file.php");
$pWrap_select = new XoopsFormSelect(smartsection_getUploadDir(true, 'content'), "address");
$folder = dir($dir);
while ($file = $folder->read()) {
    if ($file != "." && $file != "..") {
Ejemplo n.º 11
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();
}
Ejemplo n.º 12
0
            $parent_cat_sel->setDescription(_AM_SSECTION_IMPORT_PARENT_CATEGORY_DSC);
            $form->addElement($parent_cat_sel);
            ob_end_clean();
            $form->addElement(new XoopsFormHidden('op', 'go'));
            $form->addElement(new XoopsFormButton('', 'import', _AM_SSECTION_IMPORT, 'submit'));
            $form->addElement(new XoopsFormHidden('from_module_version', $_POST['wfs_version']));
            $form->display();
        }
    }
    smartsection_close_collapsable('wfsectionimport', 'wfsectionimporticon');
    exit;
}
if ($op == 'go') {
    smartsection_xoops_cp_header();
    smartsection_adminMenu(-1, _AM_SSECTION_IMPORT);
    smartsection_collapsableBar('wfsectionimportgo', 'wfsectionimportgoicon', sprintf(_AM_SSECTION_IMPORT_FROM, $importFromModuleName), _AM_SSECTION_IMPORT_RESULT);
    $cnt_imported_cat = 0;
    $cnt_imported_articles = 0;
    $parentId = $_POST['parent_category'];
    //added to support 2.0.7
    if ($_POST['from_module_version'] == 2.07 || $_POST['from_module_version'] == 2.06) {
        $orders = 'weight';
    } else {
        $orders = 'orders';
    }
    //$sql = "SELECT * FROM ".$xoopsDB->prefix("wfs_category")." ORDER by orders";
    $sql = "SELECT * FROM " . $xoopsDB->prefix("wfs_category") . " ORDER by {$orders}";
    //end added to support 2.0.7
    $resultCat = $xoopsDB->query($sql);
    $newCatArray = array();
    while ($arrCat = $xoopsDB->fetchArray($resultCat)) {
Ejemplo n.º 13
0
function edititem($showmenu = false, $itemid = 0, $clone = false)
{
    global $smartsection_current_page, $smartsection_file_handler, $smartsection_item_handler, $smartsection_category_handler, $xoopsUser, $xoopsModule, $xoopsConfig, $xoopsDB;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    include_once SMARTSECTION_ROOT_PATH . '/class/formdatetime.php';
    // if there is a parameter, and the id exists, retrieve data: we're editing a item
    if ($itemid != 0) {
        // Creating the ITEM object
        $itemObj = $smartsection_item_handler->get($itemid);
        if (!$itemObj) {
            redirect_header("item.php", 1, _AM_SSECTION_NOITEMSELECTED);
            exit;
        }
        if ($clone) {
            $itemObj->setNew();
            $itemObj->setVar('status', _SSECTION_STATUS_NOTSET);
            $itemObj->setVar('datesub', time());
        }
        switch ($itemObj->status()) {
            case _SSECTION_STATUS_SUBMITTED:
                $breadcrumb_action1 = _AM_SSECTION_SUBMITTED;
                $breadcrumb_action2 = _AM_SSECTION_APPROVING;
                $page_title = _AM_SSECTION_SUBMITTED_TITLE;
                $page_info = _AM_SSECTION_SUBMITTED_INFO;
                $button_caption = _AM_SSECTION_APPROVE;
                $new_status = _SSECTION_STATUS_PUBLISHED;
                break;
            case _SSECTION_STATUS_PUBLISHED:
                $breadcrumb_action1 = _AM_SSECTION_PUBLISHED;
                $breadcrumb_action2 = _AM_SSECTION_EDITING;
                $page_title = _AM_SSECTION_PUBLISHEDEDITING;
                $page_info = _AM_SSECTION_PUBLISHEDEDITING_INFO;
                $button_caption = _AM_SSECTION_MODIFY;
                $new_status = _SSECTION_STATUS_PUBLISHED;
                break;
            case _SSECTION_STATUS_OFFLINE:
                $breadcrumb_action1 = _AM_SSECTION_OFFLINE;
                $breadcrumb_action2 = _AM_SSECTION_EDITING;
                $page_title = _AM_SSECTION_OFFLINEEDITING;
                $page_info = _AM_SSECTION_OFFLINEEDITING_INFO;
                $button_caption = _AM_SSECTION_MODIFY;
                $new_status = _SSECTION_STATUS_OFFLINE;
                break;
            case _SSECTION_STATUS_REJECTED:
                $breadcrumb_action1 = _AM_SSECTION_REJECTED;
                $breadcrumb_action2 = _AM_SSECTION_REJECTED;
                $page_title = _AM_SSECTION_REJECTED_EDIT;
                $page_info = _AM_SSECTION_REJECTED_EDIT_INFO;
                $button_caption = _AM_SSECTION_MODIFY;
                $new_status = _SSECTION_STATUS_REJECTED;
                break;
            case _SSECTION_STATUS_NOTSET:
                // Then it's a clone...
                $breadcrumb_action1 = _AM_SSECTION_ITEMS;
                $breadcrumb_action2 = _AM_SSECTION_CLONE_NEW;
                $button_caption = _AM_SSECTION_CREATE;
                $new_status = _SSECTION_STATUS_PUBLISHED;
                $page_title = _AM_SSECTION_ITEM_DUPLICATING;
                $page_info = _AM_SSECTION_ITEM_DUPLICATING_DSC;
                break;
            case "default":
            default:
                $breadcrumb_action1 = _AM_SSECTION_ITEMS;
                $breadcrumb_action2 = _AM_SSECTION_EDITING;
                $page_title = _AM_SSECTION_PUBLISHEDEDITING;
                $page_info = _AM_SSECTION_PUBLISHEDEDITING_INFO;
                $button_caption = _AM_SSECTION_MODIFY;
                $new_status = _SSECTION_STATUS_PUBLISHED;
                break;
        }
        $categoryObj = $itemObj->category();
        if ($showmenu) {
            smartsection_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        echo "<br />\n";
        smartsection_collapsableBar('edititemtable', 'edititemicon', $page_title, $page_info);
        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_SSECTION_CLONE_ITEM . "'>&nbsp;&nbsp;";
            echo "</div></form>";
        }
    } else {
        // there's no parameter, so we're adding an item
        $itemObj =& $smartsection_item_handler->create();
        $itemObj->setVar('uid', $xoopsUser->uid());
        $categoryObj =& $smartsection_category_handler->create();
        $breadcrumb_action1 = _AM_SSECTION_ITEMS;
        $breadcrumb_action2 = _AM_SSECTION_CREATINGNEW;
        $button_caption = _AM_SSECTION_CREATE;
        $new_status = _SSECTION_STATUS_PUBLISHED;
        if ($showmenu) {
            smartsection_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        $sel_categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : 0;
        $categoryObj->setVar('categoryid', $sel_categoryid);
        smartsection_collapsableBar('createitemtable', 'createitemicon', _AM_SSECTION_ITEM_CREATING, _AM_SSECTION_ITEM_CREATING_DSC);
    }
    // ITEM FORM
    $sform = new XoopsThemeForm(_AM_SSECTION_ITEMS, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // CATEGORY
    $mytree = new XoopsTree($xoopsDB->prefix("smartsection_categories"), "categoryid", "parentid");
    ob_start();
    //$sform->addElement(new XoopsFormHidden('categoryid', $categoryObj->categoryid()));
    $mytree->makeMySelBox("name", "weight", $categoryObj->categoryid());
    $category_label = new XoopsFormLabel(_AM_SSECTION_CATEGORY, ob_get_contents());
    $category_label->setDescription(_AM_SSECTION_CATEGORY_DSC);
    $sform->addElement($category_label);
    ob_end_clean();
    // TITLE
    $title_text = new XoopsFormText(_AM_SSECTION_TITLE, 'title', 50, 255, $itemObj->title(0, 'e'));
    $sform->addElement($title_text, true);
    if (SMARTSECTION_LEVEL >= 5) {
        // SUMMARY
        $summary_text = smartsection_getEditor(_AM_SSECTION_SUMMARY, 'summary', $itemObj->getVar('summary', 'e'));
        $summary_text->setDescription(_AM_SSECTION_SUMMARY_DSC);
        $sform->addElement($summary_text, false);
        // DISPLAY_SUMMARY
        $display_summary_radio = new XoopsFormRadioYN(_AM_SSECTION_DISPLAY_SUMMARY, 'display_summary', $itemObj->display_summary(), ' ' . _AM_SSECTION_YES . '', ' ' . _AM_SSECTION_NO . '');
        $sform->addElement($display_summary_radio);
    }
    // BODY
    /*if ($itemObj->address()) {
    		// Main body : pagewrap
    		$address_select = new XoopsFormSelect(_AM_SSECTION_BODY_SELECTFILE, "address", $itemObj->address());
    		$address_select->setDescription(_AM_SSECTION_BODY_SELECTFILE_DSC);
    	    $dir = smartsection_getUploadDir(true, 'content');
    		$folder = dir($dir);
    		while($file = $folder->read()) {
    	      if ($file != "." && $file != "..") {
    		     $address_select->addOption($file, "".$file."");
    		  }
    		}
    	    $folder->close();
    		$sform->addElement($address_select);
    
    		$sform->addElement(new XoopsFormHidden('body', ''));
    	} else {*/
    $body_text = smartsection_getEditor(_AM_SSECTION_BODY, 'body', $itemObj->getVar('body', 'e'));
    if (SMARTSECTION_LEVEL >= 5) {
        $body_text->setDescription(sprintf(_AM_SSECTION_BODY_DSC, SMARTSECTION_URL . "/admin/pagewrap_lookup.php"));
    }
    $sform->addElement($body_text);
    //}
    if (SMARTSECTION_LEVEL >= 5) {
        // Available pages to wrap
        $wrap_pages = XoopsLists::getHtmlListAsArray(smartsection_getUploadDir(true, 'content'));
        $available_wrap_pages_text = array();
        foreach ($wrap_pages as $page) {
            $available_wrap_pages_text[] = "<span onclick='smartsectionPageWrap(\"body\", \"[pagewrap={$page}] \");' onmouseover='style.cursor=\"pointer\"'>{$page}</span>";
        }
        $available_wrap_pages = new XoopsFormLabel(_AM_SSECTION_AVAILABLE_PAGE_WRAP, implode(', ', $available_wrap_pages_text));
        $available_wrap_pages->setDescription(_AM_SSECTION_AVAILABLE_PAGE_WRAP_DSC);
        $sform->addElement($available_wrap_pages);
        // Tags
        if (smartsection_tag_module_included()) {
            include_once XOOPS_ROOT_PATH . "/modules/tag/include/formtag.php";
            $text_tags = new XoopsFormTag("item_tag", 60, 255, $itemObj->getVar('item_tag', 'e'), 0);
            $sform->addElement($text_tags);
        }
        // IMAGE
        $image_array = XoopsLists::getImgListAsArray(smartsection_getImageDir('item'));
        $image_select = new XoopsFormSelect('', 'image', $itemObj->image());
        //$image_select -> addOption ('-1', '---------------');
        $image_select->addOptionArray($image_array);
        $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/smartsection/images/item/' . "\", \"\", \"" . XOOPS_URL . "\")'");
        $image_tray = new XoopsFormElementTray(_AM_SSECTION_IMAGE_ITEM, '&nbsp;');
        $image_tray->addElement($image_select);
        $image_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . smartsection_getImageDir('item', false) . $itemObj->image() . "' name='image3' id='image3' alt='' />"));
        $image_tray->setDescription(_AM_SSECTION_IMAGE_ITEM_DSC);
        $sform->addElement($image_tray);
        // IMAGE UPLOAD
        $max_size = 5000000;
        $image_file_box = new XoopsFormFile(_AM_SSECTION_IMAGE_UPLOAD, "image_file", $max_size);
        $image_file_box->setExtra("size ='50'");
        $image_file_box->setDescription(_AM_SSECTION_IMAGE_UPLOAD_ITEM_DSC);
        $sform->addElement($image_file_box);
    }
    // File upload UPLOAD
    $file_box = new XoopsFormFile(smartsection_new_feature_tag() . _AM_SSECTION_ITEM_UPLOAD_FILE, "userfile", 0);
    $file_box->setDescription(_AM_SSECTION_ITEM_UPLOAD_FILE_DSC . smartsection_new_feature_tag());
    $file_box->setExtra("size ='50'");
    $sform->addElement($file_box);
    // Uid
    /*  We need to retreive the users manually because for some reason, on the frxoops.org server,
    	    the method users::getobjects encounters a memory error
    	*/
    $uid = $itemObj->uid();
    $uid_select = new XoopsFormSelect(_AM_SSECTION_UID, 'uid', $uid, 1, false);
    $uid_select->setDescription(_AM_SSECTION_UID_DSC);
    $sql = "SELECT uid, uname FROM " . $xoopsDB->prefix('users') . " ORDER BY uname ASC";
    $result = $xoopsDB->query($sql);
    $users_array = array();
    $users_array[0] = $xoopsConfig['anonymous'];
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $users_array[$myrow['uid']] = $myrow['uname'];
    }
    $uid_select->addOptionArray($users_array);
    $sform->addElement($uid_select);
    // Datesub
    $datesub = $itemObj->getVar('datesub') == 0 ? time() : $itemObj->getVar('datesub');
    $datesub_datetime = new SmartsectionFormDateTime(_AM_SSECTION_DATESUB, 'datesub', $size = 15, $datesub);
    $datesub_datetime->setDescription(_AM_SSECTION_DATESUB_DSC);
    $sform->addElement($datesub_datetime);
    // STATUS
    $options = array(_SSECTION_STATUS_PUBLISHED => _AM_SSECTION_PUBLISHED, _SSECTION_STATUS_OFFLINE => _AM_SSECTION_OFFLINE, _SSECTION_STATUS_SUBMITTED => _AM_SSECTION_SUBMITTED, _SSECTION_STATUS_REJECTED => _AM_SSECTION_REJECTED);
    $status_select = new XoopsFormSelect(_AM_SSECTION_STATUS, 'status', $new_status);
    $status_select->addOptionArray($options);
    $status_select->setDescription(_AM_SSECTION_STATUS_DSC);
    $sform->addElement($status_select);
    if (SMARTSECTION_LEVEL > 0) {
        // Short url
        $text_short_url = new XoopsFormText(_AM_SSECTION_ITEM_SHORT_URL, 'short_url', 50, 255, $itemObj->short_url('e'));
        $text_short_url->setDescription(_AM_SSECTION_ITEM_SHORT_URL_DSC);
        $sform->addElement($text_short_url);
        // Meta Keywords
        $text_meta_keywords = new XoopsFormTextArea(_AM_SSECTION_ITEM_META_KEYWORDS, 'meta_keywords', $itemObj->meta_keywords('e'), 7, 60);
        $text_meta_keywords->setDescription(_AM_SSECTION_ITEM_META_KEYWORDS_DSC);
        $sform->addElement($text_meta_keywords);
        // Meta Description
        $text_meta_description = new XoopsFormTextArea(_AM_SSECTION_ITEM_META_DESCRIPTION, 'meta_description', $itemObj->meta_description('e'), 7, 60);
        $text_meta_description->setDescription(_AM_SSECTION_ITEM_META_DESCRIPTION_DSC);
        $sform->addElement($text_meta_description);
    }
    // WEIGHT
    $sform->addElement(new XoopsFormText(_AM_SSECTION_WEIGHT, 'weight', 5, 5, $itemObj->weight()), true);
    if (SMARTSECTION_LEVEL >= 5) {
        // COMMENTS
        $addcomments_radio = new XoopsFormRadioYN(_AM_SSECTION_ALLOWCOMMENTS, 'cancomment', $itemObj->cancomment(), ' ' . _AM_SSECTION_YES . '', ' ' . _AM_SSECTION_NO . '');
        $sform->addElement($addcomments_radio);
    }
    // PER ITEM PERMISSIONS
    $member_handler =& xoops_gethandler('member');
    $group_list = $member_handler->getGroupList();
    $groups_checkbox = new XoopsFormCheckBox(_AM_SSECTION_PERMISSIONS_ITEM, 'groups[]', $itemObj->getGroups_read());
    $groups_checkbox->setDescription(_AM_SSECTION_PERMISSIONS_ITEM_DSC);
    foreach ($group_list as $group_id => $group_name) {
        if ($group_id != XOOPS_GROUP_ADMIN) {
            $groups_checkbox->addOption($group_id, $group_name);
        }
    }
    $sform->addElement($groups_checkbox);
    $p_view_checkbox = new XoopsFormCheckBox(_AM_SSECTION_PARTIAL_VIEW, 'partial_view[]', $itemObj->partial_view());
    $p_view_checkbox->setDescription(_AM_SSECTION_PARTIAL_VIEWDSC);
    foreach ($group_list as $group_id => $group_name) {
        if ($group_id != XOOPS_GROUP_ADMIN) {
            $p_view_checkbox->addOption($group_id, $group_name);
        }
    }
    $sform->addElement($p_view_checkbox);
    /*$partial_view_radio = new XoopsFormRadioYN(_AM_SSECTION_PARTIAL_VIEW, 'partial_view', $itemObj->partial_view(), ' ' . _AM_SSECTION_YES . '', ' ' . _AM_SSECTION_NO . '');
    	$partial_view_radio->setDescription(_AM_SSECTION_PARTIAL_VIEWDSC);
    	$sform->addElement($partial_view_radio);*/
    if (SMARTSECTION_LEVEL >= 5) {
        // VARIOUS OPTIONS
        $options_tray = new XoopsFormElementTray(_AM_SSECTION_OPTIONS, '<br />');
        $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $itemObj->dohtml());
        $html_checkbox->addOption(1, _AM_SSECTION_DOHTML);
        $options_tray->addElement($html_checkbox);
        $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $itemObj->dosmiley());
        $smiley_checkbox->addOption(1, _AM_SSECTION_DOSMILEY);
        $options_tray->addElement($smiley_checkbox);
        $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $itemObj->doxcode());
        $xcodes_checkbox->addOption(1, _AM_SSECTION_DOXCODE);
        $options_tray->addElement($xcodes_checkbox);
        $images_checkbox = new XoopsFormCheckBox('', 'doimage', $itemObj->doimage());
        $images_checkbox->addOption(1, _AM_SSECTION_DOIMAGE);
        $options_tray->addElement($images_checkbox);
        $linebreak_checkbox = new XoopsFormCheckBox('', 'dobr', $itemObj->dobr());
        $linebreak_checkbox->addOption(1, _AM_SSECTION_DOLINEBREAK);
        $options_tray->addElement($linebreak_checkbox);
        $sform->addElement($options_tray);
    }
    // item ID
    if ($clone) {
        $itemid = 0;
    }
    $sform->addElement(new XoopsFormHidden('itemid', $itemid));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'additem');
    $button_tray->addElement($hidden);
    if (!$itemid) {
        // there's no itemid? Then it's a new item
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SSECTION_CREATE, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', _AM_SSECTION_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'additem\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SSECTION_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
        $butt_cancel = new XoopsFormButton('', '', _AM_SSECTION_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
        $sform->addElement($button_tray);
        $sform->display();
        smartsection_close_collapsable('createitemtable', 'createitemicon');
    } else {
        // else, we're editing an existing item
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SSECTION_MODIFY, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', $button_caption, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'additem\'"');
        $button_tray->addElement($butt_create);
        $butt_cancel = new XoopsFormButton('', '', _AM_SSECTION_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
        $sform->addElement($button_tray);
        $sform->display();
        smartsection_close_collapsable('edititemtable', 'edititemicon');
    }
    if (SMARTSECTION_LEVEL >= 5) {
        smartsection_collapsableBar('pagewraptable', 'pagewrapicon', _AM_SSECTION_PAGEWRAP, _AM_SSECTION_PAGEWRAPDSC);
        $dir = smartsection_getUploadDir(true, 'content');
        if (!eregi("777", decoct(fileperms($dir)))) {
            echo "<font color='FF0000'><h4>" . _AM_SSECTION_PERMERROR . "</h4></font>";
        }
        // 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_SSECTION_UPLOAD_FILE . "</th></tr>";
        echo "<tr valign='top' align='left'><td class='head'>" . _AM_SSECTION_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_SSECTION_UPLOAD . "' /></td></tr>";
        echo "<input type='hidden' name='backto' value='{$smartsection_current_page}'/>";
        echo "</table>";
        echo "</form>";
        // Delete File
        $form = new XoopsThemeForm(_AM_SSECTION_DELETEFILE, "form_name", "pw_delete_file.php");
        $pWrap_select = new XoopsFormSelect(smartsection_getUploadDir(true, 'content'), "address");
        $folder = dir($dir);
        while ($file = $folder->read()) {
            if ($file != "." && $file != "..") {
                $pWrap_select->addOption($file, $file);
            }
        }
        $folder->close();
        $form->addElement($pWrap_select);
        $delfile = "delfile";
        $form->addElement(new XoopsFormHidden('op', $delfile));
        $submit = new XoopsFormButton("", "submit", _AM_SSECTION_BUTTON_DELETE, "submit");
        $form->addElement($submit);
        $form->addElement(new XoopsFormHidden('backto', $smartsection_current_page));
        $form->display();
        smartsection_close_collapsable('pagewraptable', 'pagewrapicon');
    }
    unset($hidden);
    if ($itemid != 0) {
        showfiles($itemObj);
    }
}