本文整理汇总了PHP中CButton::attr方法的典型用法代码示例。如果您正苦于以下问题:PHP CButton::attr方法的具体用法?PHP CButton::attr怎么用?PHP CButton::attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::attr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CTable
if (!isset($this->data['new_operation']['opmessage']['default_msg'])) {
$this->data['new_operation']['opmessage']['default_msg'] = 0;
}
$usrgrpList = new CTable(null, 'formElementTable');
$usrgrpList->setHeader(array(_('User group'), _('Action')));
$usrgrpList->attr('style', 'min-width: 310px;');
$usrgrpList->setAttribute('id', 'opmsgUsrgrpList');
$addUsrgrpBtn = new CButton('add', _('Add'), 'return PopUp("popup.php?dstfrm=action.edit&srctbl=usrgrp&srcfld1=usrgrpid&srcfld2=name&multiselect=1", 450, 450)', 'link_menu');
$addUsrgrpBtn->attr('id', 'addusrgrpbtn');
$usrgrpList->addRow(new CRow(new CCol($addUsrgrpBtn, null, 2), null, 'opmsgUsrgrpListFooter'));
$userList = new CTable(null, 'formElementTable');
$userList->setHeader(array(_('User'), _('Action')));
$userList->attr('style', 'min-width: 310px;');
$userList->setAttribute('id', 'opmsgUserList');
$addUserBtn = new CButton('add', _('Add'), 'return PopUp("popup.php?dstfrm=action.edit&srctbl=users&srcfld1=userid&srcfld2=fullname&multiselect=1", 450, 450)', 'link_menu');
$addUserBtn->attr('id', 'adduserbtn');
$userList->addRow(new CRow(new CCol($addUserBtn, null, 2), null, 'opmsgUserListFooter'));
// add participations
$usrgrpids = isset($this->data['new_operation']['opmessage_grp']) ? zbx_objectValues($this->data['new_operation']['opmessage_grp'], 'usrgrpid') : array();
$userids = isset($this->data['new_operation']['opmessage_usr']) ? zbx_objectValues($this->data['new_operation']['opmessage_usr'], 'userid') : array();
$usrgrps = API::UserGroup()->get(array('usrgrpids' => $usrgrpids, 'output' => array('name')));
order_result($usrgrps, 'name');
$users = API::User()->get(array('userids' => $userids, 'output' => array('alias', 'name', 'surname')));
order_result($users, 'alias');
foreach ($users as &$user) {
$user['fullname'] = getUserFullname($user);
}
unset($user);
$jsInsert = 'addPopupValues(' . zbx_jsvalue(array('object' => 'usrgrpid', 'values' => $usrgrps)) . ');';
$jsInsert .= 'addPopupValues(' . zbx_jsvalue(array('object' => 'userid', 'values' => $users)) . ');';
zbx_add_post_js($jsInsert);