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


PHP Am_Form_Setup::addFieldset方法代码示例

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


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

示例1: onSetupForms

 function onSetupForms(Am_Event_SetupForms $event)
 {
     $form = new Am_Form_Setup('facebook');
     $form->setTitle('Facebook');
     $fs = $form->addFieldset()->setLabel(___('FaceBook Application'));
     $fs->addText('app_id')->setLabel(___('FaceBook App ID'));
     $fs->addText('app_secret', array('size' => 40))->setLabel(___('Facebook App Secret'));
     $fs = $form->addFieldset()->setLabel(___('Features'));
     $gr = $fs->addCheckboxedGroup('like')->setLabel(___('Add "Like" button'));
     $gr->addStatic()->setContent(___('Like Url'));
     $gr->addText('likeurl', array('size' => 40));
     $form->setDefault('likeurl', ROOT_URL);
     $fs->addAdvCheckbox('no_signup')->setLabel(___('Do not add to Signup Form'));
     $fs->addAdvCheckbox('no_login')->setLabel(___('Do not add to Login Form'));
     $form->addFieldsPrefix('misc.facebook.');
     $event->addForm($form);
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:17,代码来源:facebook.php

示例2: _initSetupForm

 public function _initSetupForm(Am_Form_Setup $form)
 {
     $form->addText('merchant', array('size' => 20, 'maxlength' => 16))->setLabel("The QuickPayId")->addRule('required');
     $form->addText('secret', array('size' => 66, 'maxlength' => 80))->setLabel("Secret code")->addRule('required');
     $fl = $form->addFieldset()->setLabel(___('Quickpay parameters'));
     $fl->addSelect('lang', array(), array('options' => array('da' => 'Danish', 'de' => 'German', 'en' => 'English', 'es' => 'Spanish', 'fo' => 'Faeroese', 'fi' => 'Finnish', 'fr' => 'French', 'kl' => 'Greenlandish', 'it' => 'Italian', 'no' => 'Norwegian', 'nl' => 'Dutch', 'pl' => 'Polish', 'ru' => 'Russian', 'sv' => 'Swedish')))->setLabel("The payment window language");
     $form->addAdvCheckbox("testing")->setLabel("Test Mode Enabled");
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:8,代码来源:quickpay.php

示例3: onSetupForms

 function onSetupForms(Am_Event_SetupForms $event)
 {
     $form = new Am_Form_Setup('facebook');
     $form->setTitle('Facebook');
     $fs = $form->addFieldset()->setLabel(___('FaceBook Application'));
     $fs->addText(self::FB_APP_ID)->setLabel(___('FaceBook App ID'));
     $fs->addText(self::FB_APP_SECRET, array('size' => 40))->setLabel(___('Facebook App Secret'));
     $fs = $form->addFieldset()->setLabel(___('Features'));
     $gr = $fs->addCheckboxedGroup('like')->setLabel(___('Add "Like" button'));
     $gr->addStatic()->setContent(___('Like Url'));
     $gr->addText('likeurl', array('size' => 40));
     $form->setDefault('likeurl', ROOT_URL);
     $fs->addAdvCheckbox('no_signup')->setLabel(___('Do not add to Signup Form'));
     $fs->addAdvCheckbox('no_login')->setLabel(___('Do not add to Login Form'));
     $fs->addSelect('add_access', null, array('options' => array('' => '-- Do not add access --') + Am_Di::getInstance()->productTable->getOptions()))->setLabel(___('Add free access to a product if user signup from Facebook'));
     $form->addFieldsPrefix('misc.facebook.');
     $this->_afterInitSetupForm($form);
     $event->addForm($form);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:19,代码来源:facebook.php

示例4: _afterInitSetupForm

    protected function _afterInitSetupForm(Am_Form_Setup $form)
    {
        // insert title, description fields
        $form->setTitle(ucfirst(toCamelCase($this->getId())));
        $el = $form->addMagicSelect('reattempt', array('multiple' => 'multiple'));
        $options = array();
        for ($i = 1; $i < 60; $i++) {
            $options[$i] = ___("on %d-th day", $i);
        }
        $el->loadOptions($options);
        $el->setLabel(___("Retry On Failure\n" . "if the recurring billing has failed,\n" . "aMember can repeat it after several days,\n" . "and extend customer subscription for that period\n" . "enter number of days to repeat billing attempt"));
        if ($this->canUseMaxmind()) {
            $form->addFieldset()->setLabel(___('MaxMind Credit Card Fraud Detection'));
            $form->addAdvCheckbox('use_maxmind')->setLabel(___('Use MaxMind Credit Card Fraud Detection'));
            $form->addText('maxmind_license_key')->setLabel(___("Maxmind License Key\n" . "%sObtain a Free or Premium license key%s", '<a href="http://www.maxmind.com/app/minfraud" target="_blank">', '</a>'));
            $form->addSelect('maxmind_requested_type')->setLabel(___("Requested Type\n" . "To be used if you have multiple plans in one account\n" . "and wish to select type of query you wish to make.\n" . "By default the service uses the highest level available"))->loadOptions(array("" => 'Default', "free" => 'Free', "city" => 'City (standard paid service)', "premium" => 'Premium (premium paid service)'));
            $form->addText('maxmind_risk_score')->setLabel(___("Risk Score\n" . "Overall %sRisk Score%s (decimal from 0 to 10)\n" . "For orders that return a fraud score of 2.5 and above,\n" . " it is recommended to hold for review,\n" . " or require the validation with the Telephone Verification service\n", '<a href="http://www.maxmind.com/app/web_services_score2" target="_blank">', '</a>'));
            $form->setDefault('maxmind_risk_score', '2.5');
            /*$form->addAdvCheckbox('maxmind_use_telephone_verification')->setLabel(
              ___("Telephone Verification\n" .
                      "Enable %sTelephone Verification%s service"
                      , '<a href="http://www.maxmind.com/app/telephone_overview" target="_blank">', '</a>'));*/
            $form->addAdvCheckbox('maxmind_use_number_identification')->setLabel(___("Number Identification\n" . "Enable %sTelephone Number Identification (TNI)%s service", '<a href="http://www.maxmind.com/app/phone_id" target="_blank">', '</a>'));
            $form->addMagicSelect('maxmind_tni_phone_types')->setLabel(___("Allowed Phone Types\n" . "The TNI service is able to categorize customer inputted US and Canadian\n" . "phone numbers into %seight different phone types%s\n" . "such as fixed land line, mobile, VoIP, and invalid phone numbers", '<a href="http://www.maxmind.com/app/phone_id_codes" target="_blank">', '</a>'))->loadOptions(array('0' => 'Undetermined (Medium Risk Level)', '1' => 'Fixed Line (Low Risk Level)', '2' => 'Mobile (Low-Medium Risk Level)', '3' => 'PrePaid Mobile (Medium-High Risk Level)', '4' => 'Toll-Free (High Risk Level)', '5' => 'Non-Fixed VoIP (High Risk Level)', '8' => 'Invalid Number (High Risk Level)', '9' => 'Restricted Number (High Risk Level)'));
            $form->addAdvCheckbox('maxmind_allow_country_not_matched')->setLabel(___("Allow payment if country not matched\n" . "Whether country of IP address matches billing address country\n" . "(mismatch = higher risk)"));
            $form->addAdvCheckbox('maxmind_allow_high_risk_country')->setLabel(___("Allow payment if high risk countries\n" . "Whether IP address or billing address country is in\n" . "Egypt, Ghana, Indonesia, Lebanon, Macedonia, Morocco, Nigeria,\n" . "Pakistan, Romania, Serbia and Montenegro, Ukraine, or Vietnam"));
            $form->addAdvCheckbox('maxmind_allow_anonymous_proxy')->setLabel(___("Allow payment if anonymous proxy\n" . "Whether IP address is %sAnonymous Proxy%s\n" . "(anonymous proxy = very high risk)", '<a href="http://www.maxmind.com/app/proxy#anon" target="_blank">', '</a>'));
            $form->addAdvCheckbox('maxmind_allow_free_mail')->setLabel(___("Allow payment if free e-mail\n" . "Whether e-mail is from free e-mail provider\n" . "(free e-mail = higher risk)"));
            $form->addElement('script')->setScript(<<<CUT
function showHideMaxmind()
{
    var el = \$("[id^=use_maxmind-]");    
    \$("[id^=maxmind_]").closest(".row").toggle(el.prop('checked'));
    if(el.prop('checked'))
        /*showHideNumberidentification();*/
        showHidePhonetypes();
}
/*function showHideNumberidentification()
{
    var el = \$("[id^=maxmind_use_telephone_verification-]");    
    \$("[id^=maxmind_tni_phone_types-]").closest(".row").toggle(el.prop('checked'));
    \$("[id^=maxmind_use_number_identification-]").closest(".row").toggle(el.prop('checked'));
    if(el.prop('checked'))
        showHidePhonetypes();
}*/
function showHidePhonetypes()
{
    \$("[id^=maxmind_tni_phone_types-]").closest(".row").toggle(\$("[id^=maxmind_use_number_identification-]").prop('checked'));
}
\$(function(){
    \$("[id^=use_maxmind-]").click(function(){
        showHideMaxmind();
    });
    /*\$("[id^=maxmind_use_telephone_verification-]").click(function(){
        showHideNumberidentification();
    });*/
    \$("[id^=maxmind_use_number_identification-]").click(function(){
        showHidePhonetypes();
    });
    showHideMaxmind();
});
CUT
);
        }
        if ($this->storesCcInfo() && !$this->_pciDssNotRequired) {
            $text = "<p><font color='red'>WARNING!</font> Every application processing credit card information, must be certified\n" . "as PA-DSS compliant, and every website processing credit cards must\n" . "be certified as PCI-DSS compliant.</p>";
            $text .= "<p>aMember Pro is not yet certified as PA-DSS compliant. " . "This plugins is provided solely for TESTING purproses\n" . "Use it for anything else but testing at your own risk.</p>";
            $form->addProlog(<<<CUT
<div class="warning_box">
    {$text}
</div>   
CUT
);
        }
        $keyFile = defined('AM_KEYFILE') ? AM_KEYFILE : APPLICATION_PATH . '/configs/key.php';
        if (!is_readable($keyFile)) {
            $random = $this->getDi()->app->generateRandomString(78);
            $text = "<p>To use credit card plugins, you need to create a key file that contains unique\n";
            $text .= "encryption key for your website. It is necessary even if the plugin does not\n";
            $text .= "store sensitive information.</p>";
            $text .= "<p>In a text editor, create file with the following content (one-line, no spaces before opening &lt;?php):\n";
            $text .= "<br /><br /><pre style='background-color: #e0e0e0;'>&lt;?php return '{$random}';</pre>\n";
            $text .= "<br />save the file as <b>key.php</b>, and upload to <i>amember/application/configs/</i> folder.\n";
            $text .= "This warning will disappear once you do it correctly.</p>";
            $text .= "<p>KEEP A BACKUP COPY OF THE key.php FILE (!)</p>";
            $form->addProlog(<<<CUT
<div class="warning_box">
    {$text}
</div>
CUT
);
        }
        return parent::_afterInitSetupForm($form);
    }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:94,代码来源:CreditCard.php


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