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


PHP CView::set方法代码示例

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


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

示例1: empty

        $data['usrgrpid'] = $script['usrgrpid'];
        $data['groupid'] = $script['groupid'];
        $data['host_access'] = $script['host_access'];
        $data['confirmation'] = $script['confirmation'];
        $data['enableConfirmation'] = !zbx_empty($script['confirmation']);
        $data['hgstype'] = empty($data['groupid']) ? 0 : 1;
    }
    $scriptView = new CView('administration.script.edit', $data);
    // get host gruop
    $hostGroup = null;
    if (!empty($data['groupid'])) {
        $groups = API::HostGroup()->get(array('groupids' => array($data['groupid']), 'output' => array('groupid', 'name')));
        $groups = reset($groups);
        $hostGroup[] = array('id' => $groups['groupid'], 'name' => $groups['name']);
    }
    $scriptView->set('hostGroup', $hostGroup);
    // get list of user groups
    $usergroups = API::UserGroup()->get(array('output' => array('usrgrpid', 'name')));
    order_result($usergroups, 'name');
    $scriptView->set('usergroups', $usergroups);
    // render view
    $scriptView->render();
    $scriptView->show();
} else {
    $sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'name'));
    $sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
    CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
    CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
    $data = array('sort' => $sortField, 'sortorder' => $sortOrder);
    // list of scripts
    $data['scripts'] = API::Script()->get(array('output' => array('scriptid', 'name', 'command', 'host_access', 'usrgrpid', 'groupid', 'type', 'execute_on'), 'editable' => true, 'selectGroups' => API_OUTPUT_EXTEND));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:scripts.php

示例2: reset

     $script = API::Script()->get(array('scriptids' => $data['scriptid'], 'output' => API_OUTPUT_EXTEND));
     $script = reset($script);
     $data['name'] = $script['name'];
     $data['type'] = $script['type'];
     $data['execute_on'] = $script['execute_on'];
     $data['command'] = $data['commandipmi'] = $script['command'];
     $data['description'] = $script['description'];
     $data['usrgrpid'] = $script['usrgrpid'];
     $data['groupid'] = $script['groupid'];
     $data['access'] = $script['host_access'];
     $data['confirmation'] = $script['confirmation'];
     $data['enableConfirmation'] = !zbx_empty($script['confirmation']);
     $data['hgstype'] = empty($data['groupid']) ? 0 : 1;
 }
 $scriptView = new CView('administration.script.edit');
 $scriptView->set('form', $data['form']);
 $scriptView->set('form_refresh', $data['form_refresh']);
 $scriptView->set('scriptid', $data['scriptid']);
 $scriptView->set('name', $data['name']);
 $scriptView->set('type', $data['type']);
 $scriptView->set('execute_on', $data['execute_on']);
 $scriptView->set('command', $data['command']);
 $scriptView->set('commandipmi', $data['commandipmi']);
 $scriptView->set('description', $data['description']);
 $scriptView->set('usrgrpid', $data['usrgrpid']);
 $scriptView->set('groupid', $data['groupid']);
 $scriptView->set('access', $data['access']);
 $scriptView->set('confirmation', $data['confirmation']);
 $scriptView->set('enableConfirmation', $data['enableConfirmation']);
 $scriptView->set('hgstype', $data['hgstype']);
 // get host gruop
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:scripts.php


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