本文整理汇总了PHP中pathos_forms_initialize函数的典型用法代码示例。如果您正苦于以下问题:PHP pathos_forms_initialize函数的具体用法?PHP pathos_forms_initialize怎么用?PHP pathos_forms_initialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pathos_forms_initialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
function form($object)
{
pathos_lang_loadDictionary('standard', 'core');
pathos_lang_loadDictionary('modules', 'imagemanagermodule');
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->name = '';
$object->description = '';
$object->scale = 20;
} else {
$form->meta('id', $object->id);
}
$form->register('name', TR_IMAGEMANAGERMODULE_NAME, new textcontrol($object->name));
$form->register('description', TR_IMAGEMANAGERMODULE_DESCRIPTION, new texteditorcontrol($object->description));
if (!isset($object->id)) {
$form->register('maxsizemsg', '', new htmlcontrol(pathos_core_maxUploadSizeMessage()));
$form->register('file', TR_IMAGEMANAGERMODULE_IMAGE, new uploadcontrol());
}
$form->register('scale', TR_IMAGEMANAGERMODULE_SCALE, new textcontrol($object->scale));
$form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL));
return $form;
}
示例2: form
function form($object)
{
if (!defined("SYS_FORMS")) {
require_once BASE . "subsystems/forms.php";
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->name = "";
$object->affiliate_id = 0;
$object->url = "http://";
} else {
$form->meta("id", $object->id);
global $db;
$file = $db->selectObject("file", "id=" . $object->file_id);
$form->register(uniqid(""), "", new htmlcontrol("<img src='" . $file->directory . "/" . $file->filename . "'/>"));
}
pathos_lang_loadDictionary('standard', 'core');
pathos_lang_loadDictionary('modules', 'bannermodule');
$affiliates = bannermodule::listAffiliates();
$form->register('name', TR_BANNERMODULE_INTERNALNAME, new textcontrol($object->name));
$submit = new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL);
if (count($affiliates)) {
$form->register('affiliate_id', TR_BANNERMODULE_AFFILIATE, new dropdowncontrol($object->affiliate_id, $affiliates));
} else {
$form->registerBefore('name', null, '', new htmlcontrol('<div class="error">' . TR_BANNERMODULE_NOAFFILIATES . '</div>'));
$submit->disabled = 1;
}
$form->register('url', TR_BANNERMODULE_DESTURL, new texteditorcontrol($object->url, 2, 40));
$form->register('submit', '', $submit);
return $form;
}
示例3: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->name = '';
$object->description = '';
$object->status = 0;
$object->developer = '';
$object->contact = '';
} else {
$form->meta('id', $object->id);
}
$form->register('name', 'Name', new textcontrol($object->name));
$form->register('description', 'Description', new texteditorcontrol($object->description));
$form->register('developer', 'Developer', new textcontrol($object->developer));
$form->register('contact', 'Contact', new textcontrol($object->contact));
$form->register(uniqid(''), '', new htmlcontrol('How far along is this task?'));
$form->register(uniqid(''), 'Not Yet Started', new radiocontrol($object->status == 0 ? 1 : 0, 0, 'status', true));
$form->register(uniqid(''), 'In Progress', new radiocontrol($object->status == 1 ? 1 : 0, 1, 'status', true));
$form->register(uniqid(''), 'Completed', new radiocontrol($object->status == 2 ? 1 : 0, 2, 'status', true));
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}
示例4: form
function form($object)
{
pathos_lang_loadDictionary('modules', 'contactmodule');
pathos_lang_loadDictionary('standard', 'core');
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$type = 0;
$default = 0;
$form = new form();
if (!isset($object->id)) {
$object->user_id = 0;
$object->addressbook_contact_id = 0;
$object->email = '';
$object->contact_info = '';
} else {
$form->meta('id', $object->id);
if ($object->user_id != 0) {
$type = 0;
$default = $object->user_id;
} else {
$type = 1;
$default = $object->email;
}
}
$form->register('contact', TR_CONTACTMODULE_CONTACT, new contactcontrol($default, $type));
$form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL));
return $form;
}
示例5: form
function form($object)
{
pathos_lang_loadDictionary('standard', 'core');
pathos_lang_loadDictionary('modules', 'weblogmodule');
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->title = '';
$object->internal_name = '';
$object->body = '';
global $user;
$object->poster = $user->id;
$object->is_private = 0;
$object->is_draft = 0;
} else {
$form->meta('id', $object->id);
}
$form->register('title', TR_WEBLOGMODULE_TITLE, new textcontrol($object->title));
$form->register('internal_name', 'Internal Name', new textcontrol($object->internal_name));
$form->register('body', TR_WEBLOGMODULE_BODY, new htmleditorcontrol($object->body));
$form->register('is_private', TR_WEBLOGMODULE_ISPRIVATE, new checkboxcontrol($object->is_private, true));
if ($object->is_draft == 1 || !isset($object->id)) {
$form->register('is_draft', 'Save as Draft?', new checkboxcontrol($object->is_draft, true));
}
$form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL));
return $form;
}
示例6: form
function form($object)
{
if (!defined('SYS_FORMS')) {
include_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$i18n = pathos_lang_loadFile('datatypes/user.php');
$form = new form();
if (!isset($object->id)) {
// If the user object has no id, then this is a new user form.
// Populate the empty user object with default attributes,
// so that the calls to $form->register can confidently dereference
// thes attributes.
$object->firstname = '';
$object->lastname = '';
$object->email = '';
// Username and Password can only be specified for a new user. To change the password,
// a different form is used (part of the loginmodule)
$form->register('username', $i18n['desired_username'], new textcontrol());
$form->register('pass1', $i18n['pass1'], new passwordcontrol());
$form->register('pass2', $i18n['pass2'], new passwordcontrol());
$form->register(null, '', new htmlcontrol('<br />'));
} else {
$form->meta("id", $object->id);
}
// Register the basic user profile controls.
$form->register('firstname', $i18n['firstname'], new textcontrol($object->firstname));
$form->register('lastname', $i18n['lastname'], new textcontrol($object->lastname));
$form->register(null, '', new htmlcontrol('<br />'));
$form->register('email', $i18n['email'], new textcontrol($object->email));
$form->register(null, '', new htmlcontrol('<br />'));
$form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['cancel']));
return $form;
}
示例7: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->name = '';
$object->lang = '';
$object->charset = '';
$object->author = '';
$object->locale = '';
$object->default_view = '';
} else {
$form->meta('id', $object->id);
}
$form->register('name', 'Name', new textcontrol($object->name));
$form->register('author', 'Author(s)', new textcontrol($object->author));
$form->register('lang', 'Lang Code', new textcontrol($object->lang, 5));
$form->register('charset', 'Character Set', new textcontrol($object->charset, 15));
$form->register('locale', 'Locale', new textcontrol($object->locale));
$form->register('default_view', 'Default View Name', new textcontrol($object->default_view));
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}
示例8: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->subject = '';
$object->body = '';
} else {
$form->meta('id', $object->id);
}
if (isset($object->board_id)) {
$form->meta('bb', $object->board_id);
}
if (isset($object->parent)) {
$form->meta('parent', $object->parent);
}
$form->register('subject', 'Subject', new textcontrol($object->subject));
$form->register('body', 'Body', new htmleditorcontrol($object->body));
// Make a bbeditorcontrol ([tt] lang)
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}
示例9: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->sort = 'asc_name';
} else {
switch ($object->orderhow) {
case 0:
// ascending
$object->sort = 'asc_' . $object->orderby;
break;
case 1:
// descending
$object->sort = 'desc_' . $object->orderby;
break;
case 2:
// random
$object->sort = 'random_';
break;
default:
$object->sort = 'asc_name';
break;
}
$form->meta('id', $object->id);
}
$order_options = array('random_' => 'Randomly', 'asc_name' => 'Alphabetical By Name', 'desc_name' => 'Reverse Alphabetical By Name');
$form->register('orderby', 'Sorting', new dropdowncontrol($object->sort, $order_options));
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}
示例10: form
function form($object)
{
if (!defined('SYS_FORMS')) {
include_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$i18n = pathos_lang_loadFile('datatypes/group.php');
$form = new form();
if (!isset($object->id)) {
// If the user object has no id, then this is a new user form.
// Populate the empty user object with default attributes,
// so that the calls to $form->register can confidently dereference
// thes attributes.
$object->name = '';
$object->description = '';
$object->inclusive = 1;
} else {
$form->meta('id', $object->id);
}
// Register the basic user profile controls.
$form->register('name', $i18n['name'], new textcontrol($object->name));
$form->register('description', $i18n['description'], new texteditorcontrol($object->description));
$form->register('inclusive', $i18n['inclusive'], new checkboxcontrol($object->inclusive));
$form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['cancel']));
return $form;
}
示例11: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->name = '';
$object->description = '';
$object->priority = 5;
$object->completion = 0;
} else {
$form->meta('id', $object->id);
}
$priorities = array(9 => '9 - Highest', 8 => '8', 7 => '7', 6 => '6', 5 => '5 - Medium', 4 => '4', 3 => '3', 2 => '2', 1 => '1 - Lowest');
$completion = array();
for ($i = 0; $i < 100; $i += 5) {
$completion[$i] = $i . ' %';
}
$completion[0] = '0% - Not Started';
$completion[100] = '100% - Finished';
$form->register('name', 'Name', new textcontrol($object->name));
$form->register('description', 'Description', new htmleditorcontrol($object->description));
$form->register('priority', 'Priority', new dropdowncontrol($object->priority, $priorities));
$form->register('completion', 'Progress', new dropdowncontrol($object->completion, $completion));
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}
示例12: update
function update($values, $object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$object->subject = $values['subject'];
$object->from_name = $values['from_name'];
$object->from_address = $values['from'];
$object->replyto_address = $values['replyto'];
$object->final_message = htmleditorcontrol::parseData('final_message', $values);
return $object;
}
示例13: update
function update($values, $object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$object->title = $values['title'];
$object->internal_name = preg_replace('/--+/', '-', preg_replace('/[^A-Za-z0-9_]/', '-', $values['internal_name']));
$object->body = $values['body'];
$object->publish = popupdatetimecontrol::parseData('publish', $values);
$object->unpublish = popupdatetimecontrol::parseData('unpublish', $values);
return $object;
}
示例14: form
function form($object)
{
pathos_lang_loadDictionary('standard', 'core');
pathos_lang_loadDictionary('modules', 'addressbookmodule');
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
$object->firstname = '';
$object->lastname = '';
$object->address1 = '';
$object->address2 = '';
$object->city = '';
$object->state = '';
$object->zip = '';
$object->country = '';
$object->email = '';
$object->phone = '';
$object->cell = '';
$object->fax = '';
$object->pager = '';
$object->notes = '';
$object->webpage = '';
} else {
$form->meta('id', $object->id);
}
$form->register('firstname', TR_ADDRESSBOOKMODULE_FIRSTNAME, new textcontrol($object->firstname));
$form->register('lastname', TR_ADDRESSBOOKMODULE_LASTNAME, new textcontrol($object->lastname));
$form->register(null, '', new htmlcontrol('<hr size="1" />'));
$form->register('address1', TR_ADDRESSBOOKMODULE_ADDRESS, new textcontrol($object->address1, 30));
$form->register('address2', TR_ADDRESSBOOKMODULE_ADDRESS2, new textcontrol($object->address2, 30));
$form->register('city', TR_ADDRESSBOOKMODULE_CITY, new textcontrol($object->city));
$form->register('state', TR_ADDRESSBOOKMODULE_STATE, new textcontrol($object->state));
$form->register('zip', TR_ADDRESSBOOKMODULE_ZIPCODE, new textcontrol($object->zip));
$form->register(null, '', new htmlcontrol('<hr size="1" />'));
$form->register('email', TR_ADDRESSBOOKMODULE_EMAIL, new textcontrol($object->email));
$form->register('webpage', TR_ADDRESSBOOKMODULE_HOMEPAGE, new textcontrol($object->webpage));
$form->register(null, '', new htmlcontrol('<hr size="1" />'));
$form->register('phone', TR_ADDRESSBOOKMODULE_PHONE, new textcontrol($object->phone));
$form->register('cell', TR_ADDRESSBOOKMODULE_MOBILE, new textcontrol($object->cell));
$form->register('fax', TR_ADDRESSBOOKMODULE_FAX, new textcontrol($object->fax));
$form->register('pager', TR_ADDRESSBOOKMODULE_PAGER, new textcontrol($object->pager));
$form->register(null, '', new htmlcontrol('<hr size="1" />'));
$form->register('notes', TR_ADDRESSBOOKMODULE_NOTES, new texteditorcontrol($object->notes, 12, 50));
$form->register(null, '', new htmlcontrol('<hr size="1" />'));
$form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL));
return $form;
}
示例15: form
function form($object)
{
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
if (!isset($object->id)) {
//nothing to do here yet
} else {
$form->meta('id', $object->id);
}
$form->register('submit', '', new buttongroupcontrol('Save', '', 'Cancel'));
return $form;
}