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


PHP detect_page_type函数代码示例

本文整理汇总了PHP中detect_page_type函数的典型用法代码示例。如果您正苦于以下问题:PHP detect_page_type函数的具体用法?PHP detect_page_type怎么用?PHP detect_page_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: dirname

** 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.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
$page['title'] = _('Custom graphs');
$page['file'] = 'charts.php';
$page['hist_arg'] = array('hostid', 'groupid', 'graphid');
$page['scripts'] = array('class.calendar.js', 'gtlc.js', 'flickerfreescreen.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
ob_start();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'graphid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null));
check_fields($fields);
/*
 * Permissions
 */
if (getRequest('groupid') && !API::HostGroup()->isReadable(array($_REQUEST['groupid']))) {
    access_deny();
}
if (getRequest('hostid') && !API::Host()->isReadable(array($_REQUEST['hostid']))) {
    access_deny();
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:charts.php

示例2: dirname

** (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.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/maps.inc.php';
$page['title'] = _('Logo');
$page['file'] = 'zbxe-customer-logo.php';
$page['type'] = detect_page_type(PAGE_TYPE_IMAGE);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION		EXCEPTION
$fields = array('sysmapid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'selements' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'links' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'noselements' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nolinks' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nocalculations' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'expand_macros' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'show_triggers' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2,3'), null), 'severity_min' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5'), null), 'grid' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 500), null), 'base64image' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null));
check_fields($fields);
$maps = API::Map()->get(array('sysmapids' => $_REQUEST['sysmapid'], 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND, 'preservekeys' => true));
$map = reset($maps);
if (empty($map)) {
    access_deny();
}
$mapPainter = new CMapPainter($map, array('map' => array('drawAreas' => !isset($_REQUEST['selements']) && !isset($_REQUEST['noselements'])), 'grid' => array('size' => get_request('grid', 0))));
$im = $mapPainter->paint();
$colors['Red'] = imagecolorallocate($im, 255, 0, 0);
$colors['Dark Red'] = imagecolorallocate($im, 150, 0, 0);
$colors['Green'] = imagecolorallocate($im, 0, 255, 0);
$colors['Dark Green'] = imagecolorallocate($im, 0, 150, 0);
开发者ID:zubayr,项目名称:zabbix-extras,代码行数:31,代码来源:zbxe-customer-logo.php

示例3: dirname

**
** 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.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
require_once dirname(__FILE__) . '/include/regexp.inc.php';
$page['title'] = _('Configuration of regular expressions');
$page['file'] = 'adm.regexps.php';
$page['type'] = detect_page_type();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['regexpids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'regexpid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'], 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')], 'test_string' => [T_ZBX_STR, O_OPT, P_NO_TRIM, null, 'isset({add}) || isset({update})', _('Test string')], 'expressions' => [T_ZBX_STR, O_OPT, P_NO_TRIM, null, 'isset({add}) || isset({update})'], 'action' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"regexp.massdelete"'), null], 'add' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null], 'output' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'ajaxaction' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'ajaxdata' => [T_ZBX_STR, O_OPT, P_ACT | P_NO_TRIM, null, null]];
check_fields($fields);
/*
 * Ajax
 */
if (isset($_REQUEST['output']) && $_REQUEST['output'] == 'ajax') {
    $ajaxResponse = new CAjaxResponse();
    $ajaxData = getRequest('ajaxdata', []);
    if (isset($_REQUEST['ajaxaction']) && $_REQUEST['ajaxaction'] == 'test') {
        $result = ['expressions' => [], 'errors' => [], 'final' => true];
        $validator = new CRegexValidator(['messageInvalid' => _('Regular expression must be a string'), 'messageRegex' => _('Incorrect regular expression "%1$s": "%2$s"')]);
        foreach ($ajaxData['expressions'] as $id => $expression) {
            if (!in_array($expression['expression_type'], [EXPRESSION_TYPE_FALSE, EXPRESSION_TYPE_TRUE]) || $validator->validate($expression['expression'])) {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.regexps.php

示例4: array

** (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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
$page['title'] = "RPC";
$page['file'] = 'jsrpc.php';
$page['hist_arg'] = array();
$page['type'] = detect_page_type(PAGE_TYPE_JSON);
include_once 'include/page_header.php';
//		VAR				TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array();
check_fields($fields);
// ACTION /////////////////////////////////////////////////////////////////////////////
$http_request = new CHTTP_request();
$data = $http_request->body();
$json = new CJSON();
$data = $json->decode($data, true);
if (!is_array($data)) {
    fatal_error('Wrong RPC call to JS RPC');
}
if (!isset($data['method']) || !isset($data['params'])) {
    fatal_error('Wrong RPC call to JS RPC');
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:jsrpc.php

示例5: dirname

** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$requestType = getRequest('type', PAGE_TYPE_JSON);
if ($requestType == PAGE_TYPE_JSON) {
    $http_request = new CHttpRequest();
    $json = new CJson();
    $data = $json->decode($http_request->body(), true);
} else {
    $data = $_REQUEST;
}
$page['title'] = 'RPC';
$page['file'] = 'jsrpc.php';
$page['hist_arg'] = array();
$page['type'] = detect_page_type($requestType);
require_once dirname(__FILE__) . '/include/page_header.php';
if (!is_array($data) || !isset($data['method']) || $requestType == PAGE_TYPE_JSON && (!isset($data['params']) || !is_array($data['params']))) {
    fatal_error('Wrong RPC call to JS RPC!');
}
$result = array();
switch ($data['method']) {
    case 'host.get':
        $result = API::Host()->get(array('startSearch' => true, 'search' => $data['params']['search'], 'output' => array('hostid', 'host', 'name'), 'sortfield' => 'name', 'limit' => 15));
        break;
    case 'message.mute':
        $msgsettings = getMessageSettings();
        $msgsettings['sounds.mute'] = 1;
        updateMessageSettings($msgsettings);
        break;
    case 'message.unmute':
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:jsrpc.php

示例6: array

    $USER_DETAILS = array('alias' => ZBX_GUEST_USER, 'userid' => 0, 'lang' => 'en_gb', 'type' => '0', 'node' => array('name' => '- unknown -', 'nodeid' => 0));
}
include_once 'include/locales/en_gb.inc.php';
process_locales();
set_zbx_locales();
// INIT MB Strings if it's available
init_mbstrings();
/*
//Require MB strings, otherwise show warning page.
	if(!isset($show_setup) && !isset($show_warning) && !init_mbstrings()){
		$_REQUEST['warning_msg'] = S_ZABBIX.SPACE.ZABBIX_VERSION.SPACE.S_REQUIRE_MB_STRING_MODULE;
		$show_warning = true;
	}
//*/
// Ajax - do not need warnings or Errors
if ((isset($DENY_GUI) || isset($show_setup) || isset($show_warning)) && PAGE_TYPE_HTML != detect_page_type()) {
    header('Ajax-response: false');
    exit;
}
//---
if (isset($DENY_GUI)) {
    unset($show_warning);
    include_once 'warning.php';
}
if (isset($show_setup)) {
    unset($show_setup);
    include_once 'setup.php';
} else {
    if (isset($show_warning)) {
        unset($show_warning);
        include_once 'warning.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:config.inc.php


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