本文整理匯總了PHP中file_info::get_timecreated方法的典型用法代碼示例。如果您正苦於以下問題:PHP file_info::get_timecreated方法的具體用法?PHP file_info::get_timecreated怎麽用?PHP file_info::get_timecreated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類file_info
的用法示例。
在下文中一共展示了file_info::get_timecreated方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_node
/**
* Converts file_info object to element of repository return list
*
* @param file_info $fileinfo
* @return array
*/
private function get_node(file_info $fileinfo)
{
global $OUTPUT;
$encodedpath = base64_encode(json_encode($fileinfo->get_params()));
$node = array('title' => $fileinfo->get_visible_name(), 'datemodified' => $fileinfo->get_timemodified(), 'datecreated' => $fileinfo->get_timecreated());
if ($fileinfo->is_directory()) {
$node['path'] = $encodedpath;
$node['thumbnail'] = $OUTPUT->pix_url(file_folder_icon(90))->out(false);
$node['children'] = array();
} else {
$node['size'] = $fileinfo->get_filesize();
$node['author'] = $fileinfo->get_author();
$node['license'] = $fileinfo->get_license();
$node['isref'] = $fileinfo->is_external_file();
if ($fileinfo->get_status() == 666) {
$node['originalmissing'] = true;
}
$node['source'] = $encodedpath;
$node['thumbnail'] = $OUTPUT->pix_url(file_file_icon($fileinfo, 90))->out(false);
$node['icon'] = $OUTPUT->pix_url(file_file_icon($fileinfo, 24))->out(false);
if ($imageinfo = $fileinfo->get_imageinfo()) {
// what a beautiful picture, isn't it
$fileurl = new moodle_url($fileinfo->get_url());
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $fileinfo->get_timemodified()));
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon', 'oid' => $fileinfo->get_timemodified()));
$node['image_width'] = $imageinfo['width'];
$node['image_height'] = $imageinfo['height'];
}
}
return $node;
}