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


PHP Am_Form_Admin::addCheckbox方法代码示例

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


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

示例1: stepConfirmUpgrades

 public function stepConfirmUpgrades()
 {
     $form = new Am_Form_Admin();
     $upgrades = $form->addGroup('upgrades', array('class' => 'no-label'));
     $options = array();
     $static = '';
     $upgrades->addStatic()->setContent('<h2>' . ___('Available Upgrades') . '</h2>');
     foreach ($this->getSession()->upgrades as $k => $upgrade) {
         if (!empty($upgrade->new)) {
             $upgrades->addStatic()->setContent('<br /><h2>' . ___('New Modules Available') . '</h2>');
         }
         $text = sprintf('%s%s, ' . ___('version') . ' %s - %s' . '<br />', '<b>' . $upgrade->title . '</b>', $upgrade->type == 'core' ? '' : sprintf(' [%s - %s]', $upgrade->type, $upgrade->id), '<i>' . $upgrade->version . '</i>', '<i>' . amDate($upgrade->date) . '</i>');
         $upgrades->addCheckbox($k, empty($upgrade->checked) ? null : array('checked' => 'checked'))->setContent($text);
         $static .= "<div class='changelog' style='' data-for='{$k}'><pre>" . $upgrade->text . "</pre></div>\n";
         $upgrades->addStatic()->setContent($static);
     }
     $form->addCheckbox('_confirm', array('class' => 'no-label'))->setContent(___('I understand that upgrade may overwrite customized PHP files and templates, I have already made a backup of aMember Pro folder and database'))->addRule('required');
     $form->addSubmit('', array('value' => ___('Install Updates')));
     if ($form->isSubmitted() && $form->validate()) {
         $confirmed = array_keys(array_filter($upgrades->getValue()));
         if (!$confirmed) {
             $this->view->title = ___('No upgrades to install');
             $this->view->content = '<a href="' . REL_ROOT_URL . '/admin">' . ___('Back') . '</a>';
             return false;
         }
         $upgrades = $this->getSession()->upgrades;
         foreach ($upgrades as $k => $v) {
             if (!in_array($k, $confirmed)) {
                 unset($upgrades[$k]);
             }
         }
         $this->getSession()->upgrades = $upgrades;
         return true;
     } else {
         $this->view->content = (string) $form;
         $this->view->title = ___('Choose Upgrades to Install');
         $this->view->display('admin/layout.phtml');
         $this->noDisplay = true;
         return false;
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:41,代码来源:AdminUpgradeController.php

示例2: createForm

    protected function createForm()
    {
        $f = new Am_Form_Admin();
        $f->addText('user')->setLabel('Enter username of existing user')->addRule('required', 'This field is required');
        $f->addText('aff')->setLabel('Enter username of existing affiliate')->addRule('required', 'This field is required');
        $f->addText('coupon')->setLabel('Enter coupon code or leave field empty');
        $f->addCheckbox('is_first')->setLabel('Is first user invoice?');
        $f->addElement(new Am_Form_Element_ProductsWithQty('product_id'))->setLabel(___('Choose products to include into test invoice'))->loadOptions(Am_Di::getInstance()->billingPlanTable->selectAllSorted())->addRule('required');
        $f->addSelect('paysys_id')->setLabel(___('Payment System'))->loadOptions(Am_Di::getInstance()->paysystemList->getOptions());
        $f->addSubmit('', array('value' => 'Test'));
        $f->addScript()->setScript(<<<CUT
\$(function(){
    \$("#user-0, #aff-0" ).autocomplete({
        minLength: 2,
        source: window.rootUrl + "/admin-users/autocomplete"
    });
});
CUT
);
        foreach ($this->grid->getVariablesList() as $k) {
            $kk = $this->grid->getId() . '_' . $k;
            if ($v = @$_REQUEST[$kk]) {
                $f->addHidden($kk)->setValue($v);
            }
        }
        return $f;
    }
开发者ID:grlf,项目名称:eyedock,代码行数:27,代码来源:AdminCommissionRuleController.php


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