本文整理汇总了PHP中Lookup::item方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::item方法的具体用法?PHP Lookup::item怎么用?PHP Lookup::item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lookup
的用法示例。
在下文中一共展示了Lookup::item方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
</div>
</div>
<!-- Detail View -->
<?php
// Prepare bug list
$bugList = '';
foreach ($model->bugs as $bugCrashReport) {
if ($bugCrashReport->bug->status < Bug::STATUS_OPEN_MAX) {
$bugList .= CHtml::link('#' . $bugCrashReport->bug_id, array('bug/view', 'id' => $bugCrashReport->bug_id)) . ' ';
}
if ($bugList == '') {
$bugList = 'None';
}
}
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'received', 'type' => 'text', 'value' => date("d/m/y H:i", $model->received)), array('name' => 'date_created', 'type' => 'text', 'value' => date("d/m/y H:i", $model->date_created)), array('name' => 'status', 'type' => 'text', 'value' => Lookup::item('CrashReportStatus', $model->status)), array('name' => 'filesize', 'type' => 'raw', 'value' => CHtml::encode(MiscHelpers::fileSizeToStr($model->filesize))), array('name' => 'project_id', 'type' => 'text', 'value' => $model->project->name), array('name' => 'appversion_id', 'type' => 'text', 'value' => $model->appVersion->version), 'crashguid', array('name' => 'crashrptver', 'type' => 'text', 'value' => 'CrashRpt ' . CrashReport::generatorVersionToStr($model->crashrptver)), array('name' => 'srcfilename', 'type' => 'raw', 'value' => CHtml::link($model->srcfilename, array('crashReport/download', 'id' => $model->id))), array('name' => 'groupid', 'type' => 'raw', 'value' => CHtml::link(CHtml::encode($model->collection->title), array('crashGroup/view', 'id' => $model->groupid))), array('label' => 'Open Bug(s)', 'type' => 'raw', 'value' => $bugList))));
?>
<div class="span-27 last detail-group-caption">Sender Info:</div>
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'geo_location', 'type' => 'text', 'value' => CrashReport::geoIdToCountryName($model->geo_location)), 'ipaddress', 'emailfrom', 'description')));
?>
<div class="span-27 last detail-group-caption">Exception Info:</div>
<?php
$text = $model->exception_thread_id != 0 ? '0x' . dechex($model->exception_thread_id) : null;
$exceptionThread = $model->getExceptionThread();
if ($exceptionThread) {
$link = CHtml::link(CHtml::encode('View Stack Trace'), array('crashReport/view', 'id' => $model->id, 'tab' => 'Threads', 'thread' => $exceptionThread->id));
示例2: ID
</div>
<div>
Status: <?php
echo CHtml::encode(Lookup::item('BugStatus', $model->status));
?>
</div>
<div>
Priority: <?php
echo CHtml::encode(Lookup::item('BugPriority', $model->priority));
?>
</div>
<div>
Reproducibility: <?php
echo CHtml::encode(Lookup::item('BugReproducability', $model->reproducability));
?>
</div>
<div>
Owner: <?php
echo $model->assigned_to < 0 ? 'nobody' : (isset($model->owner) ? CHtml::encode($model->owner->username) : 'user not found');
?>
</div>
</div>
</div>
<div class="span-27 last">
<div id="bug-group-associations">
<?php
$bugCrashGroups = $model->crashGroups;
if ($bugCrashGroups != null) {
echo 'Collection ID(s) associated with this bug: ';
示例3: array
if ($model->comment != null) {
echo '<div class="bug-change-comment">' . CHtml::encode(str_replace("<br>", "\n", $model->comment->text)) . '</div>';
}
if ($model->statuschange) {
echo '<div class="bug-change-status"><ul>';
if (isset($model->statuschange->status)) {
echo '<li>Status: ' . Lookup::item('BugStatus', $model->statuschange->status);
}
if (isset($model->statuschange->merged_into)) {
echo '<li>Merged into bug: ' . CHtml::link($model->statuschange->merged_into, array('bug/view', 'id' => $model->statuschange->merged_into));
}
if (isset($model->statuschange->priority)) {
echo '<li>Priority: ' . Lookup::item('BugPriority', $model->statuschange->priority);
}
if (isset($model->statuschange->reproducability)) {
echo '<li>Reproducibility: ' . Lookup::item('BugReproducability', $model->statuschange->reproducability);
}
if (isset($model->statuschange->assigned_to)) {
if ($model->statuschange->assigned_to >= 0) {
echo '<li>Owner: ' . (isset($model->statuschange->owner) ? CHtml::encode($model->statuschange->owner->username) : 'user was deleted');
} else {
echo '<li>Owner: nobody';
}
}
echo '</ul></div>';
}
foreach ($model->attachments as $attachment) {
echo '<div class="bug-change-attach">' . CHtml::image(Yii::app()->baseUrl . '/images/file.png') . 'File attached: ' . CHtml::link(CHtml::encode($attachment->filename), array('bug/downloadAttachment', 'id' => $attachment->id)) . ' (' . MiscHelpers::fileSizeToStr($attachment->filesize) . ')' . '</div>';
}
?>
示例4: testItem
public function testItem()
{
$this->assertTrue(Lookup::item('CrashReportStatus', 1) == 'Waiting');
$this->assertTrue(Lookup::item('UserStatus', 1) == 'Active');
}
示例5: array
<?php
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('ui', 'View Person');
$this->breadcrumbs = array(Yii::t('ui', 'Persons') => $this->getReturnUrl() ? $this->getReturnUrl() : array('index'), $model->firstname . ' ' . $model->lastname);
?>
<h2><?php
echo Yii::t('ui', 'View Person');
?>
</h2>
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'id', 'visible' => Yii::app()->user->name == 'admin' ? true : false), 'firstname', 'lastname', 'birthyear', 'email:email', 'webpage:url', array('name' => 'country_id', 'value' => $model->country->name), array('name' => 'eyecolor_code', 'value' => Lookup::item('eyecolor', $model->eyecolor_code)), 'registered')));
?>
<br />
<div class="tpanel">
<div class="toggle"><?php
echo Yii::t('ui', 'View code');
?>
</div>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
array(
'name'=>'id', // only admin user can see person id
'visible'=>Yii::app()->user->name=='admin'? true : false,
示例6:
?>
<br />
<b><?php
echo CHtml::encode($data->getAttributeLabel('country_id'));
?>
:</b>
<?php
echo CHtml::encode($data->country->name);
?>
<br />
<b><?php
echo CHtml::encode($data->getAttributeLabel('eyecolor_code'));
?>
:</b>
<?php
echo Lookup::item('eyecolor', $data->eyecolor_code);
?>
<br />
<b><?php
echo CHtml::encode($data->getAttributeLabel('registered'));
?>
:</b>
<?php
echo CHtml::encode($data->registered);
?>
<br />
</div>
示例7: array
<h3><?php
echo Yii::t('ui', 'Display classificator');
?>
</h3>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
echo Lookup::item("eyecolor",$model->eyecolor_code);
<?php
$this->endWidget();
?>
<?php
echo Lookup::item("eyecolor", $model->eyecolor_code);
?>
<h3 style="margin-top:30px"><?php
echo Yii::t('ui', 'Dropdown classificators');
?>
</h3>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
echo CHtml::activeDropDownList($model,'eyecolor_code',Lookup::items('eyecolor'));
<?php
$this->endWidget();
?>
示例8: generateBugStatusDistributionGraph
/**
* Generates a crash report version distribution graph for currently
* selected project and dumps it to stdout.
* @param type $w Desired image width.
* @param type $h Desired image height.
* @throws CHttpException
* @return void
*/
public static function generateBugStatusDistributionGraph($w, $h, $file = null)
{
if (!is_numeric($w) || $w <= 0 || $w > 1024) {
throw new CHttpException(403, 'Invalid parameter');
}
if (!is_numeric($h) || $h <= 0 || $h > 960) {
throw new CHttpException(403, 'Invalid parameter');
}
// Get current project info
$curProjectId = Yii::app()->user->getCurProjectId();
if ($curProjectId == false) {
throw new CHttpException(403, 'Invalid parameter');
}
$curVer = Yii::app()->user->getCurProjectVer();
// Prepare data
$criteria = new CDbCriteria();
$criteria->select = 'status, COUNT(*) as cnt';
$criteria->group = 'status';
$criteria->compare('project_id', $curProjectId);
$criteria->order = 'status DESC';
if ($curVer != -1) {
$criteria->compare('appversion_id', $curVer == 0 ? null : $curVer);
}
$data = array();
$models = Bug::model()->findAll($criteria);
$totalCount = 0;
$curVerStr = '';
foreach ($models as $model) {
$totalCount += $model->cnt;
$data[Lookup::item('BugStatus', $model->status)] = $model->cnt;
}
// Check the case when $data is empty.
if (count($data) == 0) {
// Open out file
if ($file != null) {
$fout = @fopen($file, 'w');
if ($fout == false) {
@unlink($tmpfile);
throw new CHttpException(403, 'Invalid file.');
}
}
// No data available
$fileName = Yii::app()->basePath . '/../images/no_data_available.png';
if ($fd = @fopen($fileName, "r")) {
$fsize = filesize($fileName);
// Write HTTP headers
header("Content-type: image/png");
//header("Content-Disposition: filename=\"".$fileName."\"");
header("Content-length: {$fsize}");
header("Cache-control: private");
//use this to open files directly
// Write file content
while (!feof($fd)) {
$buffer = fread($fd, 2048);
if ($file == null) {
echo $buffer;
} else {
fwrite($fout, $buffer);
}
}
if ($file != null) {
fclose($fout);
}
fclose($fd);
}
return;
}
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->data['Versions'] = new ezcGraphArrayDataSet($data);
$graph->legend = true;
$graph->legend->position = ezcGraph::RIGHT;
$graph->options->font->name = 'Tahoma';
$graph->options->sum = $totalCount;
$graph->options->summarizeCaption = 'Others';
$graph->renderer->options->pieChartGleam = 0.3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartGleamBorder = 2;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartRotation = 0.8;
$graph->renderer->options->pieChartShadowSize = 10;
if ($file === null) {
$graph->renderToOutput($w, $h);
} else {
$graph->render($w, $h, $file);
}
}
示例9: getEffectiveStatusStr
/**
* Formats an effective status string ('Active', 'Disabled' or
* 'Disabled (group)').
* @return string Status string
*/
public function getEffectiveStatusStr()
{
if ($this->isGroupDisabled()) {
return 'Disabled (group)';
}
return Lookup::item('UserStatus', $this->status);
}
示例10: array
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $data, 'attributes' => array('id', array('name' => 'type', 'value' => Lookup::ruitem('CommentType', $data->type)), array('name' => 'parentTitle', 'value' => $data->parent->title), array('name' => 'url', 'type' => 'raw', 'value' => CHtml::link(@$data->parent->url, @$data->parent->url)), array('name' => 'author', 'type' => 'raw', 'value' => $data->_author), 'text_marked:raw', array('name' => 'created', 'type' => 'text', 'value' => $data->back_time . ' (' . $data->created . ')'), 'rating', array('name' => 'status', 'value' => Lookup::item('CommentStatus', $data->status)))));
?>
<br /><hr />
示例11: date
'id',
'username',
'password',
'email',
'activkey',
array(
'name' => 'createtime',
'value' => date("d.m.Y H:i:s",$model->createtime),
),
array(
'name' => 'lastvisit',
'value' => ($model->lastvisit?date("d.m.Y H:i:s",$model->lastvisit):Users::t("Not visited")),
),
array(
'name' => 'role',
'value' => Lookup::item("role",$model->role),
),
array(
'name' => 'status',
'value' => User::itemAlias("UserStatus",$model->status),
)
);
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>$attributes
));
$prof_attrs = array();
$profileFields=ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
示例12: array
?>
<?php
echo CHtml::endForm();
?>
</div>
</div>
<div class="span-18 last">
<div class="subheader">Project Info:</div>
<!-- Detail View -->
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('name', 'description', array('name' => 'status', 'type' => 'text', 'value' => Lookup::item('ProjectStatus', $model->status)))));
?>
</div>
<div class="span-18 last">
<div class="subheader">Project Quotas:</div>
<!-- Detail View -->
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('crash_reports_per_group_quota', 'crash_report_files_disc_quota', 'bug_attachment_files_disc_quota', 'debug_info_files_disc_quota')));
?>
</div>
<div class="span-18 last">
<div class="subheader">Misc Options:</div>