本文整理匯總了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'];
}