當前位置: 首頁>>代碼示例>>PHP>>正文


PHP url_params函數代碼示例

本文整理匯總了PHP中url_params函數的典型用法代碼示例。如果您正苦於以下問題:PHP url_params函數的具體用法?PHP url_params怎麽用?PHP url_params使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了url_params函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CFormTable

    }
}
$messageTable = new CFormTable($title . ' "' . getUserFullname(CWebUser::$data) . '"');
$messageTable->addVar('backurl', $_REQUEST['backurl']);
if (in_array($_REQUEST['backurl'], array('tr_events.php', 'events.php'))) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
    $messageTable->addVar('triggerid', $_REQUEST['triggerid']);
} elseif (in_array($_REQUEST['backurl'], array('screenedit.php', 'screens.php'))) {
    $messageTable->addVar('screenid', $_REQUEST['screenid']);
}
if (isset($_REQUEST['eventid'])) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
} elseif (isset($_REQUEST['triggers'])) {
    foreach ($_REQUEST['triggers'] as $triggerId) {
        $messageTable->addVar('triggers[' . $triggerId . ']', $triggerId);
    }
} elseif (isset($_REQUEST['events'])) {
    foreach ($_REQUEST['events'] as $eventId) {
        $messageTable->addVar('events[' . $eventId . ']', $eventId);
    }
}
$message = new CTextArea('message', '', array('rows' => ZBX_TEXTAREA_STANDARD_ROWS, 'width' => ZBX_TEXTAREA_BIG_WIDTH, 'maxlength' => 255));
$message->attr('autofocus', 'autofocus');
$messageTable->addRow(_('Message'), $message);
$messageTable->addItemToBottomRow(new CSubmit('saveandreturn', $saveAndReturnLabel));
if (!$bulk) {
    $messageTable->addItemToBottomRow(new CSubmit('save', $saveLabel));
}
$messageTable->addItemToBottomRow(new CButtonCancel(url_params(array('backurl', 'eventid', 'triggerid', 'screenid'))));
$messageTable->show(false);
require_once dirname(__FILE__) . '/include/page_footer.php';
開發者ID:SandipSingh14,項目名稱:Zabbix_,代碼行數:31,代碼來源:acknow.php

示例2: CWidget

** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$widget = (new CWidget())->setTitle(_('Applications'))->addItem(get_header_host_table('applications', $this->data['hostid']));
// create form
$applicationForm = (new CForm())->addVar('form', $this->data['form'])->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['applicationid'])) {
    $applicationForm->addVar('applicationid', $this->data['applicationid']);
}
// append tabs to form
$applicationTab = (new CTabView())->addTab('applicationTab', _('Application'), (new CFormList())->addRow(_('Name'), (new CTextBox('appname', $this->data['appname']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)->setAttribute('autofocus', 'autofocus')));
// append buttons to form
if (!empty($this->data['applicationid'])) {
    $applicationTab->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete application?'), url_params(['hostid', 'form', 'applicationid'])), new CButtonCancel(url_param('hostid'))]));
} else {
    $applicationTab->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel(url_param('hostid'))]));
}
$applicationForm->addItem($applicationTab);
// append form to widget
$widget->addItem($applicationForm);
return $widget;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:configuration.application.edit.php

示例3: CTabView

