当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::b方法代码示例

本文整理汇总了PHP中Html::b方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::b方法的具体用法?PHP Html::b怎么用?PHP Html::b使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Html的用法示例。


在下文中一共展示了Html::b方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deploy

 public function deploy($element, $flag, $alias = '', $view = '', $schema = '')
 {
     $h = new Html();
     if ($flag == 0) {
         $attr = '{"id":"' . $alias . '-' . $view . '"}';
         $h->b($element, 0, 1, $schema, $attr);
     } else {
         $h->b($element, 1, 1);
     }
 }
开发者ID:antfuentes87,项目名称:titan,代码行数:10,代码来源:Article.php

示例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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:35,代码来源:index.php

示例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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:36,代码来源:groups.php

示例4: 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) . "&nbsp;&nbsp;&nbsp;" . 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);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:35,代码来源:lookup.php

示例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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:25,代码来源:printqueue.php

示例6: example_example_add_row_action

/**
 * This is an example of a hook that adds things to a screen.
 * Look at /example/actions/index.php where this is called.
 * 
 * @param Web $w
 * @param array $actions
 * @return array the passed in array of actions plus any additional actions
 */
function example_example_add_row_action(Web $w, $params)
{
    $data = $params['data'];
    $actions = $params['actions'];
    $actions[] = Html::b("", "HOOK for id #" . $data->id);
    return $actions;
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:15,代码来源:example.hooks.php

示例7: 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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:33,代码来源:moreInfo.php

示例8: 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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:13,代码来源:index.php

示例9: index_GET

function index_GET($w)
{
    $w->Admin->navigation($w, "Templates");
    $templates = $w->Template->findTemplates();
    $table_header = array("Title", "Module", "Category", array("Active?", true), array("Created", true), array("Modified", true), "Actions");
    $table_data = array();
    if (!empty($templates)) {
        foreach ($templates as $t) {
            $table_data[] = array($t->title, $t->module, $t->category, array($t->is_active ? "Active" : "Inactive", true), array(Date("H:i d-m-Y", $t->dt_created), true), array(Date("H:i d-m-Y", $t->dt_modified), true), Html::b("/admin-templates/edit/" . $t->id, "Edit", false));
        }
    }
    $w->ctx("templates_table", Html::table($table_data, null, "tablesorter", $table_header));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:13,代码来源:index.php

示例10: 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);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:13,代码来源:printers.php

示例11: 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));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:20,代码来源:users.php

示例12: runreport_ALL

function runreport_ALL(Web &$w)
{
    $w->Report->navigation($w, "Generate Report");
    $p = $w->pathMatch("id");
    // if there is a report ID in the URL ...
    if (!empty($p['id'])) {
        // get member
        $member = $w->Report->getReportMember($p['id'], $w->session('user_id'));
        // get the relevant report
        $rep = $w->Report->getReportInfo($p['id']);
        // if report exists, first check status and user role before displaying
        if (!empty($rep)) {
            if ($rep->is_approved == "0" && $member->role != "EDITOR" && !$w->Auth->user()->hasRole("report_admin")) {
                $w->msg($rep->title . ": Report is yet to be approved", "/report/index/");
            } else {
                // display form
                $w->Report->navigation($w, $rep->title);
                if (!empty($member->role) && $member->role == "EDITOR" || $w->Auth->hasRole("report_admin")) {
                    $btnedit = Html::b("/report/viewreport/" . $rep->id, " Edit Report ");
                } else {
                    $btnedit = "";
                }
                // get the form array
                $form = $rep->getReportCriteria();
                // if there is a form display it, otherwise say as much
                if ($form) {
                    $theform = Html::form($form, $w->localUrl("/report/exereport/" . $rep->id), "POST", " Display Report ");
                } else {
                    $theform = "No search criteria?";
                }
                // display
                $w->ctx("btnedit", $btnedit);
                $w->ctx("report", $theform);
            }
        }
    }
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:37,代码来源:runreport.php

示例13: listfeed_ALL

function listfeed_ALL(Web &$w)
{
    $w->Report->navigation($w, "Feeds");
    // get all feeds
    $feeds = $w->Report->getFeeds();
    // prepare table headings
    $line = array(array("Feed", "Report", "Description", "Created", ""));
    // if feeds exists and i am suitably authorised, list them
    if ($feeds && ($w->Auth->user()->hasRole("report_editor") || $w->Auth->user()->hasRole("report_admin"))) {
        foreach ($feeds as $feed) {
            // get report data
            $rep = $w->Report->getReportInfo($feed->report_id);
            // display the details
            if ($rep) {
                $line[] = array($feed->title, $rep->title, $feed->description, formatDateTime($feed->dt_created), Html::b(WEBROOT . "/report/editfeed/" . $feed->id, " View ") . Html::b(WEBROOT . "/report/deletefeed/" . $feed->id, " Delete ", "Are you sure you wish to DELETE this feed?"));
            }
        }
    } else {
        // no feeds and/or no access
        $line[] = array("No feeds to list", "", "", "", "");
    }
    // display results
    $w->ctx("feedlist", Html::table($line, null, "tablesorter", true));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:24,代码来源:listfeed.php

示例14: 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"));
    }
//.........这里部分代码省略.........
开发者ID:itillawarra,项目名称:cmfive,代码行数:101,代码来源:edit.php

示例15: foreach

                    <td><?php 
        echo $household->is_occupied ? "yes" : "";
        ?>
</td>
                    <td>
                        <?php 
        $occupants = $household->getCurrentOccupants();
        if (!empty($occupants)) {
            foreach ($occupants as $oc) {
                echo $oc->getFullname() . ", ";
            }
        }
        ?>
                    </td>
					<td>
						<?php 
        echo Html::b("/bend-household/show/" . $household->getLot()->id . '/' . $household->id, "Details");
        ?>
					</td>
                </tr>
            <?php 
    }
    ?>
        </tbody>
    </table>
<?php 
}
?>


开发者ID:careck,项目名称:bendms,代码行数:28,代码来源:index.tpl.php


注:本文中的Html::b方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。