当前位置: 首页>>代码示例>>PHP>>正文


PHP oledrion_utils::formMarkRequiredFields方法代码示例

本文整理汇总了PHP中oledrion_utils::formMarkRequiredFields方法的典型用法代码示例。如果您正苦于以下问题:PHP oledrion_utils::formMarkRequiredFields方法的具体用法?PHP oledrion_utils::formMarkRequiredFields怎么用?PHP oledrion_utils::formMarkRequiredFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oledrion_utils的用法示例。


在下文中一共展示了oledrion_utils::formMarkRequiredFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: XoopsFormElementTray

         if ($action == 'edit' && $item->pictureExists($i)) {
             $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_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_OLEDRION_PICTURE . ' ' . $i, 'attachedfile' . $i, oledrion_utils::getModuleOption('maxuploadsize')), false);
     }
     $button_tray = new XoopsFormElementTray('', '');
     $submit_btn = new XoopsFormButton('', 'post', $label_submit, 'submit');
     $button_tray->addElement($submit_btn);
     $sform->addElement($button_tray);
     $sform = oledrion_utils::formMarkRequiredFields($sform);
     $sform->display();
     show_footer();
     break;
     // ****************************************************************************************************************
 // ****************************************************************************************************************
 case 'saveedit':
     // Sauvegarde d'un fabricant
     // ****************************************************************************************************************
     xoops_cp_header();
     $id = isset($_POST['manu_id']) ? intval($_POST['manu_id']) : 0;
     if (!empty($id)) {
         $edit = true;
         $item = $h_oledrion_manufacturer->get($id);
         if (!is_object($item)) {
             oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5);
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:manufacturers.php

示例2: listForm

function listForm($op, $product_id = 0)
{
    global $handlers, $baseurl;
    if ($op == 'edit') {
        $title = _OLEDRION_EDIT_LIST;
        $label_submit = _AM_OLEDRION_MODIFY;
        $list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : 0;
        if (empty($list_id)) {
            oledrion_utils::redirect(_AM_OLEDRION_ERROR_21, $baseurl, 5);
        }
        $item = null;
        $item = $handlers->h_oledrion_lists->get($list_id);
        if (!is_object($item)) {
            oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5);
        }
        // Vérification, est-ce que l'utilisateur courant est bien le propriétaire de cette liste ?
        if (!$handlers->h_oledrion_lists->isThisMyList($list_id)) {
            oledrion_utils::redirect(_OLEDRION_ERROR25, $baseurl, 8);
        }
        $edit = true;
        $label_submit = _AM_OLEDRION_MODIFY;
    } else {
        $title = _OLEDRION_ADD_LIST;
        $label_submit = _AM_OLEDRION_ADD;
        $item = $handlers->h_oledrion_lists->create(true);
        $edit = false;
    }
    $sform = new XoopsThemeForm($title, 'frmList', $baseurl);
    $sform->addElement(new XoopsFormHidden('op', 'save'));
    $sform->addElement(new XoopsFormHidden('list_id', $item->getVar('list_id')));
    $sform->addElement(new XoopsFormText(_AM_OLEDRION_TITLE, 'list_title', 50, 255, $item->getVar('list_title', 'e')), true);
    //$sform->addElement(new XoopsFormText(_OLEDRION_LIST_PASSWORD, 'list_password', 50, 50, $item->getVar('list_password','e')), false);
    $selectTypes = oledrion_lists::getTypesArray();
    $selectType = new XoopsFormSelect(_OLEDRION_LIST_TYPE, 'list_type', $item->getVar('list_type', 'e'));
    $selectType->addOptionArray($selectTypes);
    $sform->addElement($selectType, true);
    $sform->addElement(new XoopsFormTextArea(_OLEDRION_DESCRIPTION, 'list_description', $item->getVar('list_description', 'e'), 7, 60), false);
    $listProducts = array();
    if ($edit) {
        $listProducts = $handlers->h_oledrion_lists->getListProducts($item);
        if (count($listProducts) > 0) {
            $productsTray = new XoopsFormElementTray(_OLEDRION_PROD_IN_THIS_LIST, '<br />');
            $productsTray->addElement(new XoopsFormLabel(_OLEDRION_CHECK_PRODUCTS), false);
            foreach ($listProducts as $product) {
                $caption = "<a target='_blank' href='" . $product->getLink() . "'>" . $product->getVar('product_title') . '</a>';
                $checkbox = new XoopsFormCheckBox($caption, 'productsList[]');
                $checkbox->addOption($product->getVar('product_id'), _DELETE);
                $productsTray->addElement($checkbox);
                unset($caption, $checkbox);
            }
            $sform->addElement($productsTray, false);
        }
    }
    if ($product_id > 0) {
        $product = null;
        $product = $handlers->h_oledrion_products->get($product_id);
        if (is_object($product) && $product->isProductVisible()) {
            $content = "<a target='_blank' href='" . $product->getLink() . "'>" . $product->getVar('product_title') . '</a>';
            $sform->addElement(new XoopsFormLabel(_OLEDRION_PRODUCT_DO_ADD, $content));
            $sform->addElement(new XoopsFormHidden('product_id', $product_id));
        }
    }
    $button_tray = new XoopsFormElementTray('', '');
    $submit_btn = new XoopsFormButton('', 'post', $label_submit, 'submit');
    $button_tray->addElement($submit_btn);
    $sform->addElement($button_tray);
    $sform = oledrion_utils::formMarkRequiredFields($sform);
    return $sform;
}
开发者ID:osw17,项目名称:oledrion,代码行数:69,代码来源:my-lists.php


注:本文中的oledrion_utils::formMarkRequiredFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。