// append tabs to form
$itemTab = new CTabView();
$itemTab->addTab('itemTab', $this->data['caption'], $itemFormList);
$itemForm->addItem($itemTab);
// append buttons to form
$buttons = array();
if (!empty($this->data['itemid'])) {
    array_push($buttons, new CSubmit('clone', _('Clone')));
    if (!$this->data['is_template'] && !empty($this->data['itemid']) && empty($this->data['parent_discoveryid']) && !$this->data['is_discovery_rule']) {
        array_push($buttons, new CButtonQMessage('del_history', _('Clear history and trends'), _('History clearing can take a long time. Continue?')));
    }
    if (!$this->data['limited']) {
        if ($this->data['is_discovery_rule']) {
            array_push($buttons, new CButtonDelete(_('Delete discovery rule?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid'))));
        } else {
            array_push($buttons, new CButtonDelete(_('Delete item?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid'))));
        }
    }
}
array_push($buttons, new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid')));
$itemForm->addItem(makeFormFooter(array(new CSubmit('save', _('Save'))), $buttons));
$itemWidget->addItem($itemForm);
/*
 * Visibility
 */
$this->data['typeVisibility'] = array();
$i = 0;
foreach ($this->data['delay_flex'] as $delayFlex) {
    if (!isset($delayFlex['delay']) && !isset($delayFlex['period'])) {
        continue;
    }
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:configuration.item.edit.php

示例4: empty

if (!$this->data['form_refresh']) {
    $graphTab->setSelected(0);
}
$graphTab->addTab('graphTab', empty($this->data['parent_discoveryid']) ? _('Graph') : _('Graph prototype'), $graphFormList);
/*
 * Preview tab
 */
$chartImage = new CImg('chart3.php?period=3600');
$chartImage->preload();
$graphPreviewTable = new CTable(null, 'center maxwidth');
$graphPreviewTable->addRow(new CDiv($chartImage, null, 'previewChar'));
$graphTab->addTab('previewTab', _('Preview'), $graphPreviewTable);
$graphForm->addItem($graphTab);
// append buttons to form
if (!empty($this->data['graphid'])) {
    $updateButton = new CSubmit('update', _('Update'));
    $deleteButton = new CButtonDelete($this->data['parent_discoveryid'] ? _('Delete graph prototype?') : _('Delete graph?'), url_params(array('graphid', 'parent_discoveryid', 'hostid')));
    if (!empty($this->data['templateid'])) {
        $updateButton->setEnabled(false);
        $deleteButton->setEnabled(false);
    }
    $graphForm->addItem(makeFormFooter($updateButton, array(new CSubmit('clone', _('Clone')), $deleteButton, new CButtonCancel(url_param('parent_discoveryid')))));
} else {
    $graphForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel(url_param('parent_discoveryid'))));
}
// insert js (depended from some variables inside the file)
insert_show_color_picker_javascript();
require_once dirname(__FILE__) . '/js/configuration.graph.edit.js.php';
// append form to widget
$graphWidget->addItem($graphForm);
return $graphWidget;
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:31,代碼來源:configuration.graph.edit.php

示例5: build_nav

function build_nav($tree, $url_params = false)
{
    // Remove Index
    unset($tree['index']);
    if (!is_array($url_params)) {
        $url_params = url_params();
    }
    $url_path = url_path();
    $html = '<ul class="nav nav-list">';
    foreach ($tree as $key => $val) {
        // Active Tree Node
        if (isset($url_params[0]) && $url_params[0] == $val['clean']) {
            array_shift($url_params);
            // Final Node
            if ($url_path == $val['url']) {
                $html .= '<li class="active">';
            } else {
                $html .= '<li class="open">';
            }
        } else {
            $html .= '<li>';
        }
        if ($val['type'] == 'folder') {
            $html .= '<a href="#" class="aj-nav folder">' . $val['name'] . '</a>';
            $html .= build_nav($val['tree'], $url_params);
        } else {
            $html .= '<a href="' . $val['url'] . '">' . $val['name'] . '</a>';
        }
        $html .= '</li>';
    }
    $html .= '</ul>';
    return $html;
}
開發者ID:19830829,項目名稱:I-A-3-Documentation,代碼行數:33,代碼來源:functions.php

示例6: CTabView

