本文整理汇总了PHP中AbstractForm类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractForm类的具体用法?PHP AbstractForm怎么用?PHP AbstractForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
$this->source->update($this->name, $this->sourceDirectory, $this->buildDirectory, $this->scm, $this->url, $this->username, $this->password, null, $this->trustServerCert, $this->enableCheckout);
// call saved event
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例2: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// update
$this->suspension->update($this->title, $this->points, $this->suspension->suspensions == 0 ? $this->suspensionType : $this->suspension->suspensionType, $this->suspension->suspensions == 0 ? $this->suspensionTypeObject->getData() : unserialize($this->suspension->suspensionData), $this->expiresHour * 3600 + $this->expiresDay * 86400 + $this->expiresWeek * 86400 * 7);
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例3: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// save rule
$this->rule->update($this->title, $this->logicalOperator, $this->ruleConditions, $this->ruleAction, $this->ruleDestination, intval(!$this->enabled));
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例4: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// save server
$this->entry->update($this->kind, $this->rulesetTable, $this->rulesetColumn, $this->rulesetColumnTime);
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例5: save
/**
* @see Form::validate()
*/
public function save()
{
AbstractForm::save();
// update
$this->rank->update($this->title, $this->image, $this->groupID, $this->neededPoints, $this->gender, $this->repeatImage);
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例6: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// update item
$this->contestRatingoption->update($this->classID, $this->topic, $this->text, $this->languageID);
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例7: setFieldValues
/**
* Set the field values
*
* @param array $values
* @param array $filters
* @param \Phire\Auth\Auth $auth
* @param \Phire\Table\UserTypes $type
* @param \Phire\Model\User $user
* @return \Pop\Form\Form
*/
public function setFieldValues(array $values = null, $filters = null, $auth = null, $type = null, $user = null)
{
parent::setFieldValues($values, $filters);
if ($_POST) {
// Authenticate and get the auth result
$auth->authenticate($this->username, $this->password);
$result = $auth->getAuthResult($type, $this->username);
if (null !== $result) {
$user->login($this->username, $type, false);
if ($auth->getResult() == \Pop\Auth\Auth::PASSWORD_INCORRECT) {
$this->getElement('password')->addValidator(new Validator\NotEqual($this->password, $result));
} else {
$this->getElement('username')->addValidator(new Validator\NotEqual($this->username, $result));
}
}
// Check the user's allowed sites
if (strtolower($type->type) != 'user') {
$u = Table\Users::findBy(array('username' => $this->username));
if (isset($u->id)) {
$siteIds = unserialize($u->site_ids);
$site = Table\Sites::findBy(array('document_root' => $_SERVER['DOCUMENT_ROOT']));
$siteId = isset($site->id) ? $site->id : '0';
if (!in_array($siteId, $siteIds)) {
$this->getElement('username')->addValidator(new Validator\NotEqual($this->username, $this->i18n->__('That user is not allowed on this site.')));
}
}
}
}
return $this;
}
示例8: setData
/** {@inheritdoc} */
public function setData($data)
{
if (empty($data['OriginalId'])) {
throw new \LogicException('OriginalId not set or empty');
}
return parent::setData($data);
}
示例9: init
/** {@inheritdoc} */
public function init()
{
parent::init();
$displayBlacklistedSoftware = new \Zend\Form\Element\Checkbox('displayBlacklistedSoftware');
$displayBlacklistedSoftware->setLabel('Display ignored software');
$this->get('Preferences')->add($displayBlacklistedSoftware);
}
示例10: setData
/** {@inheritdoc} */
public function setData($data)
{
$data['Preferences']['lockValidity'] = $this->localize($data['Preferences']['lockValidity'], 'integer');
$data['Preferences']['sessionValidity'] = $this->localize($data['Preferences']['sessionValidity'], 'integer');
$data['Preferences']['sessionCleanupInterval'] = $this->localize($data['Preferences']['sessionCleanupInterval'], 'integer');
return parent::setData($data);
}
示例11: show
/**
* @see Page::show()
*/
public function show()
{
// enable menu item
if (!empty($this->activeMenuItem)) {
WCFACP::getMenu()->setActiveMenuItem($this->activeMenuItem);
}
parent::show();
}
示例12: init
public function init()
{
$this->setName('usuario');
$this->addElement('hidden', 'id', array('label' => 'id', 'value' => '', 'validators' => array(), 'required' => false));
$this->addElement('text', 'email', array('label' => 'email', 'maxlength' => '100', 'class' => 'text text-email required', 'value' => '', 'validators' => array(array('StringLength', false, array(0, 200))), 'required' => true));
$this->addElement('text', 'senha', array('label' => 'senha', 'maxlength' => '32', 'class' => 'text text-senha required', 'value' => '', 'validators' => array(array('StringLength', false, array(0, 32))), 'required' => true));
parent::init();
}
示例13: setData
/** {@inheritdoc} */
public function setData($data)
{
$data['Preferences']['scannersPerSubnet'] = $this->localize($data['Preferences']['scannersPerSubnet'], 'integer');
$data['Preferences']['scannerMinDays'] = $this->localize($data['Preferences']['scannerMinDays'], 'integer');
$data['Preferences']['scannerMaxDays'] = $this->localize($data['Preferences']['scannerMaxDays'], 'integer');
$data['Preferences']['scanArpDelay'] = $this->localize($data['Preferences']['scanArpDelay'], 'integer');
return parent::setData($data);
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->add(array('name' => 'option_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'choice_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'override_name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->labelWidth = 3;
$this->controlWidth = 9;
$this->compact = true;
$this->addText('name', 'Name')->addText('host', 'Hostname')->addText('port', 'Port')->addText('ssl', 'SSL')->addText('username', 'Username')->addPassword('password', 'Password')->addButton('submit', 'Submit', 'btn-primary');
}