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