// append tabs to form
$itemTab = new CTabView();
$itemTab->addTab('itemTab', $this->data['caption'], $itemFormList);
$itemForm->addItem($itemTab);
// append buttons to form
$buttons = array();
if (!empty($this->data['itemid'])) {
    array_push($buttons, new CSubmit('clone', _('Clone')));
    if (!$this->data['is_template'] && !empty($this->data['itemid']) && empty($this->data['parent_discoveryid']) && !$this->data['is_discovery_rule']) {
        array_push($buttons, new CButtonQMessage('del_history', _('Clear history and trends'), _('History clearing can take a long time. Continue?')));
    }
    if (!$this->data['limited']) {
        if ($this->data['is_discovery_rule']) {
            array_push($buttons, new CButtonDelete(_('Delete discovery rule?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid', 'hostid'))));
        } else {
            $buttons[] = new CButtonDelete($this->data['parent_discoveryid'] ? _('Delete item prototype?') : _('Delete item?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid', 'hostid')));
        }
    }
}
array_push($buttons, new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid')));
$itemForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), $buttons));
$itemWidget->addItem($itemForm);
/*
 * Visibility
 */
$this->data['typeVisibility'] = array();
$i = 0;
foreach ($this->data['delay_flex'] as $delayFlex) {
    if (!isset($delayFlex['delay']) && !isset($delayFlex['period'])) {
        continue;
    }
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:31,代碼來源:configuration.item.edit.php

示例7: CButton

}
$addButton = new CButton('macro_add', _('Add'), null, 'link_menu element-table-add');
$buttonColumn = new CCol($addButton);
$buttonColumn->setAttribute('colspan', 5);
$buttonRow = new CRow();
$buttonRow->setAttribute('id', 'row_new_macro');
$buttonRow->addItem($buttonColumn);
$conditionTable->addRow($buttonRow);
$conditionFormList->addRow(_('Filters'), new CDiv($conditionTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$itemTab = new CTabView();
if (!hasRequest('form_refresh')) {
    $itemTab->setSelected(0);
}
$itemTab->addTab('itemTab', $this->data['caption'], $itemFormList);
$itemTab->addTab('macroTab', _('Filters'), $conditionFormList);
$itemForm->addItem($itemTab);
// append buttons to form
if (!empty($this->data['itemid'])) {
    if (!$this->data['limited']) {
        $btnDelete = new CButtonDelete(_('Delete discovery rule?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid', 'hostid')));
    } else {
        $btnDelete = null;
    }
    $itemForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CSubmit('clone', _('Clone')), $btnDelete, new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid')))));
} else {
    $itemForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid'))));
}
$itemWidget->addItem($itemForm);
require_once dirname(__FILE__) . '/js/configuration.host.discovery.edit.js.php';
return $itemWidget;
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:31,代碼來源:configuration.host.discovery.edit.php

示例8: foreach

foreach ($this->data['slides'] as $step => $slides) {
    $name = '';
    if (!empty($slides['screenid'])) {
        $screen = get_screen_by_screenid($slides['screenid']);
        if (!empty($screen['name'])) {
            $name = $screen['name'];
        }
    }
    $delay = new CNumericBox('slides[' . $step . '][delay]', !empty($slides['delay']) ? $slides['delay'] : '', 5, 'no', true, false);
    $delay->setAttribute('placeholder', _('default'));
    $removeButton = new CButton('remove_' . $step, _('Remove'), 'javascript: removeSlide(this);', 'link_menu');
    $removeButton->setAttribute('remove_slide', $step);
    $row = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), new CSpan($i++ . ':', 'rowNum', 'current_slide_' . $step), $name, $delay, $removeButton), 'sortable', 'slides_' . $step);
    $slideTable->addRow($row);
}
$addButtonColumn = new CCol(empty($this->data['work_slide']) ? new CButton('add', _('Add'), 'return PopUp("popup.php?srctbl=screens&srcfld1=screenid&dstfrm=' . $slideForm->getName() . '&multiselect=1", 450, 450)', 'link_menu') : null, null, 5);
$addButtonColumn->setAttribute('style', 'vertical-align: middle;');
$slideTable->addRow(new CRow($addButtonColumn, null, 'screenListFooter'));
$slideFormList->addRow(_('Slides'), new CDiv($slideTable, 'objectgroup inlineblock border_dotted'));
// append tabs to form
$slideTab = new CTabView();
$slideTab->addTab('slideTab', _('Slide'), $slideFormList);
$slideForm->addItem($slideTab);
// append buttons to form
if (empty($this->data['slideshowid'])) {
    $slideForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButtonCancel()));
} else {
    $slideForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), array(new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete slide show?'), url_params(array('form', 'slideshowid'))), new CButtonCancel())));
}
$slideWidget->addItem($slideForm);
return $slideWidget;
開發者ID:itnihao,項目名稱:Zabbix_,代碼行數:31,代碼來源:configuration.slideconf.edit.php

