本文整理汇总了PHP中ArtefactTypeFileBase::artefactchooser_folder_data方法的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeFileBase::artefactchooser_folder_data方法的具体用法?PHP ArtefactTypeFileBase::artefactchooser_folder_data怎么用?PHP ArtefactTypeFileBase::artefactchooser_folder_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtefactTypeFileBase
的用法示例。
在下文中一共展示了ArtefactTypeFileBase::artefactchooser_folder_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: artefactchooser_get_element_data
/**
* Optional method. If specified, allows the blocktype class to munge the
* artefactchooser element data before it's templated
*/
public static function artefactchooser_get_element_data($artefact)
{
$folderdata = ArtefactTypeFileBase::artefactchooser_folder_data($artefact);
$artefact->icon = call_static_method(generate_artefact_class_name($artefact->artefacttype), 'get_icon', array('id' => $artefact->id));
$artefact->hovertitle = $artefact->description;
$path = $artefact->parent ? ArtefactTypeFileBase::get_full_path($artefact->parent, $folderdata->data) : '';
$artefact->description = str_shorten_text($folderdata->ownername . $path . $artefact->title, 30);
return $artefact;
}
示例2: pieform_element_filebrowser_get_path
function pieform_element_filebrowser_get_path($folder)
{
$path = array();
if ($folder) {
$folders = ArtefactTypeFileBase::artefactchooser_folder_data(artefact_instance_from_id($folder))->data;
$f = $folder;
while ($f) {
$path[] = (object) array('title' => $folders[$f]->title, 'id' => $f);
$f = $folders[$f]->parent;
}
}
$path[] = (object) array('title' => get_string('home', 'artefact.file'), 'id' => 0);
return $path;
}
示例3: unzip_directory_name
public function unzip_directory_name()
{
if (isset($this->data['unzipdir'])) {
return $this->data['unzipdir'];
}
$folderdata = ArtefactTypeFileBase::artefactchooser_folder_data($this);
$parent = $this->get('parent');
$strpath = ArtefactTypeFileBase::get_full_path($parent, $folderdata->data);
$extn = $this->get('oldextension');
$name = $this->get('title');
if (substr($name, -1 - strlen($extn)) == '.' . $extn) {
$name = substr($name, 0, strlen($name) - 1 - strlen($extn));
}
$name = ArtefactTypeFileBase::get_new_file_title($name, $parent, $this->get('owner'), $this->get('group'), $this->get('institution'));
$this->data['unzipdir'] = array('basename' => $name, 'fullname' => $strpath . $name);
return $this->data['unzipdir'];
}