本文整理汇总了PHP中Institution::count_members方法的典型用法代码示例。如果您正苦于以下问题:PHP Institution::count_members方法的具体用法?PHP Institution::count_members怎么用?PHP Institution::count_members使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Institution
的用法示例。
在下文中一共展示了Institution::count_members方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_institution_graph
function user_institution_graph($type = null)
{
// Draw a bar graph showing the number of users in each institution
require_once get_config('libroot') . 'institution.php';
$institutions = Institution::count_members(false, true);
if (count($institutions) > 1) {
$dataarray = array();
foreach ($institutions as &$i) {
$dataarray[$i->displayname][get_string('institution')] = $i->members;
}
arsort($dataarray);
// Truncate to avoid trying to fit too many results onto graph
$dataarray = array_slice($dataarray, 0, 12, true);
$data['graph'] = $type ? $type : 'bar';
$data['graph_function_name'] = 'user_institution_graph';
$data['title'] = get_string('institutionmembers', 'admin');
$data['labels'] = array_keys($dataarray[$i->displayname]);
$data['data'] = $dataarray;
return $data;
}
}
示例2: build_institutions_html
function build_institutions_html($filter, $showdefault, $query, $limit, $offset, &$count = null)
{
global $USER;
$institutions = Institution::count_members($filter, $showdefault, $query, $limit, $offset, $count);
$smarty = smarty_core();
$smarty->assign('institutions', $institutions);
$smarty->assign('siteadmin', $USER->get('admin'));
$data['tablerows'] = $smarty->fetch('admin/users/institutionsresults.tpl');
$pagination = build_pagination(array('id' => 'adminstitutionslist_pagination', 'datatable' => 'adminstitutionslist', 'url' => get_config('wwwroot') . 'admin/users/institutions.php' . (!empty($query) ? '?query=' . urlencode($query) : ''), 'jsonscript' => 'admin/users/institutions.json.php', 'count' => $count, 'limit' => $limit, 'offset' => $offset, 'resultcounttextsingular' => get_string('institution', 'admin'), 'resultcounttextplural' => get_string('institutions', 'admin')));
$data['pagination'] = $pagination['html'];
$data['pagination_js'] = $pagination['javascript'];
return $data;
}
示例3: user_institution_graph
function user_institution_graph()
{
// Draw a bar graph showing the number of users in each institution
require_once get_config('libroot') . 'institution.php';
$institutions = Institution::count_members(false, true);
if (count($institutions) > 1) {
$dataarray = array();
foreach ($institutions as &$i) {
$dataarray[$i->displayname] = $i->members;
}
arsort($dataarray);
// Truncate to avoid overlapping labels
$dataarray = array_slice($dataarray, 0, 25, true);
require_once get_config('libroot') . "pear/Image/Graph.php";
$Graph =& Image_Graph::factory('graph', array(300, 300));
$Font =& $Graph->addNew('font', 'Vera');
$Font->setSize(9);
$Graph->setFont($Font);
$Graph->add(Image_Graph::vertical(Image_Graph::vertical(Image_Graph::factory('title', array(get_string('institutionmembers', 'admin'), 9)), $Plotarea = Image_Graph::factory('plotarea'), 5), $Date = Image_Graph::factory('title', array(format_date(time(), 'strftimew3cdate'), 7)), 96));
$Date->setAlignment(IMAGE_GRAPH_ALIGN_RIGHT);
$DateFont =& $Graph->addNew('font', 'Vera');
$DateFont->setColor('gray@0.8');
$Date->setFont($DateFont);
$Dataset =& Image_Graph::factory('dataset', array($dataarray));
$Plot =& $Plotarea->addNew('bar', array(&$Dataset));
$Plot->setLineColor('gray');
$Plot->setSpacing(2);
$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
$Plot->setFillStyle($FillArray);
$FillArray->addColor('blue@0.6');
$FillArray->addColor('green@0.6');
$FillArray->addColor('red@0.6');
$FillArray->addColor('yellow@0.6');
$FillArray->addColor('orange@0.6');
$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
if (count($dataarray) > 4) {
$AxisX->setFontAngle('vertical');
}
$AxisX->setFontSize(8);
$Graph->done(array('filename' => stats_graph_path('institutions')));
}
}