예제 #1
0
파일: class.me.php 프로젝트: wujingke/Me
 /**
  * Activate a module.
  * 
  * Checks for the existence of a module, then adds it to the active_modules option.
  * 
  * @since 0.1.0
  * 
  * @see is_module
  * @see get_active_modules
  * @see get_module_path
  * 
  * @param string $module The slug of the module to activate
  * 
  */
 public static function activate_module($module)
 {
     if (!Me::is_module($module)) {
         return false;
     }
     $active = Me::get_active_modules();
     foreach ($active as $act) {
         if ($act == $module) {
             return true;
         }
     }
     require Me::get_module_path($module);
     $active[] = $module;
     Me::update_option('active_modules', $active);
     return true;
 }