示例9: CTextArea

    } else {
        $enabled = true;
    }
    $hostInventoryFieldComboBox->addItem($fieldNo, $fieldInfo['title'], $this->data['inventory_link'] == $fieldNo && $enabled ? 'yes' : null, $enabled);
}
$itemFormList->addRow(_('Populates host inventory field'), $hostInventoryFieldComboBox, 'row_inventory_link');
// append description to form list
$itemFormList->addRow(_('Description'), (new CTextArea('description', $this->data['description']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH));
// status
$enabledCheckBox = (new CCheckBox('status', ITEM_STATUS_ACTIVE))->setChecked($this->data['status'] == ITEM_STATUS_ACTIVE);
$itemFormList->addRow(_('Enabled'), $enabledCheckBox);
// append tabs to form
$itemTab = (new CTabView())->addTab('itemTab', $this->data['caption'], $itemFormList);
// append buttons to form
if ($this->data['itemid'] != 0) {
    $buttons = [new CSubmit('clone', _('Clone'))];
    if ($host['status'] == HOST_STATUS_MONITORED || $host['status'] == HOST_STATUS_NOT_MONITORED) {
        $buttons[] = new CButtonQMessage('del_history', _('Clear history and trends'), _('History clearing can take a long time. Continue?'));
    }
    if (!$this->data['limited']) {
        $buttons[] = new CButtonDelete(_('Delete item?'), url_params(['form', 'groupid', 'itemid', 'hostid']));
    }
    $buttons[] = new CButtonCancel(url_param('groupid') . url_param('hostid'));
    $itemTab->setFooter(makeFormFooter(new CSubmit('update', _('Update')), $buttons));
} else {
    $itemTab->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel(url_param('groupid') . url_param('hostid'))]));
}
$itemForm->addItem($itemTab);
$widget->addItem($itemForm);
require_once dirname(__FILE__) . '/js/configuration.item.edit.js.php';
return $widget;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:configuration.item.edit.php

示例10: CNumericBox

    $screenFormList->addRow(_('Width'), (new CNumericBox('width', $width, 5))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
    $screenFormList->addRow(_('Height'), (new CNumericBox('height', $height, 5))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
} else {
    $form->addVar('width', 500)->addVar('height', 100);
}
$resourcesWithHAlign = [SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_MAP, SCREEN_RESOURCE_CLOCK, SCREEN_RESOURCE_URL, SCREEN_RESOURCE_LLD_GRAPH, SCREEN_RESOURCE_LLD_SIMPLE_GRAPH];
if (in_array($resourceType, $resourcesWithHAlign)) {
    $screenFormList->addRow(_('Horizontal align'), (new CRadioButtonList('halign', (int) $halign))->addValue(_('Left'), HALIGN_LEFT)->addValue(_('Center'), HALIGN_CENTER)->addValue(_('Right'), HALIGN_RIGHT)->setModern(true));
} else {
    $form->addVar('halign', 0);
}
$screenFormList->addRow(_('Vertical align'), (new CRadioButtonList('valign', (int) $valign))->addValue(_('Top'), VALIGN_TOP)->addValue(_('Middle'), VALIGN_MIDDLE)->addValue(_('Bottom'), VALIGN_BOTTOM)->setModern(true));
$screenFormList->addRow(_('Column span'), (new CNumericBox('colspan', $colspan, 3))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
$screenFormList->addRow(_('Row span'), (new CNumericBox('rowspan', $rowspan, 3))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
// dynamic addon
$resourcesWithDynamic = [SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_PLAIN_TEXT, SCREEN_RESOURCE_URL, SCREEN_RESOURCE_LLD_GRAPH, SCREEN_RESOURCE_LLD_SIMPLE_GRAPH];
if ($this->data['screen']['templateid'] == 0 && in_array($resourceType, $resourcesWithDynamic)) {
    $screenFormList->addRow(_('Dynamic item'), (new CCheckBox('dynamic'))->setChecked($dynamic == 1));
}
// append tabs to form
$screenTab = new CTabView();
$screenTab->setAttribute('style', 'text-align: left;');
$screenTab->addTab('screenTab', _('Screen cell configuration'), $screenFormList);
// append buttons to form
if (isset($_REQUEST['screenitemid'])) {
    $screenTab->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CButtonDelete(null, url_params(['form', 'screenid', 'templateid', 'screenitemid'])), new CButtonCancel(url_params(['screenid', 'templateid']))]));
} else {
    $screenTab->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel(url_params(['screenid', 'templateid']))]));
}
$form->addItem($screenTab);
return $form;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:monitoring.screen.constructor.edit.php

