本文整理汇总了PHP中filter_get_name函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_get_name函数的具体用法?PHP filter_get_name怎么用?PHP filter_get_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filter_get_name函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: filter_get_all_installed
/**
* Get the names of all the filters installed in this Moodle.
*
* @global object
* @return array path => filter name from the appropriate lang file. e.g.
* array('mod/glossary' => 'Glossary Auto-linking', 'filter/tex' => 'TeX Notation');
* sorted in alphabetical order of name.
*/
function filter_get_all_installed()
{
global $CFG;
$filternames = array();
// TODO: deprecated since 2.2, will be out in 2.3, see MDL-29996
$filterlocations = array('mod', 'filter');
foreach ($filterlocations as $filterlocation) {
// TODO: move get_list_of_plugins() to get_plugin_list()
$filters = get_list_of_plugins($filterlocation);
foreach ($filters as $filter) {
// MDL-29994 - Ignore mod/data and mod/glossary filters forever, this will be out in 2.3
if ($filterlocation == 'mod' && ($filter == 'data' || $filter == 'glossary')) {
continue;
}
$path = $filterlocation . '/' . $filter;
if (is_readable($CFG->dirroot . '/' . $path . '/filter.php')) {
$strfiltername = filter_get_name($path);
$filternames[$path] = $strfiltername;
}
}
}
collatorlib::asort($filternames);
return $filternames;
}
开发者ID:raymondAntonio,项目名称:moodle,代码行数:32,代码来源:filterlib.php
示例2: filter_get_all_installed
/**
* Get the names of all the filters installed in this Moodle.
*
* @return array path => filter name from the appropriate lang file. e.g.
* array('tex' => 'TeX Notation');
* sorted in alphabetical order of name.
*/
function filter_get_all_installed()
{
global $CFG;
$filternames = array();
foreach (core_component::get_plugin_list('filter') as $filter => $fulldir) {
if (is_readable("{$fulldir}/filter.php")) {
$filternames[$filter] = filter_get_name($filter);
}
}
core_collator::asort($filternames);
return $filternames;
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:19,代码来源:filterlib.php
示例3: get_plugin_name
/**
* Returns the language string for the given plugin.
*
* @param string $plugin the plugin code name
* @param string $type the type of plugin (mod, block, filter)
* @return string The plugin language string
*/
function get_plugin_name($plugin, $type = 'mod')
{
$plugin_name = '';
switch ($type) {
case 'mod':
$plugin_name = get_string('modulename', $plugin);
break;
case 'blocks':
$plugin_name = get_string('pluginname', "block_{$plugin}");
if (empty($plugin_name) || $plugin_name == '[[pluginname]]') {
if (($block = block_instance($plugin)) !== false) {
$plugin_name = $block->get_title();
} else {
$plugin_name = "[[{$plugin}]]";
}
}
break;
case 'filter':
$plugin_name = filter_get_name('filter/' . $plugin);
break;
default:
$plugin_name = $plugin;
break;
}
return $plugin_name;
}
开发者ID:hitphp,项目名称:moodle,代码行数:33,代码来源:moodlelib.php
示例4: array
echo html_writer::start_tag('div');
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'));
$table->align = array('left', 'left');
if ($settingscol) {
$table->head[] = $strsettings;
$table->align[] = 'left';
}
$table->width = ' ';
$table->data = array();
// iterate through filters adding to display table
foreach ($availablefilters as $filter => $filterinfo) {
$row = array();
// Filter name.
$row[] = filter_get_name($filter);
// Default/on/off choice.
if ($filterinfo->inheritedstate == TEXTFILTER_ON) {
$activechoices[TEXTFILTER_INHERIT] = $strdefaulton;
} else {
$activechoices[TEXTFILTER_INHERIT] = $strdefaultoff;
}
$row[] = html_writer::select($activechoices, str_replace('/', '_', $filter), $filterinfo->localstate, false);
// Settings link, if required
if ($settingscol) {
$settings = '';
if ($filterinfo->hassettings) {
$settings = '<a href="' . $baseurl->out(true, array('filter' => $filter)) . '">' . $strsettings . '</a>';
}
$row[] = $settings;
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:31,代码来源:manage.php
示例5: load_choices
public function load_choices()
{
if (is_array($this->choices)) {
return true;
}
$this->choices = array();
foreach (core_component::get_plugin_list('filter') as $plugin => $unused) {
$this->choices[$plugin] = filter_get_name($plugin);
}
return true;
}
开发者ID:mongo0se,项目名称:moodle,代码行数:11,代码来源:adminlib.php
示例6: filter_set_global_state
break;
case 'down':
if (isset($filters[$filterpath])) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, 1);
}
break;
case 'up':
if (isset($filters[$filterpath])) {
$oldpos = $filters[$filterpath]->sortorder;
filter_set_global_state($filterpath, $filters[$filterpath]->active, -1);
}
break;
case 'delete':
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
$filtername = filter_get_name($filterpath);
$title = get_string('deletefilterareyousure', 'admin', $filtername);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
$linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
$formcancel = new single_button(new moodle_url($returnurl), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
}
// Do the deletion.
$title = get_string('deletingfilter', 'admin', $filterpath);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
// Delete all data for this plugin.
filter_delete_all_for_filter($filterpath);
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:filters.php
示例7: filter_get_all_installed
/**
* Get the names of all the filters installed in this Moodle.
*
* @global object
* @return array path => filter name from the appropriate lang file. e.g.
* array('mod/glossary' => 'Glossary Auto-linking', 'filter/tex' => 'TeX Notation');
* sorted in alphabetical order of name.
*/
function filter_get_all_installed()
{
global $CFG;
$filternames = array();
$filterlocations = array('mod', 'filter');
foreach ($filterlocations as $filterlocation) {
$filters = get_list_of_plugins($filterlocation);
foreach ($filters as $filter) {
$path = $filterlocation . '/' . $filter;
if (is_readable($CFG->dirroot . '/' . $path . '/filter.php')) {
$strfiltername = filter_get_name($path);
$filternames[$path] = $strfiltername;
}
}
}
textlib_get_instance()->asort($filternames);
return $filternames;
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:26,代码来源:filterlib.php
示例8: filter_get_all_installed
/**
* Get the names of all the filters installed in this Moodle.
*
* @return array path => filter name from the appropriate lang file. e.g.
* array('tex' => 'TeX Notation');
* sorted in alphabetical order of name.
*/
function filter_get_all_installed()
{
global $CFG;
$filternames = array();
foreach (get_list_of_plugins('filter') as $filter) {
if (is_readable("{$CFG->dirroot}/filter/{$filter}/filter.php")) {
$filternames[$filter] = filter_get_name($filter);
}
}
collatorlib::asort($filternames);
return $filternames;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:19,代码来源:filterlib.php
示例9: format_setting
//.........这里部分代码省略.........
$strman = get_string_manager();
if ($strman->string_exists('activitycompletion', 'completion')) {
// Moodle >= 2.7
$name = get_string('activitycompletion', 'completion');
} else {
// Moodle <= 2.6
$name = get_string('completioncondition', 'condition');
}
foreach ($value as $i => $v) {
$str = array();
if ($v->ungraded) {
$str[] = get_string('conditioncmungraded', $plugin);
}
if ($v->resources) {
$str[] = get_string('conditioncmresources', $plugin);
}
if ($v->labels) {
$str[] = get_string('conditioncmlabels', $plugin);
}
if ($str = implode(', ', $str)) {
$str = block_taskchain_navigation::textlib('strtolower', " ({$str})");
}
$value[$i] = html_writer::tag('p', $conditioncmidmenu[$v->cm] . "{$str} " . $conditioncmcompletionmenu[$v->e]);
}
$value = implode('', $value);
break;
case 'conditioncmlabels':
case 'conditioncmresources':
case 'conditioncmungraded':
$name = get_string($name, $plugin);
$value = format_yesno($value);
break;
case 'removecompletion':
case 'erasecompletion':
$name = get_string($name, $plugin);
$value = format_yesno($value);
break;
case 'completiontracking':
$name = get_string('completion', 'completion');
$value = $completiontrackingmenu[$value];
break;
case 'completiondate':
$name = get_string('completionexpected', 'completion');
$value = $value ? userdate($value) : get_string('disable');
break;
case 'competencyrule':
$name = get_string('uponcoursemodulecompletion', 'tool_lp');
$value = $competencyrulemenu[$value];
break;
default:
if (array_key_exists($name, $completionfields)) {
$field = $completionfields[$name];
$name = $field->text;
switch ($field->type) {
case 'checkbox':
$value = format_yesno($value);
break;
case 'duration':
list($value, $unit) = convert_seconds_to_duration($value);
$value .= ' ' . get_duration_units($unit);
break;
case 'select':
$i = 1;
$num = $value;
$value = array();
while (($ii = pow(2, $i)) && $ii <= $num) {
if ($ii & $num) {
$value[] = strip_tags($field->options[$ii]);
}
$i++;
}
$value = array_filter($value);
$value = implode(', ', $value);
break;
case 'textbox':
$value = number_format($value);
break;
}
} else {
if (substr($name, 0, 6) == 'filter') {
$name = substr($name, 6);
switch ($value) {
case TEXTFILTER_ON:
case TEXTFILTER_OFF:
$value = $filtermenu[$value];
break;
case TEXTFILTER_INHERIT:
if ($filters[$name]->inheritedstate == TEXTFILTER_ON) {
$value = $filterdefaulton;
} else {
$value = $filterdefaultoff;
}
break;
}
$name = filter_get_name($name);
}
}
}
return array($name, $value);
}
开发者ID:gbateson,项目名称:moodle-block_taskchain_navigation,代码行数:101,代码来源:accesscontrol.php
注:本文中的filter_get_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论