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


PHP Am_Form_Admin::addFieldSet方法代码示例

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


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

示例1: createForm

 function createForm()
 {
     $form = new Am_Form_Admin();
     $form->addText('comment', array('class' => 'el-wide'))->setLabel(___("Comment\n" . 'for your reference'))->addRule('required');
     $sel = $form->addMagicSelect('conditions[product]')->setLabel(___("Conditions\n" . 'After actual payment aMember will check user invoice and in case ' . 'of it contains one of defined  product or product from defined ' . 'product category this OTO will be shown for him instead of ' . 'ordinary thank you page. In case of you use OTO (Downsell) ' . 'condition it will be matched if user click NO link in defined ' . 'offer and this OTO will be shown for user'));
     $cats = $pr = $oto = array();
     foreach ($this->getDi()->productCategoryTable->getAdminSelectOptions() as $k => $v) {
         $cats['category-' . $k] = ___('Category') . ':' . $v;
     }
     foreach ($this->getDi()->productTable->getOptions() as $k => $v) {
         $pr['product-' . $k] = ___('Product') . ':' . $v;
     }
     foreach ($this->getDi()->otoTable->getOptions() as $k => $v) {
         $oto['oto-' . $k] = ___('OTO') . ':' . $v;
     }
     $options = array(___('Categories') => $cats) + ($pr ? array(___('Products') => $pr) : array()) + ($oto ? array(___('OTO (Downsell)') => $oto) : array());
     $sel->loadOptions($options);
     $sel->addRule('required');
     $bpOptions = array();
     foreach ($this->getDi()->productTable->findBy(array('is_archived' => 0)) as $product) {
         /* @var $product Product */
         foreach ($product->getBillingOptions() as $bp_id => $title) {
             $bpOptions[$product->pk() . '-' . $bp_id] = sprintf('(%d) %s (%s)', $product->pk(), $product->title, $title);
         }
     }
     $form->addSelect('product_id')->setLabel('Product to Offer')->loadOptions($bpOptions)->addRule('required');
     $coupons = array('' => '');
     foreach ($this->getDi()->db->selectCol("\n\t\tSELECT c.coupon_id as ARRAY_KEY,\n\t\tCONCAT(c.code, ' - ' , b.comment)\n\t\tFROM ?_coupon c LEFT JOIN ?_coupon_batch b USING (batch_id)\n\t\tORDER BY c.code\n        ") as $k => $v) {
         $coupons[$k] = $v;
     }
     $form->addSelect('coupon_id')->setLabel(___('Apply Coupon (optional)'))->loadOptions($coupons);
     $psList = array('' => '') + $this->getDi()->paysystemList->getOptionsPublic();
     $form->addSelect('view[paysys_id]')->setLabel(___('Paysystem (optional)'))->loadOptions($psList);
     $fs = $form->addFieldSet()->setLabel(___('Offer Page Settings'));
     $fs->addText('view[title]', array('class' => 'el-wide'))->setLabel(___('Title'));
     $fs->addHtmlEditor('view[html]')->setLabel("Offer Text\nuse %yes% and %no% to insert buttons");
     $fs->addHtmlEditor('view[yes][label]')->setLabel('[Yes] button text');
     $fs->addHtmlEditor('view[no][label]')->setLabel('[No] button code');
     $fs->addAdvCheckbox('view[no_layout]')->setLabel(___("Avoid using standard layout\nyou have to design entire page in the 'Offer Text' field"));
     return $form;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:41,代码来源:oto.php


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