示例11: CRow

    $user_group_shares_table->addRow((new CRow((new CCol($add_user_group_btn))->setColSpan(3)))->setId('user_group_list_footer'));
    $user_groups = [];
    foreach ($data['screen']['userGroups'] as $user_group) {
        $user_groupid = $user_group['usrgrpid'];
        $user_groups[$user_groupid] = ['usrgrpid' => $user_groupid, 'name' => $data['user_groups'][$user_groupid]['name'], 'permission' => $user_group['permission']];
    }
    $js_insert = 'addPopupValues(' . zbx_jsvalue(['object' => 'usrgrpid', 'values' => $user_groups]) . ');';
    // User sharing table.
    $user_shares_table = (new CTable())->setHeader([_('Users'), _('Permissions'), _('Action')])->setAttribute('style', 'width: 100%;');
    $add_user_btn = [(new CButton(null, _('Add')))->onClick('return PopUp("popup.php?dstfrm=' . $form->getName() . '&srctbl=users&srcfld1=userid&srcfld2=fullname&multiselect=1")')->addClass(ZBX_STYLE_BTN_LINK)];
    $user_shares_table->addRow((new CRow((new CCol($add_user_btn))->setColSpan(3)))->setId('user_list_footer'));
    $users = [];
    foreach ($data['screen']['users'] as $user) {
        $userid = $user['userid'];
        $users[$userid] = ['id' => $userid, 'name' => getUserFullname($data['users'][$userid]), 'permission' => $user['permission']];
    }
    $js_insert .= 'addPopupValues(' . zbx_jsvalue(['object' => 'userid', 'values' => $users]) . ');';
    zbx_add_post_js($js_insert);
    $sharing_tab = (new CFormList('sharing_form'))->addRow(_('Type'), (new CRadioButtonList('private', (int) $data['screen']['private']))->addValue(_('Private'), PRIVATE_SHARING)->addValue(_('Public'), PUBLIC_SHARING)->setModern(true))->addRow(_('List of user group shares'), (new CDiv($user_group_shares_table))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_STANDARD_WIDTH . 'px;'))->addRow(_('List of user shares'), (new CDiv($user_shares_table))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_STANDARD_WIDTH . 'px;'));
    // Append data to form.
    $tabs->addTab('sharing_tab', _('Sharing'), $sharing_tab);
}
// append buttons to form
if ($data['screen']['screenid']) {
    $tabs->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete screen?'), url_params(['form', 'screenid', 'templateid'])), new CButtonCancel(url_param('templateid'))]));
} else {
    $tabs->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel(url_param('templateid'))]));
}
$form->addItem($tabs);
$widget->addItem($form);
return $widget;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:monitoring.screen.edit.php

