if ($action == 'edit' && $item->thumbExists()) { $pictureTray = new XoopsFormElementTray(_AM_MYSHOP_IMAGE2_HELP, '<br />'); $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getThumbUrl() . "' alt='' border='0' />")); $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture2'); $deleteCheckbox->addOption(1, _DELETE); $pictureTray->addElement($deleteCheckbox); $sform->addElement($pictureTray); unset($pictureTray, $deleteCheckbox); } $sform->addElement(new XoopsFormFile(_AM_MYSHOP_IMAGE2_CHANGE, 'attachedfile2', myshop_utils::getModuleOption('maxuploadsize')), false); } // on-line $sform->addElement(new XoopsFormRadioYN(_MYSHOP_ONLINE_HLP, 'product_online', $item->getVar('product_online')), true); $sform->addElement(new XoopsFormText(_MYSHOP_DATE, 'product_date', 50, 255, $item->getVar('product_date', 'e')), false); $date_submit = new XoopsFormTextDateSelect(_MYSHOP_DATE_SUBMIT, 'product_submitted', 15, $item->getVar('product_submitted', 'e')); $date_submit->setDescription(_AM_MYSHOP_SUBDATE_HELP); $sform->addElement($date_submit, false); $sform->addElement(new XoopsFormHidden('product_hits', $item->getVar('product_hits'))); $sform->addElement(new XoopsFormHidden('product_rating', $item->getVar('product_rating'))); $sform->addElement(new XoopsFormHidden('product_votes', $item->getVar('product_votes'))); $sform->addElement(new XoopsFormHidden('product_comments', $item->getVar('product_comments'))); // manufacturers $manufacturers = $productsManufacturers = $manufacturers_d = $productsManufacturers_d = array(); // search $criteria = new Criteria('manu_id', 0, '<>'); $criteria->setSort('manu_name'); $manufacturers = $h_myshop_manufacturer->getObjects($criteria); foreach ($manufacturers as $oneitem) { $manufacturers_d[$oneitem->getVar('manu_id')] = xoops_trim($oneitem->getVar('manu_name')) . ' ' . xoops_trim($oneitem->getVar('manu_commercialname')); } if ($edit) {
if ($action == 'edit' && $item->thumbExists()) { $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_IMAGE2_HELP, '<br />'); $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getThumbUrl() . "' alt='' border='0' />")); $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture2'); $deleteCheckbox->addOption(1, _DELETE); $pictureTray->addElement($deleteCheckbox); $sform->addElement($pictureTray); unset($pictureTray, $deleteCheckbox); } $sform->addElement(new XoopsFormFile(_AM_OLEDRION_IMAGE2_CHANGE, 'attachedfile2', oledrion_utils::getModuleOption('maxuploadsize')), false); } // En ligne ? ********************************************************* $sform->addElement(new XoopsFormRadioYN(_OLEDRION_ONLINE_HLP, 'product_online', $item->getVar('product_online')), true); $sform->addElement(new XoopsFormText(_OLEDRION_DATE, 'product_date', 50, 255, $item->getVar('product_date', 'e')), false); $date_submit = new XoopsFormTextDateSelect(_OLEDRION_DATE_SUBMIT, 'product_submitted', 15, $item->getVar('product_submitted', 'e')); $date_submit->setDescription(_AM_OLEDRION_SUBDATE_HELP); $sform->addElement($date_submit, false); $sform->addElement(new XoopsFormHidden('product_hits', $item->getVar('product_hits'))); $sform->addElement(new XoopsFormHidden('product_rating', $item->getVar('product_rating'))); $sform->addElement(new XoopsFormHidden('product_votes', $item->getVar('product_votes'))); $sform->addElement(new XoopsFormHidden('product_comments', $item->getVar('product_comments'))); // Fabricants ************************************************************ $manufacturers = $productsManufacturers = $manufacturers_d = $productsManufacturers_d = array(); // Recherche de tous les fabricants $criteria = new Criteria('manu_id', 0, '<>'); $criteria->setSort('manu_name'); $manufacturers = $h_oledrion_manufacturer->getObjects($criteria); foreach ($manufacturers as $oneitem) { $manufacturers_d[$oneitem->getVar('manu_id')] = xoops_trim($oneitem->getVar('manu_name')) . ' ' . xoops_trim($oneitem->getVar('manu_commercialname')); } // Recherche des fabricants de ce produit
/** * XoopsfaqContents::displayForm() * * @return */ function displayForm() { global $xoopsModuleConfig; $category_handler =& xoops_getModuleHandler('category'); if (!$category_handler->getCount()) { xoops_error(_AM_XOOPSFAQ_ERRORNOCAT, $title = ''); xoops_cp_footer(); exit; } include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $caption = $this->isNew() ? _AM_XOOPSFAQ_CREATENEW : sprintf(_AM_XOOPSFAQ_MODIFYITEM, $this->getVar('contents_title')); $form = new XoopsThemeForm($caption, 'content', $_SERVER['REQUEST_URI']); $form->addElement(new XoopsFormHiddenToken()); $form->addElement(new xoopsFormHidden('op', 'save')); $form->addElement(new xoopsFormHidden('contents_id', $this->getVar('contents_id', 'e'))); // title $category_handler =& xoops_getModuleHandler('category'); $objects = $category_handler->getList(); $contents_cid = new XoopsFormSelect(_AM_XOOPSFAQ_E_CONTENTS_CATEGORY, 'contents_cid', $this->getVar('contents_cid', 'e'), 1, false); $contents_cid->setDescription(_AM_XOOPSFAQ_E_CONTENTS_CATEGORY_DSC); $contents_cid->addOptionArray($objects); $form->addElement($contents_cid); $contents_title = new XoopsFormText(_AM_XOOPSFAQ_E_CONTENTS_TITLE, 'contents_title', 50, 150, $this->getVar('contents_title', 'e')); $contents_title->setDescription(_AM_XOOPSFAQ_E_CONTENTS_TITLE_DSC); $form->addElement($contents_title, true); /** */ $options_tray = new XoopsFormElementTray(_AM_XOOPSFAQ_E_CONTENTS_CONTENT, '<br />'); if (class_exists('XoopsFormEditor')) { $options['name'] = 'contents_contents'; $options['value'] = $this->getVar('contents_contents', 'e'); $options['rows'] = 25; $options['cols'] = '100%'; $options['width'] = '100%'; $options['height'] = '600px'; $contents_contents = new XoopsFormEditor('', $xoopsModuleConfig['use_wysiwyg'], $options, $nohtml = false, $onfailure = 'textarea'); $options_tray->addElement($contents_contents); } else { $contents_contents = new XoopsFormDhtmlTextArea('', 'contents_contents', $this->getVar('contents_contents', 'e'), '100%', '100%'); $options_tray->addElement($contents_contents); } $options_tray->setDescription(_AM_XOOPSFAQ_E_CONTENTS_CONTENT_DSC); if (false == xoopsFaq_isEditorHTML()) { if ($this->isNew()) { $this->setVar('dohtml', 0); $this->setVar('dobr', 1); } $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $this->getVar('dohtml', 'e')); $html_checkbox->addOption(1, _AM_XOOPSFAQ_E_DOHTML); $options_tray->addElement($html_checkbox); $breaks_checkbox = new XoopsFormCheckBox('', 'dobr', $this->getVar('dobr', 'e')); $breaks_checkbox->addOption(1, _AM_XOOPSFAQ_E_BREAKS); $options_tray->addElement($breaks_checkbox); } else { $form->addElement(new xoopsFormHidden('dohtml', 1)); $form->addElement(new xoopsFormHidden('dobr', 0)); } $doimage_checkbox = new XoopsFormCheckBox('', 'doimage', $this->getVar('doimage', 'e')); $doimage_checkbox->addOption(1, _AM_XOOPSFAQ_E_DOIMAGE); $options_tray->addElement($doimage_checkbox); $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $this->getVar('doxcode', 'e')); $xcodes_checkbox->addOption(1, _AM_XOOPSFAQ_E_DOXCODE); $options_tray->addElement($xcodes_checkbox); $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $this->getVar('dosmiley', 'e')); $smiley_checkbox->addOption(1, _AM_XOOPSFAQ_E_DOSMILEY); $options_tray->addElement($smiley_checkbox); $form->addElement($options_tray); $contents_publish = new XoopsFormTextDateSelect(_AM_XOOPSFAQ_E_CONTENTS_PUBLISH, 'contents_publish', 20, $this->getVar('contents_publish'), $this->isNew()); $contents_publish->setDescription(_AM_XOOPSFAQ_E_CONTENTS_PUBLISH_DSC); $form->addElement($contents_publish); $contents_weight = new XoopsFormText(_AM_XOOPSFAQ_E_CONTENTS_WEIGHT, 'contents_weight', 5, 5, $this->getVar('contents_weight', 'e')); $contents_weight->setDescription(_AM_XOOPSFAQ_E_CONTENTS_WEIGHT_DSC); $form->addElement($contents_weight, false); $contents_active = new XoopsFormRadioYN(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE, 'contents_active', $this->getVar('contents_active', 'e'), ' ' . _YES . '', ' ' . _NO . ''); $contents_active->setDescription(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE_DSC); $form->addElement($contents_active, false); //$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); $btnTray = new XoopsFormElementTray('', ''); $btnSubmit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); $btnTray->addElement($btnSubmit); $btnCancel = new XoopsFormButton('', '', _CANCEL, 'button'); $btnCancel->setExtra('onclick="history.go(-1)"'); $btnTray->addElement($btnCancel); $form->addElement($btnTray); $form->display(); }