本文整理匯總了PHP中Templates::GetTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Templates::GetTemplate方法的具體用法?PHP Templates::GetTemplate怎麽用?PHP Templates::GetTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Templates
的用法示例。
在下文中一共展示了Templates::GetTemplate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
*/
require './common.php';
if ($ldapserver->isReadOnly()) {
pla_error(_('You cannot perform updates while server is in read-only mode'));
}
if (!$ldapserver->haveAuthInfo()) {
pla_error(_('Not enough information to login to server. Please check your configuration.'));
}
$new_dn = isset($_POST['new_dn']) ? $_POST['new_dn'] : null;
$required_attrs = isset($_POST['required_attrs']) ? $_POST['required_attrs'] : false;
$object_classes = unserialize(rawurldecode($_POST['object_classes']));
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : false;
# See if there are any presubmit values to work out.
if (isset($_POST['presubmit']) && count($_POST['presubmit']) && isset($_POST['template'])) {
$templates = new Templates($ldapserver->server_id);
$template = $templates->GetTemplate($_POST['template']);
foreach ($_POST['presubmit'] as $attr) {
$_POST['attrs'][] = $attr;
$_POST['form'][$attr] = $templates->EvaluateDefault($ldapserver, $template['attribute'][$attr]['presubmit'], $_POST['container']);
$_POST['vals'][] = $_POST['form'][$attr];
}
# @todo: This section needs to be cleaned up, and will be when the old templates are removed. In the mean time...
# Rebuild the $_POST['attrs'] & $_POST['vals'], as they can be inconsistent.
unset($_POST['attrs']);
unset($_POST['vals']);
foreach ($_POST['form'] as $attr => $val) {
$_POST['attrs'][] = $attr;
$_POST['vals'][] = $val;
}
}
$vals = isset($_POST['vals']) ? $_POST['vals'] : array();
示例2: isset
$attrs = $ldapserver->getDNAttrs($dn, false, $config->GetValue('deref', 'view'));
$modified_attrs = isset($_REQUEST['modified_attrs']) ? $_REQUEST['modified_attrs'] : false;
$show_internal_attrs = isset($_REQUEST['show_internal_attrs']) ? true : false;
# If an entry has more children than this, stop searching and display this amount with a '+'
$max_children = 100;
} else {
$dn = '';
$rdn = '';
$encoded_dn = '';
if ($_REQUEST['template'] == 'custom') {
include TMPLDIR . 'template_header.php';
require TMPLDIR . 'creation/custom.php';
die;
} else {
$templates = new Templates($ldapserver->server_id);
$template = $templates->GetTemplate($_REQUEST['template']);
}
}
include TMPLDIR . 'template_header.php';
/*
* When we get here, (either a new entry, or modifying an existing entry), if the
* empty_attrs array has content, then we need to ask the user for this information.
*/
if (isset($template['empty_attrs'])) {
masort($template['empty_attrs'], 'page,order', 1);
# What page are we working on.
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
printf('<center><h2>%s</h2></center>', $template['description']);
echo "\n\n";
if (isset($_REQUEST['nextpage']) && !$_REQUEST['nextpage']) {
$new_dn = sprintf('%s=%s,%s', $template['rdn'], $_REQUEST['form'][$template['rdn']], $_REQUEST['container']);