コード例 #1
0
 /**
  * prepare classes
  * @param $class: return path of class file
  */
 public static function setup_classes($class = '')
 {
     //more classes
     if (!self::$classes_libs) {
         self::$classes_libs = array();
     }
     if (empty(self::$classes_libs)) {
         $default_classes = array('AdminPageFramework' => array('debug' => HW_HOANGWEB_PATH . '/lib/admin-page-framework/development/admin-page-framework.php', 'release' => HW_HOANGWEB_PATH . '/lib/admin-page-framework/admin-page-framework.min.php', 'class' => 'AdminPageFramework'), 'redrokk_metabox_class' => HW_HOANGWEB_PATH . '/classes/class-redrokk-metabox-class.php', 'redrokk_post_class' => HW_HOANGWEB_PATH . '/classes/class-redrokk-post-class.php', 'HW_APF_FormField' => array('release' => HW_HOANGWEB_PATH . '/classes/class-hw-apf-field-type.php', 'class' => 'HW_APF_FormField', 'deps' => 'AdminPageFramework'), 'hwArray' => HW_HOANGWEB_PATH . '/classes/array/class-core-array.php', 'HW_Ajax' => array('release' => HW_HOANGWEB_PATH . '/classes/array/class-hw-ajax.php', 'class' => 'HW_Ajax', 'deps' => 'hwArray'), 'HW_SESSION' => array('release' => HW_HOANGWEB_PATH . '/classes/class-core-session.php', 'class' => 'HW_SESSION', 'deps' => array('hwArray')), 'HW_Logger' => array('release' => HW_HOANGWEB_PATH . '/classes/class-hw-logger.php', 'class' => 'HW_Logger'), 'HW_XML' => HW_HOANGWEB_PATH . '/classes/class-core-XML.php', 'HW_Shell' => HW_HOANGWEB_PATH . '/classes/class-hw-shell.php', 'HW_XMLRPC_Server' => HW_HOANGWEB_PATH . '/classes/class-hw-api.php', 'HW_File_Directory' => HW_HOANGWEB_PATH . '/classes/class-core-directories.php', 'Twig_Autoloader' => HW_HOANGWEB_PATH . '/lib/vendor/autoload.php', 'HW_Twig_Template' => HW_HOANGWEB_PATH . '/classes/class-template-twig.php', 'HW_ACF_API' => HW_HOANGWEB_PATH . '/classes/plugins/class-hw_acf_api.php', 'HW_ButtonToggle_widget' => HW_HOANGWEB_PATH . '/classes/class-ui-button_toggle_widget.php', 'HW_WP' => HW_HOANGWEB_PATH . '/classes/class-core.php', 'HW_WP_NOTICES' => HW_HOANGWEB_PATH . '/classes/admin/class-ui-notices.php', 'HW_POST' => HW_HOANGWEB_PATH . '/classes/class-core-posts.php', 'HW_URL' => HW_HOANGWEB_PATH . '/classes/class-URL.php', 'HW_Screen_Option' => HW_HOANGWEB_PATH . '/classes/admin/class-core-screen-option.php', 'HW_WP_Attachment' => HW_HOANGWEB_PATH . '/classes/class-wp-attachment.php', 'HW_CURL' => HW_HOANGWEB_PATH . '/classes/class-core-CURL.php', 'HW_Encryptor' => HW_HOANGWEB_PATH . '/classes/class-core-EnDecrypt.php', 'HW_String' => HW_HOANGWEB_PATH . '/classes/class-core-string.php', 'CreateZipFile' => HW_HOANGWEB_PATH . '/classes/class-core-CreateZipFile_helper.php', 'JSLikeHTMLElement' => HW_HOANGWEB_PATH . '/classes/class-core-JSLikeHTMLElement.php', 'HW_Validation' => HW_HOANGWEB_PATH . '/classes/class-core-validation.php', 'HW_List_Table' => HW_HOANGWEB_PATH . '/classes/admin/class-ui-admin-table.php', 'HW_UI_Component' => HW_HOANGWEB_PATH . '/classes/class-ui.php', 'HW_UI_Menus' => HW_HOANGWEB_PATH . '/classes/class-ui-menu.php');
         self::$classes_libs = array_merge(self::$classes_libs, $default_classes);
     }
     if ($class) {
         if (isset(self::$classes_libs[$class])) {
             return self::$classes_libs[$class];
         }
     } else {
         return self::$classes_libs;
     }
 }