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


PHP form::meta方法代码示例

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


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

示例1: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:25,代码来源:bb_post.php

示例2: form

 function form($object = null)
 {
     $i18n = exponent_lang_loadFile('datatypes/section_template.php');
     if (!defined('SYS_FORMS')) {
         require_once BASE . 'subsystems/forms.php';
     }
     exponent_forms_initialize();
     $form = new form();
     if (!isset($object->id)) {
         $object->name = '';
         $object->active = 1;
         $object->public = 1;
         $object->subtheme = '';
         $object->page_title = SITE_TITLE;
         $object->keywords = SITE_KEYWORDS;
         $object->description = SITE_DESCRIPTION;
         if (!isset($object->parent)) {
             $object->parent = 0;
         }
         // NOT IMPLEMENTED YET
         //$object->subtheme='';
     } else {
         $form->meta('id', $object->id);
     }
     $form->meta('parent', $object->parent);
     $form->register('name', $i18n['name'], new textcontrol($object->name));
     if (!isset($object->id) && $object->parent != 0) {
         // Add the 'Add' drop down if not a top level
         global $db;
         $sections = $db->selectObjects('section_template', 'parent=' . $object->parent);
         if (count($sections)) {
             if (!defined('SYS_SORTING')) {
                 require_once BASE . 'subsystems/sorting.php';
             }
             usort($sections, 'exponent_sorting_byRankAscending');
             $dd = array($i18n['position_top']);
             foreach ($sections as $s) {
                 $dd[] = sprintf($i18n['position_after'], $s->name);
             }
             $form->register('rank', $i18n['rank'], new dropdowncontrol(count($dd) - 1, $dd));
         } else {
             $form->meta('rank', 0);
         }
     } else {
         $form->meta('rank', 0);
     }
     if (is_readable(THEME_ABSOLUTE . 'subthemes')) {
         // grab sub themes
         $form->register('subtheme', $i18n['subtheme'], new dropdowncontrol($object->subtheme, exponent_theme_getSubThemes()));
     }
     $form->register('active', $i18n['active'], new checkboxcontrol($object->active));
     $form->register('public', $i18n['public'], new checkboxcontrol($object->public));
     // Register the Page Meta Data controls.
     $form->register('page_title', $i18n['page_title'], new textcontrol($object->page_title));
     $form->register('keywords', $i18n['keywords'], new texteditorcontrol($object->keywords, 5, 25));
     $form->register('description', $i18n['description'], new texteditorcontrol($object->keywords, 5, 25));
     $form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['save']));
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:59,代码来源:section_template.php

