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


PHP Web::setLayout方法代码示例

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


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

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

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

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

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

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

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

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

示例8: printview_GET

function printview_GET(Web &$w)
{
    $p = $w->pathMatch("table", "id");
    $attachments = $w->service("File")->getAttachments($p['table'], $p['$id']);
    $w->ctx("attachments", $attachments);
    $w->setLayout(null);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:printview.php

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

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

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

示例12: token_GET

function token_GET(Web &$w)
{
    $w->setLayout(null);
    $username = $w->request("username");
    $password = $w->request("password");
    $api = $w->request("api");
    $w->out($w->Rest->getTokenJson($username, $password, $api));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:8,代码来源:token.php

示例13: index_ALL

function index_ALL(Web &$w)
{
    // $w->out(print_r($w->Search->getIndexes(),true));
    $w->ctx("indexes", $w->Search->getIndexes());
    if ($w->request("isbox") !== NULL) {
        $w->setLayout(null);
    }
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:8,代码来源:index.php

示例14: taskAjaxSelectbyTable_ALL

function taskAjaxSelectbyTable_ALL(Web $w)
{
    $tbl = $_REQUEST['id'];
    // create dropdowns loaded with respective data
    $dbfields = $w->Report->getFieldsinTable($tbl);
    $w->setLayout(null);
    $w->out(json_encode($dbfields));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:8,代码来源:taskAjaxSelectbyTable.php

示例15: callchannel_ALL

function callchannel_ALL(Web $w)
{
    $w->setLayout(null);
    $p = $w->pathMatch("id");
    $id = $p["id"];
    $channel = $w->Channel->getEmailChannel($id);
    $channel->doJob();
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:8,代码来源:callchannel.php


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