本文整理汇总了PHP中Pommo_Template::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Pommo_Template::display方法的具体用法?PHP Pommo_Template::display怎么用?PHP Pommo_Template::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pommo_Template
的用法示例。
在下文中一共展示了Pommo_Template::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$view->assign('returnStr', _('Groups Page'));
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& Pommo_Api::stateInit('groups_edit', array('group' => 0), $_REQUEST);
$groups = Pommo_Groups::get();
$fields = Pommo_Fields::get();
$group =& $groups[$state['group']];
if (empty($group)) {
Pommo::redirect('subscribers_groups.php');
}
$rules = Pommo_Sql::sortRules($group['rules']);
$rules['and'] = Pommo_Sql::sortLogic($rules['and']);
$rules['or'] = Pommo_Sql::sortLogic($rules['or']);
foreach ($rules as $key => $a) {
if ($key == 'include' || $key == 'exclude') {
foreach ($a as $k => $gid) {
$rules[$key][$k] = $groups[$gid]['name'];
}
}
}
$view->assign('fields', $fields);
$view->assign('legalFieldIDs', Pommo_Rules::getLegal($group, $fields));
$view->assign('legalGroups', Pommo_Rules::getLegalGroups($group, $groups));
$view->assign('group', $group);
$view->assign('logicNames', Pommo_Rules::getEnglish());
$view->assign('rules', $rules);
$view->assign('tally', Pommo_Groups::tally($group));
$view->assign('ruleCount', count($rules['and']) + count($rules['or']) + count($rules['include']) + count($rules['exclude']));
$view->assign('getURL', $_SERVER['PHP_SELF'] . '?group_id=' . $group['id']);
$view->assign('t_include', Pommo::_T('INCLUDE'));
$view->display('admin/subscribers/groups_edit');
示例2: PommoWYSIWYG
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
if (Pommo_Mailing::isCurrent()) {
Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the' . ' %sStatus%s page to check its progress.'), '<a href="mailing_status.php">', '</a>'));
}
if (Pommo::$_config['demo_mode'] == 'on') {
$logger->addMsg(sprintf(Pommo::_T('%sDemonstration Mode%s is on -- no Emails' . ' will actually be sent. This is good for testing settings.'), '<a href="' . Pommo::$_baseUrl . 'setup_configure.php#mailings">', '</a>'));
}
require_once Pommo::$_baseDir . 'themes/wysiwyg/editors.php';
$editors = new PommoWYSIWYG();
$editor = $editors->loadEditor();
if (!$editor) {
die('Could not find requested WYSIWYG editor (' . $editor . ') in editors.php');
}
$view->assign('wysiwygJS', $editor);
// translation assignments for dialg titles...
$view->assign('t_personalization', Pommo::_T('Personalization'));
$view->assign('t_testMailing', Pommo::_T('Test Mailing'));
$view->assign('t_saveTemplate', Pommo::_T('Save Template'));
$view->display('admin/mailings/mailings_start');
示例3: unserialize
/**********************************
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Pending.php';
Pommo::init(array('authLevel' => 0, 'noSession' => true));
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
if (empty($_GET['code'])) {
$logger->addMsg(Pommo::_T('No code given.'));
$view->display('user/confirm');
Pommo::kill();
}
// lookup code
$pending = Pommo_Pending::get($_GET['code']);
if (!$pending) {
$logger->addMsg(Pommo::_T('Invalid code! Make sure you copied it correctly from the email.'));
$view->display('user/confirm');
Pommo::kill();
}
// Load success messages and redirection URL from config
$config = Pommo_Api::configGet(array('site_success', 'messages', 'notices'));
$messages = unserialize($config['messages']);
$notices = unserialize($config['notices']);
if (Pommo_Pending::perform($pending)) {
require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Messages.php';
示例4: elseif
if ($state['order'] != 'asc' && $state['order'] != 'desc') {
$state['order'] = 'asc';
}
if (!is_numeric($state['sort']) && $state['sort'] != 'email' && $state['sort'] != 'ip' && $state['sort'] != 'time_registered' && $state['sort'] != 'time_touched') {
$state['sort'] = 'email';
}
if (!is_numeric($state['status'])) {
$state['status'] = 1;
}
if (!is_numeric($state['group']) && $state['group'] != 'all') {
$state['group'] = 'all';
}
if (isset($_REQUEST['searchClear'])) {
$state['search'] = false;
} elseif (isset($_REQUEST['searchField']) && (is_numeric($_REQUEST['searchField']) || $_REQUEST['searchField'] == 'email' || $_REQUEST['searchField'] == 'ip' || $_REQUEST['searchField'] == 'time_registered' || $_REQUEST['searchField'] == 'time_touched')) {
$_REQUEST['searchString'] = trim($_REQUEST['searchString']);
$state['search'] = empty($_REQUEST['searchString']) ? false : array('field' => $_REQUEST['searchField'], 'string' => trim($_REQUEST['searchString']));
}
/**********************************
DISPLAY METHODS
*********************************/
// Get the *empty* group [no member IDs. 3rd arg is set TRUE]
$group = new Pommo_Groups($state['group'], $state['status'], $state['search']);
// Calculate and Remember number of pages for this group/status combo
$state['pages'] = is_numeric($group->_tally) && $group->_tally > 0 ? ceil($group->_tally / $state['limit']) : 0;
$view->assign('state', $state);
$view->assign('tally', $group->_tally);
$view->assign('groups', Pommo_Groups::get());
$view->assign('fields', Pommo_Fields::get());
$view->display('admin/subscribers/subscribers_manage');
示例5: current
*
* poMMo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
* This fork is from https://github.com/soonick/poMMo
* Please see docs/contribs for Contributors
*
*/
// Progress bar modified from the works of Juha Suni <juha.suni@ilmiantajat.fi>
/**********************************
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$mailing = current(Pommo_Mailing::get(array('active' => TRUE)));
$view->assign('mailing', $mailing);
$view->display('admin/mailings/mailing_status');
示例6: current
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with program; see the file docs/LICENSE. If not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**********************************
INITIALIZATION METHODS
*********************************/
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
if (isset($_REQUEST['mailings'])) {
if (is_array($_REQUEST['mailings'])) {
$_REQUEST['mailings'] = $_REQUEST['mailings'][0];
}
$mailing = current(Pommo_Mailing::get(array('id' => $_REQUEST['mailings'])));
} else {
$mailing = Pommo::$_session['state']['mailing'];
}
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->assign($mailing);
$smarty->display('inc/mailing.tpl');
Pommo::kill();
示例7:
* This file is part of poMMo (http://www.pommo.org)
*
* poMMo is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2, or any later version.
*
* poMMo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with program; see the file docs/LICENSE. If not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**********************************
INITIALIZATION METHODS
*********************************/
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->assign('fields', Pommo_Fields::get());
$smarty->display('admin/subscribers/ajax/subscriber_edit.tpl');
Pommo::kill();
示例8: unserialize
/**********************************
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Pending.php';
Pommo::init(array('authLevel' => 0, 'noSession' => true));
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
if (empty($_GET['code'])) {
$logger->addMsg(Pommo::_T('No code given.'));
$smarty->display('user/confirm.tpl');
Pommo::kill();
}
// lookup code
$pending = Pommo_Pending::get($_GET['code']);
if (!$pending) {
$logger->addMsg(Pommo::_T('Invalid code! Make sure you copied it correctly from the email.'));
$smarty->display('user/confirm.tpl');
Pommo::kill();
}
// Load success messages and redirection URL from config
$config = Pommo_Api::configGet(array('site_success', 'messages', 'notices'));
$messages = unserialize($config['messages']);
$notices = unserialize($config['notices']);
if (Pommo_Pending::perform($pending)) {
require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Messages.php';
示例9: PommoWYSIWYG
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
if (Pommo_Mailing::isCurrent()) {
Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the
%sStatus%s page to check its progress.'), '<a href="mailing_status.php">', '</a>'));
}
if (Pommo::$_config['demo_mode'] == 'on') {
$logger->addMsg(sprintf(Pommo::_T('%sDemonstration Mode%s is on -- no Emails
will actually be sent. This is good for testing settings.'), '<a href="' . Pommo::$_baseUrl . 'setup_configure.php#mailings">', '</a>'));
}
require_once Pommo::$_baseDir . 'themes/wysiwyg/editors.php';
$editors = new PommoWYSIWYG();
$editor = $editors->loadEditor();
if (!$editor) {
die('Could not find requested WYSIWYG editor (' . $editor . ') in editors.php');
}
$smarty->assign('wysiwygJS', $editor);
// translation assignments for dialg titles...
$smarty->assign('t_personalization', Pommo::_T('Personalization'));
$smarty->assign('t_testMailing', Pommo::_T('Test Mailing'));
$smarty->assign('t_saveTemplate', Pommo::_T('Save Template'));
$smarty->display('admin/mailings/mailings_start.tpl');
示例10: unset
session_start();
// required by smartyValidate. TODO -> move to prepareForForm() ??
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
$dbo->dieOnQuery(FALSE);
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->prepareForForm();
// Check to make sure poMMo is not already installed.
if (Pommo_Install::verify()) {
$logger->addErr(Pommo::_T('poMMo is already installed.'));
$smarty->assign('installed', TRUE);
$smarty->display('install.tpl');
Pommo::kill();
}
if (isset($_REQUEST['disableDebug'])) {
unset($_REQUEST['debugInstall']);
} elseif (isset($_REQUEST['debugInstall'])) {
$smarty->assign('debug', TRUE);
}
if (!SmartyValidate::is_registered_form() || empty($_POST)) {
// ___ USER HAS NOT SENT FORM ___
SmartyValidate::connect($smarty, true);
SmartyValidate::register_validator('list_name', 'list_name', 'notEmpty', false, false, 'trim');
SmartyValidate::register_validator('site_name', 'site_name', 'notEmpty', false, false, 'trim');
SmartyValidate::register_validator('site_url', 'site_url', 'isURL');
SmartyValidate::register_validator('admin_password', 'admin_password', 'notEmpty', false, false, 'trim');
SmartyValidate::register_validator('admin_password2', 'admin_password:admin_password2', 'isEqual');
示例11:
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
*
* This file is part of poMMo (http://www.pommo.org)
*
* poMMo is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2, or any later version.
*
* poMMo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with program; see the file docs/LICENSE. If not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**********************************
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->display('admin/subscribers/admin_subscribers.tpl');
Pommo::kill();
示例12: die
if (!$configErrors) {
// I am sure there must be better ways to do this, but this works
// for now.
// TODO: If there is a better method change this, if not. Delete
// this line.
$handle = @fopen('config.php', 'w');
if (!$handle) {
$configErrors[] = 'Script was not able to create config.php
file. You should assign write permission for this script
to pommo root folder or create config.php yourself.';
} else {
$string = '<?php die(); /* DO NOT REMOVE THIS LINE! */ ?>' . PHP_EOL . PHP_EOL . '[db_hostname] = ' . $_POST['dbhost'] . PHP_EOL . '[db_username] = ' . $_POST['dbuser'] . PHP_EOL . '[db_password] = ' . $_POST['dbpass'] . PHP_EOL . '[db_database] = ' . $_POST['dbname'] . PHP_EOL . '[db_prefix] = pommo_' . PHP_EOL . PHP_EOL . '[lang] = en' . PHP_EOL . '[debug] = off' . PHP_EOL . '[verbosity] = 3' . PHP_EOL . '[date_format] = 1' . PHP_EOL;
fwrite($handle, $string);
fclose($handle);
$redir = Pommo::$_baseUrl . 'install.php';
header('Location: ' . $redir);
exit;
}
}
}
if (Pommo::$_hasConfigFile) {
// referer (used to return user to requested page upon login success)
$smarty->assign('referer', isset($_REQUEST['referer']) ? $_REQUEST['referer'] : Pommo::$_baseUrl . 'admin.php');
$smarty->display('index.tpl');
} else {
$smarty->assign('messages', $configErrors);
$smarty->assign('dbhost', $_POST['dbhost']);
$smarty->assign('dbname', $_POST['dbname']);
$smarty->assign('dbuser', $_POST['dbuser']);
$smarty->display('configure.tpl');
}
示例13: kill
public static function kill($msg = NULL, $backtrace = FALSE)
{
// output passed message
if ($msg) {
if (empty(self::$_workDir)) {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">';
echo '<title>poMMo Error</title>';
// Added for valid output
echo '<div><img src="' . Pommo::$_baseUrl . 'themes/shared/images/icons/alert.png" alt="alert icon"
style="vertical-align: middle; margin-right: 20px;"/>' . $msg . '</div>';
} else {
$logger = self::$_logger;
$logger->addErr($msg);
require_once self::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('fatalMsg', TRUE);
$view->display('message');
}
}
// output debugging info if enabled (in config.php)
if (self::$_debug) {
require_once self::$_baseDir . 'classes/Pommo_Helper_Debug.php';
$debug = new Pommo_Helper_Debug();
$debug->bmDebug();
}
if ($backtrace) {
$backtrace = debug_backtrace();
echo @'<h2>BACKTRACE</h2>' . '<p>' . @str_ireplace(Pommo::$_baseDir, '', $backtrace[1]['file']) . ':' . $backtrace[1]['line'] . ' ' . $backtrace[1]['function'] . '()</p>' . '<p>' . @str_ireplace(Pommo::$_baseDir, '', $backtrace[2]['file']) . ' ' . $backtrace[2]['function'] . '()</p>' . '<p>' . @str_ireplace(Pommo::$_baseDir, '', $backtrace[3]['file']) . ' ' . $backtrace[3]['function'] . '()</p>';
}
// print and clear output buffer
ob_end_flush();
// kill script
die;
}
示例14:
* poMMo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* poMMo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
* This fork is from https://github.com/soonick/poMMo
* Please see docs/contribs for Contributors
*
*/
/**********************************
INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->display('admin/subscribers/admin_subscribers');
示例15: array
Pommo::redirect('login.php');
}
$subscriber = array('email' => $_POST['Email'], 'registered' => time(), 'ip' => $_SERVER['REMOTE_ADDR'], 'status' => 1, 'data' => @$_POST['d']);
// ** check for correct email syntax
if (!Pommo_Helper::isEmail($subscriber['email'])) {
$logger->addErr(Pommo::_T('Invalid Email Address'));
}
// ** check if email already exists in DB ("duplicates are bad..")
if (Pommo_Helper::isDupe($subscriber['email'])) {
$logger->addErr(Pommo::_T('Email address already exists. Duplicates are not allowed.'));
$smarty->assign('dupe', TRUE);
}
// check if errors exist with data, if so print results and die.
if ($logger->isErr() || !Pommo_Validate::subscriberData($subscriber['data'], array('active' => FALSE))) {
$smarty->assign('back', TRUE);
$smarty->display('user/process.tpl');
Pommo::kill();
}
$comments = isset($_POST['comments']) ? substr($_POST['comments'], 0, 255) : false;
/**********************************
ADD SUBSCRIBER
*********************************/
$config = Pommo_Api::configGet(array('site_success', 'site_confirm', 'list_confirm', 'notices'));
$notices = unserialize($config['notices']);
require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Messages.php';
if ($config['list_confirm'] == 'on') {
// email confirmation required.
// add user as "pending"
$subscriber['pending_code'] = Pommo_Helper::makeCode();
$subscriber['pending_type'] = 'add';
$subscriber['status'] = 2;