示例3: form

 static function form($object = null)
 {
     $form = new form();
     if (!isset($object->id)) {
         $object->name = '';
         $object->active = 1;
         $object->public = 1;
         $object->subtheme = '';
         $object->page_title = SITE_TITLE;
         $object->keywords = SITE_KEYWORDS;
         $object->description = SITE_DESCRIPTION;
         if (!isset($object->parent)) {
             $object->parent = 0;
         }
         // NOT IMPLEMENTED YET
         //$object->subtheme='';
     } else {
         $form->meta('id', $object->id);
     }
     $form->meta('parent', $object->parent);
     $form->register('name', gt('Name'), new textcontrol($object->name));
     if (!isset($object->id) && $object->parent != 0) {
         // Add the 'Add' drop down if not a top level
         global $db;
         $sections = $db->selectObjects('section_template', 'parent=' . $object->parent);
         if (count($sections)) {
             $sections = expSorter::sort(array('array' => $sections, 'sortby' => 'rank', 'order' => 'ASC'));
             $dd = array(gt('At the Top'));
             foreach ($sections as $s) {
                 $dd[] = sprintf(gt('After') . " %s", $s->name);
             }
             $form->register('rank', gt('Position'), new dropdowncontrol(count($dd) - 1, $dd));
         } else {
             $form->meta('rank', 0);
         }
     } else {
         $form->meta('rank', 0);
     }
     if (is_readable(THEME_ABSOLUTE . 'subthemes')) {
         // grab sub themes
         $form->register('subtheme', gt('Theme Variation'), new dropdowncontrol($object->subtheme, expTheme::getSubThemes()));
     }
     $form->register('active', gt('Active'), new checkboxcontrol($object->active));
     $form->register('public', gt('Public'), new checkboxcontrol($object->public));
     // Register the Page Meta Data controls.
     $form->register('page_title', gt('Page Title'), new textcontrol($object->page_title));
     $form->register('keywords', gt('keywords'), new texteditorcontrol($object->keywords, 5, 25));
     $form->register('description', gt('Page Description'), new texteditorcontrol($object->keywords, 5, 25));
     $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel')));
     return $form;
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:51,代码来源:section_template.php

示例4: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:27,代码来源:codemap_stepstone.php

示例5: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:26,代码来源:translation_language.php

示例6: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:34,代码来源:linklistmodule_config.php

示例7: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:30,代码来源:contact_contact.php

示例8: form

 function form($object)
 {
     if (!defined('SYS_FORMS')) {
         include_once BASE . 'subsystems/forms.php';
     }
     exponent_forms_initialize();
     $i18n = exponent_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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:26,代码来源:group.php

示例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->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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:29,代码来源:tasklist_task.php

示例10: form

 function form($object)
 {
     if (!defined('SYS_FORMS')) {
         include_once BASE . 'subsystems/forms.php';
     }
     exponent_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 . '"/>'));
     }
     $i18n = exponent_lang_loadFile('datatypes/banner_ad.php');
     $affiliates = BannerModule::listAffiliates();
     $form->register('name', $i18n['name'], new textcontrol($object->name));
     $submit = new buttongroupcontrol($i18n['save'], '', $i18n['cancel']);
     if (count($affiliates)) {
         $form->register('affiliate_id', $i18n['affiliate_id'], new dropdowncontrol($object->affiliate_id, $affiliates));
     } else {
         $form->registerBefore('name', null, '', new htmlcontrol('<div class="error">' . $i18n['no_affiliates'] . '</div>'));
         $submit->disabled = 1;
     }
     $form->register('url', $i18n['url'], new texteditorcontrol($object->url, 2, 40));
     $form->register('submit', '', $submit);
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:31,代码来源:banner_ad.php

示例11: form

 function form($object)
 {
     pathos_lang_loadDictionary('standard', 'core');
     pathos_lang_loadDictionary('modules', 'newsmodule');
     global $user;
     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 = '';
         $object->publish = null;
         $object->unpublish = null;
     } else {
         $form->meta('id', $object->id);
         if ($object->publish == 0) {
             $object->publish = null;
         }
         if ($object->unpublish == 0) {
             $object->unpublish = null;
         }
     }
     $form->register('title', TR_NEWSMODULE_HEADLINE, new textcontrol($object->title));
     $form->register('internal_name', 'Internal Name', new textcontrol($object->internal_name));
     $form->register('body', TR_NEWSMODULE_BODY, new htmleditorcontrol($object->body));
     $form->register('publish', TR_NEWSMODULE_PUBLISH, new popupdatetimecontrol($object->publish, TR_NEWSMODULE_NOPUBLISH));
     $form->register('unpublish', TR_NEWSMODULE_UNPUBLISH, new popupdatetimecontrol($object->unpublish, TR_NEWSMODULE_NOUNPUBLISH));
     $form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL));
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:33,代码来源:newsitem.php

示例12: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:26,代码来源:imagemanageritem.php

示例13: form

 function form($object)
 {
     $i18n = exponent_lang_loadFile('datatypes/imagemanageritem.php');
     if (!defined('SYS_FORMS')) {
         require_once BASE . 'subsystems/forms.php';
     }
     exponent_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', $i18n['name'], new textcontrol($object->name));
     $form->register('description', $i18n['description'], new texteditorcontrol($object->description));
     if (!isset($object->id)) {
         $form->register(null, '', new htmlcontrol(exponent_core_maxUploadSizeMessage()));
         $form->register('file', $i18n['file'], new uploadcontrol());
     }
     $form->register('scale', $i18n['scale'], new textcontrol($object->scale));
     $form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['cancel']));
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:25,代码来源:imagemanageritem.php

示例14: 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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:34,代码来源:user.php

示例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)) {
         $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;
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:32,代码来源:banner_ad.php


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