Esempio n. 1
0
     $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
     $deleteCheckbox->addOption(1, _DELETE);
     $pictureTray->addElement($deleteCheckbox);
     $sform->addElement($pictureTray);
     unset($pictureTray, $deleteCheckbox);
 }
 $sform->addElement(new XoopsFormFile(_AM_MYSHOP_PICTURE, 'attachedfile', myshop_utils::getModuleOption('maxuploadsize')), false);
 $editor = myshop_utils::getWysiwygForm(_AM_MYSHOP_DESCRIPTION, 'cat_description', $item->getVar('cat_description', 'e'), 15, 60, 'description_hidden');
 if ($editor) {
     $sform->addElement($editor, false);
 }
 $editor3 = myshop_utils::getWysiwygForm(_AM_MYSHOP_FOOTER, 'cat_footer', $item->getVar('cat_footer', 'e'), 15, 60, 'footer_hidden');
 if ($editor3) {
     $sform->addElement($editor3, false);
 }
 $editor2 = myshop_utils::getWysiwygForm(_MI_MYSHOP_ADVERTISEMENT, 'cat_advertisement', $item->getVar('cat_advertisement', 'e'), 15, 60, 'advertisement_hidden');
 if ($editor2) {
     $sform->addElement($editor2, false);
 }
 // META Data
 if ($manual_meta) {
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_KEYWORDS, 'cat_metakeywords', 50, 255, $item->getVar('cat_metakeywords', 'e')), false);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_DESCRIPTION, 'cat_metadescription', 50, 255, $item->getVar('cat_metadescription', 'e')), false);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_PAGETITLE, 'cat_metatitle', 50, 255, $item->getVar('cat_metatitle', 'e')), false);
 }
 $button_tray = new XoopsFormElementTray('', '');
 $submit_btn = new XoopsFormButton('', 'post', $label_submit, 'submit');
 $button_tray->addElement($submit_btn);
 $sform->addElement($button_tray);
 $sform = myshop_utils::formMarkRequiredFields($sform);
 $sform->display();
Esempio n. 2
0
 } else {
     $title = _AM_MYSHOP_ADD_MANUFACTURER;
     $item = $h_myshop_manufacturer->create(true);
     $label_submit = _AM_MYSHOP_ADD;
     $edit = false;
 }
 $sform = new XoopsThemeForm($title, 'frmmanufacturer', $baseurl);
 $sform->setExtra('enctype="multipart/form-data"');
 $sform->addElement(new XoopsFormHidden('op', 'manufacturers'));
 $sform->addElement(new XoopsFormHidden('action', 'saveedit'));
 $sform->addElement(new XoopsFormHidden('manu_id', $item->getVar('manu_id')));
 $sform->addElement(new XoopsFormText(_MYSHOP_LASTNAME, 'manu_name', 50, 255, $item->getVar('manu_name', 'e')), true);
 $sform->addElement(new XoopsFormText(_MYSHOP_COMM_NAME, 'manu_commercialname', 50, 255, $item->getVar('manu_commercialname', 'e')), false);
 $sform->addElement(new XoopsFormText(_MYSHOP_EMAIL, 'manu_email', 50, 255, $item->getVar('manu_email', 'e')), false);
 $sform->addElement(new XoopsFormText(_MYSHOP_SITEURL, 'manu_url', 50, 255, $item->getVar('manu_url', 'e')), false);
 $editor = myshop_utils::getWysiwygForm(_MYSHOP_MANUFACTURER_INF, 'manu_bio', $item->getVar('manu_bio', 'e'), 15, 60, 'bio_hidden');
 if ($editor) {
     $sform->addElement($editor, false);
 }
 for ($i = 1; $i <= 5; $i++) {
     if ($action == 'edit' && $item->pictureExists($i)) {
         $pictureTray = new XoopsFormElementTray(_AM_MYSHOP_CURRENT_PICTURE, '<br />');
         $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl($i) . "' alt='' border='0' />"));
         $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture' . $i);
         $deleteCheckbox->addOption(1, _DELETE);
         $pictureTray->addElement($deleteCheckbox);
         $sform->addElement($pictureTray);
         unset($pictureTray, $deleteCheckbox);
     }
     $sform->addElement(new XoopsFormFile(_AM_MYSHOP_PICTURE . ' ' . $i, 'attachedfile' . $i, myshop_utils::getModuleOption('maxuploadsize')), false);
 }
Esempio n. 3
0
     if ($editor1) {
         $sform->addElement($editor1, false);
     }
     $editor2 = myshop_utils::getWysiwygForm(_MYSHOP_CGV, 'welcome2', $registry->getfile(MYSHOP_TEXTFILE2), 5, 60, 'hometext2_hidden');
     if ($editor2) {
         $sform->addElement($editor2, false);
     }
     $editor3 = myshop_utils::getWysiwygForm(_AM_MYSHOP_RECOMM_TEXT, 'welcome3', $registry->getfile(MYSHOP_TEXTFILE3), 5, 60, 'hometext3_hidden');
     if ($editor3) {
         $sform->addElement($editor3, false);
     }
     $editor4 = myshop_utils::getWysiwygForm(_AM_MYSHOP_OFFLINEPAY_TEXT, 'welcome4', $registry->getfile(MYSHOP_TEXTFILE4), 5, 60, 'hometext4_hidden');
     if ($editor4) {
         $sform->addElement($editor4, false);
     }
     $editor5 = myshop_utils::getWysiwygForm(_AM_MYSHOP_RESTRICT_TEXT, 'welcome5', $registry->getfile(MYSHOP_TEXTFILE5), 5, 60, 'hometext5_hidden');
     if ($editor5) {
         $sform->addElement($editor5, false);
     }
     $button_tray = new XoopsFormElementTray('', '');
     $submit_btn = new XoopsFormButton('', 'post', _AM_MYSHOP_MODIFY, 'submit');
     $button_tray->addElement($submit_btn);
     $sform->addElement($button_tray);
     $sform = myshop_utils::formMarkRequiredFields($sform);
     $sform->display();
     break;
 case 'savetexts':
     require_once MYSHOP_PATH . 'class/registryfile.php';
     $registry = new myshop_registryfile();
     $registry->savefile($myts->stripSlashesGPC($_POST['welcome1']), MYSHOP_TEXTFILE1);
     $registry->savefile($myts->stripSlashesGPC($_POST['welcome2']), MYSHOP_TEXTFILE2);
