本文整理汇总了PHP中readable函数的典型用法代码示例。如果您正苦于以下问题:PHP readable函数的具体用法?PHP readable怎么用?PHP readable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quality_report
function quality_report($id, $status_filter = null)
{
//$data['report'] = $this->getDataSourceReport($id);
$data['title'] = 'Data Source Report';
$data['scripts'] = array();
$data['less'] = array('charts');
$data['js_lib'] = array('core');
$this->load->model("data_source/data_sources", "ds");
$this->load->model("registry_object/registry_objects", "ro");
if ($status_filter) {
$data['filter'] = "Quality report for " . readable($status_filter);
}
$report = array();
$data['ds'] = $this->ds->getByID($id);
$ids = $this->ro->getIDsByDataSourceID($id, false, 'All');
acl_enforce('REGISTRY_USER');
ds_acl_enforce((int) $id);
if ($ids) {
$data['record_count'] = sizeof($ids);
$problems = 0;
$replacements = array("recommended" => "<u>recommended</u>", "required" => "<u>required</u>", "must be" => "<u>must be</u>");
foreach ($ids as $idx => $ro_id) {
try {
$ro = $this->ro->getByID($ro_id);
if (!$status_filter || $ro->status == $status_filter) {
$report_html = $ro ? str_replace(array_keys($replacements), array_values($replacements), $ro->getMetadata('quality_html')) : '';
$report[$ro_id] = array('quality_level' => $ro->quality_level == 4 ? 'Gold Standard' : $ro->quality_level, 'class' => $ro->class, 'title' => $ro->title, 'status' => readable($ro->status), 'id' => $ro->id, 'report' => $report_html);
}
} catch (Exception $e) {
throw new Exception($e);
}
unset($ro);
clean_cycles();
}
}
uasort($report, array($this, 'cmpByQualityLevel'));
$data['report'] = $report;
$this->load->view('detailed_quality_report', $data);
}
示例2: getDataSourceQualityChart
public function getDataSourceQualityChart($data_source_id, $status = 'ALL', $as_csv = false)
{
$chart_result = array();
$constraints = array($data_source_id);
if ($status != 'ALL') {
$constraints[] = $status;
}
$query = $this->db->query("SELECT count(*) AS count, `value`, `class`\n\t\t\t\t\t\t\tFROM registry_objects ro \n\t\t\t\t\t\t\tJOIN registry_object_attributes ra ON ra.registry_object_id = ro.registry_object_id \n\t\t\t\t\t\t\tWHERE data_source_id=? AND ra.attribute = 'quality_level' " . ($status != 'ALL' ? "AND ro.status = ? " : '') . "\n\t\t\t\t\t\t\tGROUP BY `value`, `class`;", $constraints);
$this->load->model("registry_object/registry_objects");
$chart_result['All Records'] = array();
foreach (Registry_objects::$classes as $c => $c_label) {
$chart_result[$c_label] = array();
foreach (Registry_objects::$quality_levels as $q => $q_label) {
if (!isset($chart_result['All'][$q_label])) {
$chart_result['All Records'][$q_label] = 0;
}
if ($q_label == "Gold Standard Record") {
$gs_query = $this->db->query("SELECT count(*) AS count\n\t\t\t\t\t\t\tFROM registry_objects ro \n\t\t\t\t\t\t\tJOIN registry_object_attributes ra ON ra.registry_object_id = ro.registry_object_id \n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\tclass = ? \n\t\t\t\t\t\t\tAND data_source_id=? \n\t\t\t\t\t\t\tAND ra.attribute = 'gold_status_flag' \n\t\t\t\t\t\t\tAND ra.value = 't' " . ($status != 'ALL' ? "AND ro.status = ? " : '') . ";", array_merge(array($c), $constraints));
$gs_query = array_pop($gs_query->result_array());
$chart_result[$c_label][$q_label] = (int) $gs_query['count'];
$chart_result['All Records'][$q_label] = $chart_result['All Records'][$q_label] + (int) $gs_query['count'];
} else {
$chart_result[$c_label][$q_label] = 0;
}
}
}
foreach ($query->result() as $row) {
if (isset($chart_result[Registry_objects::$classes[$row->class]]) && isset(Registry_objects::$quality_levels[$row->value])) {
$chart_result[Registry_objects::$classes[$row->class]][Registry_objects::$quality_levels[$row->value]] = (int) $row->count;
$chart_result['All Records'][Registry_objects::$quality_levels[$row->value]] = $chart_result['All Records'][Registry_objects::$quality_levels[$row->value]] + (int) $row->count;
}
}
// Default, deliver as JSON
if (!$as_csv) {
echo json_encode($chart_result);
} else {
$header_row = array("");
foreach (Registry_objects::$quality_levels as $q => $q_label) {
array_push($header_row, $q_label);
}
$rows = array(array(readable($status) . " Records"), $header_row);
foreach ($chart_result as $class => $results) {
array_unshift($results, $class);
$rows[] = $results;
}
// We'll be outputting a CSV
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename="datasource_quality_' . $data_source_id . '.xls"');
$data = array_merge($rows);
echo array_to_TABCSV($data);
}
}
示例3: readable
@endforeach
@if($ro->relationships['service_count'] > $relatedLimit)
<a href="{{$relatedSearchQuery}}/class=service">View all {{$ro->relationships['service_count']}} related services</a>
@endif
</p>
@endif
@if($hasRelatedWebsite)
<h4>Related Websites</h4>
@foreach($ro->relatedInfo as $relatedInfo)
@if($relatedInfo['type']=='website')
<?php
$description = '';
$relationship = '';
if (isset($relatedInfo['relation']['relation_type']) && $relatedInfo['relation']['relation_type'] != '') {
$relationship = readable($relatedInfo['relation']['relation_type']);
}
if (isset($relatedInfo['relation']['description']) && $relatedInfo['relation']['description'] != '') {
$description .= 'tip="' . $relatedInfo['relation']['description'] . '"';
} elseif (isset($relatedInfo['identifier']['identifier_href']['hover_text']) && $relatedInfo['identifier']['identifier_href']['hover_text'] != '') {
$description = 'tip="' . $relatedInfo['identifier']['identifier_href']['hover_text'] . '"';
} elseif (isset($relatedInfo['identifier']['identifier_value']) && $relatedInfo['identifier']['identifier_value'] != '') {
$description = 'tip="' . $relatedInfo['identifier']['identifier_value'] . '"';
} else {
$description = 'tip="' . $relatedInfo['title'] . '"';
}
?>
@if($relatedInfo['title'])
<i class="fa fa-globe icon-portal""></i> <small>{{$relationship}} </small> {{$relatedInfo['title']}}
<p>
@if($relatedInfo['identifier']['identifier_href']['display_text'])
示例4: ReleaseImage
$ri = new ReleaseImage();
$folders[$ri->audSavePath] = [R, W];
$folders[$ri->imgSavePath] = [R, W];
$folders[$ri->jpgSavePath] = [R, W];
$folders[$ri->movieImgSavePath] = [R, W];
$folders[$ri->vidSavePath] = [R, W];
} else {
echo 'Skipping cover folders check, as you have not set up a database yet. You can rerun this script after running install.' . PHP_EOL;
}
// Check folders.
foreach ($folders as $folder => $check) {
exists($folder);
foreach ($check as $type) {
switch ($type) {
case R:
readable($folder);
break;
case W:
writable($folder);
break;
case E:
executable($folder);
break;
}
}
}
echo 'Your permissions seem right for this user. Note, this script does not verify all paths, only the most important ones.' . PHP_EOL;
if (!nzedb\utility\Misc::isWin()) {
$user = posix_getpwuid(posix_geteuid());
if ($user['name'] !== 'www-data') {
echo 'If you have not already done so, please rerun this script using the www-data user: sudo -u www-data php verify_permissions.php yes' . PHP_EOL;
示例5: foreach
if (isset($right['accessRights_type'])) {
$ar = $right['accessRights_type'];
}
$detail = true;
} else {
$detail = true;
}
}
if ($detail) {
$content = '';
foreach ($ro->rights as $right) {
$itemprop = '';
if ($right['type'] == 'licence') {
$itemprop = 'itemprop="license"';
}
$content .= '<h4>' . readable($right['type']) . '</h4>';
$content .= '<p ' . $itemprop . '>' . $right['value'] . '</p>';
}
}
}
?>
<div class="panel panel-primary swatch-white">
<div class="panel-body">
<div class="center-block" style="text-align:center">
<div ng-if="ro.stat">
<span style="padding-right:4px;" tip="This page has been viewed [[ro.stat.viewed]] times.<br/><span style='font-size:0.8em'>Statistics collected since April 2015</span>"><small>Viewed: </small>[[ro.stat.viewed]]</span>
<!-- <a href="#" style="padding-right:4px;"><small>Accessed: </small>[[ro.stat.accessed]]</a> -->
</div>
</div>
<div class="btn-group btn-group-justified element element-short-bottom element-short-top" role="group" aria-label="...">
示例6: list_roles
/**
* List All Roles that fit in a role_type_id in JSON form
* @param string $role_type_id
* @return json
*/
public function list_roles($role_type_id = false)
{
if (!$role_type_id) {
$role_type_id = false;
}
$roles = array();
foreach ($this->roles->list_roles($role_type_id) as $role) {
$role = array('role_id' => rawurlencode($role->role_id), 'name' => $role->name, 'type' => readable($role->role_type_id), 'enabled' => readable($role->enabled), 'last_modified' => $role->modified_when, 'auth_service' => $role->authentication_service_id);
array_push($roles, $role);
}
echo json_encode($roles);
}
示例7: readable
?>
</label>
<label class="checkbox"><input type="checkbox" name="ro_status" value="DRAFT" checked="checked" /><?php
echo readable('DRAFT');
?>
</label>
<label class="checkbox"><input type="checkbox" name="ro_status" value="SUBMITTED_FOR_ASSESSMENT" checked="checked" /><?php
echo readable('SUBMITTED_FOR_ASSESSMENT');
?>
</label>
<label class="checkbox"><input type="checkbox" name="ro_status" value="MORE_WORK_REQUIRED" checked="checked" /><?php
echo readable('MORE_WORK_REQUIRED');
?>
</label>
<label class="checkbox"><input type="checkbox" name="ro_status" value="ASSESSMENT_IN_PROGRESS" checked="checked"/><?php
echo readable('assessment_in_progress');
?>
</label>
<hr/>
<label><b>Export As:</b></label>
<label class="checkbox"><input type="radio" name="format" checked="checked" value="rif-cs"/> RIF-CS</label>
<label class="checkbox"><input type="radio" name="format" value="dci"/> DCI</label>
</fieldset>
</form>
</div>
</div>
<div class="modal-footer">
<a href="javascript:;" class="btn btn-primary" ng-click="export('file')"><i class="icon icon-white icon-download"></i> Download As File</a>
<a href="javascript:;" class="btn btn-link" ng-click="export('xml')">View Records in Browser</a>
<a href="#" class="btn hide" data-dismiss="modal">Close</a>
</div>
示例8: tmp
/**
* 创建并返回一个临时文件路径
* @param string $prefix 文件名前缀
* @param string $dir 指定根目录
* @return boolean
*/
function tmp($prefix = 'tmp', $dir = null)
{
if (!is_dir($dir)) {
$dir = sys_get_temp_dir();
}
$filename = tempnam($dir, $prefix);
if (!$filename) {
return error('cannot create template file');
}
if (!readable($filename)) {
return false;
}
return realpath($filename);
}
示例9: check_unique_ro_key
/**
* check an ro_key to see uniqueness
* @param string ro_key
* @return [results]
*/
public function check_unique_ro_key()
{
$results = array();
$this->load->database();
$key = $this->input->get('ro_key');
$results['ro_key'] = $key;
// $query = $this->db->select('*')->get_where('registry_objects', array("binary key"=>$key), true);
//case sensitive search for key
$query = $this->db->where('binary `key` =', '"' . $key . '"', false)->get('registry_objects');
$results['ro_list'] = $query->result_array();
if (is_array($results['ro_list']) && count($results['ro_list'] > 0)) {
foreach ($results['ro_list'] as &$item) {
$item['status'] = readable($item['status'], true);
}
}
$results = json_encode($results);
echo $results;
}
示例10: readable
@if($ro->relatedInfo)
@foreach($ro->relatedInfo as $relatedInfo)
@if($relatedInfo['type']=='party')
@if(isset($relatedInfo['identifier']['identifier_href']['href']))
<?php
$outstr = '<a href="' . $relatedInfo['identifier']['identifier_href']['href'] . '">' . $relatedInfo['title'] . ' </a>';
?>
@else
<?php
$outstr = $relatedInfo['title'];
?>
@endif
@if(isset($relatedInfo['relation']['relation_type']))
<?php
$type = readable($relatedInfo['relation']['relation_type'], 'EXPLICIT', $ro->core['class']);
?>
@else
<?php
$type = '';
?>
@endif
<?php
if (isset($sortedArray[$type])) {
$sortedArray[$type][] = $outstr;
} else {
$sortedArray[$type] = array();
$sortedArray[$type][] = $outstr;
}
?>
示例11: registry_url
echo registry_url('assets/img/party.png');
?>
">
<div class="pull-left" style="line-height:10px;">
<small>
<?php
echo ellipsis($record->title, 55);
?>
<small class="clearfix muted">Updated <?php
echo timeAgo($record->updated);
?>
</small>
</small>
</div>
<span class="tag pull-right status_<?php
echo $record->status;
?>
"><?php
echo readable($record->status, true);
?>
</span> </a>
<br class="clear"/>
<?php
}
} else {
echo '<i>No records have been updated in the past 7 days.</i>';
}
?>
</div>
示例12: readable
<td><?php
echo readable($role->role_type_id);
?>
</td>
</tr>
<tr>
<th>Authentication Service</th>
<td><?php
echo readable($role->authentication_service_id);
?>
</td>
</tr>
<tr>
<th>Enabled</th>
<td><?php
echo readable($role->enabled);
?>
</td>
</tr>
<tr>
<th>Last Login</th>
<td><?php
echo $role->last_login;
?>
</td>
</tr>
<tr>
<th>Created When</th>
<td><?php
echo $role->created_when;
?>
示例13: arrayCleaner
?>
</div>
<div id="minTime" class="hidden"> <?php
echo $minTime;
?>
</div>
<?php
#### Diagnostics ####
if ($_CONFIG->trial_diagnostics == true or $trialFail == true) {
// clean the arrays used so that they output strings, not code
$clean_session = arrayCleaner($_SESSION);
$clean_currentTrial = arrayCleaner($currentTrial);
echo '<div class=diagnostics>' . '<h2>Diagnostic information</h2>' . '<ul>' . '<li> Condition #: ' . $clean_session['Condition']['Number'] . '</li>' . '<li> Condition Stimuli File:' . $clean_session['Condition']['Stimuli'] . '</li>' . '<li> Condition Procedure File: ' . $clean_session['Condition']['Procedure'] . '</li>' . '<li> Condition description: ' . $clean_session['Condition']['Condition Description'] . '</li>' . '</ul>' . '<ul>' . '<li> Trial Number: ' . $currentPos . '</li>' . '<li> Trial Type: ' . $trialType . '</li>' . '<li> Trial max time: ' . $clean_currentTrial['Procedure']['Max Time'] . '</li>' . '<li> Trial Time (seconds): ' . $maxTime . '</li>' . '</ul>' . '<ul>' . '<li> Cue: ' . show($cue) . '</li>' . '<li> Answer: ' . show($answer) . '</li>' . '</ul>';
readable($currentTrial, "Information loaded about the current trial");
readable($_SESSION['Trials'], "Information loaded about the entire experiment");
echo '</div>';
}
?>
<!-- Pre-Cache Next trial -->
<div class="precachenext">
<?php
if ($nextTrial) {
$nextCues = explode('|', $nextTrial['Stimuli']['Cue']);
$nextAnswers = explode('|', $nextTrial['Stimuli']['Answer']);
$allNext = array_merge($nextCues, $nextAnswers);
foreach ($allNext as $next) {
echo show($next);
}
}
示例14: getConnections
public function getConnections($ro_id, $limit = null)
{
$connections = array();
$status = array();
if ($limit && (int) $limit > 0) {
$party_conn_limit = $limit;
} else {
$party_conn_limit = 20;
}
$this->load->model('registry_object/registry_objects', 'ro');
$ro = $this->ro->getByID($ro_id);
if ($ro) {
//$connections = $ro->getConnections();
if ($ro->class == 'party') {
$connections = $ro->getAllRelatedObjects(true, false, false, $party_conn_limit);
} else {
$connections = $ro->getAllRelatedObjects(true);
}
foreach ($connections as &$link) {
// Reverse the relationship description (note: this reverses to the "readable" version (i.e. not camelcase))
if ($link['registry_object_id'] && in_array($link['origin'], array('REVERSE_EXT', 'REVERSE_INT'))) {
$link['relation_type'] = format_relationship($link['class'], $link['relation_type'], $link['origin'], $ro->class);
}
if ($link['status']) {
$link['readable_status'] = readable($link['status']);
}
}
}
$status['count'] = sizeof($connections);
echo json_encode(array("status" => $status, "connections" => $connections));
}
示例15: phpini
/**
* Prints a list of the configuration settings read from <i>php.ini</i>
*
* @access public
* @static
*/
public static function phpini()
{
// disabled ?
//
if (!krumo::_debug()) {
return false;
}
if (!readable(get_cfg_var('cfg_file_path'))) {
return false;
}
// render it
//
?>
<div class="krumo-title">
This is a list of the configuration settings read from <code><b><?php
echo get_cfg_var('cfg_file_path');
?>
</b></code>.
</div>
<?php
return krumo::dump(parse_ini_file(get_cfg_var('cfg_file_path'), true));
}