本文整理汇总了PHP中Utilities::print_warning_message方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::print_warning_message方法的具体用法?PHP Utilities::print_warning_message怎么用?PHP Utilities::print_warning_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::print_warning_message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (isset( $projects))
{
/**
* get results
*/
/**
* display results
*/
if (sizeof($projects) == 0)
{
if($pageNo==1){
Utilities::print_warning_message('No results found. Please try again.');
}else{
Utilities::print_warning_message('No more results found.');
}
}
else
{
?>
<div class="table-responsive">
<table class="table">
<tr>
<th>Name</th>
<th>Creation Time</th>
<th>Experiments</th>
</tr>
示例2: create_project_select
/**
* Create a select input and populate it with project options from the database
*/
public static function create_project_select($projectId = null, $editable = true)
{
$editable? $disabled = '' : $disabled = 'disabled';
$userProjects = Utilities::get_all_user_projects( Session::get("gateway_id"), Session::get('username') );
echo '<select class="form-control" name="project" id="project" required ' . $disabled . '>';
if (sizeof($userProjects) > 0)
{
foreach ($userProjects as $project)
{
if ($project->projectID == $projectId)
{
$selected = 'selected';
}
else
{
$selected = '';
}
echo '<option value="' . $project->projectID . '" ' . $selected . '>' . $project->name . '</option>';
}
}
echo '</select>';
if( sizeof($userProjects) == 0 )
{
Utilities::print_warning_message('<p>You must create a project before you can create an experiment.
Click <a href="' . URL::to('/') . '/project/create">here</a> to create a project.</p>');
}
}
示例3: process_inputs
//.........这里部分代码省略.........
for ($i = 0; $i < sizeof($experimentInputs); $i++)
{
if ($experimentInputs[$i]->name == $applicationInput->name)
{
$index = $i;
}
}
if ($index >= 0)
{
$experimentInput->value = $experimentInputs[$index]->value;
$experimentInput->type = $applicationInput->type;
}
}
}
elseif ($applicationInput->type == DataType::URI)
{
//var_dump($_FILES[$applicationInput->name]->name);
if ($_FILES[$applicationInput->name]['name'])
{
$file = $_FILES[$applicationInput->name];
//
// move file to experiment data directory
//
$filePath = Utilities::$experimentPath . $file['name'];
// check if file already exists
if (is_file($filePath))
{
unlink($filePath);
Utilities::print_warning_message('Uploaded file already exists! Overwriting...');
}
$moveFile = move_uploaded_file($file['tmp_name'], $filePath);
if ($moveFile)
{
Utilities::print_success_message('Upload: ' . $file['name'] . '<br>' .
'Type: ' . $file['type'] . '<br>' .
'Size: ' . ($file['size']/1024) . ' kB');//<br>' .
//'Stored in: ' . $experimentPath . $file['name']);
}
else
{
Utilities::print_error_message('<p>Error moving uploaded file ' . $file['name'] . '!
Please try again later or report a bug using the link in the Help menu.</p>');
$experimentAssemblySuccessful = false;
}
$experimentInput->value = str_replace(base_path() . Constant::EXPERIMENT_DATA_ROOT, Utilities::$pathConstant , $filePath);
$experimentInput->type = $applicationInput->type;
}
else
{
$index = -1;
for ($i = 0; $i < sizeof($experimentInputs); $i++)
{
if ($experimentInputs[$i]->name == $applicationInput->name)
{
$index = $i;
}
}
示例4: echo
</div>
<input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
<div style="clear: both"></div>
</form>
<?php
/**
* get results
*/
/**
* display results
*/
if (sizeof($projects) == 0)
{
Utilities::print_warning_message('No results found. Please try again.');
}
else
{
?>
<div class="table-responsive">
<table class="table">
<tr>
<th>Name</th>
<th>Creation Time</th>
<th>Experiments</th>
</tr>
<?php