• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP module_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中module_list函数的典型用法代码示例。如果您正苦于以下问题:PHP module_list函数的具体用法?PHP module_list怎么用?PHP module_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了module_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: invoke

 static function invoke($numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, $fnSuffix)
 {
     $result = array();
     // copied from user_module_invoke
     if (function_exists('module_list')) {
         foreach (module_list() as $module) {
             $fnName = "{$module}_{$fnSuffix}";
             if (function_exists($fnName)) {
                 if ($numParams == 1) {
                     $fResult = $fnName($arg1);
                 } else {
                     if ($numParams == 2) {
                         $fResult = $fnName($arg1, $arg2);
                     } else {
                         if ($numParams == 3) {
                             $fResult = $fnName($arg1, $arg2, $arg3);
                         } else {
                             if ($numParams == 4) {
                                 $fResult = $fnName($arg1, $arg2, $arg3, $arg4);
                             } else {
                                 if ($numParams == 5) {
                                     $fResult = $fnName($arg1, $arg2, $arg3, $arg4, $arg5);
                                 }
                             }
                         }
                     }
                 }
                 if (is_array($fResult)) {
                     $result = array_merge($result, $fResult);
                 }
             }
         }
     }
     return empty($result) ? true : $result;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:35,代码来源:Drupal.php


示例2: includeLibClassFilesWithPattern

 /**
  * @param string $folder_name
  */
 private static function includeLibClassFilesWithPattern($folder_name)
 {
     $enabled_modules = module_list();
     foreach ($enabled_modules as $module_name) {
         $module_path = drupal_get_path('module', $module_name);
         // PSR-0 compliant search
         $path = $module_path . '/lib/Drupal/' . $module_name;
         if (is_dir($path)) {
             $folders = self::listFoldersWithPattern($path, $folder_name);
             if (!empty($folders)) {
                 foreach ($folders as $folder) {
                     foreach (self::listClassesWithinFolder($folder) as $class_name) {
                         include_once $class_name;
                     }
                 }
             }
         }
         // PSR-4 compliant search
         $path = $module_path . '/src';
         if (is_dir($path)) {
             $folders = self::listFoldersWithPattern($path, $folder_name);
             if (!empty($folders)) {
                 foreach ($folders as $folder) {
                     foreach (self::listClassesWithinFolder($folder) as $class_name) {
                         include_once $class_name;
                     }
                 }
             }
         }
     }
 }
开发者ID:rockfireredmoon,项目名称:tawsite,代码行数:34,代码来源:Loader.php


示例3: index

 public function index($context = null)
 {
     // Get a list of modules with a controller matching
     // $context ('content', 'appearance', 'settings', 'statistics', or 'developer')
     foreach (module_list() as $module) {
         if (module_controller_exists($context, $module)) {
             $this->actions[] = $module;
         }
     }
     // Do we have any actions?
     if (!count($this->actions)) {
         return '<ul class="nav-sub clearfix"></ul>';
     }
     // Grab our module permissions so we know who can see what on the sidebar
     $permissions = config_item('module_permissions');
     // Build up our menu array
     foreach ($this->actions as $module) {
         // Make sure the user has permission to view this page.
         if (isset($permissions[$context][$module]) && has_permission($permissions[$context][$module]) || !array_key_exists($module, $permissions[$context])) {
             // Grab our module config array, if any.
             $mod_config = module_config($module);
             $display_name = isset($mod_config['name']) ? $mod_config['name'] : $module;
             $title = isset($mod_config['description']) ? $mod_config['description'] : $module;
             $menu_topic = isset($mod_config['menu_topic'][$context]) ? $mod_config['menu_topic'][$context] : $display_name;
             // Drop-down menus?
             if (isset($mod_config['menus']) && isset($mod_config['menus'][$context])) {
                 $menu_view = $mod_config['menus'][$context];
             } else {
                 $menu_view = '';
             }
             $this->menu[$menu_topic][$module] = array('title' => $title, 'display_name' => $display_name, 'menu_view' => $menu_view, 'menu_topic' => $menu_topic);
         }
     }
     return $this->build_menu($context);
 }
开发者ID:hnmurugan,项目名称:Bonfire,代码行数:35,代码来源:subnav.php


示例4: crm_get_data

/**
 * Get an array of data structures from the database, and allow all modules
 * to extend them.  This function will call hook_data() to get the data and
 * hook_data_alter() to allow modules to alter the data.
 * @param $type The type of data.
 * @param $opts An associative array of options.
 * @return An array of data structures.
 */
function crm_get_data($type, $opts = array())
{
    // Get the base data
    $hook = "{$type}_data";
    if (!function_exists($hook)) {
        error_register('No such data type: ' . $type);
        die;
    }
    $data = call_user_func($hook, $opts);
    if (!empty($data)) {
        // Let other modules extend the data
        foreach (module_list() as $module) {
            // Make sure module is really installed
            $rev_hook = "{$module}_revision";
            $hook = "{$module}_data_alter";
            if (function_exists($hook)) {
                if (module_get_schema_revision($module) != call_user_func($rev_hook)) {
                    error_register("Database schema needs to be upgraded for module {$module}.");
                    continue;
                }
                $data = call_user_func($hook, $type, $data, $opts);
                // Make sure the hook actually returned data
                if (is_null($data)) {
                    error_register('Hook returned null: ' . $hook);
                }
            }
        }
    }
    return $data;
}
开发者ID:mehulsbhatt,项目名称:seltzer,代码行数:38,代码来源:data.inc.php


示例5: crm_get_form

/**
 * Get a form, allowing modules to alter it.
 */
function crm_get_form()
{
    if (func_num_args() < 1) {
        return array();
    }
    $args = func_get_args();
    $form_id = array_shift($args);
    $hook = "{$form_id}_form";
    // Build initial form
    if (!function_exists($hook)) {
        error_register("No such hook: {$hook}");
        return array();
    }
    $form = call_user_func_array($hook, $args);
    if (empty($form)) {
        return $form;
    }
    // Allow modules to alter the form
    foreach (module_list() as $module) {
        $hook = $module . '_form_alter';
        if (function_exists($hook)) {
            $form = $hook($form, $form_id);
            if (empty($form)) {
                error_register('Empty form returned by ' . $hook);
            }
        }
    }
    return $form;
}
开发者ID:mehulsbhatt,项目名称:seltzer,代码行数:32,代码来源:form.inc.php


示例6: settingsForm

 /**
  * Generate a settings form for this handler.
  */
 public function settingsForm($field, $instance)
 {
     $field_name = $field['field_name'];
     $form['action'] = array('#type' => 'select', '#title' => t('Action'), '#options' => array('none' => t('Do nothing'), 'hide' => t('Hide field'), 'disable' => t('Disable field')), '#description' => t('Action to take when prepopulating field with values via URL.'));
     $form['action_on_edit'] = array('#type' => 'checkbox', '#title' => t('Apply action on edit'), '#description' => t('Apply action when editing an existing entity.'), '#states' => array('invisible' => array(':input[name="instance[settings][behaviors][prepopulate][action]"]' => array('value' => 'none'))));
     $form['fallback'] = array('#type' => 'select', '#title' => t('Fallback behaviour'), '#description' => t('Determine what should happen if no values are provided via URL.'), '#options' => array('none' => t('Do nothing'), 'hide' => t('Hide field'), 'form_error' => t('Set form error'), 'redirect' => t('Redirect')));
     // Get list of permissions.
     $perms = array();
     $perms[0] = t('- None -');
     foreach (module_list(FALSE, FALSE, TRUE) as $module) {
         // By keeping them keyed by module we can use optgroups with the
         // 'select' type.
         if ($permissions = module_invoke($module, 'permission')) {
             foreach ($permissions as $id => $permission) {
                 $perms[$module][$id] = strip_tags($permission['title']);
             }
         }
     }
     $form['skip_perm'] = array('#type' => 'select', '#title' => t('Skip access permission'), '#description' => t('Set a permission that will not be affected by the fallback behavior.'), '#options' => $perms);
     $description = t('Determine if values that should be prepopulated should "listen" to the OG-context.');
     if ($disabled = !module_exists('og_context') || !og_is_group_audience_field($field_name)) {
         $description .= '<br / >' . t('Organic groups integration: Enable OG-context and set "Entity selection mode" to "Organic groups" to enable this selection.');
     }
     $form['og_context'] = array('#type' => 'checkbox', '#title' => t('OG context'), '#description' => $description, '#disabled' => $disabled);
     return $form;
 }
开发者ID:swarad07,项目名称:india-standalone-drupal,代码行数:29,代码来源:EntityReferencePrepopulateInstanceBehavior.class.php


示例7: buildModuleList

 /**
  * Build the list of modules to be processed for hooks.
  */
 function buildModuleList()
 {
     if ($this->isBuilt === FALSE) {
         if ($this->drupalModules === NULL) {
             if (function_exists('module_list')) {
                 // copied from user_module_invoke
                 $this->drupalModules = module_list();
             }
         }
         if ($this->civiModules === NULL) {
             $this->civiModules = array();
             $this->requireCiviModules($this->civiModules);
         }
         // we should add civicrm's module's just after main civicrm drupal module
         // Note: Assume that drupalModules and civiModules may each be array() or NULL
         if ($this->drupalModules !== NULL) {
             foreach ($this->drupalModules as $moduleName) {
                 $this->allModules[$moduleName] = $moduleName;
                 if ($moduleName == 'civicrm') {
                     if (!empty($this->civiModules)) {
                         foreach ($this->civiModules as $civiModuleName) {
                             $this->allModules[$civiModuleName] = $civiModuleName;
                         }
                     }
                 }
             }
         } else {
             $this->allModules = (array) $this->civiModules;
         }
         if ($this->drupalModules !== NULL && $this->civiModules !== NULL) {
             // both CRM and CMS have bootstrapped, so this is the final list
             $this->isBuilt = TRUE;
         }
     }
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:38,代码来源:Drupal.php


示例8: list_lang_files

 /**
  * Finds a list of all language files for a specific language by
  * searching the application/languages folder as well as all core_module
  * folders for folders matching the language name.
  *
  * @param string $language The language
  *
  * @return array An array of files.
  */
 function list_lang_files($language = 'english')
 {
     $ci =& get_instance();
     $ci->load->helper('file');
     $lang_files = array();
     // Base language files.
     $lang_files['core'] = find_lang_files(APPPATH . 'language/' . $language . '/');
     // Module lang files
     $modules = module_list();
     $custom_modules = module_list(TRUE);
     foreach ($modules as $module) {
         $module_langs = module_files($module, 'language');
         $type = 'core';
         if (isset($module_langs[$module]['language'][$language])) {
             $path = implode('/', array($module, 'language', $language));
             if (in_array($module, $custom_modules)) {
                 $files = find_lang_files(realpath(APPPATH . '../modules/' . $path) . '/');
                 $type = 'custom';
             } else {
                 $files = find_lang_files(APPPATH . 'core_modules/' . $path . '/');
             }
             foreach ($files as $file) {
                 $lang_files[$type][] = $file;
             }
         }
         //end if
     }
     //end foreach
     return $lang_files;
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:39,代码来源:languages_helper.php


示例9: index

	public function index($type=null) 
	{	
		// Get a list of modules with a controller matching
		// $type ('content', 'appearance', 'settings', 'statistics', or 'developer')
		foreach (module_list() as $module)
		{
			if (module_controller_exists($type, $module))
			{
				$this->actions[] = $module;
			}
		}
		
		// Do we have any actions? 
		if (!count($this->actions))
		{
			return '<ul class="nav-sub clearfix"></ul>';
		}
		
		// Grab our module permissions so we know who can see what on the sidebar
		$permissions = config_item('module_permissions');
		
		// Build a ul to return
		$list = "<ul class='nav-sub clearfix'>\n";
		
		foreach ($this->actions as $module)
		{
			// Make sure the user has permission to view this page.
			if ((isset($permissions[$type][$module]) && has_permission($permissions[$type][$module])) || !array_key_exists($module, $permissions[$type]))
			{
				// Is this the current module? 
				if ($module == $this->uri->segment(3))
				{
					$class = 'class="current"';
				}
				else
				{
					$class = '';
				}
				
				// Build our list item.
				$list .= '<li><a href="'. site_url('admin/'. $type .'/'. $module) .'" '. $class;
				// Icon
				/*
				if ($icon = module_icon($module))
				{
					$list .= ' style="background: url('. $icon .')"';
				}
				*/
				$list .= '>'. ucwords(str_replace('_', '', $module)) ."</a></li>\n";
			}
		}
		
		$list .= "</ul>\n";
		
		return $list;
	}
开发者ID:ndcisiv,项目名称:Bonfire,代码行数:56,代码来源:subnav.php


示例10: index

 /**
  * Displays a list of installed modules with the option to create
  * a new one.
  *
  * @access public
  *
  * @return void
  */
 public function index()
 {
     $modules = module_list(true);
     $configs = array();
     // check that the modules folder is writeable
     Template::set('writeable', $this->_check_writeable());
     // Get a list of available generators
     Template::set('generators', $this->get_generators());
     Template::render();
 }
开发者ID:raviphad,项目名称:Bonfire-builder,代码行数:18,代码来源:developer.php


示例11: post

 /** 
  * This hook will be called on any operation on some core CiviCRM 
  * objects. We will extend the functionality over a period of time 
  * to make it similar to Drupal's user hook, where the external module 
  * can inject and collect form elements and form information into a 
  * Drupal form (specifically the registration page and the account 
  * information page) 
  * 
  * @param string $op         the type of operation being performed 
  * @param string $objectName the BAO class name of the object 
  * @param int    $objectId   the unique identifier for the object 
  * @param object $objectRef  the reference to the object if available 
  *  
  * @return mixed             based on op. pre-hooks return a boolean and/or
  *                           an error message which aborts the operation
  * @access public 
  */
 function post($op, $objectName, $objectId, &$objectRef)
 {
     // copied from user_module_invoke
     foreach (module_list() as $module) {
         $function = $module . '_civicrm_post';
         if (function_exists($function)) {
             $function($op, $objectName, $objectId, $objectRef);
         }
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:27,代码来源:Drupal.php


示例12: getAllModulePerms

 public function getAllModulePerms() {
   $permissions = array();
   $module_list = module_list();
   ksort($module_list);
   foreach ($module_list as $module) {
     if ($perms = $this->getModulePerms($module)) {
       $permissions = array_merge($permissions, $perms);
     }
   }
   return $permissions;
 }
开发者ID:ronanguilloux,项目名称:Bin,代码行数:11,代码来源:DrushRole.php


示例13: __construct

 /**
  * Constructs a new instance.
  *
  * @param string[] $plugin_manager_definition
  *   (optional) An array of namespace that may contain plugin implementations.
  *   Defaults to an empty array.
  * @param string $plugin_definition_annotation_name
  *   (optional) The name of the annotation that contains the plugin definition.
  *   Defaults to 'Drupal\Component\Annotation\Plugin'.
  */
 function __construct($plugin_manager_definition, $plugin_definition_annotation_name = 'Drupal\\Component\\Annotation\\Plugin')
 {
     $namespaces = array();
     foreach (module_list() as $module_name) {
         $directory = DRUPAL_ROOT . '/' . drupal_get_path('module', $module_name) . '/src/' . trim($plugin_manager_definition['directory'], DIRECTORY_SEPARATOR);
         $namespaces['Drupal\\' . $module_name] = array($directory);
     }
     $this->pluginNamespaces = new \ArrayObject($namespaces);
     $this->pluginDefinitionAnnotationName = isset($plugin_manager_definition['class']) ? $plugin_manager_definition['class'] : $plugin_definition_annotation_name;
     $this->pluginManagerDefinition = $plugin_manager_definition;
 }
开发者ID:EarthTeam,项目名称:earthteam.net,代码行数:21,代码来源:AnnotatedClassDiscovery.php


示例14: invoke

 function invoke($numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, $fnSuffix)
 {
     if (!$this->first || empty($this->allModules)) {
         $this->first = TRUE;
         // copied from user_module_invoke
         if (function_exists('module_list')) {
             $this->allModules = module_list();
         }
         $this->requireCiviModules($this->allModules);
     }
     return $this->runHooks($this->allModules, $fnSuffix, $numParams, $arg1, $arg2, $arg3, $arg4, $arg5);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:12,代码来源:Drupal.php


示例15: modules

 /**
  * Display the list of modules in the Bonfire installation
  *
  * @access public
  *
  * @return void
  */
 public function modules()
 {
     $modules = module_list();
     $configs = array();
     foreach ($modules as $module) {
         $configs[$module] = module_config($module);
         if (!isset($configs[$module]['name'])) {
             $configs[$module]['name'] = ucwords($module);
         }
     }
     ksort($configs);
     Template::set('modules', $configs);
     Template::render();
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:21,代码来源:developer.php


示例16: settingsForm

 /**
  * Generate a settings form for this handler.
  */
 public function settingsForm($field, $instance)
 {
     $form['action'] = array('#type' => 'select', '#title' => t('Action'), '#options' => array('none' => t('Do nothing'), 'hide' => t('Hide field'), 'disable' => t('Disable field')), '#description' => t('Action to take when prepopulating field with values via URL.'));
     $form['action_on_edit'] = array('#type' => 'checkbox', '#title' => t('Apply action on edit'), '#description' => t('Apply action when editing an existing entity.'), '#states' => array('invisible' => array(':input[name="instance[settings][behaviors][prepopulate][action]"]' => array('value' => 'none'))));
     $form['fallback'] = array('#type' => 'select', '#title' => t('Fallback behaviour'), '#description' => t('Determine what should happen if no values are provided via URL.'), '#options' => array('none' => t('Do nothing'), 'hide' => t('Hide field'), 'form_error' => t('Set form error'), 'redirect' => t('Redirect')));
     // Get list of permissions.
     $perms = array();
     $perms[0] = t('- None -');
     foreach (module_list(FALSE, FALSE, TRUE) as $module) {
         // By keeping them keyed by module we can use optgroups with the
         // 'select' type.
         if ($permissions = module_invoke($module, 'permission')) {
             foreach ($permissions as $id => $permission) {
                 $perms[$module][$id] = strip_tags($permission['title']);
             }
         }
     }
     $form['skip_perm'] = array('#type' => 'select', '#title' => t('Skip access permission'), '#description' => t('Set a permission that will not be affected by the fallback behavior.'), '#options' => $perms);
     $form['providers'] = array('#type' => 'container', '#theme' => 'entityreference_prepopulate_providers_table', '#element_validate' => array('entityreference_prepopulate_providers_validate'));
     $providers = entityreference_prepopulate_providers_info();
     // Sort providers by weight.
     $providers_names = !empty($instance['settings']['behaviors']['prepopulate']['providers']) ? array_keys($instance['settings']['behaviors']['prepopulate']['providers']) : array();
     $providers_names = drupal_array_merge_deep($providers_names, array_keys($providers));
     $weight = 0;
     foreach ($providers_names as $name) {
         // Validate that the provider exists.
         if (!isset($providers[$name])) {
             continue;
         }
         $provider = $providers[$name];
         // Set default values.
         $provider += array('disabled' => FALSE);
         $form['providers']['title'][$name] = array('#type' => 'item', '#markup' => filter_xss($provider['title']), '#description' => filter_xss($provider['description']));
         if (!isset($instance['settings']['behaviors']['prepopulate']['providers'][$name])) {
             // backwards compatibility with version 1.4.
             if ($name == 'url') {
                 // Enable the URL provider is it is not set in the instance yet.
                 $default_value = TRUE;
             } elseif ($name == 'og_context') {
                 $default_value = !empty($instance['settings']['behaviors']['prepopulate']['og_context']);
             }
         } else {
             $default_value = !empty($instance['settings']['behaviors']['prepopulate']['providers'][$name]);
         }
         $form['providers']['enabled'][$name] = array('#type' => 'checkbox', '#disabled' => $provider['disabled'], '#default_value' => $default_value);
         $form['providers']['weight'][$name] = array('#type' => 'weight', '#default_value' => $weight, '#attributes' => array('class' => array('provider-weight')));
         ++$weight;
     }
     return $form;
 }
开发者ID:elmsln,项目名称:spawn,代码行数:53,代码来源:EntityReferencePrepopulateInstanceBehavior.class.php


示例17: getExtensionPathList

 /**
  * {@inheritDoc}
  */
 public function getExtensionPathList()
 {
     $paths = array();
     // Get enabled modules.
     $modules = \module_list();
     foreach ($modules as $module) {
         $paths[] = $this->drupalRoot . DIRECTORY_SEPARATOR . \drupal_get_path('module', $module);
     }
     // Themes.
     // @todo
     // Active profile
     // @todo
     return $paths;
 }
开发者ID:bjeavons,项目名称:probo-test,代码行数:17,代码来源:Drupal7.php


示例18: page

/**
 * Construct the data structure for a specified page.
 *
 * @param $page The page to construct.
 * @param $options An associative array of options.
 *
 * @return The page data structure.
 */
function page($page, $options)
{
    // Initialize page structure
    $data = array();
    // Loop through modules
    foreach (module_list() as $module) {
        // Check if hook exists and execute
        $hook = $module . '_page';
        if (function_exists($hook)) {
            $hook($data, $page, $options);
        }
    }
    return $data;
}
开发者ID:mehulsbhatt,项目名称:seltzer,代码行数:22,代码来源:page.inc.php


示例19: index

 public function index()
 {
     $modules = module_list();
     $configs = array();
     foreach ($modules as $module) {
         $configs[$module] = module_config($module);
         if (!isset($configs[$module]['name'])) {
             $configs[$module]['name'] = ucwords($module);
         }
     }
     ksort($configs);
     Template::set('modules', $configs);
     Template::set_view('admin/developer/index');
     Template::render();
 }
开发者ID:hnmurugan,项目名称:Bonfire,代码行数:15,代码来源:developer.php


示例20: crm_get_table

/**
 * Get a table, allowing modules to alter it.
 * @param $table_id The name of the table.
 * @param $opts Associative array of options.
 */
function crm_get_table($table_id, $opts = array())
{
    // Get base table
    $table = call_user_func("{$table_id}_table", $opts);
    // Allow modules to alter the table
    foreach (module_list() as $module) {
        $hook = $module . '_table_alter';
        if (function_exists($hook)) {
            $table = call_user_func($hook, $table, $table_id, $opts);
            if (is_null($table)) {
                error_register('Null table returned by ' . $hook);
            }
        }
    }
    return $table;
}
开发者ID:mehulsbhatt,项目名称:seltzer,代码行数:21,代码来源:table.inc.php



注:本文中的module_list函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP module_load_include函数代码示例发布时间:2022-05-15
下一篇:
PHP module_invoke_all函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap