本文整理汇总了PHP中Am_Form_Setup::addScript方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Form_Setup::addScript方法的具体用法?PHP Am_Form_Setup::addScript怎么用?PHP Am_Form_Setup::addScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Form_Setup
的用法示例。
在下文中一共展示了Am_Form_Setup::addScript方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initSetupForm
public function _initSetupForm(Am_Form_Setup $form)
{
$form->addText("company")->setLabel(array("Your company name in payforit platform", ""))->addRule('required');
$form->addText("password", array('size' => 40))->setLabel(array("Your password in payforit platform", ""))->addRule('required');
$form->addSelect("window")->setLabel(array("Type of Payforit Window ", "to render for the end user"))->loadOptions(array('small' => 'small', 'embed_small ' => 'embed_small ', 'large' => 'large', 'embed_large' => 'embed_large'));
$form->addAdvCheckbox("is_frame")->setLabel(array("Use Iframe", ""));
$form->addAdvCheckbox("debugLog")->setLabel(array("Debug Log Enabled", "write all requests/responses to log"));
// hide reattempt
$form->addScript()->setScript('$(function(){$("[id^=\'row-reattempt-\']").remove()});');
}
示例2: _initSetupForm
protected function _initSetupForm(Am_Form_Setup $form)
{
$group = $form->addGroup()->setLabel(array('ListMail Board Db and Prefix', "database name (if other database) plus ListMail\n" . "tables prefix, like <i>listmail.lm_</i>\n" . "here listmail in database <i>listmail</i> and tables prefix is <i>lm_</i>\n" . "after change click SAVE twice"));
$group->addText("db", array('class' => 'db-prefix'))->addRule('required', 'this field is required');
$group->addText("prefix", array('class' => 'db-prefix'));
$group->addRule('callback2', '-error-', array($this, 'validateListmailDb'));
$form->addSelect('expired_list')->setLabel(array('ListMail Expired List', 'Add expired members to the following list'))->loadOptions($this->getListmailGroups());
if (!$this->isConfigured()) {
$form->addScript()->setScript('jQuery(function($){ $("#expired_list-0").attr("disabled", true); })');
}
}
示例3: _initSetupForm
public function _initSetupForm(Am_Form_Setup $form)
{
$form->addInteger('merchantId', array('maxlength' => 20, 'size' => 15))->setLabel('Your WMI Merchant ID#')->addRule('required');
$form->addSelect('signature')->setLabel('Signature Method')->loadOptions(array('' => 'None', 'md5' => 'MD5', 'sha1' => 'SHA1'));
$form->addText('key', array('size' => 40))->setLabel('Secret Key')->addRule('callback2', 'error', array($this, 'validateSecretKey'));
$form->addScript()->setScript(<<<CUT
jQuery(document).ready(function(\$){
\$('#signature-0').change(function(){
if(\$(this).val())
\$('#row-key-0').show();
else
\$('#row-key-0').hide();
}).change();
});
CUT
);
}
示例4: array
function _initSetupForm(Am_Form_Setup $form)
{
$form->setTitle(___('Single Login Session'));
$form->addText('timeout', array('size' => 4))->setLabel(___('Session Timeout, min'));
$form->setDefault('timeout', 5);
$form->addSelect('action')->setId('form-action')->setLabel(___('Action on Simultaneous Login Attempt'))->loadOptions(array(self::ACTION_LOGIN_REJECT => ___('Show error and do not allow to login until session timeout'), self::ACTION_LOGOUT_OTHER => ___('Delete other session when user try to login from new one'), self::ACTION_NOTHING => ___('Nothing, allow simultaneous login for same user from different computers')));
$form->addTextarea('error', array('class' => 'el-wide'))->setId('form-error')->setLabel(___('Error Message'));
$form->setDefault('error', 'There is already exits active login session for your account. Simultaneous login from different computers is not allowed.');
$error = self::ACTION_LOGIN_REJECT;
$form->addScript()->setScript(<<<CUT
\$('#form-action').change(function(){
\$('#form-error').closest('.row').toggle(\$(this).val() == '{$error}')
}).change();
CUT
);
$form->addElement('email_checkbox', 'notify_admin')->setLabel(___('Notify Admin on Simultaneous Login'));
}
示例5: array
function _initSetupForm(Am_Form_Setup $form)
{
$el = $form->addAdvRadio('api_type')->setLabel(___('Version of script'))->loadOptions(array('0' => ___('Downloaded on your own server'), '1' => ___('Hosted at Activecampaing\'s server')));
$form->addScript()->setScript(<<<CUT
\$(document).ready(function() {
function api_ch(val){
\$("input[id^=api_key]").parent().parent().toggle(val == '1');
\$("input[id^=api_user]").parent().parent().toggle(val == '0');
\$("input[id^=api_password]").parent().parent().toggle(val == '0');
}
\$("input[type=radio]").change(function(){ api_ch(\$(this).val()); }).change();
api_ch(\$("input[type=radio]:checked").val());
});
CUT
);
$form->addText('api_url', array('size' => 40))->setLabel('Activecampaign API url' . "\nit should be with http://");
$form->addText('api_key', array('size' => 40))->setLabel('Activecampaign API Key');
$form->addText('api_user', array('size' => 40))->setLabel('Activecampaign Admin Login');
$form->addPassword('api_password', array('size' => 40))->setLabel('Activecampaign Admin Password');
$form->addAdvCheckbox('debug')->setLabel(array('Debug logging', 'Record debug information in the log.'));
}
示例6: _initSetupForm
protected function _initSetupForm(Am_Form_Setup $form)
{
$form->addText('login')->setLabel('API Login')->addRule('required');
$form->addPassword('passwd')->setLabel('API Password')->addRule('required');
$form->addText('pslid')->setLabel('PSLID (Service User)')->addRule('required');
$form->addText('sun')->setLabel('Service User Number (SUN)')->addRule('required');
$form->addText('lead_time')->setLabel('Lead time, days')->default = 12;
for ($i = 1; $i <= 28; $i++) {
$options[$i] = ___("%d-th day", $i);
}
$payment_day = $form->addMagicSelect('payment_day')->setLabel(___("Process Payment Day"))->loadOptions($options);
$payment_day->default = 8;
$payment_day->addRule('required');
$form->addText('legal_name', array('class' => 'el-wide'))->setLabel(___("Legal Name\n" . "Please enter the legal name of your organisation " . "which will be included in the Direct Debit Guarantee statement"))->addRule('required');
$form->addTextarea('legal_address', array('class' => 'el-wide', 'rows' => 5))->setLabel(___("Legal Address\n" . "Please enter the legal address of your organisation " . "which will be included in the Direct Debit Guarantee statement"))->addRule('required');
$form->addAdvCheckbox('auddis', array('id' => 'auddis'))->setLabel("Log AUDDIS reports as Tickets in helpdesk\n" . "helpdesk module should be enabled");
$form->addText('auddis_login', array('id' => 'auddis-login'))->setLabel('Username of user for AUDDIS reports');
$form->addScript()->setScript(<<<CUT
(function(){
\$('#auddis').change(function(){
\$('#auddis-login').closest('.row').toggle(this.checked);
}).change();
\$('#auddis-login').autocomplete({
minLength: 2,
source: window.rootUrl + "/admin-users/autocomplete/"
});
})()
CUT
);
}
示例7: _initSetupForm
protected function _initSetupForm(Am_Form_Setup $form)
{
$form->addSelect('my_country')->setLabel(___('My Country'))->loadOptions($this->countries)->addRule('required');
$form->addText('my_id')->setLabel(___('VAT Id'))->addRule('required');
$gr = $form->addGroup()->setLabel(___("Local VAT Rate\n" . "for example 18.5 (no percent sign)"));
$gr->addText('local_rate', array('size' => 5, 'maxlength' => 5));
$gr->addStatic()->setContent(' %');
$form->addAdvCheckbox('extempt_if_vat_number')->setLabel(___('Do not add VAT if a valid EU VAT Id entered by foreign customer'));
$fs = $form->addGroup()->setLabel(___("Tax Rates for Other Countries\n" . 'in case of it is different with Local VAT Rate'));
foreach ($this->countries as $k => $v) {
$fs->addText('rate.' . $k, array('class' => 'vat-rate'));
}
$rate = $fs->addElement(new Am_Form_Element_VatRate('rate'));
foreach ($this->countries as $k => $v) {
$val = $this->getConfig('rate.' . $k, $this->getConfig('local_rate', ''));
$attr = array('data-label' => $v . sprintf(' <input style="padding:0" type="text" onChange = "$(this).closest(\'div\').find(\'input[type=hidden]\').val($(this).val())" name="" size="4" value="%s" /> %%', $val), 'data-value' => $val);
$rate->addOption($v, $k, $attr);
}
$rate->setJsOptions('{
getOptionName : function (name, option) {
return name.replace(/\\[\\]$/, "") + "___" + option.value;
},
getOptionValue : function (option) {
return $(option).data("value");
}
}');
$rate->setValue(array_keys(array_filter($this->getConfig('rate', array()))));
$form->addScript()->setScript(<<<CUT
\$('.vat-rate').hide();
\$('.vat-rate').val('');
CUT
);
}