本文整理汇总了PHP中admin_setting::is_related方法的典型用法代码示例。如果您正苦于以下问题:PHP admin_setting::is_related方法的具体用法?PHP admin_setting::is_related怎么用?PHP admin_setting::is_related使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin_setting
的用法示例。
在下文中一共展示了admin_setting::is_related方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_related
/**
* Checks if $query is one of the available subplugins.
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$subplugins = core_component::get_plugin_list('tinymce');
foreach ($subplugins as $name => $dir) {
if (stripos($name, $query) !== false) {
return true;
}
$namestr = get_string('pluginname', 'tinymce_' . $name);
if (strpos(core_text::strtolower($namestr), core_text::strtolower($query)) !== false) {
return true;
}
}
return false;
}
示例2: is_related
/**
* Checks if $query is one of the available log plugins.
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$query = core_text::strtolower($query);
$plugins = \tool_log\log\manager::get_store_plugins();
foreach ($plugins as $plugin => $fulldir) {
if (strpos(core_text::strtolower($plugin), $query) !== false) {
return true;
}
$localised = get_string('pluginname', $plugin);
if (strpos(core_text::strtolower($localised), $query) !== false) {
return true;
}
}
return false;
}
示例3: is_related
/**
* Checks if $query is one of the available dataformfield plugins.
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$query = \core_text::strtolower($query);
$plugins = \core_component::get_plugin_list('dataformfield');
foreach ($plugins as $plugin => $fulldir) {
if (strpos(\core_text::strtolower($plugin), $query) !== false) {
return true;
}
$localised = get_string('pluginname', "dataformfield_{$plugin}");
if (strpos(\core_text::strtolower($localised), $query) !== false) {
return true;
}
}
return false;
}
示例4: is_related
/**
* Check if this is $query is related to a choice
*
* @param string $query
* @return bool true if related, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
if (!$this->load_choices()) {
return false;
}
foreach ($this->choices as $key => $value) {
if (strpos(core_text::strtolower($key), $query) !== false) {
return true;
}
if (strpos(core_text::strtolower($value), $query) !== false) {
return true;
}
}
return false;
}
示例5: is_related
/**
* Checks if $query is one of the available webservices
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$textlib = textlib_get_instance();
$protocols = get_plugin_list('webservice');
foreach ($protocols as $protocol => $location) {
if (strpos($protocol, $query) !== false) {
return true;
}
$protocolstr = get_string('pluginname', 'webservice_' . $protocol);
if (strpos($textlib->strtolower($protocolstr), $query) !== false) {
return true;
}
}
return false;
}
示例6: is_related
/**
* Checks if $query is one of the available webservices
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$protocols = core_component::get_plugin_list('webservice');
foreach ($protocols as $protocol => $location) {
if (strpos($protocol, $query) !== false) {
return true;
}
$protocolstr = get_string('pluginname', 'webservice_' . $protocol);
if (strpos(core_text::strtolower($protocolstr), $query) !== false) {
return true;
}
}
return false;
}
示例7: is_related
/**
* Searches repository plugins for one that matches $query
*
* @param string $query The string to search for
* @return bool true if found, false if not
*/
public function is_related($query)
{
if (parent::is_related($query)) {
return true;
}
$textlib = textlib_get_instance();
$repositories = get_plugin_list('repository');
foreach ($repositories as $p => $dir) {
if (strpos($p, $query) !== false) {
return true;
}
}
foreach (repository::get_types() as $instance) {
$title = $instance->get_typename();
if (strpos($textlib->strtolower($title), $query) !== false) {
return true;
}
}
return false;
}