本文整理汇总了PHP中Html::box方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::box方法的具体用法?PHP Html::box怎么用?PHP Html::box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::box方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lookup_ALL
function lookup_ALL(Web &$w)
{
$w->Admin->navigation($w, "Lookup");
$types = $w->Admin->getLookupTypes();
$typelist = Html::select("type", $types, $w->request('type'));
$w->ctx("typelist", $typelist);
// tab: Lookup List
$where = array();
if (NULL == $w->request('reset')) {
if ($w->request('type') != "") {
$where['type'] = $w->request('type');
}
} else {
// Reset called, unset vars
if ($w->request("type") !== null) {
unset($_REQUEST["type"]);
}
var_dump($_REQUEST);
}
$lookup = $w->Admin->getAllLookup($where);
$line[] = array("Type", "Code", "Title", "Actions");
if ($lookup) {
foreach ($lookup as $look) {
$line[] = array($look->type, $look->code, $look->title, Html::box($w->localUrl("/admin/editlookup/" . $look->id . "/" . urlencode($w->request('type'))), " Edit ", true) . " " . Html::b($w->webroot() . "/admin/deletelookup/" . $look->id . "/" . urlencode($w->request('type')), " Delete ", "Are you sure you wish to DELETE this Lookup item?"));
}
} else {
$line[] = array("No Lookup items to list", null, null, null);
}
// display list of items, if any
$w->ctx("listitem", Html::table($line, null, "tablesorter", true));
// tab: new lookup item
$types = $w->Admin->getLookupTypes();
$f = Html::form(array(array("Create a New Entry", "section"), array("Type", "select", "type", null, $types), array("or Add New Type", "text", "ntype"), array("Key", "text", "code"), array("Value", "text", "title")), $w->localUrl("/admin/newlookup/"), "POST", " Save ");
$w->ctx("newitem", $f);
}
示例2: index_ALL
/**
* @hook example_add_row_action(array(<ExampleData> 'data', <String> 'actions')
* @param Web $w
*/
function index_ALL(Web $w)
{
// adding data to the template context
$w->ctx("message", "Example Data List");
// get the list of data objects
$listdata = $w->Example->getAllData();
// prepare table data
$t[] = array("Title", "Data", "Actions");
// table header
if (!empty($listdata)) {
foreach ($listdata as $d) {
$row = array();
$row[] = $d->title;
$row[] = $d->data;
// prepare action buttons for each row
$actions = array();
if ($d->canEdit($w->Auth->user())) {
$actions[] = Html::box("/example/edit/" . $d->id, "Edit", true);
}
if ($d->canDelete($w->Auth->user())) {
$actions[] = Html::b("/example/delete/" . $d->id, "Delete", "Really delete?");
}
// allow any other module to add actions here
$actions = $w->callHook("example", "add_row_action", array("data" => $d, "actions" => $actions));
$row[] = implode(" ", $actions);
$t[] = $row;
}
}
// create the html table and put into template context
$w->ctx("table", Html::table($t, "table", "tablesorter", true));
}
示例3: groups_GET
/**
* Display a list of all groups which are not deleted
*
* @param <type> $w
*/
function groups_GET(Web &$w)
{
$w->Admin->navigation($w, "Groups");
$table = array(array("Title", "Parent Groups", "Operations"));
$groups = $w->Auth->getGroups();
if ($groups) {
foreach ($groups as $group) {
$ancestors = array();
$line = array();
$line[] = $w->Auth->user()->is_admin ? Html::box($w->localUrl("/admin/groupedit/" . $group->id), "<u>" . $group->login . "</u>") : $group->login;
//if it is a sub group from other group;
$groupUsers = $group->isInGroups();
if ($groupUsers) {
foreach ($groupUsers as $groupUser) {
$ancestors[] = $groupUser->getGroup()->login;
}
}
$line[] = count($ancestors) > 0 ? "<div style=\"color:green;\">" . implode(", ", $ancestors) . "</div>" : "";
$operations = Html::b("/admin/moreInfo/" . $group->id, "More Info");
if ($w->Auth->user()->is_admin) {
$operations .= Html::b("/admin/groupdelete/" . $group->id, "Delete", "Are you sure you want to delete this group?");
}
$line[] = $operations;
$table[] = $line;
}
}
if ($w->Auth->user()->is_admin) {
$w->out(Html::box("/admin/groupadd", "New Group", true));
}
$w->out(Html::table($table, null, "tablesorter", true));
}
示例4: 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));
}
示例5: moreInfo_GET
/**
* Display member and permission infomation
*
* @param <type> $w
*/
function moreInfo_GET(Web &$w)
{
$option = $w->pathMatch("group_id");
$w->Admin->navigation($w, $w->Auth->getUser($option['group_id'])->login);
if ($w->Auth->user()->is_admin || $w->Auth->getRoleForLoginUser($option['group_id'], $w->Auth->user()->id) == "owner") {
$w->ctx("addMember", Html::box("/admin/groupmember/" . $option['group_id'], "New Member", true));
}
$w->ctx("editPermission", Html::b("/admin/permissionedit/" . $option['group_id'], "Edit Permissions"));
//fill in member table;
$table = array(array("Name", "Role", "Operations"));
$groupMembers = $w->Auth->getGroupMembers($option['group_id']);
if ($groupMembers) {
foreach ($groupMembers as $groupMember) {
$line = array();
$style = $groupMember->role == "owner" ? "<div style=\"color:red;\">" : "<div style=\"color:blue;\">";
$name = $groupMember->getUser()->is_group == 1 ? $groupMember->getUser()->login : $groupMember->getUser()->getContact()->getFullName();
$line[] = $style . $name . "</div>";
$line[] = $style . $groupMember->role . "</div>";
if ($w->Auth->user()->is_admin || $w->Auth->getRoleForLoginUser($option['group_id'], $w->Auth->user()->id) == "owner") {
$line[] = Html::a("/admin/memberdelete/" . $option['group_id'] . "/" . $groupMember->id, "Delete", null, null, "Are you sure you want to delete this member?");
} else {
$line[] = null;
}
$table[] = $line;
}
}
$w->ctx("memberList", Html::table($table, null, "tablesorter", true));
}
示例6: printers_GET
function printers_GET(Web $w)
{
$printers = $w->Printer->getPrinters();
$table_data = array();
$table_header = array("Name", "Server", "Port", "Actions");
if (!empty($printers)) {
foreach ($printers as $printer) {
$table_data[] = array($printer->name, $printer->server, $printer->port, Html::box("/admin/editprinter/{$printer->id}", "Edit", true) . Html::b("/admin/deleteprinter/{$printer->id}", "Delete", "Are you sure you want to delete this printer?"));
}
}
$w->ctx("table_header", $table_header);
$w->ctx("table_data", $table_data);
}
示例7: index_ALL
function index_ALL(Web $w)
{
$connections = $w->Report->getConnections();
$table_header = array("Driver", "Host", "Database", "Port", "Username", "Actions");
$table_body = array();
if (!empty($connections)) {
foreach ($connections as $conn) {
$conn->decrypt();
$table_body[] = array($conn->db_driver, $conn->db_host, $conn->db_database, $conn->db_port, $conn->s_db_user, Html::box("/report-connections/test/{$conn->id}", "Test Connection", true) . Html::box("/report-connections/edit/{$conn->id}", "Edit", true) . Html::b("/report-connections/delete/{$conn->id}", "Delete", "Are you sure you want to remove this connection?"));
}
}
$w->ctx("connections_table", Html::table($table_body, null, "tablesorter", $table_header));
}
示例8: viewmembergroup_GET
function viewmembergroup_GET(Web $w)
{
$p = $w->pathMatch("id");
// tab: Members
// get all members in a task group given a task group ID
$member_group = $w->Task->getMemberGroup($p['id']);
// get the group attributes given a task group ID
$group = $w->Task->getTaskGroup($p['id']);
// put the group title into the page heading
$w->Task->navigation($w, "Task Group - " . $group->title);
History::add("Task Group: " . $group->title);
// set columns headings for display of members
$line[] = array("Member", "Role", "");
// if their are members, display their full name, role and buttons to edit or delete the member
if ($member_group) {
foreach ($member_group as $member) {
$line[] = array($w->Task->getUserById($member->user_id), $member->role, Html::box(WEBROOT . "/task-group/viewmember/" . $member->id, " Edit ", true) . " " . Html::box(WEBROOT . "/task-group/deletegroupmember/" . $member->id, " Delete ", true));
}
} else {
// if there are no members, say as much
$line[] = array("Group currently has no members. Please Add New Members.", "", "");
}
// enter task group attributes sa query string for buttons providing group specific functions such as delete or add members
$w->ctx("taskgroup", $group->task_group_type);
$w->ctx("grpid", $group->id);
$w->ctx("groupid", $p['id']);
// display list of group members
$w->ctx("viewmembers", Html::table($line, null, "tablesorter", true));
// tab: Notify
$notify = $w->Task->getTaskGroupNotify($group->id);
if ($notify) {
foreach ($notify as $n) {
$v[$n->role][$n->type] = $n->value;
}
} else {
$v['guest']['creator'] = 0;
$v['member']['creator'] = 0;
$v['member']['assignee'] = 0;
$v['owner']['creator'] = 0;
$v['owner']['assignee'] = 0;
$v['owner']['other'] = 0;
}
$notifyForm['Task Group Notifications'] = array(array(array("", "hidden", "task_group_id", $group->id)), array(array("", "static", ""), array("Creator", "static", "creator"), array("Assignee", "static", "assignee"), array("All Others", "static", "others")), array(array("Guest", "static", "guest"), array("", "checkbox", "guest_creator", $v['guest']['creator'])), array(array("Member", "static", "member"), array("", "checkbox", "member_creator", $v['member']['creator']), array("", "checkbox", "member_assignee", $v['member']['assignee'])), array(array("Owner", "static", "owner"), array("", "checkbox", "owner_creator", $v['owner']['creator']), array("", "checkbox", "owner_assignee", $v['owner']['assignee']), array("", "checkbox", "owner_other", $v['owner']['other'])));
$w->ctx("notifymatrix", Html::multiColForm($notifyForm, $w->localUrl("/task-group/updategroupnotify/"), "POST", " Submit "));
}
示例9: users_GET
function users_GET(Web &$w)
{
$w->Admin->navigation($w, "Users");
$header = array("Login", "First Name", "Last Name", array("Admin", true), array("Active", true), array("Created", true), array("Last Login", true), "Operations");
// $result = $w->db->sql("select user.id as id,login,firstname,lastname,is_admin,is_active,user.dt_created as dt_created,dt_lastlogin from user left join contact on user.contact_id = contact.id where user.is_deleted = 0 AND user.is_group = 0")->fetch_all();
// $result = $w->db->get("user")->select("user.*, contact.*")->leftJoin("contact on user.contact_id = contact.id")->where("user.is_deleted", 0)->where("user.is_group", 0)->fetch_all();
$users = $w->Admin->getObjects("User", array("is_deleted" => 0, "is_group" => 0));
$data = array();
foreach ($users as $user) {
$contact = $user->getContact();
$firstName = '';
$lastName = '';
if (!empty($contact)) {
$firstName = $contact->firstname;
$lastName = $contact->lastname;
}
$data[] = array($user->login, $firstName, $lastName, array($user->is_admin ? "X" : "", true), array($user->is_active ? "X" : "", true), array($w->Admin->time2Dt($user->dt_created), true), array($w->Admin->time2Dt($user->dt_lastlogin), true), Html::box($w->localUrl("/admin/useredit/" . $user->id . "/box"), "Edit", true) . Html::b("/admin/permissionedit/" . $user->id, "Permissions") . Html::b($w->localUrl("/admin/userdel/" . $user->id), "Delete", "Are you sure to delete this user?"));
}
$w->ctx("table", Html::table($data, null, "tablesorter", $header));
}
示例10: viewMemberstab
static function viewMemberstab(Web &$w, $id)
{
// return list of members of given report
$members = $w->Report->getReportMembers($id);
// get report details
$report = $w->Report->getReportInfo($id);
// set columns headings for display of members
$line[] = array("Member", "Role", "");
// if there are members, display their full name, role and button to delete the member
if ($members) {
foreach ($members as $member) {
$line[] = array($w->Report->getUserById($member->user_id), $member->role, Html::box("/report/editmember/" . $report->id . "/" . $member->user_id, " Edit ", true) . " " . Html::box("/report/deletemember/" . $report->id . "/" . $member->user_id, " Delete ", true));
}
} else {
// if there are no members, say as much
$line[] = array("Group currently has no members. Please Add New Members.", "", "");
}
$w->ctx("reportid", $report->id);
// display list of group members
$w->ctx("viewmembers", Html::table($line, null, "tablesorter", true));
}
示例11: edit_GET
function edit_GET($w)
{
$p = $w->pathMatch("id");
$task = !empty($p["id"]) ? $w->Task->getTask($p["id"]) : new Task($w);
if (!empty($task->id) && !$task->canView($w->Auth->user())) {
$w->error("You do not have permission to edit this Task", "/task/tasklist");
}
// Get a list of the taskgroups and filter by what can be used
$taskgroups = array_filter($w->Task->getTaskGroups(), function ($taskgroup) {
return $taskgroup->getCanICreate();
});
$tasktypes = array();
$priority = array();
$members = array();
// Try and prefetch the taskgroup by given id
$taskgroup = null;
$taskgroup_id = $w->request("gid");
if (!empty($taskgroup_id) || !empty($task->task_group_id)) {
$taskgroup = $w->Task->getTaskGroup(!empty($task->task_group_id) ? $task->task_group_id : $taskgroup_id);
if (!empty($taskgroup->id)) {
$tasktypes = $w->Task->getTaskTypes($taskgroup->task_group_type);
$priority = $w->Task->getTaskPriority($taskgroup->task_group_type);
$members = $w->Task->getMembersBeAssigned($taskgroup->id);
sort($members);
}
}
// Create form
$form = array(!empty($p["id"]) ? "Edit task" : "Create a new task" => array(array(!empty($p["id"]) ? array("Task Group", "text", "-task_group_id_text", $taskgroup->title) : array("Task Group", "autocomplete", "task_group_id", !empty($task->task_group_id) ? $task->task_group_id : $taskgroup_id, $taskgroups), !empty($p["id"]) ? array("Task Type", "select", "-task_type", $task->task_type, $tasktypes) : array("Task Type", "select", "task_type", $task->task_type, $tasktypes)), array(array("Task Title", "text", "title", $task->title), array("Status", "select", "status", $task->status, $task->getTaskGroupStatus())), array(array("Priority", "select", "priority", $task->priority, $priority), array("Date Due", "date", "dt_due", formatDate($task->dt_due)), !empty($taskgroup) && $taskgroup->getCanIAssign() ? array("Assigned To", "select", "assignee_id", $task->assignee_id, $members) : array("Assigned To", "select", "-assignee_id", $task->assignee_id, $members)), array(array("Description", "textarea", "description", $task->description))));
if (empty($p['id'])) {
History::add("New Task");
} else {
History::add("Task: {$task->title}");
}
$w->ctx("task", $task);
$w->ctx("form", Html::multiColForm($form, $w->localUrl("/task/edit/{$task->id}"), "POST", "Save", "edit_form"));
//////////////////////////
// Build time log table //
//////////////////////////
$timelog = $task->getTimeLog();
$total_seconds = 0;
$table_header = array("Assignee", "Start", "Period (hours)", "Comment", "Actions");
$table_data = array();
if (!empty($timelog)) {
// for each entry display, calculate period and display total time on task
foreach ($timelog as $log) {
// get time difference, start to end
$seconds = $log->dt_end - $log->dt_start;
$period = $w->Task->getFormatPeriod($seconds);
$comment = $w->Comment->getComment($log->comment_id);
$comment = !empty($comment) ? $comment->comment : "";
$table_row = array($w->Task->getUserById($log->user_id), formatDateTime($log->dt_start), $period, !empty($comment) ? $w->Comment->renderComment($comment) : "");
// Build list of buttons
$buttons = '';
if ($log->is_suspect == "0") {
$total_seconds += $seconds;
$buttons .= Html::box($w->localUrl("/task/addtime/" . $task->id . "/" . $log->id), " Edit ", true);
}
if ($w->Task->getIsOwner($task->task_group_id, $w->Auth->user()->id)) {
$buttons .= Html::b($w->localUrl("/task/suspecttime/" . $task->id . "/" . $log->id), empty($log->is_suspect) || $log->is_suspect == "0" ? "Review" : "Accept");
}
$buttons .= Html::b($w->localUrl("/task/deletetime/" . $task->id . "/" . $log->id), "Delete", "Are you sure you wish to DELETE this Time Log Entry?");
$table_row[] = $buttons;
$table_data[] = $table_row;
}
$table_data[] = array("<b>Total</b>", "", "<b>" . $w->Task->getFormatPeriod($total_seconds) . "</b>", "", "");
}
// display the task time log
$w->ctx("timelog", Html::table($table_data, null, "tablesorter", $table_header));
///////////////////
// Notifications //
///////////////////
$notify = null;
// If I am assignee, creator or task group owner, I can get notifications for this task
if (!empty($task->id) && $task->getCanINotify()) {
// get User set notifications for this Task
$notify = $w->Task->getTaskUserNotify($w->Auth->user()->id, $task->id);
if (empty($notify)) {
$logged_in_user_id = $w->Auth->user()->id;
// Get my role in this task group
$me = $w->Task->getMemberGroupById($task->task_group_id, $logged_in_user_id);
$type = "";
if ($task->assignee_id == $logged_in_user_id) {
$type = "assignee";
} else {
if ($task->getTaskCreatorId() == $logged_in_user_id) {
$type = "creator";
} else {
if ($w->Task->getIsOwner($task->task_group_id, $logged_in_user_id)) {
$type = "other";
}
}
}
if (!empty($type) && !empty($me)) {
$notify = $w->Task->getTaskGroupUserNotifyType($logged_in_user_id, $task->task_group_id, strtolower($me->role), $type);
}
}
// create form. if still no 'notify' all boxes are unchecked
$form = array("Notification Events" => array(array(array("", "hidden", "task_creation", "0")), array(array("Task Details Update", "checkbox", "task_details", !empty($notify->task_details) ? $notify->task_details : null), array("Comments Added", "checkbox", "task_comments", !empty($notify->task_comments) ? $notify->task_comments : null)), array(array("Time Log Entry", "checkbox", "time_log", !empty($notify->time_log) ? $notify->time_log : null), array("Task Data Updated", "checkbox", "task_data", !empty($notify->task_data) ? $notify->task_data : null)), array(array("Documents Added", "checkbox", "task_documents", !empty($notify->task_documents) ? $notify->task_documents : null))));
$w->ctx("tasknotify", Html::multiColForm($form, $w->localUrl("/task/updateusertasknotify/" . $task->id), "POST"));
}
//.........这里部分代码省略.........
示例12:
<td><?php
echo !empty($channel->name) ? $channel->name : "";
?>
</td>
<td>
<?php
echo Html::box("/channels-processor/edit/{$p->id}", "Edit");
?>
<?php
echo Html::a("/channels-processor/delete/{$p->id}", "Delete", null, null, "Are you sure you want to delete " . (!empty($p->name) ? $p->name : "this processor") . "?");
?>
<?php
// Only show edit settings form if it returns something
$class = new $p->class($w);
if (method_exists($class, "getSettingsForm")) {
$form = $class->getSettingsForm($p->settings);
if (!empty($form)) {
echo Html::box("/channels-processor/editsettings/{$p->id}", "Edit Settings");
}
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
示例13: addslashes
</td>
<td><?php
echo $base_channel->is_active ? "ON" : "OFF";
?>
</td>
<td><?php
echo $base_channel->notify_user_email;
?>
</td>
<td><?php
$user = $base_channel->getNotifyUser();
echo !empty($user->id) ? $user->getFullName() : "";
?>
<td>
<?php
echo Html::box("/channels-{$c->_channeltype}/edit/{$base_channel->id}", "Edit");
?>
<?php
echo Html::a("/channels-email/delete/{$base_channel->id}", "Delete", null, null, "Are you sure you want to delete " . (!empty($base_channel->name) ? addslashes($base_channel->name) : "this channel") . "?");
?>
<?php
echo Html::a("/channels/listmessages/{$base_channel->id}", "Messages");
?>
</td>
</tr>
<?php
}
?>
<?php
}
?>
示例14: foreach
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php
}
?>
<hr/>
<h2>Households</h2>
<?php
echo Html::box("/bend-household/edit/" . $lot->id, "Add Household", true);
if (!empty($households)) {
?>
<table width="80%">
<thead>
<tr>
<th>Street Number</th>
<th>CHL?</th>
<th>Occupied?</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach ($households as $household) {
?>
示例15:
?>
</div>
<?php
if (!empty($report->id)) {
?>
<div id="templates">
<?php
echo Html::box("/report-templates/edit/{$report->id}", "Add Template", true);
?>
<?php
echo !empty($templates_table) ? $templates_table : "";
?>
</div>
<div id="members" style="display: none;" class="clearfix">
<?php
echo Html::box("/report/addmembers/" . $report->id, " Add New Members ", true);
?>
<?php
echo $viewmembers;
?>
</div>
<?php
}
?>
<div id="database" style="display: none;" class="clearfix">
<?php
echo $dbform;
?>
</div>
</div>
</div>