本文整理匯總了PHP中ArtefactTypeFileBase::get_switch_width方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArtefactTypeFileBase::get_switch_width方法的具體用法?PHP ArtefactTypeFileBase::get_switch_width怎麽用?PHP ArtefactTypeFileBase::get_switch_width使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArtefactTypeFileBase
的用法示例。
在下文中一共展示了ArtefactTypeFileBase::get_switch_width方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pieform_element_filebrowser_build_filelist
function pieform_element_filebrowser_build_filelist($form, $element, $folder, $highlight = null, $user = null, $group = null, $institution = null)
{
require_once 'license.php';
if (!$form->submitted_by_js()) {
// We're going to rebuild the page from scratch anyway.
return;
}
global $USER;
$smarty = smarty_core();
$userid = null;
if (is_null($institution) && is_null($group) && is_null($user)) {
// See if the filebrowser has indicated it's a group element
if (!empty($element['group'])) {
$group = $element['group'];
} else {
// otherwise check if the form knows it's in a group setting
$group = $form->get_property('group');
}
// See if the filebrowser has indicated it's an institution element
if (!empty($element['institution'])) {
$institution = $element['institution'];
} else {
// otherwise check if the form knows it's in an institution setting
$institution = $form->get_property('institution');
}
$userid = $group || $institution ? null : $USER->get('id');
}
if ($user) {
$userid = $USER->get('id');
$smarty->assign('owner', 'user');
$smarty->assign('ownerid', $userid);
} else {
if ($institution) {
$smarty->assign('owner', 'institution');
$smarty->assign('ownerid', $institution);
} else {
$smarty->assign('owner', 'group');
$smarty->assign('ownerid', $group);
}
}
$editable = (int) $element['config']['edit'];
$selectable = (int) $element['config']['select'];
$selectfolders = (int) (!empty($element['config']['selectfolders']));
$publishing = (int) (!empty($element['config']['publishing']));
$showtags = !empty($element['config']['tag']) ? (int) $userid : 0;
$editmeta = (int) ($userid && !$editable && !empty($element['config']['tag']));
$querybase = $element['page'] . (strpos($element['page'], '?') === false ? '?' : '&');
$prefix = $form->get_name() . '_' . $element['name'];
$filters = isset($element['filters']) ? $element['filters'] : null;
$filedata = ArtefactTypeFileBase::get_my_files_data($folder, $userid, $group, $institution, $filters);
$switchwidth = ArtefactTypeFileBase::get_switch_width();
$smarty->assign('edit', -1);
$smarty->assign('highlight', $highlight);
$smarty->assign('editable', $editable);
$smarty->assign('selectable', $selectable);
$smarty->assign('selectfolders', $selectfolders);
$smarty->assign('publishing', $publishing);
$smarty->assign('showtags', $showtags);
$smarty->assign('editmeta', $editmeta);
$smarty->assign('filelist', $filedata);
$smarty->assign('switchwidth', $switchwidth);
$smarty->assign('querybase', $querybase);
$smarty->assign('prefix', $prefix);
$params = 'folder=' . ($folder === null ? 0 : $folder);
if ($group !== null) {
$params .= '&group=' . $group;
}
if ($institution !== null) {
$params .= '&institution=' . $institution;
}
$smarty->assign('folderparams', $params);
return array('data' => $filedata, 'html' => $smarty->fetch('artefact:file:form/filelist.tpl'));
}