本文整理汇总了PHP中MailForm::MailForm方法的典型用法代码示例。如果您正苦于以下问题:PHP MailForm::MailForm方法的具体用法?PHP MailForm::MailForm怎么用?PHP MailForm::MailForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailForm
的用法示例。
在下文中一共展示了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: RealtyAddForm
function RealtyAddForm()
{
parent::MailForm();
$w =& $this->addWidget('hidden', 'collection');
$w =& $this->addWidget('hidden', '_return');
global $cgi;
loader_import('cms.Versioning.Rex');
$rex = new Rex($cgi->collection);
$widgets = $rex->getStruct();
if (!$widgets) {
die($rex->error);
}
$this->widgets = array_merge($this->widgets, $widgets);
foreach (array_keys($this->widgets) as $k) {
if (strtolower(get_class($this->widgets[$k])) == 'mf_widget_xeditor') {
$this->extra = 'onsubmit="xed_copy_value (this, \'' . $k . '\')"';
}
}
if (isset($rex->info['Collection']['singular'])) {
page_title(intl_get('Adding') . ' ' . $rex->info['Collection']['singular']);
} else {
page_title(intl_get('Adding Item'));
}
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Create'));
$b =& $w->addButton('submit_button', intl_get('Cancel'));
$b->extra = 'onclick="return cms_cancel (this.form)"';
}
示例3: 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);
}
}
示例4: 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);
}
示例5: 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);
}
}
示例6: 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());
}
}
示例7: DevtoolsTplForm
function DevtoolsTplForm()
{
parent::MailForm();
$this->parseSettings('inc/app/devtools/forms/tpl/settings.php');
page_title(intl_get('Create a New Template Set'));
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/devtools-app\'; return false"';
}
示例8: 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"';
}
示例9: 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']);
}
示例10: SitepresenterAddForm
function SitepresenterAddForm()
{
parent::MailForm();
global $page, $cgi;
$this->parseSettings('inc/app/sitepresenter/forms/add/settings.php');
page_title(intl_get('Adding Presentation'));
loader_import('ext.phpsniff');
$sniffer = new phpSniff();
$this->_browser = $sniffer->property('browser');
// include formhelp, edit panel init, and cancel handler
page_add_script(site_prefix() . '/js/formhelp.js');
page_add_script(CMS_JS_FORMHELP_INIT);
page_onload('cms_init_edit_panels ()');
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;
}
');
// add cancel handler
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
}
示例11: SitetemplateEditForm
function SitetemplateEditForm()
{
parent::MailForm();
global $cgi;
$this->parseSettings('inc/app/sitetemplate/forms/edit/settings.php');
if (@file_exists('inc/app/xed/lib/Widget/Linker.php')) {
$this->link_chooser = true;
}
list($set, $tpl) = explode('/', $cgi->path);
list($mode, $name, $ext) = preg_split('|\\.|', basename($cgi->path));
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'];
} else {
$sname = $set;
}
} else {
$sname = $set;
}
session_set('imagechooser_path', site_prefix() . '/inc/html/' . $set . '/pix');
page_title(intl_get('Editing Template') . ': ' . $sname . ' / ' . strtoupper($mode) . ' / ' . ucfirst($name));
$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/' . $cgi->path)));
$this->widgets['submit_buttons']->data = array('set' => $set);
}
示例12: SiteblogCommentForm
function SiteblogCommentForm()
{
parent::MailForm();
global $cgi;
$this->parseSettings('inc/app/siteblog/forms/comment/settings.php');
if (isset($cgi->_key) && !empty($cgi->_key)) {
//edit a comment
page_title('Editing Comment');
$comment = db_single('select * from siteblog_comment where id = ?', $cgi->_key);
$this->widgets['name']->setValue($comment->author);
$this->widgets['email']->setValue($comment->email);
$this->widgets['url']->setValue($comment->url);
$this->widgets['body']->setValue($comment->body);
} elseif (!isset($cgi->post)) {
header('Location: ' . site_prefix() . '/index');
exit;
} else {
if (session_valid()) {
$this->widgets['name']->setValue(session_username());
$user = session_get_user();
$this->widgets['email']->setValue($user->email);
$this->widgets['url']->setValue($user->website);
}
$this->widgets['post']->setValue($cgi->post);
//page_title ('Post a Comment');
}
if (!appconf('comments_security')) {
unset($this->widgets['security_test']);
}
}
示例13: 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'));
}
示例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: ComposeForm
function ComposeForm()
{
parent::MailForm();
$t =& $this->addWidget('hidden', 'response_id');
$t =& $this->addWidget('text', 'subject');
$t->alt = intl_get('Subject');
$t->addRule('not empty', intl_get('You must enter a subject line.'));
$t->attr('size', 50);
$t =& $this->addWidget('cms.Widget.Recipients', 'recipients');
$t->alt = intl_get('Send To');
$t->addRule('not empty', intl_get('You must enter at least one recipient.'));
$t =& $this->addWidget('select', 'priority');
$t->setValues(array('normal' => intl_get('Normal'), 'high' => intl_get('High'), 'urgent' => intl_get('Urgent')));
$t->alt = intl_get('Priority');
$t =& $this->addWidget('xed.Widget.Xeditor', 'body');
$this->extra = 'onsubmit="xed_copy_value (this, \'body\')"';
$t->addRule('not empty', intl_get('You must enter a message to be sent.'));
$t =& $this->addWidget('msubmit', 'submit_button');
$b =& $t->getButton();
$b->setValues(intl_get('Send'));
$b->extra = 'onclick="cms_recipient_select_all (this.form)"';
$b =& $t->addButton('cancel_button');
$b->setValues(intl_get('Cancel'));
$b->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/cms-cpanel-action\'; return false"';
$this->error_mode = 'all';
}