本文整理汇总了PHP中TemplatePower::assignInclude方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::assignInclude方法的具体用法?PHP TemplatePower::assignInclude怎么用?PHP TemplatePower::assignInclude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatePower
的用法示例。
在下文中一共展示了TemplatePower::assignInclude方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TemplatePower
<?php
/* $Id: host_view.php 1831 2008-09-26 12:18:54Z carenas $ */
$tpl = new TemplatePower(template("host_view.tpl"));
$tpl->assignInclude("extra", template("host_extra.tpl"));
$tpl->prepare();
$tpl->assign("cluster", $clustername);
$tpl->assign("host", $hostname);
$tpl->assign("node_image", node_image($metrics));
$tpl->assign("sort", $sort);
$tpl->assign("range", $range);
if ($hosts_up) {
$tpl->assign("node_msg", "This host is up and running.");
} else {
$tpl->assign("node_msg", "This host is down.");
}
$cluster_url = rawurlencode($clustername);
$tpl->assign("cluster_url", $cluster_url);
$tpl->assign("graphargs", "h={$hostname}&{$get_metric_string}&st={$cluster['LOCALTIME']}");
# For the node view link.
$tpl->assign("node_view", "./?p=2&c={$cluster_url}&h={$hostname}");
# No reason to go on if this node is down.
if ($hosts_down) {
$tpl->printToScreen();
return;
}
$tpl->assign("ip", $hosts_up['IP']);
$tpl->newBlock('columns_dropdown');
$tpl->assign("metric_cols_menu", $metric_cols_menu);
$g_metrics_group = array();
foreach ($metrics as $name => $v) {
示例2: TemplatePower
<?php
/* $Id: cluster_view.php 1710 2008-08-21 16:44:54Z bernardli $ */
$tpl = new TemplatePower(template("cluster_view.tpl"));
$tpl->assignInclude("extra", template("cluster_extra.tpl"));
$tpl->prepare();
$tpl->assign("images", "./templates/{$template_name}/images");
$cpu_num = !$showhosts ? $metrics["cpu_num"]['SUM'] : cluster_sum("cpu_num", $metrics);
$load_one_sum = !$showhosts ? $metrics["load_one"]['SUM'] : cluster_sum("load_one", $metrics);
$load_five_sum = !$showhosts ? $metrics["load_five"]['SUM'] : cluster_sum("load_five", $metrics);
$load_fifteen_sum = !$showhosts ? $metrics["load_fifteen"]['SUM'] : cluster_sum("load_fifteen", $metrics);
$roxies_up = !$showhosts ? $metrics["roxie_instances"]['SUM'] : cluster_sum("roxie_instances", $metrics);
#
# Correct handling of *_report metrics
#
if (!$showhosts) {
if (array_key_exists($metricname, $metrics)) {
$units = $metrics[$metricname]['UNITS'];
}
} else {
if (array_key_exists($metricname, $metrics[key($metrics)])) {
$units = $metrics[key($metrics)][$metricname]['UNITS'];
}
}
if (isset($cluster['HOSTS_UP'])) {
$tpl->assign("num_nodes", intval($cluster['HOSTS_UP']));
} else {
$tpl->assign("num_nodes", 0);
}
if (isset($cluster['HOSTS_DOWN'])) {
$tpl->assign("num_dead_nodes", intval($cluster['HOSTS_DOWN']));
示例3: TemplatePower
$tpl->assignGlobal('error_message', 'You are not not enrolled in any courses.');
$tpl->prepare();
// the user is good to go
} else {
$tpl = new TemplatePower('template/students.html');
// see if a form was submitted
if (isset($_POST['action'])) {
$action = $_POST['action'];
// check to see what the user wanted to do
switch ($action) {
// uploading a file
case 'upload':
$assignment = $_POST['assignment'];
$user = $_SESSION['userID'];
$path = $_CONF['upload_path'];
$tpl->assignInclude('upload', 'template/upload.html');
$tpl->assignGlobal('assignment', $assignment);
// check to see if a file has been uploaded
if (isset($_FILES['file'])) {
$target_file = $path . $assignment . '-' . $_FILES['file']['name'];
// save the file to the uploads directory
if (move_uploaded_file($_FILES['file']['tmp_name'], $target_file)) {
$tpl->assignGlobal('upload_error', 'The file ' . basename($_FILES['file']['name']) . ' has been uploaded as ' . $target_file);
// check to see if the grade already exists.
$_DB->sql_query("SELECT * FROM grades WHERE gradeAssignment='{$assignment}' AND gradeUser='{$user}' LIMIT 1;");
if ($_DB->sql_numrows() > 0) {
// use the existing grade
$gradeID = $_DB->sql_fetchrow();
$gradeID = $gradeID['gradeID'];
} else {
// create a new grade for the user
示例4: TemplatePower
<?php
require_once 'lib/TemplatePower.class.php';
//session_destroy();
$tpl = new TemplatePower('template/master.html');
$tpl->assignInclude('content', 'template/error.html');
$tpl->prepare();
$tpl->showUnAssigned(false);
$tpl->printToScreen();