本文整理汇总了PHP中UserForm::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP UserForm::getInstance方法的具体用法?PHP UserForm::getInstance怎么用?PHP UserForm::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserForm
的用法示例。
在下文中一共展示了UserForm::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNewInstance
{
if (!isset(static::$instance)) {
static::$instance = static::getUserForm()->instanciate();
}
return static::$instance;
}
static function getNewInstance()
{
$o = static::objects()->one();
static::$instance = $o->instanciate();
return static::$instance;
}
}
Filter::addSupportedMatches('User Data', function () {
$matches = array();
foreach (UserForm::getInstance()->getFields() as $f) {
if (!$f->hasData()) {
continue;
}
$matches['field.' . $f->get('id')] = 'User / ' . $f->getLabel();
if (($fi = $f->getImpl()) instanceof SelectionField) {
foreach ($fi->getList()->getProperties() as $p) {
$matches['field.' . $f->get('id') . '.' . $p->get('id')] = 'User / ' . $f->getLabel() . ' / ' . $p->getLabel();
}
}
}
return $matches;
}, 20);
class TicketForm extends DynamicForm
{
static $instance;
示例2: getRequestStructure
function getRequestStructure($format, $data = null)
{
$supported = array("alert", "autorespond", "source", "topicId", "attachments" => array("*" => array("name", "type", "data", "encoding", "size")), "message", "ip", "priorityId");
# Fetch dynamic form field names for the given help topic and add
# the names to the supported request structure
if (isset($data['topicId']) && ($topic = Topic::lookup($data['topicId'])) && ($form = $topic->getForm())) {
foreach ($form->getDynamicFields() as $field) {
$supported[] = $field->get('name');
}
}
# Ticket form fields
# TODO: Support userId for existing user
if ($form = TicketForm::getInstance()) {
foreach ($form->getFields() as $field) {
$supported[] = $field->get('name');
}
}
# User form fields
if ($form = UserForm::getInstance()) {
foreach ($form->getFields() as $field) {
$supported[] = $field->get('name');
}
}
if (!strcasecmp($format, 'email')) {
$supported = array_merge($supported, array('header', 'mid', 'emailId', 'to-email-id', 'ticketId', 'reply-to', 'reply-to-name', 'in-reply-to', 'references', 'thread-type', 'flags' => array('bounce', 'auto-reply', 'spam', 'viral'), 'recipients' => array('*' => array('name', 'email', 'source'))));
$supported['attachments']['*'][] = 'cid';
}
return $supported;
}
示例3: actionEditUser
public function actionEditUser()
{
$userId = getParam('id', FALSE);
$user = User::model()->findByPk($userId);
if (!$user) {
throw new CHttpException(404);
}
$form = UserForm::getInstance($userId);
$this->setModel($form);
if (isPostOrAjaxRequest()) {
$this->processUpdate();
}
$this->render('edit-user', array('model' => $this->getModel(), 'pageTitle' => 'Редагуання користувача', 'formId' => $form::FORM_ID, 'formView' => '_user-form', 'formAction' => '', 'innerLinks' => NULL, 'changeUserAvatarHandlerUrl' => $this->createAbsoluteUrl('changeUserAvatarHandler', array('userId' => $user->id)), 'user' => $user));
}
示例4: __
<p class="full-width">
<span class="buttons pull-left">
<input type="button" name="cancel" class="close" value="<?php
echo __('Cancel'); ?>">
</span>
<span class="buttons pull-right">
<input type="submit" value="<?php echo __('Continue'); ?>">
</span>
</p>
</form>
</div>
<div id="new-user-form" style="display:<?php echo $user ? 'none' :'block'; ?>;">
<form method="post" class="user" action="<?php echo $info['action'] ?: '#users/lookup/form'; ?>">
<table width="100%" class="fixed">
<?php
if(!$form) $form = UserForm::getInstance();
$form->render(true, __('Create New User')); ?>
</table>
<hr>
<p class="full-width">
<span class="buttons pull-left">
<input type="reset" value="<?php echo __('Reset'); ?>">
<input type="button" name="cancel" class="<?php echo $user ? 'cancel' : 'close' ?>" value="<?php echo __('Cancel'); ?>">
</span>
<span class="buttons pull-right">
<input type="submit" value="<?php echo __('Add User'); ?>">
</span>
</p>
</form>
</div>
<div class="clear"></div>
示例5: __
<p><?php
echo __('Use the forms below to create or update the information we have on file for your account');
?>
</p>
<form action="account.php" method="post">
<?php
csrf_token();
?>
<input type="hidden" name="do" value="<?php
echo Format::htmlchars($_REQUEST['do'] ?: ($info['backend'] ? 'import' : 'create'));
?>
" />
<table width="800" class="padded">
<tbody>
<?php
$cf = $user_form ?: UserForm::getInstance();
$cf->render(false);
?>
<tr>
<td colspan="2">
<div><hr><h3><?php
echo __('Preferences');
?>
</h3>
</div>
</td>
</tr>
<td><?php
echo __('Time Zone');
?>
:</td>
示例6: __
</span>
</p>
</form>
</div>
<div id="new-user-form" style="display:<?php
echo $user ? 'none' : 'block';
?>
;">
<form method="post" class="user" action="<?php
echo $info['action'] ?: '#users/lookup/form';
?>
">
<table width="100%" class="fixed">
<?php
if (!$form) {
$form = UserForm::getInstance();
}
$form->render(true, __('Create New User'));
?>
</table>
<hr>
<p class="full-width">
<span class="buttons pull-left">
<input type="reset" value="<?php
echo __('Reset');
?>
">
<input type="button" name="cancel" class="<?php
echo $user ? 'cancel' : 'close';
?>
" value="<?php