本文整理汇总了PHP中ProcessTemplate函数的典型用法代码示例。如果您正苦于以下问题:PHP ProcessTemplate函数的具体用法?PHP ProcessTemplate怎么用?PHP ProcessTemplate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProcessTemplate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AutoRespond
function AutoRespond($s_to, $s_subj, $a_values)
{
global $aPHPVERSION, $SPECIAL_VALUES, $FROM_USER;
//
// need PHP 4.0.5 for the preg_replace_callback function
//
if (!IsPHPAtLeast("4.0.5")) {
SendAlert(GetMessage(MSG_PHP_AUTORESP, array("PHPVERS" => implode(".", $aPHPVERSION))));
return false;
}
$a_headers = array();
$s_mail_text = "";
$s_from_addr = "";
if (isset($FROM_USER) && !empty($FROM_USER)) {
if ($FROM_USER != "NONE") {
$s_from_addr = $a_headers['From'] = $FROM_USER;
}
} else {
global $SERVER;
$s_from_addr = "FormMail@" . $SERVER;
$a_headers['From'] = $s_from_addr;
}
if (IsAROptionSet('PlainTemplate')) {
$s_template = GetAROption("PlainTemplate");
if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
return false;
}
$s_mail_text = implode(BODY_LF, $a_lines);
}
if (IsAROptionSet("HTMLTemplate")) {
if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
return false;
}
}
return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
}
示例2: check_request_var
$appEngine->forwardInvalidModule(true);
}
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_ASSIGN);
// Load language.
$appTR->loadModule("groupassign");
// Form request.
$assign = check_request_var('assign');
if ($assign) {
$appEngine->handleAction('assign_togroup');
}
// User list.
$users = null;
if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_USER, ACL_ACTION_VIEW)) {
$users = $appEngine->getUserViewProvider()->getUsers();
// Remove the * user from array.
$o = new \svnadmin\core\entities\User();
$o->id = '*';
$o->name = '*';
$users = remove_item_by_value($users, $o, true);
usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
}
// Group list.
$groups = null;
if ($appEngine->isGroupViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_VIEW)) {
$groups = $appEngine->getGroupViewProvider()->getGroups();
usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
}
SetValue("UserList", $users);
SetValue("GroupList", $groups);
ProcessTemplate("group/membership.html.php");
示例3: usort
}
// Access-Path permissions of the current group.
$paths = null;
if ($appEngine->isAccessPathViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_ACCESSPATH, ACL_ACTION_VIEW)) {
$paths = $appEngine->getAccessPathViewProvider()->getPathsOfUser($oUser);
usort($paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
}
// Check whether the user is an project administrator.
$restricted_paths = null;
$isprojectmanager = false;
if ($appEngine->isAuthenticationActive()) {
$uname = $username;
if ($appEngine->getAclManager()->isUserAccessPathManager($uname)) {
$restricted_paths = $appEngine->getAclManager()->getAccessPathsOfUser($uname);
if (count($restricted_paths) > 0) {
usort($restricted_paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
$isprojectmanager = true;
}
}
}
SetValue("RoleList", $rolesOfUser);
SetValue("RoleListAll", $allroles);
SetValue("GroupList", $groups);
SetValue("GroupListAll", $allgroups);
SetValue("PathList", $paths);
SetValue("RestrictedPathList", $restricted_paths);
SetValue("ProjectManager", $isprojectmanager);
SetValue("Username", $username);
SetValue("UsernameEncoded", rawurlencode($username));
ProcessTemplate("user/userview.html.php");
示例4: _SendEmail
function _SendEmail($s_to, $s_subj, $a_values, $b_use_template)
{
global $aPHPVERSION, $SPECIAL_VALUES, $FROM_USER;
//
// need PHP 4.0.5 for the preg_replace_callback function
//
if (!IsPHPAtLeast("4.0.5")) {
SendAlert(GetMessage(MSG_PHP_AUTORESP, array("PHPVERS" => implode(".", $aPHPVERSION))));
return false;
}
$a_headers = array();
$s_mail_text = "";
$s_from_addr = GetAROption("FromAddr");
if (!isset($s_from_addr)) {
$s_from_addr = "";
if (isset($FROM_USER) && !empty($FROM_USER)) {
if ($FROM_USER != "NONE") {
$s_from_addr = $FROM_USER;
}
} else {
global $SERVER;
$s_from_addr = "FormMail@" . $SERVER;
}
} else {
$s_from_addr = UnMangle($s_from_addr);
}
if (!empty($s_from_addr)) {
$a_headers['From'] = SafeHeader($s_from_addr);
}
$s_type = "";
if ($b_use_template) {
if (IsAROptionSet('PlainTemplate')) {
$s_type .= "PlainTemplate ";
$s_template = GetAROption("PlainTemplate");
if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
return false;
}
FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines");
$s_mail_text = implode(BODY_LF, $a_lines);
}
if (IsAROptionSet("HTMLTemplate")) {
$s_type .= "HTMLTemplate ";
if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
return false;
}
FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
}
} else {
global $TEMPLATEURL, $TEMPLATEDIR;
if (IsAROptionSet('PlainFile')) {
$s_type .= "PlainFile ";
//
// load the plain text file from the templates area
//
if (empty($TEMPLATEDIR) && empty($TEMPLATEURL)) {
SendAlert(GetMessage(MSG_TEMPLATES));
return false;
}
$s_file = GetAROption("PlainFile");
if (($a_lines = LoadTemplate($s_file, $TEMPLATEDIR, $TEMPLATEURL, true)) === false) {
return false;
}
$s_mail_text = implode(BODY_LF, $a_lines);
FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines");
}
if (IsAROptionSet("HTMLFile")) {
$s_type .= "HTMLFile ";
if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) {
return false;
}
FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
}
}
if (strlen($s_mail_text) == 0) {
SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type));
}
FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes");
return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
}
示例5: check_request_var
* 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 this program.
*/
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isAccessPathEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_ACCESSPATH, ACL_ACTION_ADD);
$appTR->loadModule("accesspathcreate");
// Form request to create the user
$create = check_request_var('create');
if ($create) {
$appEngine->handleAction('create_accesspath');
}
// HTTP request parameters.
$varRepoEnc = get_request_var("r");
$varPathEnc = get_request_var("p");
$varRepo = rawurldecode($varRepoEnc);
$varPath = rawurldecode($varPathEnc);
// Stick together the pre-value of the input field.
$preFill = "";
if ($varRepo != NULL) {
$preFill = $varRepo . ":/";
if ($varPath != NULL) {
$preFill .= $varPath;
}
}
SetValue("DefaultAccessPath", $preFill);
ProcessTemplate("accesspath/accesspathcreate.html.php");
示例6: array
$list = array();
$users = array();
try {
// All AccessPaths.
$list = $appEngine->getAccessPathViewProvider()->getPaths();
usort($list, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
// Filter access-paths for project-managers.
if ($appEngine->isAuthenticationActive()) {
$currentUsername = $appEngine->getSessionUsername();
if ($appEngine->getAclManager()->isUserAccessPathManager($currentUsername)) {
$list = $appEngine->getAclManager()->filterAccessPathsList($currentUsername, $list);
}
// Load list of users to create a combobox and assign them as project managers to paths.
if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_PROJECTMANAGER, ACL_ACTION_ASSIGN)) {
$users = $appEngine->getUserViewProvider()->getUsers(false);
usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
}
// Get the project managers of each path.
$listCount = count($list);
for ($i = 0; $i < $listCount; $i++) {
$managers = $appEngine->getAclManager()->getUsersOfAccessPath($list[$i]->path);
$list[$i]->managers = $managers;
}
}
} catch (Exception $ex) {
$appEngine->addException($ex);
}
SetValue("UserList", $users);
SetValue("AccessPathList", $list);
ProcessTemplate("accesspath/accesspathlist.html.php");
示例7: _SendEmail
function _SendEmail($s_to, $s_subj, $a_values, $b_use_template)
{
global $SPECIAL_VALUES;
$a_headers = array();
$s_mail_text = "";
$s_from_addr = GetAROption("FromAddr");
if (!isset($s_from_addr)) {
$s_from_addr = "";
if (!Settings::isEmpty('FROM_USER')) {
if (Settings::get('FROM_USER') != "NONE") {
$s_from_addr = Settings::get('FROM_USER');
}
} else {
global $SERVER;
$s_from_addr = "FormMail@" . $SERVER;
}
} else {
$s_from_addr = UnMangle($s_from_addr);
}
if (!empty($s_from_addr)) {
$a_headers['From'] = SafeHeader($s_from_addr);
}
$s_type = "";
if ($b_use_template) {
if (IsAROptionSet('PlainTemplate')) {
$s_type .= "PlainTemplate ";
$s_template = GetAROption("PlainTemplate");
if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
return false;
}
FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines");
$s_mail_text = implode(Settings::get('BODY_LF'), $a_lines);
}
if (IsAROptionSet("HTMLTemplate")) {
$s_type .= "HTMLTemplate ";
if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
return false;
}
FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
}
} else {
if (IsAROptionSet('PlainFile')) {
$s_type .= "PlainFile ";
//
// load the plain text file from the templates area
//
if (Settings::isEmpty('TEMPLATEDIR') && Settings::isEmpty('TEMPLATEURL')) {
SendAlert(GetMessage(MSG_TEMPLATES));
return false;
}
$s_file = GetAROption("PlainFile");
if (($a_lines = LoadTemplate($s_file, Settings::get('TEMPLATEDIR'), Settings::get('TEMPLATEURL'), true)) === false) {
return false;
}
$s_mail_text = implode(Settings::get('BODY_LF'), $a_lines);
FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines");
}
if (IsAROptionSet("HTMLFile")) {
$s_type .= "HTMLFile ";
if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) {
return false;
}
FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
}
}
if (strlen($s_mail_text) == 0) {
SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type));
}
FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes");
return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
}
示例8: check_request_var
/**
* iF.SVNAdmin
* Copyright (c) 2010 by Manuel Freiholz
* http://www.insanefactory.com/
*
* This program 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; version 2
* of the License.
*
* This program 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 this program.
*/
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isUserEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_ADD);
$appTR->loadModule("usercreate");
// Action handling.
// Form request to create the user
$create = check_request_var('create');
if ($create) {
$appEngine->handleAction('create_user');
}
ProcessTemplate("user/usercreate.html.php");
示例9: elseif
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
*/
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isUserViewActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_VIEW);
$appTR->loadModule("userlist");
$appTR->loadModule("roles");
// Form request to delete users.
if (check_request_var("delete")) {
$appEngine->handleAction("delete_user");
} elseif (check_request_var("assign_role")) {
$appEngine->handleAction("assign_userrole");
}
// Assign roles.
// Get all roles to assign the user to a new role.
$allroles = null;
if ($appEngine->isAclManagerActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_ROLE, ACL_ACTION_ASSIGN)) {
// All existing roles.
$allroles = $appEngine->getAclManager()->getRoles();
usort($allroles, array('\\svnadmin\\core\\entities\\Role', "compare"));
}
// Get all users and sort them by name.
$users = $appEngine->getUserViewProvider()->getUsers();
usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
SetValue("UserList", $users);
SetValue("RoleList", $allroles);
ProcessTemplate("user/userlist.html.php");
示例10: get_request_var
// Get required variables.
$accesspathEnc = get_request_var('accesspath');
$accesspath = rawurldecode($accesspathEnc);
// View data.
$o = new \svnadmin\core\entities\AccessPath();
$o->path = $accesspath;
$users = $appEngine->getAccessPathViewProvider()->getUsersOfPath($o);
$groups = $appEngine->getAccessPathViewProvider()->getGroupsOfPath($o);
// Data to assign new user permissions.
// Data to assign new group permissions.
if ($appEngine->isAccessPathEditActive() && $appEngine->checkUserAccess(ACL_MOD_ACCESSPATH, ACL_ACTION_ASSIGN)) {
if ($appEngine->isUserViewActive()) {
$allusers = $appEngine->getUserViewProvider()->getUsers();
usort($allusers, array('\\svnadmin\\core\\entities\\User', "compare"));
SetValue("UserListAll", $allusers);
}
if ($appEngine->isGroupViewActive()) {
$allgroups = $appEngine->getGroupViewProvider()->getGroups();
usort($allgroups, array('\\svnadmin\\core\\entities\\Group', "compare"));
SetValue("GroupListAll", $allgroups);
}
}
SetValue("PermNone", \svnadmin\core\entities\Permission::$PERM_NONE);
SetValue("PermRead", \svnadmin\core\entities\Permission::$PERM_READ);
SetValue("PermReadWrite", \svnadmin\core\entities\Permission::$PERM_READWRITE);
SetValue("UserList", $users);
SetValue("GroupList", $groups);
SetValue("AccessPath", $accesspath);
SetValue("AccessPathEncoded", rawurlencode($accesspath));
ProcessTemplate("accesspath/accesspathview.html.php");
示例11: check_request_var
* Copyright (c) 2010 by Manuel Freiholz
* http://www.insanefactory.com/
*
* This program 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; version 2
* of the License.
*
* This program 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 this program.
*/
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isGroupViewActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_VIEW);
$appTR->loadModule("grouplist");
// Form 'delete' request.
$delete = check_request_var('delete');
if ($delete) {
$appEngine->handleAction('delete_group');
}
// Get all groups and sort them by name.
$groups = $appEngine->getGroupViewProvider()->getGroups();
usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
SetValue("GroupList", $groups);
ProcessTemplate("group/grouplist.html.php");
示例12: get_request_var
include "include/config.inc.php";
//
// Authentication
//
$appEngine->checkUserAuthentication();
$appTR->loadModule("errors");
//
// HTTP Request Vars
//
$e = get_request_var('e');
//
// View Data
//
$page = "";
switch ($e) {
case ERROR_INVALID_MODULE:
$page = "error/invalid-module.html.php";
break;
case ERROR_NO_ACCESS:
$acl_module = get_request_var("m");
$acl_action = get_request_var("a");
$page = "error/no-access.html.php";
SetValue("Module", $acl_module);
SetValue("Action", $acl_action);
break;
default:
$appEngine->forward(PAGE_HOME, true);
break;
}
ProcessTemplate($page);
示例13: check_request_var
<?php
/**
* iF.SVNAdmin
* Copyright (c) 2010 by Manuel Freiholz
* http://www.insanefactory.com/
*
* This program 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; version 2
* of the License.
*
* This program 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 this program.
*/
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isGroupEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_ADD);
$appTR->loadModule("groupcreate");
// Form request to create the user
$create = check_request_var('create');
if ($create) {
$appEngine->handleAction('create_group');
}
ProcessTemplate("group/groupcreate.html.php");
示例14: array
// Basic view data.
$users = array();
$groups = array();
$paths = array();
if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_USER, ACL_ACTION_VIEW)) {
$users = $appEngine->getUserViewProvider()->getUsers();
usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
}
if ($appEngine->isGroupViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_VIEW)) {
$groups = $appEngine->getGroupViewProvider()->getGroups();
usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
}
if (true) {
$paths = $appEngine->getAccessPathViewProvider()->getPaths();
// Filter access-paths for project-managers.
if ($appEngine->isAuthenticationActive()) {
$currentUsername = $appEngine->getSessionUsername();
if ($appEngine->getAclManager()->isUserAccessPathManager($currentUsername)) {
$paths = $appEngine->getAclManager()->filterAccessPathsList($currentUsername, $paths);
}
}
usort($paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
}
SetValue("PermNone", \svnadmin\core\entities\Permission::$PERM_NONE);
SetValue("PermRead", \svnadmin\core\entities\Permission::$PERM_READ);
SetValue("PermReadWrite", \svnadmin\core\entities\Permission::$PERM_READWRITE);
SetValue("UserList", $users);
SetValue("GroupList", $groups);
SetValue("AccessPathList", $paths);
ProcessTemplate("permission/permissionassign.html.php");
示例15: strrpos
}
if ($hasCustomWebLink) {
$val->customWebLink = IF_StringUtils::arguments($customWebLink, $args);
}
}
$itemList[] = $val;
}
// Create "up" link.
// Load the user list template file and add the array of users.
$backLinkPath = "/";
if (empty($varPath)) {
$varPath = "";
} else {
$pos = strrpos($varPath, "/");
if ($pos !== false && $pos > 0) {
$backLinkPath = substr($varPath, 0, $pos);
}
}
SetValue("ApacheWebLink", $hasApacheWebLink);
SetValue("CustomWebLink", $hasCustomWebLink);
SetValue("ItemList", $itemList);
SetValue("Repository", $oR);
SetValue("BackLinkPath", $backLinkPath);
SetValue("BackLinkPathEncoded", rawurlencode($backLinkPath));
SetValue("CurrentPath", $varPath);
SetValue("RepositoryRoot", $isRepositoryRoot);
} catch (Exception $ex) {
$engine->addException($ex);
}
ProcessTemplate("repository/repositoryview.html.php");