本文整理汇总了PHP中Mobile::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile::config方法的具体用法?PHP Mobile::config怎么用?PHP Mobile::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile::config方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process(Mobile_API_Request $request)
{
$current_user = $this->getActiveUser();
$query = $request->get('query');
$nextPage = 0;
$queryResult = false;
if (preg_match("/(.*) LIMIT[^;]+;/i", $query)) {
$queryResult = vtws_query($query, $current_user);
} else {
// Implicit limit and paging
$query = rtrim($query, ";");
$currentPage = intval($request->get('page', 0));
$FETCH_LIMIT = Mobile::config('API_RECORD_FETCH_LIMIT');
$startLimit = $currentPage * $FETCH_LIMIT;
$queryWithLimit = sprintf("%s LIMIT %u,%u;", $query, $startLimit, $FETCH_LIMIT + 1);
$queryResult = vtws_query($queryWithLimit, $current_user);
// Determine paging
$hasNextPage = count($queryResult) > $FETCH_LIMIT;
if ($hasNextPage) {
array_pop($queryResult);
// Avoid sending next page record now
$nextPage = $currentPage + 1;
}
}
$records = array();
if (!empty($queryResult)) {
foreach ($queryResult as $recordValues) {
$records[] = $this->processQueryResultRecord($recordValues, $current_user);
}
}
$result = array('records' => $records, 'nextPage' => $nextPage);
$response = new Mobile_API_Response();
$response->setResult($result);
return $response;
}
示例2: viewController
function viewController()
{
$smarty = new vtigerCRM_Smarty();
foreach ($this->parameters as $k => $v) {
$smarty->assign($k, $v);
}
$smarty->assign("IS_SAFARI", Mobile::isSafari());
$smarty->assign("SKIN", Mobile::config('Default.Skin'));
return $smarty;
}
示例3: getHistoryList
function getHistoryList()
{
$uid = intval($this->Get['uid']);
if (empty($uid)) {
Mobile::error("No Error Tips", 321);
}
$info = $this->MyPmLogic->getHistoryList(MEMBER_ID, $uid, array("per_page_num" => Mobile::config("perpage_pm")));
if (!empty($info)) {
$info['current_page'] = empty($info['current_page']) ? 1 : $info['current_page'];
Mobile::output($info);
} else {
Mobile::error("No Error Tips", 400);
}
}
示例4: Main
function Main()
{
$uid = intval($this->Get['uid']);
$param = array('limit' => Mobile::config("perpage_def"), 'uid' => $uid);
$ret = Mobile::convert($this->MTagLogic->getTagList($param));
if (is_array($ret)) {
$tag_list = $ret['tag_list'];
$list_count = $ret['list_count'];
$total_record = $ret['total_record'];
$max_id = $ret['max_id'];
} else {
Mobile::show_message($ret);
}
include template('tag_list');
}
示例5: searchUser
function searchUser()
{
Mobile::logic('member');
$MemberLogic = new MemberLogic();
$q = trim($this->Get['q']);
if (empty($q)) {
Mobile::error("No Data", 400);
}
$param = array('limit' => Mobile::config("perpage_member"), 'nickname' => $q, 'max_id' => $this->Get['max_id']);
$ret = $MemberLogic->getMemberList($param);
if (is_array($ret)) {
Mobile::output($ret);
} else {
Mobile::error("No Data", $ret);
}
}
示例6: getHistoryList
function getHistoryList()
{
$uid = intval($this->Get['uid']);
if (empty($uid)) {
Mobile::show_message(300);
}
$info = Mobile::convert($this->MyPmLogic->getHistoryList(MEMBER_ID, $uid, array("per_page_num" => Mobile::config("perpage_pm"))));
if (!empty($info)) {
$pm_list = $info['pm_list'];
$current_page = empty($info['current_page']) ? 1 : $info['current_page'];
$next_page = $current_page + 1;
$total_page = intval($info['total_page']);
$list_count = count($info['pm_list']);
} else {
Mobile::show_message(400);
}
include template('pm_list');
}
示例7: getListing
function getListing($user)
{
function useSortBySettings($a, $b)
{
global $displayed_modules;
$posA = $displayed_modules[$a['name']];
$posB = $displayed_modules[$b['name']];
if ($posA == $posB) {
return 0;
}
return $posA < $posB ? -1 : 1;
}
//settings information
global $displayed_modules, $current_language, $app_strings;
$modulewsids = Mobile_WS_Utils::getEntityModuleWSIds();
// Disallow modules
unset($modulewsids['Users']);
include_once dirname(__FILE__) . '/../../Mobile.Config.php';
$CRM_Version = Mobile::config('crm_version');
if ($CRM_Version != '5.2.1') {
//we use this class only for privilege purposes on types
$listresult = vtws_listtypes(null, $user, 'en_us');
} else {
$listresult = vtws_listtypes($user);
}
$listing = array();
foreach ($listresult['types'] as $index => $modulename) {
if (!isset($modulewsids[$modulename])) {
continue;
}
if (in_array($modulename, $displayed_modules)) {
$listing[] = array('id' => $modulewsids[$modulename], 'name' => $modulename, 'isEntity' => $listresult['information'][$modulename]['isEntity'], 'label' => getTranslatedString($modulename, $modulename), 'singular' => getTranslatedString('SINGLE_' . $modulename, $modulename));
}
}
//make sure the active modules are displayed in the order of the $displayed_modules settings entry in MobileSettings.config.php
$displayed_modules = array_flip($displayed_modules);
usort($listing, 'useSortBySettings');
return $listing;
}
示例8: searchUser
function searchUser()
{
$this->Title = "Search User";
Mobile::logic('member');
$MemberLogic = new MemberLogic();
$q = trim($this->Get['q']);
if (empty($q)) {
Mobile::show_message($ret);
} else {
$param = array('limit' => Mobile::config("perpage_member"), 'nickname' => $q);
$keyword = urlencode($param['nickname']);
$ret = Mobile::convert($MemberLogic->getMemberList($param));
if (is_array($ret)) {
$member_list = $ret['member_list'];
$total_record = $ret['total_record'];
$list_count = count($member_list);
$max_tid = $ret['max_tid'];
} else {
Mobile::show_message($ret);
}
}
include template('search_user');
}
示例9: getCommentList
function getCommentList()
{
$tid = intval($this->Get['tid']);
$topic_info = $this->MblogLogic->TopicLogic->Get($tid);
if (empty($topic_info)) {
Mobile::error('No Data', 400);
}
if ($topic_info['replys'] > 0) {
$param = array('tid' => $tid, 'limit' => Mobile::config("perpage_mblog"), 'max_tid' => intval($this->Get['max_tid']));
$ret = $this->MblogLogic->getCommentList($param);
$error_code = 0;
if (is_array($ret)) {
$topic_list = $ret['topic_list'];
$ret['list_count'] = count($topic_list);
Mobile::output($ret);
} else {
$error_code = $ret;
Mobile::error('No Data', 400);
}
} else {
Mobile::error('No Data', 400);
}
}
示例10: __construct
function __construct()
{
$this->_limit = Mobile::config('API_RECORD_FETCH_LIMIT', 20);
}
示例11: MasterObject
function MasterObject(&$config)
{
require_once ROOT_PATH . 'mobile/include/func/mobile.func.php';
$config['client_type'] = '';
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (empty($user_agent)) {
exit('Access Denied');
}
$pc_browser = false;
if (preg_match("/android/i", $user_agent)) {
$config['client_type'] = "android";
} else {
if (preg_match("/iphone/i", $user_agent)) {
$config['client_type'] = "iphone";
} else {
$pc_browser = true;
}
}
$config['is_mobile_client'] = false;
if (isset($_GET['JSG_SESSION']) && isset($_GET['iv']) && isset($_GET['app_key']) && isset($_GET['app_secret']) && isset($_GET['bt'])) {
$config['is_mobile_client'] = true;
define("IS_MOBILE_CLIENT", true);
}
define("CLIENT_TYPE", $config['client_type']);
$config['sys_version'] = sys_version();
$config['sys_published'] = SYS_PUBLISHED;
if (!$config['mobile_url']) {
$config['mobile_url'] = $config['site_url'] . "/mobile";
}
if (!$config['topic_length']) {
$config['topic_length'] = 140;
}
$this->Config = $config;
$this->Config = array_merge($this->Config, Mobile::config());
define("CHARSET", $this->Config['charset']);
Obj::register('config', $this->Config);
$this->Get =& $_GET;
$this->Post =& $_POST;
$this->Module = trim($this->Post['mod'] ? $this->Post['mod'] : $this->Get['mod']);
$this->Code = trim($this->Post['code'] ? $this->Post['code'] : $this->Get['code']);
$this->DatabaseHandler =& Obj::registry('DatabaseHandler');
$uid = 0;
$password = '';
$authcode = '';
$implicit_pass = true;
if (!empty($this->Get['JSG_SESSION']) && $config['is_mobile_client']) {
$authcode = $this->Get['JSG_SESSION'];
$authcode = rawurldecode($authcode);
$implicit_pass = false;
} else {
$authcode = jsg_getcookie('auth');
}
if (!empty($authcode)) {
list($password, $uid) = explode("\t", authcode($authcode, 'DECODE'));
}
$this->MemberHandler = jclass('member');
$MemberFields = $this->MemberHandler->FetchMember($uid, $password);
if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
Mobile::show_message(411);
exit;
}
if (!in_array($this->Module, array('member', 'login', 'wechat'))) {
$visit_rets = $this->MemberHandler->visit();
if ($visit_rets['error']) {
Mobile::show_message(411);
exit;
}
}
$this->Title = $this->MemberHandler->CurrentAction['name'];
Obj::register("MemberHandler", $this->MemberHandler);
$rets = jsg_member_login_extract();
if ($rets) {
if (MEMBER_ID < 1) {
$func = $rets['login_direct'];
} else {
$func = $rets['logout_direct'];
}
if ($func && function_exists($func)) {
$ret = $func();
}
}
if (MEMBER_ID > 0) {
jsg_member_login_set_status($MemberFields);
}
if ($this->Config['extcredits_enable']) {
if (MEMBER_ID > 0 && jsg_getcookie('login_credits') + 3600 < time()) {
update_credits_by_action('login', MEMBER_ID);
jsg_setcookie('login_credits', time(), 3600);
}
}
}
示例12: process
/** END */
function process(Mobile_API_Request $request)
{
global $current_user, $current_language, $displayed_modules;
global $adb, $theme;
$wsResponse = parent::process($request);
$response = false;
if ($wsResponse->hasError()) {
$response = $wsResponse;
} else {
$current_user = $this->getActiveUser();
$response = false;
$total_record_count = 0;
$query_string = trim($_REQUEST['query_string']);
$curModule = 'Home';
$search_tag = vtlib_purify($_REQUEST['search_tag']);
//get language
$current_user = $this->getActiveUser();
$CRM_Version = Mobile::config('crm_version');
if ($CRM_Version != '5.2.1') {
//for v5.3.0 use User's Settings
include 'user_privileges/user_privileges_' . $current_user->id . '.php';
if (isset($user_info['language'])) {
$this->activeUser->column_fields['language'] = $user_info['language'];
} else {
$this->activeUser->column_fields['language'] = 'en_us';
}
} else {
//for v5.2.1 use default language
global $adb;
$queryResult = $adb->pquery("SELECT prefix FROM vtiger_language WHERE isdefault =1", array());
$this->activeUser->column_fields['language'] = $adb->query_result($queryResult, 0, 'prefix');
}
$current_language = $this->activeUser->column_fields['language'];
include dirname(__FILE__) . '/../language/' . $current_language . '.lang.php';
function getSearchModules($filter = array())
{
global $adb;
// vtlib customization: Ignore disabled modules.
//$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29)';
$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29) and vtiger_tab.presence != 1 and vtiger_field.presence in (0,2)';
// END
$result = $adb->pquery($sql, array());
while ($module_result = $adb->fetch_array($result)) {
$modulename = $module_result['name'];
// Do we need to filter the module selection?
if (!empty($filter) && is_array($filter) && !in_array($modulename, $filter)) {
continue;
}
// END
if ($modulename != 'Calendar') {
$return_arr[$modulename] = $modulename;
} else {
$return_arr[$modulename] = 'Activity';
}
}
return $return_arr;
}
if (isset($query_string) && $query_string != '') {
// limit search to modules enabled for mobile
$search_onlyin = vtlib_purify($_REQUEST['search_onlyin']);
if (!empty($search_onlyin)) {
$search_onlyin = explode(',', $search_onlyin);
//prevent manipulations
if (array_values($search_onlyin) != array_values($displayed_modules)) {
//do standard search
$search_onlyin = $displayed_modules;
}
} else {
$search_onlyin = $displayed_modules;
}
// Save the selection for future use (UnifiedSearchModules.php)
$_SESSION['__UnifiedSearch_SelectedModules__'] = $search_onlyin;
// END
$object_array = getSearchModules($search_onlyin);
$search_val = $query_string;
$search_module = $_REQUEST['search_module'];
$i = 0;
$moduleRecordCount = array();
foreach ($object_array as $module => $object_name) {
if ($curModule == 'Home' || $curModule == $module && !empty($_REQUEST['ajax'])) {
$focus = CRMEntity::getInstance($module);
if (isPermitted($module, "index") == "yes") {
$listquery = getListQuery($module);
$oCustomView = '';
$oCustomView = new CustomView($module);
//Instead of getting current customview id, use cvid of All so that all entities will be found
//$viewid = $oCustomView->getViewId($module);
$cv_res = $adb->pquery("select cvid from vtiger_customview where viewname='All' and entitytype=?", array($module));
$viewid = $adb->query_result($cv_res, 0, 'cvid');
$listquery = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
if ($module == "Calendar") {
if (!isset($oCustomView->list_fields['Close'])) {
$oCustomView->list_fields['Close'] = array('activity' => 'status');
}
if (!isset($oCustomView->list_fields_name['Close'])) {
$oCustomView->list_fields_name['Close'] = 'status';
}
}
if ($search_module != '' || $search_tag != '') {
//.........这里部分代码省略.........
示例13: blacklist
function blacklist()
{
$param = array('limit' => Mobile::config("perpage_member"), 'uid' => intval($this->Get['uid']), 'max_id' => intval($this->Get['max_id']));
$ret = $this->FriendLogic->getBlackList($param);
if (is_array($ret)) {
Mobile::output($ret);
} else {
Mobile::error("No Error Tips", $ret);
}
}
示例14: getCommentList
function getCommentList()
{
$tid = intval($this->Get['tid']);
$topic_info = $this->MblogLogic->TopicLogic->Get($tid);
if (empty($topic_info)) {
Mobile::show_message(400);
}
if ($topic_info['replys'] > 0) {
$param = array('tid' => $tid, 'limit' => Mobile::config("perpage_mblog"));
$ret = Mobile::convert($this->MblogLogic->getCommentList($param));
$error_code = 0;
if (is_array($ret)) {
$topic_list = $ret['topic_list'];
$parent_list = $ret['parent_list'];
$total_record = $ret['total_record'];
$list_count = count($topic_list);
$max_tid = $ret['max_tid'];
$next_page = $ret['next_page'];
}
} else {
}
$huifu_flg = "is_huifu";
include template('topic_comment');
}
示例15: getPagingModel
function getPagingModel(Mobile_API_Request $request)
{
$pagingModel = Mobile_WS_PagingModel::modelWithPageStart($request->get('page'));
$pagingModel->setLimit(Mobile::config('Navigation.Limit', 100));
return $pagingModel;
}