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


PHP CSpan::attr方法代码示例

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


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

示例1: elseif

    $form->show();
} elseif ($srctbl == 'users') {
    $form = new CForm();
    $form->setName('userform');
    $form->setAttribute('id', 'users');
    $table = new CTableInfo(_('No users found.'));
    $table->setHeader(array($multiselect ? new CCheckBox('all_users', null, "javascript: checkAll('" . $form->getName() . "', 'all_users', 'users');") : null, _('Alias'), _('Name'), _('Surname')));
    $options = array('nodeids' => $nodeId, 'output' => array('alias', 'name', 'surname', 'type', 'theme', 'lang'), 'preservekeys' => true);
    if (!is_null($writeonly)) {
        $options['editable'] = true;
    }
    $users = API::User()->get($options);
    order_result($users, 'alias');
    foreach ($users as &$user) {
        $alias = new CSpan($user['alias'], 'link');
        $alias->attr('id', 'spanid' . $user['userid']);
        if (isset($srcfld2) && $srcfld2 == 'fullname') {
            $user[$srcfld2] = getUserFullname($user);
        }
        if ($multiselect) {
            $js_action = 'javascript: addValue(' . zbx_jsvalue($reference) . ', ' . zbx_jsvalue($user['userid']) . ');';
        } else {
            $values = array($dstfld1 => $user[$srcfld1]);
            if (isset($srcfld2)) {
                $values[$dstfld2] = $user[$srcfld2];
            }
            $js_action = 'javascript: addValues(' . zbx_jsvalue($dstfrm) . ', ' . zbx_jsvalue($values) . '); close_window(); return false;';
        }
        $alias->setAttribute('onclick', $js_action . ' jQuery(this).removeAttr("onclick");');
        $table->addRow(array($multiselect ? new CCheckBox('users[' . zbx_jsValue($user[$srcfld1]) . ']', null, null, $user['userid']) : null, $alias, $user['name'], $user['surname']));
    }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:popup.php

示例2: make_trigger_details

function make_trigger_details($trigger)
{
    $table = new CTableInfo();
    if (is_show_all_nodes()) {
        $table->addRow(array(_('Node'), get_node_name_by_elid($trigger['triggerid'])));
    }
    $expression = explode_exp($trigger['expression'], true, true);
    $host = API::Host()->get(array('output' => array('name', 'hostid'), 'hostids' => $trigger['hosts'][0]['hostid'], 'selectScreens' => API_OUTPUT_COUNT, 'selectInventory' => array('hostid'), 'preservekeys' => true));
    $host = reset($host);
    $hostScripts = API::Script()->getScriptsByHosts($host['hostid']);
    // host js link
    $hostSpan = new CSpan($host['name'], 'link_menu menu-host');
    $scripts = $hostScripts[$host['hostid']];
    $hostSpan->attr('data-menu', hostMenuData($host, $scripts));
    // get visible name of the first host
    $table->addRow(array(_('Host'), $hostSpan));
    $table->addRow(array(_('Trigger'), CTriggerHelper::expandDescription($trigger)));
    $table->addRow(array(_('Severity'), getSeverityCell($trigger['priority'])));
    $table->addRow(array(_('Expression'), $expression));
    $table->addRow(array(_('Event generation'), _('Normal') . (TRIGGER_MULT_EVENT_ENABLED == $trigger['type'] ? SPACE . '+' . SPACE . _('Multiple PROBLEM events') : '')));
    $table->addRow(array(_('Disabled'), TRIGGER_STATUS_ENABLED == $trigger['status'] ? new CCol(_('No'), 'off') : new CCol(_('Yes'), 'on')));
    return $table;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:23,代码来源:triggers.inc.php


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