本文整理汇总了PHP中MailForm类的典型用法代码示例。如果您正苦于以下问题:PHP MailForm类的具体用法?PHP MailForm怎么用?PHP MailForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MailForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XedReplaceForm
function XedReplaceForm()
{
parent::MailForm();
$this->parseSettings('inc/app/xed/forms/replace/settings.php');
$this->widgets['find']->setValue(session_get('xed_source_find'));
$this->widgets['replace']->setValue(session_get('xed_source_replace'));
}
示例2: SiteblogEditForm
function SiteblogEditForm()
{
parent::MailForm();
global $cgi;
$refer = $_SERVER['HTTP_REFERER'];
$this->parseSettings('inc/app/siteblog/forms/edit/settings.php');
$this->widgets['refer']->setValue($refer);
//if add is true, we're creating a blog post, otherwise we're editing a blog post
$add = isset($cgi->_key) && !empty($cgi->_key) ? false : true;
$this->widgets['status']->setValues(array('Live', 'Not Live'));
$cats = db_pairs('select id, title from siteblog_category where status = "on"');
if ($add) {
page_title('Adding a Blog Post');
$this->widgets['author']->setValue(session_username());
unset($this->widgets['icategory']);
$this->widgets['category']->setValues($cats);
} else {
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$document = $rex->getCurrent($cgi->_key);
page_title('Editing a Blog Post');
//populate fields
$this->widgets['subject']->setValue($document->subject);
$this->widgets['author']->setValue($document->author);
$this->widgets['status']->setValue($document->status);
unset($this->widgets['category']);
$catname = db_shift('select title from siteblog_category where id = ?', $document->category);
$this->widgets['icategory']->setValue($catname);
$this->widgets['oldcat']->setValue($document->category);
$this->widgets['body']->setValue($document->body);
}
}
示例3: SitefaqEditForm
function SitefaqEditForm()
{
parent::MailForm();
global $page, $cgi;
$this->extra = 'id="cms-edit-form"';
// get copy from repository
loader_import('cms.Versioning.Rex');
$rex = new Rex($cgi->_collection);
// default: database, database
$_document = $rex->getCurrent($cgi->_key);
$widgets = $rex->getStruct();
if (!$widgets) {
$widgets = array();
}
// edit widgets go here
$this->widgets = array_merge($this->widgets, $widgets);
foreach ($this->widgets as $k => $v) {
if (isset($_document->{$k})) {
$this->widgets[$k]->setValue($_document->{$k});
}
}
$w =& $this->addWidget('hidden', '_key');
$w =& $this->addWidget('hidden', '_collection');
$w =& $this->addWidget('hidden', '_return');
if ($rex->isVersioned) {
$t =& $this->addWidget('textarea', 'changelog');
$t->alt = intl_get('Change Summary');
$t->rows = 3;
$t->labelPosition = 'left';
$t->extra = 'id="changelog"';
}
// submit buttons
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Save'));
$b =& $w->addButton('submit_button', intl_get('Cancel'));
$b->extra = 'onclick="return cms_cancel (this.form)"';
$this->error_mode = 'all';
if ($rex->info['Collection']['singular']) {
page_title(intl_get('Editing') . ' ' . $rex->info['Collection']['singular'] . ': ' . $_document->{$rex->key});
} else {
page_title(intl_get('Editing Item') . ': ' . $_document->{$rex->key});
}
// the SiteFAQ additions:
if (appconf('user_anonymity')) {
unset($this->widgets['name']);
unset($this->widgets['email']);
unset($this->widgets['url']);
unset($this->widgets['ip']);
unset($this->widgets['member_id']);
}
$admin_roles = session_admin_roles();
$this->widgets['assigned_to']->setValues(db_pairs('select username, concat(lastname, ", ", firstname, " (", username, ")")
from sitellite_user
where role in("' . join('", "', $admin_roles) . '")
order by lastname, firstname, username'));
if (!$_document->assigned_to) {
$this->widgets['assigned_to']->setValue(session_username());
}
}
示例4: SiteglossaryEditForm
function SiteglossaryEditForm()
{
parent::MailForm();
$this->parseSettings('inc/app/siteglossary/forms/edit/settings.php');
global $cgi;
page_title(intl_get('Editing Glossary Term') . ': ' . $cgi->_key);
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/siteglossary-app";
}
}
return false;
}
');
// add cancel handler
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
$res = db_single('select * from siteglossary_term where word = ?', $cgi->_key);
foreach (get_object_vars($res) as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
示例5: EntryAddForm
function EntryAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/timetracker/forms/entry/add/settings.php');
$res = db_fetch('select username, firstname, lastname from sitellite_user order by lastname asc');
if (!$res) {
$res = array();
} elseif (is_object($res)) {
$res = array($res);
}
$users = array();
foreach ($res as $row) {
if (!empty($row->lastname)) {
$users[$row->username] = $row->lastname;
if (!empty($row->firstname)) {
$users[$row->username] .= ', ' . $row->firstname;
}
$users[$row->username] .= ' (' . $row->username . ')';
} else {
$users[$row->username] = $row->username;
}
}
$this->widgets['users']->setValues($users);
$this->widgets['users']->setDefault(session_username());
$this->widgets['users']->addRule('not empty', 'You must select at least one user.');
$this->widgets['started']->setDefault(date('Y-m-d H:i:s'));
$this->widgets['ended']->setDefault(date('Y-m-d H:i:s'));
global $cgi;
$this->widgets['proj_name']->setValue(db_shift('select name from timetracker_project where id = ?', $cgi->project));
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="history.go (-1); return false"';
}
示例6: SiteblogBrowseForm
function SiteblogBrowseForm()
{
parent::MailForm();
$this->parseSettings('inc/app/siteblog/forms/browse/settings.php');
echo '<h2> Search for Posts </h2>';
$years = array();
$years[] = 'All Years';
$currYear = date('Y');
for ($i = 2000; $i <= $currYear + 1; $i++) {
$years[$i] = $i;
}
$months = array(0 => 'All Months', 1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
$authors[] = 'All Users';
foreach (db_shift_array('select distinct author from siteblog_post') as $a) {
$authors[$a] = $a;
}
$cats = db_fetch_array('select * from siteblog_category');
$newcats = array();
foreach ($cats as $c) {
$newcats[$c->id] = $c->title;
}
$this->widgets['author']->setValues($authors);
$this->widgets['month']->setValues($months);
$this->widgets['year']->setValues($years);
$this->widgets['category']->setValues($newcats);
}
示例7: UsradmCacheForm
function UsradmCacheForm()
{
parent::MailForm(__FILE__);
page_add_style('
td.label {
width: 200px;
}
td.field {
padding-left: 7px;
padding-right: 7px;
}
');
$cache = ini_parse('inc/conf/cache.php');
foreach ($cache['Cache'] as $k => $v) {
$this->widgets[$k]->setValue($v);
}
$cacheable = '';
foreach ($cache['Cacheable'] as $k => $v) {
if (in_array($k, $this->ignore)) {
continue;
}
if ($v) {
$cacheable .= $k . " = yes\n";
} else {
$cacheable .= $k . " = no\n";
}
}
$this->widgets['cacheable']->setValue($cacheable);
}
示例8: SiteblogPropertiesForm
function SiteblogPropertiesForm()
{
parent::MailForm();
global $cgi;
if (empty($cgi->blog)) {
return;
}
$this->parseSettings('inc/app/siteblog/forms/properties/settings.php');
page_title('Editing Category Properties: ' . $cgi->blog);
$category = db_single('select * from siteblog_category where id = ?', $cgi->blog);
$set = array();
if ($category->comments == 'on') {
$set[] = 'Enable Comments';
}
if ($category->poster_visible == 'yes') {
$set[] = 'Author Visible';
}
if ($category->display_rss == 'yes') {
$set[] = 'Include RSS Links';
}
if ($category->status == 'on') {
$set[] = 'Enabled';
}
$this->widgets['blog_properties']->setValue($set);
$this->widgets['blog']->setValue($cgi->blog);
$this->widgets['refer']->setValue($_SERVER['HTTP_REFERER']);
}
示例9: CmsMessagesCategoryEditForm
function CmsMessagesCategoryEditForm()
{
parent::MailForm();
$this->parseSettings('inc/app/cms/forms/messages/category/edit/settings.php');
global $cgi;
$this->widgets['name']->setDefault($cgi->category);
}
示例10: AppdocTranslationAddForm
function AppdocTranslationAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/appdoc/forms/translation/add/settings.php');
page_title(intl_get('Add Language'));
global $cgi;
if ($cgi->appname == 'GLOBAL') {
$this->_file = 'inc/lang/languages.php';
} else {
$this->_file = 'inc/app/' . $cgi->appname . '/lang/languages.php';
}
$list = array('no' => 'None');
$info = ini_parse($this->_file);
foreach ($info as $k => $v) {
$list[$k] = $v['name'];
}
$this->widgets['fallback']->setValues($list);
$this->widgets['default']->setValues(array('yes' => 'Yes', 'no' => 'No'));
if (count($list) == 1) {
$this->widgets['default']->setDefault('yes');
} else {
$this->widgets['default']->setDefault('no');
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.history.go (-1); return false"';
}
示例11: SitepresenterEditSlideForm
function SitepresenterEditSlideForm()
{
parent::MailForm();
$this->parseSettings('inc/app/sitepresenter/forms/edit/slide/settings.php');
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/sitepresenter-app";
}
}
return false;
}
');
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
global $cgi;
page_title(intl_get('Adding Slide to Presentation') . ': ' . db_shift('select title from sitepresenter_presentation where id = ?', $cgi->presentation));
$res = db_single('select * from sitepresenter_slide where id = ?', $cgi->id);
foreach (get_object_vars($res) as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
示例12: SitetemplateNewtplForm
function SitetemplateNewtplForm()
{
parent::MailForm();
global $cgi;
$this->parseSettings('inc/app/sitetemplate/forms/newtpl/settings.php');
if (@file_exists('inc/app/xed/lib/Widget/Linker.php')) {
$this->link_chooser = true;
}
$mode = 'html';
$name = 'new file';
$set = $cgi->set_name;
$sname = $set;
session_set('imagechooser_path', site_prefix() . '/inc/html/' . $set . '/pix');
if (@file_exists('inc/html/' . $set . '/config.ini.php')) {
$info = parse_ini_file('inc/html/' . $set . '/config.ini.php');
if (isset($info['set_name'])) {
$sname = $info['set_name'];
}
}
page_title(intl_get('Editing New Template in') . ': ' . $sname);
$set = str_replace('/' . $mode . '.' . $name . '.' . $ext, '', $cgi->path);
//$this->widgets['edit_buttons']->data = array ('mode' => strtoupper ($mode), 'name' => ucfirst ($name), 'link_chooser' => $this->link_chooser);
//$this->widgets['body']->setValue (join ('', file ('inc/html/' . $sname)));
$this->widgets['submit_buttons']->data = array('set' => $set);
$this->widgets['path']->setValue($set);
}
示例13: EditForm
function EditForm()
{
parent::MailForm();
global $cgi, $_helpdoc;
$this->addWidget('hidden', 'appname');
$this->addWidget('hidden', 'lang');
$this->addWidget('hidden', 'helpfile');
$w =& $this->addWidget('text', 'filename');
$w->alt = intl_get('File Name (ie. 001-about-myApp)');
$w->addRule('not empty', intl_get('You must specify a file name.'));
$w->addRule('not contains ".."', intl_get('Your file name contains invalid characters.'));
$w->setValue($cgi->helpfile);
$w =& $this->addWidget('text', 'title');
$w->alt = intl_get('Title');
$w->addRule('not empty', intl_get('You must specify a title.'));
$w->setValue($_helpdoc->title);
session_set('imagechooser_path', 'inc/app/' . $cgi->appname . '/pix');
$this->extra = 'onsubmit="xed_copy_value (this, \'body\')"';
$w =& $this->addWidget('xed.Widget.Xeditor', 'body');
$w->setValue($_helpdoc->body);
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Save'));
$b =& $w->addButton('submit_button');
$b->setValues(intl_get('Cancel'));
$b->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/appdoc-helpdoc-action?appname=' . $cgi->appname . '&lang=' . $cgi->lang . '\'; return false"';
}
示例14: SitetemplateEditsetForm
function SitetemplateEditsetForm()
{
parent::MailForm();
global $cgi;
$set = $cgi->set;
$this->parseSettings('inc/app/sitetemplate/forms/editset/settings.php');
$settings = array();
if (file_exists('inc/html/' . $set . '/config.ini.php')) {
$settings = ini_parse('inc/html/' . $set . '/config.ini.php', false);
}
$name = $settings['set_name'];
if (!$name) {
$name = $set;
}
$settings['set'] = $set;
//put form values into respective forms
foreach ($settings as $k => $v) {
$this->widgets[$k]->setDefault($v);
}
if (@file_exists('inc/html/' . $set . '/modes.php')) {
$this->widgets['modes']->setDefault(@join('', @file('inc/html/' . $set . '/modes.php')));
} else {
$this->widgets['modes']->setDefault($modesd);
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="history.go (-1); return false"';
page_title(intl_get('Editing Properties') . ': ' . $name);
}
示例15: DeadlinesAddForm
function DeadlinesAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/deadlines/forms/add/settings.php');
page_title('Deadlines - Add Item');
$this->widgets['ts']->setDefault(date('Y-m-d H:i:s'));
}