本文整理汇总了PHP中Browse类的典型用法代码示例。如果您正苦于以下问题:PHP Browse类的具体用法?PHP Browse怎么用?PHP Browse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Browse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_set_help
public function act_set_help()
{
global $global;
global $conf;
$browse = new Browse();
$id = $_GET['element_id'];
$message = $_GET['wysiwyg'];
$sql = "UPDATE help SET definition='{$message}' WHERE field_number ='{$id}'";
$res = $browse->ExecuteNonQuery($sql);
exit(0);
}
示例2: showPanel
/**
* 显示当前面板内容
* @Title: showPanel
* @Description: todo(页面展示)
* @author 管理员
* @date 2015-06-30 19:36:36
* @throws
*/
public function showPanel()
{
import('@.ORG.Browse');
$submodel = M("mis_system_panel_desing_sub");
$sublist = $submodel->where("masid=15")->select();
$scdmodel = D("SystemConfigDetail");
$map["status"] = 1;
foreach ($sublist as $key => $val) {
$model = $val["modelname"];
$fields = explode(",", $val["showtitle"]);
$defaultwidth = (int) 100 / count($fields);
$temp = explode(",", $val["showtitle"]);
foreach ($temp as $tk => $tv) {
$temparr = explode("|", $tv);
if ($temparr[2]) {
$fields[$temparr[0]]['name'] = $temparr[0];
$fields[$temparr[0]]['width'] = $temparr[1];
$fields[$temparr[0]]['sort'] = $temparr[2];
}
}
sortArray($fields, 'sort', 'asc', 'number');
$detailList = $scdmodel->getDetail($model, true, "", "status");
$sublist[$key]['link'] = __APP__ . "/" . $model . "/index";
$sublist[$key]['rel'] = $model;
$newd = array();
foreach ($fields as $k => $v) {
foreach ($detailList as $dk => $dv) {
if ($v['name'] == $dv['name']) {
$newd[$k] = $dv;
$newd[$k]['shows'] = 1;
$newd[$k]['sortnum'] = $v['sort'];
if (strpos('px', $v['width']) > 0 || strpos('PX', $v['width']) > 0 || strpos('Px', $v['width']) > 0) {
$newd[$k]['widths'] = $v['width'];
} else {
$newd[$k]['widths'] = $v['width'] ? $v['width'] . "%" : $defaultwidth . "%";
}
}
}
}
$sublist[$key]["detailList"] = $newd;
//具体数据1
$listmodel = D($model);
$val['num'] = $val['num'] ? $val['num'] : 5;
//获取当前模型数据权限 by renl 20150626
$broMap = Browse::getUserMap($model);
if ($broMap) {
if ($map['_string']) {
$map['_string'] .= " and " . $broMap;
} else {
$map['_string'] = $broMap;
}
}
$list = $listmodel->where($map)->order('id desc')->limit($val['num'])->select();
$sublist[$key]["list"] = $list;
unset($map["_string"]);
}
$this->assign("sublist", $sublist);
$this->display("MisSystemPanelDesingMas:news");
}
示例3: l10n
public function l10n($subformat)
{
global $conf;
$locale = $conf['locale'];
$sql = "SELECT field_label, field_number FROM data_dict WHERE field_name = '{$subformat}'";
$browse = new Browse();
$field = $browse->ExecuteQuery($sql)[0];
$result = $field['field_label'];
if ($locale != 'en') {
$field_number = $field['field_number'];
$sql = "SELECT msgstr FROM data_dict_l10n WHERE msgid = {$field_number} AND locale = '{$locale}'";
$l10n = $browse->ExecuteQuery($sql);
if (!is_null($l10n)) {
$result = $l10n[0]['msgstr'];
}
}
return $result;
}
示例4: loadUserFieldNames
private function loadUserFieldNames()
{
$entityFields = Browse::getEntityFields($this->getEntityType());
foreach ($entityFields as $entityField) {
$mlt = trim($entityField['is_repeat']) == 'Y' || trim($entityField['is_repeat']) == 'y' ? true : false;
if ($mlt && $entityField['field_type'] == 'user_select') {
$this->uf[] = $entityField['field_name'];
}
}
$this->uf = array_unique($this->uf);
}
示例5: saveBrowse
public function saveBrowse($nCoolType)
{
try {
// $record = new BrowseRecord();
$br = new Browse();
$br->setRecord();
// $result = $record->saveRecord($nCoolType, $br);
// if(!$result){
// Log::write('RecordTask::saverBrowse():saveRecord() failed', 'log');
// // return false;
// }
// $record->close();
// Log::write('RecordTask::saverRequest():saveBrowse()', 'debug');
$queue = new QueueTask();
$queue->push('browse', $nCoolType, json_encode($br), 'coolshow_browse_count');
} catch (Exception $e) {
Log::write('RecordTask::saveBrowse():QueueTask():push() failed', 'log');
}
return true;
}
示例6: getAllHuriTerms
public function getAllHuriTerms($fieldName)
{
if (is_numeric($fieldName)) {
$listCode = (int) $fieldName;
$fieldName = $this->getFieldNameforListCode($listCode);
} else {
$listCode = $this->getListCodeforMTField($fieldName);
}
if ($listCode != null || trim($listCode) != '') {
//var_dump($listCode);
$mtTable = "mt_{$listCode}_{$fieldName}";
$consistancyJoin = "INNER JOIN {$mtTable} ON m.vocab_number = {$mtTable}.vocab_number";
}
global $conf;
$sql = "SELECT m.vocab_number , IFNULL(l.msgstr , english) as 'label',\n term_order,parent_vocab_number ,term_level ,huri_code\n FROM mt_vocab m \n LEFT JOIN mt_vocab_l10n l ON ( l.msgid = m.vocab_number AND l.locale = '{$conf['locale']}' )\n {$consistancyJoin}\n WHERE TRIM(list_code)='{$listCode}' AND (visible = 'y' or visible IS NULL) ORDER BY term_order";
//echo $sql;exit;
$browse = new Browse();
$res = $browse->ExecuteQuery($sql);
//print_r($res);
return $res;
}
示例7: ob_get_clean
echo "</div>";
$results['fslider'] = ob_get_clean();
ob_start();
echo "<script language='javascript' type='text/javascript'>";
echo "\$('#" . $fsname . "').rhinoslider({\n showTime: 15000,\n effectTime: 2000,\n randomOrder: true,\n controlsPlayPause: false,\n autoPlay: true,\n showBullets: 'never',\n showControls: 'always',\n controlsMousewheel: false,\n });";
echo "</script>";
}
$results['fslider_script'] = ob_get_clean();
break;
case 'songs':
$label_id = intval($_REQUEST['label']);
ob_start();
if ($label_id > 0) {
$label = new Label($label_id);
$object_ids = $label->get_songs();
$browse = new Browse();
$browse->set_type('song');
$browse->set_simple_browse(false);
$browse->save_objects($object_ids);
$browse->store();
UI::show_box_top(T_('Songs'), 'info-box');
require_once AmpConfig::get('prefix') . UI::find_template('show_songs.inc.php');
UI::show_box_bottom();
}
$results['songs'] = ob_get_contents();
ob_end_clean();
break;
default:
$results['rfc3514'] = '0x1';
break;
}
示例8: switch
* as published by the Free Software Foundation.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once '../lib/init.php';
if (!Access::check('interface', 100)) {
UI::access_denied();
exit;
}
UI::show_header();
switch ($_REQUEST['action']) {
default:
// Show Catalogs
$catalog_ids = Catalog::get_catalogs();
$browse = new Browse();
$browse->set_type('catalog');
$browse->set_static_content(true);
$browse->save_objects($catalog_ids);
$browse->show_objects($catalog_ids);
$browse->store();
break;
}
UI::show_footer();
示例9: array
case 'basket':
$object_type = $_REQUEST['type'];
$object_id = $_REQUEST['id'];
if (Core::is_playable_item($object_type)) {
if (!is_array($object_id)) {
$object_id = array($object_id);
}
foreach ($object_id as $id) {
$item = new $object_type($id);
$medias = $item->get_medias();
$GLOBALS['user']->playlist->add_medias($medias);
}
} else {
switch ($_REQUEST['type']) {
case 'browse_set':
$browse = new Browse($_REQUEST['browse_id']);
$objects = $browse->get_saved();
foreach ($objects as $object_id) {
$GLOBALS['user']->playlist->add_object($object_id, 'song');
}
break;
case 'album_random':
$data = explode('_', $_REQUEST['type']);
$type = $data['0'];
foreach ($_REQUEST['id'] as $i) {
$object = new $type($i);
$songs = $object->get_random_songs();
foreach ($songs as $song_id) {
$GLOBALS['user']->playlist->add_object($song_id, 'song');
}
}
示例10: Browse
if (AmpConfig::get('sociable')) {
?>
<div id="following" class="tab_content">
<?php
$following_ids = $client->get_following();
$browse = new Browse();
$browse->set_type('user');
$browse->set_simple_browse(false);
$browse->show_objects($following_ids);
$browse->store();
?>
</div>
<div id="followers" class="tab_content">
<?php
$follower_ids = $client->get_followers();
$browse = new Browse();
$browse->set_type('user');
$browse->set_simple_browse(false);
$browse->show_objects($follower_ids);
$browse->store();
?>
</div>
<div id="timeline" class="tab_content">
<?php
if (Preference::get_by_user($client->id, 'allow_personal_info_recent')) {
$activities = Useractivity::get_activities($client->id);
Useractivity::build_cache($activities);
foreach ($activities as $aid) {
$activity = new Useractivity($aid);
$activity->show();
}
示例11: session_start
* Sub-Ajax page, requires AJAX_INCLUDE
*/
require_once '../lib/init.php';
if (!Core::is_session_started()) {
session_start();
}
if (!defined('AJAX_INCLUDE')) {
exit;
}
if (isset($_REQUEST['browse_id'])) {
$browse_id = $_REQUEST['browse_id'];
} else {
$browse_id = null;
}
debug_event('browse.ajax.php', 'Called for action: {' . $_REQUEST['action'] . '}', '5');
$browse = new Browse($browse_id);
if (isset($_REQUEST['show_header']) && $_REQUEST['show_header']) {
$browse->set_show_header($_REQUEST['show_header'] == 'true');
}
$argument = null;
if ($_REQUEST['argument']) {
$argument = scrub_in($_REQUEST['argument']);
}
$results = array();
switch ($_REQUEST['action']) {
case 'browse':
$object_ids = array();
// Check 'value' with isset because it can null
//(user type a "start with" word and deletes it)
if ($_REQUEST['key'] && (isset($_REQUEST['multi_alpha_filter']) or isset($_REQUEST['value']))) {
// Set any new filters we've just added
示例12: signin
/**
* @Title: signin
* @Description: todo(浏览器版登陆方法)
* @author liminggang
* @date 2014-8-28 下午4:34:10
* @throws
*/
public function signin()
{
//获取产品模块授权培
$model = D('SerialNumber');
$system = array();
$system = $model->CheckFile();
if (count($system) > 0) {
//验证序列号文件是否存在,基本校验。
redirect(U("Public/serialnumber?register=" . $_POST['account']));
}
//读取名人录数据
//$this->getsolidotinfor();
if ($_POST["login_type"] == "dialog") {
$this->loginType = "dialog";
}
if (empty($_POST['account'])) {
$this->assign("jumpUrl", __URL__ . '/login/');
} elseif (empty($_POST['password'])) {
$this->assign("jumpUrl", __URL__ . '/login/');
} elseif (C("VERIFICATION_CODE") && empty($_POST['verify'])) {
if ($this->loginType != 'helperLogin') {
$this->assign("jumpUrl", __URL__ . '/login/');
$this->error('验证码必须!');
}
} elseif (C("VERIFICATION_CODE") && $_SESSION['verify'] != md5($_POST['verify'])) {
if ($this->loginType != 'helperLogin') {
$this->assign("jumpUrl", __URL__ . '/login/');
$this->error('验证码错误!');
}
}
//获取authinfo信息
$authInfo = $this->getAuthInfo();
//使用用户名、密码和状态的方式进行认证
if (false == $authInfo) {
$this->assign("jumpUrl", __URL__ . '/login/');
if ($this->loginType != 'helperLogin') {
$this->assign("info", "帐号不存在或已禁用!");
$this->display('login');
} else {
return array('status' => 0, 'msg' => "error:帐号不存在或已禁用!");
exit;
}
} else {
//--------------此部分为验证密码-------------------//
$checkPwd = $this->checkPwd($authInfo);
if ($checkPwd) {
return $checkPwd;
}
//-----------以下部分已被分成方法-------------//
$this->setSession($authInfo);
//设置session
$this->setUserInfoCookie($authInfo);
//设置UserInfo的cookie
//$this->setBBSCookie($authInfo);//设置BBS的cookie
$time = time();
//保存登录信息
$ip = get_client_ip();
$data = array();
$data['last_login_time'] = $time;
$data['logintime'] = $time;
$data['isonline'] = 1;
$data['sessionid'] = session_id();
$data['id'] = $authInfo['id'];
$data['login_count'] = array('exp', 'login_count+1');
$data['login_error_count'] = 0;
$data['newmsg'] = 1;
$data['newmsgtype'] = 1;
$data['last_login_ip'] = $ip;
if (!$bindacount) {
$User = M('User');
$User->save($data);
$User->commit();
}
//新增online信息,类型为新增
$this->setUserOnline($authInfo, $type = "insert");
// 缓存访问权限
RBAC::saveAccessList();
//写入浏览及权限
Browse::saveBrowseList();
if (isset($_SESSION[C('ADMIN_AUTH_KEY')])) {
$re = $this->check_upgrade(false);
}
//如果是从OA客户端登录的,返回真
if ($this->loginType == 'helperLogin') {
if ($_REQUEST['fromOA'] == 2) {
//$this->success('登录成功!');
redirect(U('Index/index'), 0.01, '页面跳转中。。。');
} else {
return array('status' => 1, 'msg' => "success:登录成功!");
exit;
}
} else {
if ($this->loginType != 'checkLogin') {
//.........这里部分代码省略.........
示例13: searchResult
protected function searchResult()
{
require_once APPROOT . 'mod/analysis/analysisModule.class.php';
$analysisModule = new analysisModule();
$dataArray = array();
//assign post search queries to get
foreach ($_REQUEST as $key => $element) {
if ($_REQUEST[$key] != null) {
$_GET[$key] = $_REQUEST[$key];
}
}
$sqlStatement = $analysisModule->generateSqlforEntity('person', null, $_REQUEST, 'search');
$entity_type_form_results = generate_formarray('person', 'search_view');
$entity_type_form_results['person_record_number']['type'] = 'text';
$field_list = array();
foreach ($entity_type_form_results as $field_name => $field) {
$field_list[$field['map']['field']] = $field['label'];
}
foreach ($entity_type_form_results as $fieldName => &$field) {
$field['extra_opts']['help'] = null;
$field['label'] = null;
$field['extra_opts']['clari'] = null;
$field['extra_opts']['value'] = $_GET[$fieldName];
$field['extra_opts']['required'] = null;
}
$entity_fields_html = shn_form_get_html_fields($entity_type_form_results);
$htmlFields = array();
//iterate through the search fields, checking input values
foreach ($entity_type_form_results as $field_name => $x) {
// Generates the view's Label list
$htmlFields[$field_name] = $entity_fields_html[$field_name];
}
$result_pager = Browse::getExecuteSql($sqlStatement);
$columnValues = $result_pager->get_page_data();
$columnValues = set_links_in_recordset($columnValues, 'person');
set_huriterms_in_record_array($entity_type_form_results, $columnValues);
//rendering the view
$columnNames = $field_list;
$this->htmlFields = $htmlFields;
if ($columnValues != null && count($columnValues)) {
$result_pager->render_pages();
shn_form_get_html_person_search_ctrl($columnNames, $columnValues, $htmlFields, $_GET['mod'], $_GET['act']);
$result_pager->render_pages();
} else {
shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_FOUND_'));
echo shnMessageQueue::renderMessages();
}
}
示例14: License
if (isset($_POST['license_id'])) {
$license = new License($_POST['license_id']);
if ($license->id) {
$license->update($_POST);
}
$text = T_('License Updated');
} else {
License::create($_POST);
$text = T_('License Created');
}
show_confirmation($text, '', AmpConfig::get('web_path') . '/admin/license.php');
break;
case 'show_edit':
$license = new License($_REQUEST['license_id']);
case 'show_create':
require_once AmpConfig::get('prefix') . '/templates/show_edit_license.inc.php';
break;
case 'delete':
License::delete($_REQUEST['license_id']);
show_confirmation(T_('License Deleted'), '', AmpConfig::get('web_path') . '/admin/license.php');
break;
default:
$browse = new Browse();
$browse->set_type('license');
$browse->set_simple_browse(true);
$license_ids = $browse->get_objects();
$browse->show_objects($license_ids);
$browse->store();
break;
}
UI::show_footer();
示例15: act_dashboard
public function act_dashboard()
{
global $global, $conf;
$activeFormats = getActiveFormats();
$entityFields = Browse::getAllEntityFields();
$response = array();
foreach ($activeFormats as $format => $formatTitle) {
if ($conf['dashboard_format_counts_' . $format] != 'true') {
continue;
}
$count_query = "SELECT COUNT(*) as count FROM {$format} ";
try {
$res_count = $global['db']->Execute($count_query);
foreach ($res_count as $row) {
$response["counts"][$format] = array((int) $row["count"], $formatTitle);
}
} catch (Exception $e) {
}
}
$timelineType = "day";
if ($_REQUEST['timelinetype'] == "month") {
$timelineType = "month";
} elseif ($_REQUEST['timelinetype'] == "year") {
$timelineType = "year";
}
$this->timelineType = $timelineType;
if ($timelineType == "month") {
$dateFormat = '%b %Y';
} elseif ($timelineType == "year") {
$dateFormat = '%Y';
} else {
$dateFormat = '%d %b %Y';
}
$datestart = "";
$dateend = "";
if (isset($_REQUEST['daterange'])) {
$daterange = $_REQUEST['daterange'];
$daterange = explode(",", $daterange);
$datestart2 = trim($daterange[0]);
$dateend2 = trim($daterange[1]);
$date_format = 'Y-m-d';
$timestart = strtotime($datestart2);
$timeend = strtotime($dateend2);
if ($timestart && $timeend) {
$datestart = date($date_format, $timestart);
$dateend = date($date_format, $timeend);
}
}
if ($datestart && $dateend) {
$this->daterange = $datestart . " , " . $dateend;
} else {
$this->daterange = "";
}
/*$sql = "SELECT DATE_FORMAT(m.date_of_entry,'$dateFormat') as val , COUNT(e.event_record_number) AS count
FROM event e join management m on m.entity_id=e.event_record_number and m.entity_type='event' ";
if ($datestart && $dateend) {
$sql .= " where m.date_of_entry BETWEEN '$datestart' AND '$dateend' ";
}
$sql .= "GROUP BY val order by m.date_of_entry ";*/
$dashboard_date_counts = array();
if ($conf['dashboard_date_counts']) {
$dashboard_date_counts = @json_decode($conf['dashboard_date_counts']);
$dashboard_date_counts = (array) $dashboard_date_counts;
}
$response["timeline"] = array();
foreach ($entityFields as $record) {
$entity = $record['entity'];
$field = $record['field_name'];
$selVal = $entity . "|||" . $field;
if (in_array($selVal, $dashboard_date_counts)) {
$primary_key = get_primary_key($entity);
if (in_array($field, array('date_received', 'date_of_entry', 'date_updated'))) {
$sql = "SELECT DATE_FORMAT(m.{$field},'{$dateFormat}') as val , COUNT(e.{$primary_key}) AS count\n FROM {$entity} e join management m on m.entity_id=e.{$primary_key} and m.entity_type='{$entity}' ";
if ($datestart && $dateend) {
$sql .= " where m.{$field} BETWEEN '{$datestart}' AND '{$dateend}' ";
}
$sql .= "GROUP BY val order by m.{$field} ";
} else {
$sql = "SELECT DATE_FORMAT(e.{$field} ,'{$dateFormat}') as val , COUNT(e.{$primary_key}) AS count\n FROM {$entity} e ";
if ($datestart && $dateend) {
$sql .= " where e.{$field} BETWEEN '{$datestart}' AND '{$dateend}' ";
}
$sql .= "GROUP BY val order by e.{$field} ";
}
$response["timeline"][$selVal]['entity'] = $entity;
$response["timeline"][$selVal]['entity_label'] = $activeFormats[$entity];
$response["timeline"][$selVal]['field_name'] = $field;
$response["timeline"][$selVal]['field_label'] = $record['field_label'];
try {
$res_count = $global['db']->Execute($sql);
foreach ($res_count as $row) {
$response["timeline"][$selVal]['data'][0] = array(ucfirst($timelineType), "Count");
if (!$row["val"] && !(int) $row["count"]) {
continue;
}
if (!$row["val"]) {
$row["val"] = "Undefined";
}
$response["timeline"][$selVal]['data'][] = array($row["val"], (int) $row["count"]);
}
//.........这里部分代码省略.........