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


PHP Fields::addField方法代码示例

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


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

示例1: displayWebFormFields

 /**
  *  displayWebForm
  *  Display the webform within OFuz.net so we can use all the ofuz / radria field type
  */
 function displayWebFormFields()
 {
     $out = '<table>';
     $do_webform_userfields = new WebFormUserField();
     $do_webform_userfields->query("SELECT wfu.name, wfu.label, wfu.required, wfu.size, wff.field_type \n\t\t                                 FROM webformfields as wff, webformuserfield as wfu \n\t\t\t\t\t\t\t\t\t\t WHERE wff.name=wfu.name\n\t\t\t\t\t\t\t\t\t\t   AND wfu.idwebformuser = " . $this->getPrimaryKeyValue() . "\n\t\t\t\t\t\t\t\t\t\t ORDER BY wff.display_order");
     $field_format = new Fields();
     while ($do_webform_userfields->next()) {
         $field_format->addField($do_webform_userfields->name, $do_webform_userfields->field_type);
         if ($do_webform_userfields->size) {
             if ($do_webform_userfields->field_type == 'FieldTypeText') {
                 $field_format->fields[$do_webform_userfields->name]->textarea = $do_webform_userfields->size;
             } else {
                 $field_format->fields[$do_webform_userfields->name]->size = $do_webform_userfields->size;
             }
         }
     }
     //print_r($field_format);
     $do_webform_userfields->first();
     //$do_webform_userfields->newForm();
     //$do_webform_userfields->setFields($field_format);
     //$do_webform_userfields->setApplyFieldFormating(true);
     while ($do_webform_userfields->next()) {
         $out .= "\n" . '<tr><td class="webform_row_label">' . $do_webform_userfields->label . '</td><td class="webform_row_field">' . $field_format->applyRegToForm($do_webform_userfields->name, '') . '</td></tr>';
     }
     $out .= '</table>';
     return $out;
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:WebFormUser.class.php

示例2: initFields

 /**
  * Fields initialization
  * This method set the initial fields descriptio for this DataObjec
  * Each property in the values array will be stored
  * in the model (database).
  * The Fields object let you assign to it FieldType and
  * manipulates the FieldType properties.
  * Field type define how a property value will display in a context of a Form
  * or general Display.
  * 
  * All the base FieldType are describe here:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * You can create your own:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * Some extra package add fieldtype from Dojo or other jquery frameworks.
  */
 function initFields()
 {
     $invoice_fields = new Fields();
     $invoice_fields->addField(new FieldTypeInt('idinvoice'));
     $invoice_fields->addField(new FieldTypeChar('num'));
     $invoice_fields->addField(new FieldTypeInt('iduser'));
     $invoice_fields->addField(new FieldTypeText('description'));
     $invoice_fields->addField(new FieldTypeFloat('amount'));
     $invoice_fields->addField(new FieldTypeDateSQL('datepaid'));
     $invoice_fields->addField(new FieldTypeDateSQL('datecreated'));
     $invoice_fields->addfield(new FieldTypeListBoxSmall('status'));
     $invoice_fields->idinvoice->hidden = 1;
     $invoice_fields->iduser->hidden = 1;
     $invoice_fields->description->rows = 10;
     $invoice_fields->description->cols = 40;
     $invoice_fields->amount->numberformat = '$:1:.:,:';
     $invoice_fields->status->listvalues = 'New:Sent:Paid';
     $invoice_fields->status->listlabels = 'new:sent:paid';
     $invoice_fields->status->emptydefault = 'no';
     $this->setFields($invoice_fields);
 }
开发者ID:philfree,项目名称:radria,代码行数:37,代码来源:Invoice.class.php

示例3: initFields

 /**
  * Fields initialization
  * This method set the initial fields descriptio for this DataObjec
  * Each property in the values array will be stored
  * in the model (database).
  * The Fields object let you assign to it FieldType and
  * manipulates the FieldType properties.
  * Field type define how a property value will display in a context of a Form
  * or general Display.
  * 
  * All the base FieldType are describe here:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * You can create your own:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * Some extra package add fieldtype from Dojo or other jquery frameworks.
  */
 function initFields()
 {
     $user_fields = new Fields();
     $user_fields->addField(new FieldTypeChar('firstname'));
     $user_fields->firstname->required = 1;
     $user_fields->firstname->size = 20;
     $user_fields->addField(new FieldTypeChar('lastname'));
     $user_fields->lastname->size = 20;
     $user_fields->addField(new FieldTypeLogin('email'));
     $user_fields->email->textline = '20:30';
     $user_fields->email->required = 1;
     $user_fields->addField(new FieldTypePassword('password'));
     $user_fields->password->size = 10;
     $user_fields->addField(new FieldTypeListBoxSmall('status'));
     $user_fields->status->listvalues = 'Active:Inactive:Suspended:Paid';
     $user_fields->status->listlabels = 'active:inactive:suspend:paid';
     $user_fields->status->emptydefault = 'no';
     $user_fields->addField(new FieldTypeDateSQL('regdate'));
     $user_fields->regdate->hidden = 1;
     $user_fields->addField(new FieldTypeInt('iduser'));
     $user_fields->iduser->hidden = 1;
     $this->setFields($user_fields);
 }
开发者ID:philfree,项目名称:radria,代码行数:39,代码来源:User.class.php

示例4: formLogin

 /**
  * formLogin
  * This method just call the login form.
  * Print out a login form for user identification
  * Having fun her as its nore very usefull to have a registry for such simple form
  */
 function formLogin($nextPage, $strWrongLoginPassword, $login_form_style = "", $errPage = "")
 {
     if (empty($login_form_style)) {
         $login_form_style = "formfield";
     }
     if (empty($errPage)) {
         $errPage = $_SERVER['PHP_SELF'];
     }
     if (empty($strWrongLoginPassword)) {
         $strWrongLoginPassword = _("Wrong Username or Password");
     }
     $form_fields = new Fields();
     $field_username = new FieldTypeChar($this->getUsernameField());
     $field_username->label = _("User name");
     $field_username->size = 20;
     $field_username->maxlenght = 40;
     $field_username->css_form_class = "formfield";
     $form_fields->addField($field_username);
     $field_password = new FieldTypePassword($this->getPasswordField());
     $field_password->label = _("Password");
     $field_password->size = 20;
     $field_password->maxlenght = 40;
     $field_password->loginform = true;
     $form_fields->addField($field_password);
     $this->setFields($form_fields);
     $login_form = $this->prepareForm();
     $login_form->setFormEvent($this->getObjectName() . "->eventSignIn");
     //$login_form->addEventAction($this->getObjectName()."->eventAuditLogin", 207);
     $login_form->addParam("goto", $nextPage);
     $login_form->addParam("errPage", $errPage);
     $login_form->setForm();
     $login_form->execute();
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:39,代码来源:RegisteredUser.class.php

示例5: formTwLoginVerification

 /**
  * While general registered user logs in for the first time with Twitter ask for 
  * login validation so that the fb_user_id can be stored in the DB
  * @param string $goto
  * @param string $errPage
  * @param string $tw_user_id
  * @param string $tw_screen_name
  * @param string $tw_token
  * 
  * @return the form for Twitter validation
  */
 function formTwLoginVerification($goto, $errPage, $tw_user_id, $tw_screen_name, $tw_token)
 {
     $form_fields = new Fields('', $this->getDbCon());
     $field_username = new FieldTypeChar($this->getUsernameField());
     $field_username->label = _('User name');
     $field_username->size = 20;
     $field_username->maxlenght = 40;
     $field_username->css_form_class = 'formfield';
     $form_fields->addField($field_username);
     $field_password = new OfuzFieldTypePassword($this->getPasswordField());
     $field_password->label = _('Password');
     $field_password->size = 20;
     $field_password->maxlenght = 40;
     $field_password->loginform = true;
     $form_fields->addField($field_password);
     $this->setFields($form_fields);
     $login_form = $this->prepareForm();
     $login_form->setFormEvent($this->getObjectName() . '->eventCheckIdentificationOnTwLogin');
     $login_form->addParam('goto', $goto);
     $login_form->addParam('errPage', $errPage);
     $login_form->addParam('tw_user_id', $tw_user_id);
     $login_form->addParam('tw_screen_name', $tw_screen_name);
     $login_form->addParam('tw_token', $tw_token);
     $login_form->setForm();
     $login_form->execute();
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:37,代码来源:User.class.php


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