示例12: zbx_jsvalue

    $user_groupid = $user_group['usrgrpid'];
    if (array_key_exists($user_groupid, $data['user_groups'])) {
        $user_groups[$user_groupid] = ['usrgrpid' => $user_groupid, 'name' => $data['user_groups'][$user_groupid]['name'], 'permission' => $user_group['permission']];
    }
}
$js_insert = 'addPopupValues(' . zbx_jsvalue(['object' => 'usrgrpid', 'values' => $user_groups]) . ');';
// User sharing table.
$user_shares_table = (new CTable())->setHeader([_('Users'), _('Permissions'), _('Action')])->setAttribute('style', 'width: 100%;');
$add_user_btn = [(new CButton(null, _('Add')))->onClick('return PopUp("popup.php?dstfrm=' . $form->getName() . '&srctbl=users&srcfld1=userid&srcfld2=fullname&multiselect=1")')->addClass(ZBX_STYLE_BTN_LINK)];
$user_shares_table->addRow((new CRow((new CCol($add_user_btn))->setColSpan(3)))->setId('user_list_footer'));
$users = [];
foreach ($data['slideshow']['users'] as $user) {
    $userid = $user['userid'];
    if (array_key_exists($userid, $data['users'])) {
        $users[$userid] = ['id' => $userid, 'name' => getUserFullname($data['users'][$userid]), 'permission' => $user['permission']];
    }
}
$js_insert .= 'addPopupValues(' . zbx_jsvalue(['object' => 'userid', 'values' => $users]) . ');';
zbx_add_post_js($js_insert);
$sharing_tab = (new CFormList('sharing_form'))->addRow(_('Type'), (new CRadioButtonList('private', (int) $data['slideshow']['private']))->addValue(_('Private'), PRIVATE_SHARING)->addValue(_('Public'), PUBLIC_SHARING)->setModern(true))->addRow(_('List of user group shares'), (new CDiv($user_group_shares_table))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_STANDARD_WIDTH . 'px;'))->addRow(_('List of user shares'), (new CDiv($user_shares_table))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_STANDARD_WIDTH . 'px;'));
// Append data to form.
$tabs->addTab('sharing_tab', _('Sharing'), $sharing_tab);
// append buttons to form
if (isset($data['slideshow']['slideshowid'])) {
    $tabs->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete slide show?'), url_params(['form', 'slideshowid'])), new CRedirectButton(_('Cancel'), 'slides.php')]));
} else {
    $tabs->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel()]));
}
$form->addItem($tabs);
$widget->addItem($form);
return $widget;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:monitoring.slideconf.edit.php

示例13: CFormList

if (empty($this->data['parent_discoveryid'])) {
    $dependenciesFormList = new CFormList('dependenciesFormList');
    $dependenciesTable = new CTable(_('No dependencies defined.'), 'formElementTable');
    $dependenciesTable->setAttribute('style', 'min-width: 500px;');
    $dependenciesTable->setAttribute('id', 'dependenciesTable');
    $dependenciesTable->setHeader(array(_('Name'), _('Action')));
    foreach ($this->data['db_dependencies'] as $dependency) {
        $triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
        $row = new CRow(array($dependency['host'] . NAME_DELIMITER . $dependency['description'], new CButton('remove', _('Remove'), 'javascript: removeDependency("' . $dependency['triggerid'] . '");', 'link_menu')));
        $row->setAttribute('id', 'dependency_' . $dependency['triggerid']);
        $dependenciesTable->addRow($row);
    }
    $dependenciesFormList->addRow(_('Dependencies'), new CDiv(array($dependenciesTable, new CButton('bnt1', _('Add'), 'return PopUp("popup.php?' . 'srctbl=triggers' . '&srcfld1=triggerid' . '&reference=deptrigger' . '&multiselect=1' . '&with_triggers=1", 1000, 700);', 'link_menu')), 'objectgroup inlineblock border_dotted ui-corner-all'));
    $triggersTab->addTab('dependenciesTab', _('Dependencies'), $dependenciesFormList);
}
// append tabs to form
$triggersForm->addItem($triggersTab);
// append buttons to form
$buttons = array();
if (!empty($this->data['triggerid'])) {
    $buttons[] = new CSubmit('clone', _('Clone'));
    $deleteButton = new CButtonDelete($this->data['parent_discoveryid'] ? _('Delete trigger prototype?') : _('Delete trigger?'), url_params(array('form', 'groupid', 'hostid', 'triggerid', 'parent_discoveryid')));
    if ($this->data['limited']) {
        $deleteButton->setAttribute('disabled', 'disabled');
    }
    $buttons[] = $deleteButton;
}
$buttons[] = new CButtonCancel(url_params(array('groupid', 'hostid', 'parent_discoveryid')));
$triggersForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), array($buttons)));
$triggersWidget->addItem($triggersForm);
return $triggersWidget;
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:31,代碼來源:configuration.triggers.edit.php