Esempio n. 4
0
     $stores = $h_myshop_stores->getList();
     $stores[0] = _ALL;
     ksort($stores);
     $xoopsTpl->assign('disc_store_id_options', $stores);
     $xoopsTpl->assign('disc_store_id_selected', $item->getVar('disc_store_id'));
     // Category
     $xoopsTpl->assign('disc_cat_cid_options', $categoriesSelect);
     // Products
     $products = $h_myshop_products->getList();
     $products[0] = _ALL;
     ksort($products);
     $xoopsTpl->assign('disc_product_id_options', $products);
     $xoopsTpl->assign('disc_product_id_selected', $item->getVar('disc_product_id'));
     $xoopsTpl->assign('discount', $discountForTemplate);
     $xoopsTpl->assign('currencyName', myshop_utils::getModuleOption('money_full'));
     $editor = myshop_utils::getWysiwygForm(_AM_MYSHOP_DISCOUNT_DESCR, 'disc_description', $item->getVar('disc_description', 'e'), 15, 60, 'description_hidden');
     $xoopsTpl->assign('editor', $editor->render());
     $xoopsTpl->display('db:myshop_admin_discounts.html');
     break;
 case 'copy':
     xoops_cp_header();
     $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
     if (empty($id)) {
         myshop_utils::redirect(_AM_MYSHOP_ERROR_1, $baseurl, 5);
     }
     $opRedirect = 'discounts';
     $item = null;
     $item = $h_myshop_discounts->get($id);
     if (is_object($item)) {
         $newDiscount = $item->xoopsClone();
         $newDiscount->setVar('disc_title', xoops_trim($item->getvar('disc_title')) . ' ' . _AM_MYSHOP_DUPLICATED);
Esempio n. 5
0
     $vatSelect->addOptionArray($vatsForDisplay);
     $sform->addElement($vatSelect, true);
     $sform->addElement(new XoopsFormText(_MYSHOP_PRICE, 'product_price', 20, 20, $item->getVar('product_price', 'e')), true);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_DISCOUNT_HLP, 'product_discount_price', 20, 20, $item->getVar('product_discount_price', 'e')), false);
     $sform->addElement(new XoopsFormText(_MYSHOP_SHIPPING_PRICE, 'product_shipping_price', 20, 20, $item->getVar('product_shipping_price', 'e')), false);
     $sform->addElement(new XoopsFormText(_MYSHOP_ECOTAXE, 'product_ecotaxe', 10, 10, $item->getVar('product_ecotaxe', 'e')), false);
 }
 $sform->addElement(new XoopsFormText(_MYSHOP_STOCK_QUANTITY, 'product_stock', 10, 10, $item->getVar('product_stock', 'e')), false);
 $alertStock = new XoopsFormText(_MYSHOP_STOCK_ALERT, 'product_alert_stock', 10, 10, $item->getVar('product_alert_stock', 'e'));
 $alertStock->setDescription(_AM_MYSHOP_STOCK_HLP);
 $sform->addElement($alertStock, false);
 $editor2 = myshop_utils::getWysiwygForm(_MYSHOP_SUMMARY, 'product_summary', $item->getVar('product_summary', 'e'), 15, 60, 'summary_hidden');
 if ($editor2) {
     $sform->addElement($editor2, false);
 }
 $editor = myshop_utils::getWysiwygForm(_MYSHOP_DESCRIPTION, 'product_description', $item->getVar('product_description', 'e'), 15, 60, 'description_hidden');
 if ($editor) {
     $sform->addElement($editor, false);
 }
 // META Data
 if ($manual_meta) {
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_KEYWORDS, 'product_metakeywords', 50, 255, $item->getVar('product_metakeywords', 'e')), false);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_DESCRIPTION, 'product_metadescription', 50, 255, $item->getVar('product_metadescription', 'e')), false);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_META_PAGETITLE, 'product_metatitle', 50, 255, $item->getVar('product_metatitle', 'e')), false);
 }
 // Attachement
 if ($action == 'edit' && trim($item->getVar('product_attachment')) != '' && file_exists(XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . trim($item->getVar('product_attachment')))) {
     $pictureTray = new XoopsFormElementTray(_MYSHOP_ATTACHED_FILE, '<br />');
     $pictureTray->addElement(new XoopsFormLabel('', "<a href='" . XOOPS_UPLOAD_URL . '/' . $item->getVar('product_attachment') . "' target='_blank'>" . XOOPS_UPLOAD_URL . '/' . $item->getVar('product_attachment') . "</a>"));
     $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture3');
     $deleteCheckbox->addOption(1, _DELETE);