示例#1
0
 function get_theme_customizers()
 {
     $array = array();
     foreach (reason_get_merged_fileset('theme_customizers') as $k => $v) {
         if ($v != 'interface.php') {
             $name = basename($v, '.php');
             $array[$name] = $name;
         }
     }
     return prettify_array($array);
 }
示例#2
0
 /**
  * Returns an array describing available social accounts.
  *
  * @return array
  */
 function get_available_integrators()
 {
     static $integrators = NULL;
     if (NULL === $integrators) {
         $files = reason_get_merged_fileset('classes/social/');
         foreach ($files as $file) {
             $account_type = basename($file, '.php');
             if ($integrator = $this->get_integrator($account_type)) {
                 if ($integrator instanceof SocialAccountPlatform) {
                     $integrators[$account_type] = $integrator->get_platform_name();
                 } else {
                     $integrators[$account_type] = $account_type;
                 }
             }
         }
     }
     return $integrators;
 }
 function _build_upgrader_info($upgrade_string)
 {
     $dir_path = 'scripts/upgrade/' . $upgrade_string . '/';
     $files = reason_get_merged_fileset($dir_path);
     $upgraders = array();
     if (!empty($files)) {
         foreach ($files as $file) {
             reason_include_once($dir_path . $file);
             $name = basename($file, '.php');
             if (!empty($GLOBALS['_reason_upgraders'][$upgrade_string][$name])) {
                 $classname = $GLOBALS['_reason_upgraders'][$upgrade_string][$name];
                 if (class_exists($classname)) {
                     $obj = new $classname();
                     if ($obj instanceof reasonUpgraderInterface) {
                         $upgrader = new $classname();
                         if (method_exists($upgrader, 'standalone') && $upgrader->standalone()) {
                             $upgraders['standalone_upgraders'][$name] = $upgrader;
                         } else {
                             $upgraders['upgraders'][$name] = $upgrader;
                         }
                     } elseif ($obj instanceof reasonUpgraderInterfaceAdvanced) {
                         $upgraders['standalone_upgraders'][$name] = new $classname();
                     } elseif ($obj instanceof reasonUpgraderInfoInterface) {
                         $upgraders['upgrade_info'][$name] = new $classname();
                     } else {
                         trigger_error('Upgraders must implement the reasonUpgraderInterface, reasonUpgraderInterfaceAdvanced, or the reasonUpgraderInfoInterface; ' . $classname . ' appears not to.');
                     }
                 } else {
                     trigger_error('Unable to instantiate upgrader class ' . $classname . ' -- it does not appear to exist');
                 }
             } else {
                 trigger_error('The upgrader file ' . $file . ' does not appear to have registered itself properly. At the top of the file there should be' . ' a declaration like this: $GLOBALS[\'_reason_upgraders\'][\'' . $upgrade_string . '\'][\'' . $name . '\'] = \'NameOfUpgraderClass\'');
             }
         }
     }
     if (!empty($upgraders['upgraders'])) {
         ksort($upgraders['upgraders']);
     }
     if (!empty($upgraders['upgrade_info'])) {
         ksort($upgraders['upgrade_info']);
     }
     if (!empty($upgraders['standalone_upgraders'])) {
         ksort($upgraders['standalone_upgraders']);
     }
     $this->upgraders = !empty($upgraders['upgraders']) ? $upgraders['upgraders'] : array();
     $this->upgrade_info = !empty($upgraders['upgrade_info']) ? $upgraders['upgrade_info'] : array();
     $this->standalone_upgraders = !empty($upgraders['standalone_upgraders']) ? $upgraders['standalone_upgraders'] : array();
 }