本文整理汇总了PHP中Web::out方法的典型用法代码示例。如果您正苦于以下问题:PHP Web::out方法的具体用法?PHP Web::out怎么用?PHP Web::out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Web
的用法示例。
在下文中一共展示了Web::out方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rendertemplate_ALL
function rendertemplate_ALL(Web $w)
{
$p = $w->pathMatch("id");
$t = $w->Template->getTemplate($p['id']);
$t = $t ? $t : new Template($w);
$w->setLayout(null);
$w->out($t->testTitle());
$w->out("<hr/>");
$w->out($t->testBody());
}
示例2: comment_GET
function comment_GET(Web $w)
{
$p = $w->pathMatch("comment_id", "tablename", "object_id");
$comment_id = intval($p["comment_id"]);
$comment = $comment_id > 0 ? $w->Comment->getComment($comment_id) : new Comment($w);
if ($comment === null) {
$comment = new Comment($w);
}
$help = <<<EOF
//italics//
**bold**
\t\t
* bullet list
* second item
** subitem
# numbered list
# second item
## sub item
[[URL|linkname]]
== Large Heading
=== Medium Heading
==== Small Heading
Horizontal Line:
---
EOF;
$form = array(array("Comment", "section"), array("", "textarea", "comment", $comment->comment, 100, 15, false), array("Help", "section"), array("", "textarea", "-help", $help, 100, 5, false), array("", "hidden", "redirect_url", $w->request("redirect_url")));
// return the comment for display and edit
$w->setLayout(null);
$w->out(Html::form($form, $w->localUrl("/admin/comment/{$p["comment_id"]}/{$p["tablename"]}/{$p["object_id"]}"), "POST", "Save"));
}
示例3: taskAjaxSelectbyTaskGroup_ALL
function taskAjaxSelectbyTaskGroup_ALL(Web $w)
{
$p = $w->pathMatch("taskgroup_id");
$taskgroup = $w->Task->getTaskGroup($p['taskgroup_id']);
if (empty($taskgroup->id)) {
return;
}
$tasktypes = $taskgroup != "" ? $w->Task->getTaskTypes($taskgroup->task_group_type) : array();
$priority = $taskgroup != "" ? $w->Task->getTaskPriority($taskgroup->task_group_type) : array();
$members = $taskgroup != "" ? $w->Task->getMembersBeAssigned($taskgroup->id) : array();
sort($members);
$typetitle = $taskgroup != "" ? $taskgroup->getTypeTitle() : "";
$typedesc = $taskgroup != "" ? $taskgroup->getTypeDescription() : "";
// if user cannot assign tasks in this group, leave 'first_assignee' blank for owner/member to delegate
$members = $taskgroup->getCanIAssign() ? $members : array(array("Default", ""));
// create dropdowns loaded with respective data
$ttype = Html::select("task_type", $tasktypes, null);
$prior = Html::select("priority", $priority, null);
$mem = Html::select("assignee_id", $members, null);
// first_
$taskgroup_link = $taskgroup->isOwner($w->Auth->user()) ? "<a href=\"" . $w->localUrl("task-group/viewmembergroup/" . $taskgroup->id) . "\">" . $taskgroup->title . "</a>" : $taskgroup->title;
$tasktext = "<table style='width: 100%;'>" . "<tr><td class=section colspan=2>Task Group Description</td></tr>" . "<tr><td><b>Task Group</td><td>" . $taskgroup_link . "</td></tr>" . "<tr><td><b>Task Type</b></td><td>" . $typetitle . "</td></tr>" . "<tr valign=top><td><b>Description</b></td><td>" . $typedesc . "</td></tr>" . "</table>";
// return as array of arrays
$result = array($ttype, $prior, $mem, $tasktext, Html::select("status", $taskgroup->getTypeStatus(), null, null, null, null));
$w->setLayout(null);
$w->out(json_encode($result));
}
示例4: edit_GET
function edit_GET(Web $w)
{
$p = $w->pathMatch("report_id", "id");
$report_template = !empty($p['id']) ? $w->Report->getReportTemplate($p['id']) : new ReportTemplate($w);
$form = array("Add Report Template" => array(array(array("Template", "select", "template_id", $report_template->template_id, $w->Template->findTemplates("report"))), array(array("Type", "select", "type", $report_template->type, $report_template->getReportTypes())), array(array("Report ID", "hidden", "report_id", $p['report_id']))));
$w->out(Html::multiColForm($form, "/report-templates/edit/{$report_template->id}"));
}
示例5: printqueue_GET
function printqueue_GET(Web $w)
{
$print_folder = FILE_ROOT . "print";
$path = realpath($print_folder);
// Check if folder exists
if ($path === false) {
// Make print folder (If you specify a full path, use the recursion flag because it seems to crash without it in unix)
// Other wise you would need to chdir to the parent folder, create and change back to wherever execution currently was at
mkdir($print_folder, 0777, true);
$path = realpath($print_folder);
}
$exclude = array("THUMBS.db");
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
$table_data = array();
$table_header = array("Name", "Size", "Date Created", "Actions");
foreach ($objects as $name => $object) {
$filename = $object->getFilename();
// Ignore files starting with '.' and in exclude array
if ($filename[0] === '.' || in_array($filename, $exclude)) {
continue;
}
$table_data[] = array(Html::a("/uploads/print/" . $filename, $filename), humanReadableBytes($object->getSize()), date("H:i d/m/Y", filectime($name)), Html::box("/admin/printfile?filename=" . urlencode($name), "Print", true) . " " . Html::b("/admin/deleteprintfile?filename=" . urlencode($name), "Delete", "Are you sure you want to remove this file? (This is irreversible)"));
}
$w->out(Html::table($table_data, null, "tablesorter", $table_header));
}
示例6: taskAjaxGrouptoType_ALL
function taskAjaxGrouptoType_ALL(Web &$w)
{
$types = array();
// split query string into group and assignee
list($group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
$where .= "is_closed = 0";
// get task types from available task list
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->task_type, $types)) {
$types[$task->task_type] = array($task->getTypeTitle(), $task->task_type);
}
}
}
if (!$types) {
$types = array(array("No assigned Tasks", ""));
}
// load type dropdown and return
$tasktypes = Html::select("tasktypes", $types, null);
$w->setLayout(null);
$w->out(json_encode($tasktypes));
}
示例7: addcategory_GET
function addcategory_GET(Web $w)
{
list($parent_id) = $w->pathMatch("a");
$parent = $w->Bend->getWorkCategoryForId($parent_id);
$form = array("Category" => array(array(array("Title", "text", "title", "")), array(array("Description", "text", "description", ""))));
$w->out(Html::multiColForm($form, "/bend-workhours/addcategory/{$parent_id}", "POST", "Save"));
}
示例8: get_GET
function get_GET(Web &$w)
{
$w->setLayout(null);
$p = $w->pathMatch("classname", "id");
$token = $w->request("token");
$w->out($w->Rest->getJson($p['classname'], $p['id'], $token));
}
示例9: profile_GET
function profile_GET(Web &$w)
{
$p = $w->pathMatch("box");
$user = $w->Auth->user();
$contact = $user->getContact();
if ($user) {
$w->ctx("title", "Administration - Profile - " . $user->login);
} else {
$w->error("User does not exist.");
}
$lines = array();
$lines[] = array("Change Password", "section");
$lines[] = array("Password", "password", "password", "");
$lines[] = array("Repeat Password", "password", "password2", "");
$lines[] = array("Contact Details", "section");
$lines[] = array("First Name", "text", "firstname", $contact ? $contact->firstname : "");
$lines[] = array("Last Name", "text", "lastname", $contact ? $contact->lastname : "");
$lines[] = array("Communication", "section");
$lines[] = array("Home Phone", "text", "homephone", $contact ? $contact->homephone : "");
$lines[] = array("Work Phone", "text", "workphone", $contact ? $contact->workphone : "");
$lines[] = array("Private Mobile", "text", "priv_mobile", $contact ? $contact->priv_mobile : "");
$lines[] = array("Work Mobile", "text", "mobile", $contact ? $contact->mobile : "");
$lines[] = array("Fax", "text", "fax", $contact ? $contact->fax : "");
$lines[] = array("Email", "text", "email", $contact ? $contact->email : "");
$lines[] = array("Redirect URL", "text", "redirect_url", $user->redirect_url);
$f = Html::form($lines, $w->localUrl("/auth/profile"), "POST", "Update");
if ($p['box']) {
$w->setLayout(null);
$f = "<h2>Edit Profile</h2>" . $f;
}
$w->out($f);
}
示例10: reportAjaxCategorytoType_ALL
function reportAjaxCategorytoType_ALL(Web $w)
{
$type = array();
list($category, $module) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $w->session('user_id');
$where = array();
if (!empty($module)) {
$where['report.module'] = $module;
}
if (!empty($category)) {
$where['report.category'] = $category;
}
// get report categories from available report list
$reports = $w->Report->getReportsbyUserWhere($who, $where);
if ($reports) {
foreach ($reports as $report) {
$arrtype = preg_split("/,/", $report->sqltype);
foreach ($arrtype as $rtype) {
$rtype = trim($rtype);
if (!array_key_exists(strtolower($rtype), $type)) {
$type[strtolower($rtype)] = array(strtolower($rtype), strtolower($rtype));
}
}
}
}
if (empty($type)) {
$type = array(array("No Reports", ""));
}
$w->setLayout(null);
$w->out(json_encode(Html::select("type", $type)));
}
示例11: taskAjaxPrioritytoStatus_ALL
function taskAjaxPrioritytoStatus_ALL(Web &$w)
{
$status = array();
// split query string into proirity, type, group and assignee
list($priority, $type, $group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
if ($type != "") {
$where .= "task_type = '" . $type . "' and ";
}
if ($priority != "") {
$where .= "priority = '" . $priority . "' and ";
}
$where .= "is_closed = 0";
// get statuses from available tasks
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->status, $status)) {
$status[$task->status] = array($task->status, $task->status);
}
}
}
if (!$status) {
$status = array(array("No assigned Tasks", ""));
}
// load status dropdown and return
$status = Html::select("status", $status, null);
$w->setLayout(null);
$w->out(json_encode($status));
}
示例12: reportAjaxModuletoCategory_ALL
function reportAjaxModuletoCategory_ALL(Web $w)
{
$category = array();
$module = $w->request('id');
// organise criteria
$who = $w->session('user_id');
$where = array();
if ($module != "") {
$where['report.module'] = $module;
}
// get report categories from available report list
$reports = $w->Report->getReportsbyUserWhere($who, $where);
if ($reports) {
foreach ($reports as $report) {
if (!array_key_exists($report->category, $category)) {
$category[$report->category] = array($report->getCategoryTitle(), $report->category);
}
}
}
if (!$category) {
$category = array(array("No Reports", ""));
}
// load Category dropdown and return
$category = Html::select("category", $category);
$w->setLayout(null);
$w->out(json_encode($category));
}
示例13: taskAjaxTypetoPriority_ALL
function taskAjaxTypetoPriority_ALL(Web &$w)
{
$priority = array();
// split the query string into type, group and assignee
list($type, $group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
if ($type != "") {
$where .= "task_type = '" . $type . "' and ";
}
$where .= "is_closed = 0";
// get priorities from available task list
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->priority, $priority)) {
$priority[$task->priority] = array($task->priority, $task->priority);
}
}
}
if (!$priority) {
$priority = array(array("No assigned Tasks", ""));
}
// load priority dropdown and return
$priority = Html::select("tpriority", $priority, null);
$w->setLayout(null);
$w->out(json_encode($priority));
}
示例14: groupedit_GET
/**
* Display edit group dialog
*
* @param <type> $w
*/
function groupedit_GET(Web $w)
{
$option = $w->pathMatch("group_id");
$user = $w->Auth->getUser($option['group_id']);
$template['Edit Group'] = array(array(array("Group Title: ", "text", "title", $user->login)));
$w->out(Html::multiColForm($template, "/admin/groupedit/" . $option['group_id'], "POST", "Save"));
$w->setLayout(null);
}
示例15: edit_GET
function edit_GET(Web $w)
{
$p = $w->pathMatch("id");
$user = !empty($p['id']) ? $w->Auth->getUser($p['id']) : new User($w);
$template[($user->id ? "Edit" : "Create") . ' Group'] = array(array(array("Group Title", "text", "title", $user->login)));
$w->out(Html::multiColForm($template, "/admin-groups/edit/" . $user->id));
$w->setLayout(null);
}