本文整理汇总了PHP中url_param函数的典型用法代码示例。如果您正苦于以下问题:PHP url_param函数的具体用法?PHP url_param怎么用?PHP url_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了url_param函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_dynamic_chart
function get_dynamic_chart($dom_graph_id, $img_src, $width = 0)
{
if (is_int($width) && $width > 0) {
$img_src .= url_param($width, false, 'width');
}
$result = new CScript('
<script language="JavaScript" type="text/javascript">
<!--
var width = "' . (!(is_int($width) && $width > 0) ? $width : '') . '";
var img_src = "' . $img_src . '";
A_SBOX["' . $dom_graph_id . '"] = new Object;
A_SBOX["' . $dom_graph_id . '"].shiftT = 17;
A_SBOX["' . $dom_graph_id . '"].shiftL = 10;
var ZBX_G_WIDTH;
if(width!=""){
if(window.innerWidth) ZBX_G_WIDTH=window.innerWidth;
else ZBX_G_WIDTH=document.body.clientWidth;
ZBX_G_WIDTH-= 80;
ZBX_G_WIDTH+= parseInt(width);
width = "&width=" + ZBX_G_WIDTH;
}
else{
ZBX_G_WIDTH = ' . $width . ';
}
document.write(\'<img src="\'+img_src + width +\'" alt="chart" id="' . $dom_graph_id . '" />\');
-->
</script>');
return $result;
}
示例2: rte_image_editor_search
static function rte_image_editor_search()
{
$active = url_param('view');
$cls = '';
if ($active == 'shop') {
$cls = ' class="active" ';
}
print '<module type="files/admin" />';
}
示例3: mw_print_stats_on_dashboard
function mw_print_stats_on_dashboard()
{
$active = url_param('view');
$cls = '';
if ($active == 'shop') {
// $cls = ' class="active" ';
}
print ' <module type="site_stats/admin" subtype="graph" />
<module type="site_stats/admin" />';
//print '<microweber module="site_stats" view="admin" />';
}
示例4: mw_print_admin_updates_settings_link
function mw_print_admin_updates_settings_link()
{
$active = url_param('view');
$cls = '';
if ($active == 'comments') {
$cls = ' class="active" ';
}
$notif_html = '';
$mname = module_name_encode('updates');
print "<li><a class=\"item-" . $mname . "\" href=\"#option_group=" . $mname . "\">" . _e("Updates", true) . "</a></li>";
//$notif_count = mw()->notifications_manager->get('module=comments&is_read=0&count=1');
/*if ($notif_count > 0) {
$notif_html = '<sup class="mw-notif-bubble">' . $notif_count . '</sup>';
}*/
//print '<li' . $cls . '><a href="' . admin_url() . 'view:comments"><span class="ico icomment">' . $notif_html . '</span><span>Comments</span></a></li>';
}
示例5: index
function index()
{
$is_admin = is_admin();
if ($is_admin == false) {
$go = site_url('login');
safe_redirect($go);
}
$action = url_param('action');
$this->template['functionName'] = strtolower(__FUNCTION__);
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
if ($action == false) {
$primarycontent = CI::view('admin/index', true, true);
} else {
$primarycontent = CI::view('admin/' . $action, true, true);
}
$layout = str_ireplace('{content}', $primarycontent, $layout);
$layout = CI::model('template')->parseMicrwoberTags($layout);
CI::library('output')->set_output($layout);
}
示例6: loginas
function loginas()
{
$id = url_param('id');
if ($id == false) {
exit('Specify id');
}
$cur_user = user_id();
if ($cur_user == false) {
exit('You need to be logged in as some of the parent users.');
}
$other_user = get_user($id);
if ($cur_user == $other_user) {
redirect('dashboard');
}
//var_dump($other_user);
if (intval($other_user['parent_id']) == $cur_user) {
} else {
exit('You need to be logged in as some of the parent users.');
}
$user_session['is_logged'] = 'yes';
$user_session['user_id'] = $other_user['id'];
CI::library('session')->set_userdata('user_session', $user_session);
CI::library('session')->set_userdata('user', $other_user);
$back_to = CI::model('core')->getParamFromURL('back_to');
if ($back_to != '') {
$back_to = base64_decode($back_to);
if (trim($back_to) != '') {
header('Location: ' . $back_to);
exit;
} else {
redirect('dashboard');
}
} else {
redirect('dashboard');
}
}
示例7: CTableInfo
$hostinvent_wdgt->addItem(BR());
$table = new CTableInfo(_('No hosts defined.'));
$table->setHeader(array(make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field'), make_sorting_header(_('Host count'), 'host_count')));
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
$options = array('output' => array('hostid', 'name'), 'selectInventory' => array($_REQUEST['groupby']), 'withInventory' => true);
if ($pageFilter->groupid > 0) {
$options['groupids'] = $pageFilter->groupid;
}
$hosts = API::Host()->get($options);
// aggregating data by chosen field value
$report = array();
foreach ($hosts as $host) {
if ($host['inventory'][$_REQUEST['groupby']] !== '') {
$lowerValue = zbx_strtolower($host['inventory'][$_REQUEST['groupby']]);
if (!isset($report[$lowerValue])) {
$report[$lowerValue] = array('inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1);
} else {
$report[$lowerValue]['host_count'] += 1;
}
}
}
order_result($report, getPageSortField('host_count'), getPageSortOrder());
foreach ($report as $rep) {
$row = array(new CSpan($rep['inventory_field'], 'pre'), new CLink($rep['host_count'], 'hostinventories.php?filter_field=' . $_REQUEST['groupby'] . '&filter_field_value=' . urlencode($rep['inventory_field']) . '&filter_set=1&filter_exact=1' . url_param('groupid')));
$table->addRow($row);
}
}
$hostinvent_wdgt->addItem($table);
$hostinvent_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例8: CTable
if (isset($service) && isset($_REQUEST['showgraph'])) {
$table = new CTable(null, 'chart');
$table->AddRow(new CImg('chart5.php?serviceid=' . $service['serviceid'] . url_param('path')));
$table->Show();
} else {
$query = 'SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, ' . ' s.name as caption, s.algorithm, t.description, t.expression, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status ' . ' FROM services s ' . ' LEFT JOIN triggers t ON s.triggerid = t.triggerid ' . ' LEFT JOIN services_links sl ON s.serviceid = sl.serviceupid and NOT(sl.soft=0) ' . ' LEFT JOIN services_links sl_p ON s.serviceid = sl_p.servicedownid and sl_p.soft=0 ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (t.triggerid IS NULL OR ' . DBcondition('t.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder, sl_p.serviceupid, s.serviceid';
$result = DBSelect($query);
$services = array();
$row = array('id' => 0, 'serviceid' => 0, 'serviceupid' => 0, 'caption' => S_ROOT_SMALL, 'status' => SPACE, 'reason' => SPACE, 'sla' => SPACE, 'sla2' => SPACE, 'graph' => SPACE, 'linkid' => '');
$services[0] = $row;
$now = time();
while ($row = DBFetch($result)) {
$row['id'] = $row['serviceid'];
empty($row['serviceupid']) ? $row['serviceupid'] = '0' : '';
empty($row['description']) ? $row['description'] = 'None' : '';
$row['graph'] = new CLink(S_SHOW, "srv_status.php?serviceid=" . $row["serviceid"] . "&showgraph=1" . url_param('path'), "action");
if (isset($row["triggerid"]) && !empty($row["triggerid"])) {
$url = new CLink(expand_trigger_description($row['triggerid']), 'events.php?triggerid=' . $row['triggerid']);
$row['caption'] = array($row['caption'] . ' [', $url, ']');
}
if ($row["status"] == 0 || isset($service) && bccomp($service["serviceid"], $row["serviceid"]) == 0) {
$row['reason'] = '-';
} else {
$row['reason'] = '-';
$result2 = DBselect('SELECT s.triggerid,s.serviceid ' . ' FROM services s, triggers t ' . ' WHERE s.status>0 ' . ' AND s.triggerid is not NULL ' . ' AND t.triggerid=s.triggerid ' . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' AND ' . DBin_node('s.serviceid') . ' ORDER BY s.status DESC, t.description');
while ($row2 = DBfetch($result2)) {
if (is_string($row['reason']) && $row['reason'] == '-') {
$row['reason'] = new CList(null, "itservices");
}
if (does_service_depend_on_the_service($row["serviceid"], $row2["serviceid"])) {
$row['reason']->AddItem(new CLink(expand_trigger_description($row2["triggerid"]), "events.php?triggerid=" . $row2["triggerid"]));
示例9: CFormList
$itemFormList = new CFormList('itemFormList');
// append type to form list
$copyTypeComboBox = new CComboBox('copy_type', $this->data['copy_type'], 'submit()');
$copyTypeComboBox->addItem(0, _('Hosts'));
$copyTypeComboBox->addItem(1, _('Host groups'));
$itemFormList->addRow(_('Target type'), $copyTypeComboBox);
// append targets to form list
$targetList = array();
if ($this->data['copy_type'] == 0) {
$groupComboBox = new CComboBox('copy_groupid', $this->data['copy_groupid'], 'submit()');
foreach ($this->data['groups'] as $group) {
$groupComboBox->addItem($group['groupid'], $group['name']);
}
$itemFormList->addRow(_('Group'), $groupComboBox);
foreach ($this->data['hosts'] as $host) {
array_push($targetList, array(new CCheckBox('copy_targetid[' . $host['hostid'] . ']', uint_in_array($host['hostid'], $this->data['copy_targetid']), null, $host['hostid']), SPACE, $host['name'], BR()));
}
} else {
foreach ($this->data['groups'] as $group) {
array_push($targetList, array(new CCheckBox('copy_targetid[' . $group['groupid'] . ']', uint_in_array($group['groupid'], $this->data['copy_targetid']), null, $group['groupid']), SPACE, $group['name'], BR()));
}
}
$itemFormList->addRow(_('Target'), !empty($targetList) ? $targetList : SPACE);
// append tabs to form
$itemTab = new CTabView();
$itemTab->addTab('itemTab', count($this->data['group_itemid']) . ' ' . _('elements copy to ...'), $itemFormList);
$itemForm->addItem($itemTab);
// append buttons to form
$itemForm->addItem(makeFormFooter(new CSubmit('copy', _('Copy')), new CButtonCancel(url_param('groupid') . url_param('hostid') . url_param('config'))));
$itemWidget->addItem($itemForm);
return $itemWidget;
示例10: CForm
$imageForm = new CForm('post', null, 'multipart/form-data');
$imageForm->setName('imageForm');
$imageForm->addVar('form', $this->data['form']);
if (isset($this->data['imageid'])) {
$imageForm->addVar('imageid', $this->data['imageid']);
}
$imageForm->addVar('imagetype', $this->data['imagetype']);
// append form list
$imageFormList = new CFormList('imageFormList');
$nameTextBox = new CTextBox('name', $this->data['imagename'], 64, false, 64);
$nameTextBox->attr('autofocus', 'autofocus');
$imageFormList->addRow(_('Name'), $nameTextBox);
$imageFormList->addRow(_('Upload'), new CFile('image'));
if (isset($this->data['imageid'])) {
if ($this->data['imagetype'] == IMAGE_TYPE_BACKGROUND) {
$imageFormList->addRow(_('Image'), new CLink(new CImg('imgstore.php?width=200&height=200&iconid=' . $this->data['imageid'], 'no image'), 'image.php?imageid=' . $this->data['imageid']));
} else {
$imageFormList->addRow(_('Image'), new CImg('imgstore.php?iconid=' . $this->data['imageid'], 'no image', null));
}
}
// append tab
$imageTab = new CTabView();
$imageTab->addTab('imageTab', $this->data['imagetype'] == IMAGE_TYPE_ICON ? _('Icon') : _('Background'), $imageFormList);
$imageForm->addItem($imageTab);
// append buttons
if (isset($this->data['imageid'])) {
$imageForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CButtonDelete(_('Delete selected image?'), url_param('form') . url_param('imageid')), new CButtonCancel())));
} else {
$imageForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel()));
}
return $imageForm;
示例11: dirname
if (!isset($params['id'])) {
return;
}
require_once dirname(__FILE__) . DS . 'functions.php';
if (get_option('enable_comments', 'comments') == 'y') {
$engine = get_option('engine', 'comments');
if ($engine == 'disqus') {
return include dirname(__FILE__) . DS . 'engines/disqus.php';
} elseif ($engine == 'facebook') {
return include dirname(__FILE__) . DS . 'engines/facebook.php';
}
$login_required = get_option('user_must_be_logged', 'comments') == 'y';
$from_related_posts = false;
$paging_param = $params['id'] . '_page';
$current_page_from_url = url_param($paging_param);
$data = $params;
if (isset($params['content-id'])) {
$data['rel_type'] = 'content';
$data['rel_id'] = $params['content-id'];
} elseif (isset($params['content_id'])) {
$data['rel_type'] = 'content';
$data['rel_id'] = $params['content_id'];
}
if (!isset($params['rel_type'])) {
$data['rel_type'] = 'content';
}
if (!isset($data['rel_id']) and isset($params['content-id'])) {
$data['rel_id'] = intval($params['content-id']);
$data['rel_type'] = 'content';
}
示例12: make_latest_data
function make_latest_data()
{
global $USER_DETAILS;
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
while ($db_app = DBfetch($db_applications)) {
$db_items = DBselect('SELECT DISTINCT i.* ' . ' FROM items i,items_applications ia' . ' WHERE ia.applicationid=' . $db_app['applicationid'] . ' AND i.itemid=ia.itemid' . ' AND i.status=' . ITEM_STATUS_ACTIVE . order_by('i.description,i.itemid,i.lastclock'));
$app_rows = array();
$item_cnt = 0;
while ($db_item = DBfetch($db_items)) {
$description = item_description($db_item);
if (!zbx_empty($_REQUEST['select']) && !zbx_stristr($description, $_REQUEST['select'])) {
continue;
}
++$item_cnt;
if (!uint_in_array($db_app['applicationid'], $_REQUEST['applications']) && !isset($show_all_apps)) {
continue;
}
if (isset($db_item['lastclock'])) {
$lastclock = date(S_DATE_FORMAT_YMDHMS, $db_item['lastclock']);
} else {
$lastclock = new CCol('-', 'center');
}
$lastvalue = format_lastvalue($db_item);
if (isset($db_item['lastvalue']) && isset($db_item['prevvalue']) && $db_item['value_type'] == 0 && $db_item['lastvalue'] - $db_item['prevvalue'] != 0) {
if ($db_item['lastvalue'] - $db_item['prevvalue'] < 0) {
$change = convert_units($db_item['lastvalue'] - $db_item['prevvalue'], $db_item['units']);
} else {
$change = '+' . convert_units($db_item['lastvalue'] - $db_item['prevvalue'], $db_item['units']);
}
$change = nbsp($change);
} else {
$change = new CCol('-', 'center');
}
if ($db_item['value_type'] == ITEM_VALUE_TYPE_FLOAT || $db_item['value_type'] == ITEM_VALUE_TYPE_UINT64) {
$actions = new CLink(S_GRAPH, 'history.php?action=showgraph&itemid=' . $db_item['itemid'], 'action');
} else {
$actions = new CLink(S_HISTORY, 'history.php?action=showvalues&period=3600&itemid=' . $db_item['itemid'], 'action');
}
array_push($app_rows, new CRow(array(is_show_all_nodes() ? SPACE : null, $_REQUEST['hostid'] > 0 ? NULL : SPACE, str_repeat(SPACE, 6) . $description, $lastclock, new CCol($lastvalue, $lastvalue == '-' ? 'center' : null), $change, $actions)));
}
if ($item_cnt > 0) {
if (uint_in_array($db_app['applicationid'], $_REQUEST['applications']) || isset($show_all_apps)) {
$link = new CLink(new CImg('images/general/opened.gif'), '?close=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
} else {
$link = new CLink(new CImg('images/general/closed.gif'), '?open=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
}
$col = new CCol(array($link, SPACE, bold($db_app['name']), SPACE . '(' . $item_cnt . SPACE . S_ITEMS . ')'));
$col->setColSpan(5);
$table->ShowRow(array(get_node_name_by_elid($db_app['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_app['host'], $col));
$any_app_exist = true;
foreach ($app_rows as $row) {
$table->ShowRow($row);
}
}
}
}
示例13: zbx_strtolower
$hosts[$num]['pr_serialno_a'] = $host['inventory']['serialno_a'];
$hosts[$num]['pr_tag'] = $host['inventory']['tag'];
$hosts[$num]['pr_macaddress_a'] = $host['inventory']['macaddress_a'];
// if we are filtering by inventory field
if (!empty($_REQUEST['filter_field']) && !empty($_REQUEST['filter_field_value'])) {
// must we filter exactly or using a substring (both are case insensitive)
$match = $_REQUEST['filter_exact'] ? zbx_strtolower($hosts[$num]['inventory'][$_REQUEST['filter_field']]) === zbx_strtolower($_REQUEST['filter_field_value']) : zbx_strpos(zbx_strtolower($hosts[$num]['inventory'][$_REQUEST['filter_field']]), zbx_strtolower($_REQUEST['filter_field_value'])) !== false;
if (!$match) {
unset($hosts[$num]);
}
}
}
order_result($hosts, getPageSortField('name'), getPageSortOrder());
$paging = getPagingLine($hosts);
foreach ($hosts as $host) {
$host_groups = array();
foreach ($host['groups'] as $group) {
$host_groups[] = $group['name'];
}
natsort($host_groups);
$host_groups = implode(', ', $host_groups);
$row = array(get_node_name_by_elid($host['hostid']), new CLink($host['name'], '?hostid=' . $host['hostid'] . url_param('groupid')), $host_groups, zbx_str2links($host['inventory']['name']), zbx_str2links($host['inventory']['type']), zbx_str2links($host['inventory']['os']), zbx_str2links($host['inventory']['serialno_a']), zbx_str2links($host['inventory']['tag']), zbx_str2links($host['inventory']['macaddress_a']));
$table->addRow($row);
}
}
}
$table = array($paging, $table, $paging);
$hostinvent_wdgt->addItem($table);
}
$hostinvent_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例14: CList
$controls = (new CList())->addItem([_('Group') . SPACE, $pageFilter->getGroupsCB()])->addItem([_('Grouping by') . SPACE, $inventoryFieldsComboBox]);
$hostinvent_wdgt->setControls((new CForm('get'))->addItem($controls));
$table = (new CTableInfo())->setHeader([make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field', $sortField, $sortOrder), make_sorting_header(_('Host count'), 'host_count', $sortField, $sortOrder)]);
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
$options = ['output' => ['hostid', 'name'], 'selectInventory' => [$_REQUEST['groupby']], 'withInventory' => true];
if ($pageFilter->groupid > 0) {
$options['groupids'] = $pageFilter->groupid;
}
$hosts = API::Host()->get($options);
// aggregating data by chosen field value
$report = [];
foreach ($hosts as $host) {
if ($host['inventory'][$_REQUEST['groupby']] !== '') {
// same names with different letter casing are considered the same
$lowerValue = mb_strtolower($host['inventory'][$_REQUEST['groupby']]);
if (!isset($report[$lowerValue])) {
$report[$lowerValue] = ['inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1];
} else {
$report[$lowerValue]['host_count'] += 1;
}
}
}
order_result($report, $sortField, $sortOrder);
foreach ($report as $rep) {
$table->addRow([zbx_str2links($rep['inventory_field']), new CLink($rep['host_count'], 'hostinventories.php?filter_field=' . $_REQUEST['groupby'] . '&filter_field_value=' . urlencode($rep['inventory_field']) . '&filter_set=1&filter_exact=1' . url_param('groupid'))]);
}
}
$hostinvent_wdgt->addItem($table);
$hostinvent_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例15: function
?>
", function () {
data = {};
data.id = id
$.post("<?php
print api_link();
?>
delete_user", data, function () {
_mw_admin_users_manage();
});
});
}
</script>
<?php
$mw_notif = url_param('mw_notif');
if ($mw_notif != false) {
$mw_notif = mw()->notifications_manager->read($mw_notif);
}
mw()->notifications_manager->mark_as_read('users');
?>
<?php
if (is_array($mw_notif) and isset($mw_notif['rel_id'])) {
?>
<script type="text/javascript">
$(document).ready(function () {
mw.url.windowHashParam('edit-user', '<?php
print $mw_notif['rel_id'];
?>
');
_mw_admin_user_edit();