示例14: CFormList

/*
 * Dependencies tab
 */
$dependenciesFormList = new CFormList('dependenciesFormList');
$dependenciesTable = (new CTable())->setAttribute('style', 'width: 100%;')->setHeader([_('Name'), _('Action')]);
foreach ($this->data['db_dependencies'] as $dependency) {
    $triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
    $depTriggerDescription = CHtml::encode(implode(', ', zbx_objectValues($dependency['hosts'], 'name')) . NAME_DELIMITER . $dependency['description']);
    if ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
        $description = (new CLink($depTriggerDescription, 'triggers.php?form=update&triggerid=' . $dependency['triggerid']))->setAttribute('target', '_blank');
    } else {
        $description = $depTriggerDescription;
    }
    $dependenciesTable->addRow((new CRow([$description, (new CCol((new CButton('remove', _('Remove')))->onClick('javascript: removeDependency("' . $dependency['triggerid'] . '");')->addClass(ZBX_STYLE_BTN_LINK)))->addClass(ZBX_STYLE_NOWRAP)]))->setId('dependency_' . $dependency['triggerid']));
}
$dependenciesFormList->addRow(_('Dependencies'), (new CDiv([$dependenciesTable, (new CButton('bnt1', _('Add')))->onClick('return PopUp("popup.php?srctbl=triggers&srcfld1=triggerid&reference=deptrigger&multiselect=1' . '&with_triggers=1&noempty=1");')->addClass(ZBX_STYLE_BTN_LINK)]))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;'));
$triggersTab->addTab('dependenciesTab', _('Dependencies'), $dependenciesFormList);
// append buttons to form
if (!empty($this->data['triggerid'])) {
    $deleteButton = new CButtonDelete(_('Delete trigger?'), url_params(['form', 'hostid', 'triggerid']));
    if ($this->data['limited']) {
        $deleteButton->setAttribute('disabled', 'disabled');
    }
    $triggersTab->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CSubmit('clone', _('Clone')), $deleteButton, new CButtonCancel(url_param('hostid'))]));
} else {
    $triggersTab->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel(url_param('hostid'))]));
}
// append tabs to form
$triggersForm->addItem($triggersTab);
$widget->addItem($triggersForm);
return $widget;
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:configuration.triggers.edit.php

示例15: tort

liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.
*/
require_once 'libs/functions.php';
$options = get_options();
$tree = get_tree($options['docs_path'], $base_url);
// If a language is set in the config, rewrite urls based on the language
if (!isset($language) || $language === null) {
    $homepage_url = homepage_url($tree);
    $docs_url = docs_url($tree);
} else {
    $homepage_url = "/";
}
$docs_url = docs_url($tree);
$url_params = url_params();
if (count($options['languages']) > 0 && count($url_params) > 0 && strlen($url_params[0]) > 0) {
    $language = array_shift($url_params);
    $base_path = "docs/" . $language;
} else {
    $language = null;
    $base_path = "docs";
}
$tree = get_tree($base_path, $base_url, '', true, $language);
$page = load_page($tree, $url_params);
// If a timezone has been set in the config file, override the default PHP timezone for this application.
if (isset($options['timezone'])) {
    date_default_timezone_set($options['timezone']);
}
// Redirect to docs, if there is no homepage
if ($homepage && $homepage_url !== '/') {
開發者ID:dongcheng,項目名稱:daux,代碼行數:31,代碼來源:index.php


注:本文中的url_params函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。