Exemplo n.º 1
0
 /**
  *    widgets_init
  *
  * @access private
  * @return void
  */
 public function widgets_init()
 {
     //only init widgets on admin pages when not in complete maintenance, and
     //on frontend when not in any maintenance mode
     if (!EE_Maintenance_Mode::instance()->level() || is_admin() && EE_Maintenance_Mode::instance()->level() !== EE_Maintenance_Mode::level_2_complete_maintenance) {
         // grab list of installed widgets
         $widgets_to_register = glob(EE_WIDGETS . '*', GLOB_ONLYDIR);
         // filter list of modules to register
         $widgets_to_register = apply_filters('FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register);
         if (!empty($widgets_to_register)) {
             // cycle thru widget folders
             foreach ($widgets_to_register as $widget_path) {
                 // add to list of installed widget modules
                 EE_Config::register_ee_widget($widget_path);
             }
         }
         // filter list of installed modules
         EE_Registry::instance()->widgets = apply_filters('FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets);
     }
 }