本文整理汇总了PHP中FileHelper::removeExtensions方法的典型用法代码示例。如果您正苦于以下问题:PHP FileHelper::removeExtensions方法的具体用法?PHP FileHelper::removeExtensions怎么用?PHP FileHelper::removeExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileHelper
的用法示例。
在下文中一共展示了FileHelper::removeExtensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGroupsFieldset
/**
* create the fieldset that allows user to select the groups of the contact, and whether the contact is hidden or not
* @return string html-content
* @global DB used to query database for groups
*/
function createGroupsFieldset()
{
global $db;
$cont = '<fieldset class="edit-groups">';
$cont .= '<legend>Groups</legend>';
$gr = $this->contact->getValueGroup('groups');
$groups = array();
foreach ($gr as $g) {
$groups[] = $g['groupname'];
}
$db->query('SELECT * FROM ' . TABLE_GROUPLIST . ' ORDER BY groupname ASC');
$cont .= '<div class="edit-line">';
while ($r = $db->next()) {
$cont .= HTMLHelper::createCheckbox("groups[{$r['groupname']}]", $r['groupname'], in_array($r['groupname'], $groups), 'edit-input-checkbox');
}
$cont .= '</div>';
$cont .= '<div class="edit-line">';
$cont .= HTMLHelper::createTextField('newgroup', 'Add new group', '', 'edit-input');
if ($_SESSION['user']->isAtLeast('admin')) {
global $CONFIG_INSTALL_SUBDIR;
// find .xls files without dash (type-edit.xsl)
$func = create_function('$val', 'return strpos($val,"-")===FALSE;');
$files = array_filter(FileHelper::scanDirectory($CONFIG_INSTALL_SUBDIR . 'lib/xslt', '.xsl'), $func);
if (count($files) > 0) {
FileHelper::removeExtensions($files);
$files = array_merge(array(''), $files);
$xs = isset($this->contact->contact['xsltDisplayType']) ? $this->contact->contact['xsltDisplayType'] : '';
$cont .= HTMLHelper::createDropdownValuesAreKeys('contact[xsltDisplayType]', 'XSLT stylesheet', $files, $xs, 'edit-input', false);
}
$cont .= HTMLHelper::createCheckbox('contact[hidden]', 'Hide this entry', isset($this->contact->contact['hidden']) ? $this->contact->contact['hidden'] : 0, 'edit-input-checkbox-hide');
}
$cont .= '</div>';
$cont .= '</fieldset>';
return $cont;
}