@@ -26,6 +26,7 @@ discard block |
||
| 26 | 26 | * Sets up hooks and properties. |
| 27 | 27 | * |
| 28 | 28 | * @internal |
| 29 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
| 29 | 30 | */ |
| 30 | 31 | public function __construct( $oFactory ) { |
| 31 | 32 | |
@@ -82,6 +83,7 @@ discard block |
||
| 82 | 83 | |
| 83 | 84 | /** |
| 84 | 85 | * @since 3.7.4 |
| 86 | + * @param string $sSubMenuSlug |
|
| 85 | 87 | */ |
| 86 | 88 | private function _setSubMenuSlugForSorting( $sSubMenuSlug ) { |
| 87 | 89 | |
@@ -94,6 +96,7 @@ discard block |
||
| 94 | 96 | |
| 95 | 97 | /** |
| 96 | 98 | * @since 3.7.4 |
| 99 | + * @param string $sSubMenuSlug |
|
| 97 | 100 | */ |
| 98 | 101 | private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
| 99 | 102 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $this->oFactory = $oFactory; |
| 33 | 33 | |
| 34 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
| 34 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | add_action( |
| 49 | 49 | 'admin_menu', |
| 50 | - array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
| 50 | + array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
| 51 | 51 | 9999 |
| 52 | 52 | ); |
| 53 | 53 | |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Check the post type `show_ui` and other related UI arguments. |
| 64 | 64 | $_bsShowInMeenu = $this->getShowInMenuPostTypeArgument( $this->oFactory->oProp->aPostTypeArgs ); |
| 65 | - if ( ! $_bsShowInMeenu ) { |
|
| 65 | + if ( !$_bsShowInMeenu ) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // If the user sets a menu slug to the 'show_in_menu' argument, use that. |
| 70 | 70 | // It is used to set a custom post type sub-menu belong to another menu. |
| 71 | - $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
| 71 | + $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
| 72 | 72 | ? $_bsShowInMeenu |
| 73 | - : 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
| 73 | + : 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
| 74 | 74 | |
| 75 | 75 | // Set the index to the framework specific global array for sorting. |
| 76 | 76 | $this->_setSubMenuSlugForSorting( $_sSubMenuSlug ); |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // @remark This is the partial link url set in the third element ( index of 2 ) in the third dimension of submenu global array element. |
| 133 | 133 | // This is not the submenu slug. |
| 134 | - $_sLinkSlugManage = 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
| 134 | + $_sLinkSlugManage = 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
| 135 | 135 | |
| 136 | 136 | $_aLinkSlugs = array( |
| 137 | 137 | $_sLinkSlugManage => $_nSubMenuOrderManage, |
| 138 | - 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
| 138 | + 'post-new.php?post_type='.$this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | 141 | // If the user does not set a custom value, unset it |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // If the user does not want to show the Add New sub menu, no need to change the order. |
| 147 | - if ( ! $_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
| 148 | - unset( $_aLinkSlugs[ 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType ] ); |
|
| 147 | + if ( !$_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
| 148 | + unset( $_aLinkSlugs[ 'post-new.php?post_type='.$this->oFactory->oProp->sPostType ] ); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | return $_aLinkSlugs; |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | private function _setSubMenuIndexByLinksSlugs( $sSubMenuSlug, array $aLinkSlugs ) { |
| 167 | 167 | |
| 168 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
| 168 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
| 169 | 169 | |
| 170 | - foreach( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
| 170 | + foreach ( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
| 171 | 171 | |
| 172 | 172 | $_bIsSet = $this->_setSubMenuIndexByLinksSlug( $sSubMenuSlug, $_nIndex, $_aSubMenuItem, $_sLinkSlug, $_nOrder ); |
| 173 | 173 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
| 194 | 194 | |
| 195 | 195 | // The third item is the link slug. |
| 196 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 196 | + if ( !isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 197 | 197 | return false; |
| 198 | 198 | } |
| 199 | 199 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * @package AdminPageFramework/Factory/PostType |
| 15 | 15 | * @internal |
| 16 | 16 | */ |
| 17 | -class AdminPageFramework_PostType_Model__SubMenuOrder extends AdminPageFramework_FrameworkUtility { |
|
| 17 | +class AdminPageFramework_PostType_Model__SubMenuOrder extends AdminPageFramework_FrameworkUtility { |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Stores a post type factory object. |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * @since 3.7.4 |
| 96 | 96 | */ |
| 97 | - private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
|
| 97 | + private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
|
| 98 | 98 | |
| 99 | 99 | // Only if custom values are set, set them. |
| 100 | 100 | $this->_setSubMenuIndexByLinksSlugs( |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
| 193 | 193 | |
| 194 | 194 | // The third item is the link slug. |
| 195 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 195 | + if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
| 196 | 196 | return false; |
| 197 | 197 | } |
| 198 | 198 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @param string $sPluginFilePath The plugin file path. |
| 39 | 39 | * @param string $sPluginHookPrefix The plugin hook slug without underscore. This will be used to construct hook names. |
| 40 | 40 | * @param string $sSetUpHook The action hook name for the setUp callback. Default 'plugins_loaded'. |
| 41 | - * @param string $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
|
| 41 | + * @param integer $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
|
| 42 | 42 | */ |
| 43 | 43 | public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) { |
| 44 | 44 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param string $sSetUpHook The action hook name for the setUp callback. Default 'plugins_loaded'. |
| 41 | 41 | * @param string $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
| 42 | 42 | */ |
| 43 | - public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) { |
|
| 43 | + public function __construct( $sPluginFilePath, $sPluginHookPrefix = '', $sSetUpHook = 'plugins_loaded', $iPriority = 10 ) { |
|
| 44 | 44 | |
| 45 | 45 | // Check if it has been loaded. |
| 46 | 46 | if ( $this->_hasLoaded() ) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) ); |
| 77 | 77 | |
| 78 | 78 | // 8. Schedule to load plugin specific components. |
| 79 | - if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
| 79 | + if ( !$this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
| 80 | 80 | $this->_replyToLoadPluginComponents(); |
| 81 | 81 | } else { |
| 82 | 82 | add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority ); |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | protected function _registerClasses() { |
| 117 | 117 | |
| 118 | 118 | // This class should be used in the framework bootstrap so disabling the auto-load option for performance. |
| 119 | - if ( ! class_exists( 'AdminPageFramework_RegisterClasses', false ) ) { |
|
| 119 | + if ( !class_exists( 'AdminPageFramework_RegisterClasses', false ) ) { |
|
| 120 | 120 | return; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // Register classes |
| 124 | 124 | new AdminPageFramework_RegisterClasses( |
| 125 | - $this->getScanningDirs(), // scanning directory paths |
|
| 126 | - array(), // autoloader options |
|
| 125 | + $this->getScanningDirs(), // scanning directory paths |
|
| 126 | + array(), // autoloader options |
|
| 127 | 127 | $this->getClasses() // pre-generated class list |
| 128 | 128 | ); |
| 129 | 129 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) ); |
| 77 | 77 | |
| 78 | 78 | // 8. Schedule to load plugin specific components. |
| 79 | - if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
| 79 | + if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
| 80 | 80 | $this->_replyToLoadPluginComponents(); |
| 81 | 81 | } else { |
| 82 | 82 | add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority ); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | protected function _hasLoaded() { |
| 101 | 101 | |
| 102 | 102 | static $_bLoaded = false; |
| 103 | - if ( $_bLoaded ) { |
|
| 103 | + if ( $_bLoaded ) { |
|
| 104 | 104 | return true; |
| 105 | 105 | } |
| 106 | 106 | $_bLoaded = true; |
@@ -25,6 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Sets up hooks and properties. |
| 28 | + * @param AdminPageFrameworkLoader_AdminPage $oFactory |
|
| 28 | 29 | */ |
| 29 | 30 | public function __construct( $oFactory, array $aPageArguments ) { |
| 30 | 31 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function __construct( $oFactory, array $aPageArguments ) { |
| 30 | 30 | |
| 31 | 31 | $this->oFactory = $oFactory; |
| 32 | - $this->sPageSlug = $aPageArguments['page_slug']; |
|
| 32 | + $this->sPageSlug = $aPageArguments[ 'page_slug' ]; |
|
| 33 | 33 | $this->_addPage( $aPageArguments ); |
| 34 | 34 | $this->construct( $oFactory ); |
| 35 | 35 | |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function replyToLoadResources( $oFactory ) { |
| 60 | 60 | |
| 61 | - $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/' . $this->sPageSlug . '.css'; |
|
| 62 | - if ( ! file_exists( $_sCSSPath ) ) { |
|
| 61 | + $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/'.$this->sPageSlug.'.css'; |
|
| 62 | + if ( !file_exists( $_sCSSPath ) ) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | $this->oFactory->enqueueStyle( |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | public function getClasses() { |
| 32 | 32 | |
| 33 | 33 | // Include the include lists. The including file reassigns the list(array) to the $_aClassFiles variable. |
| 34 | - $_aClassFiles = array(); |
|
| 35 | - include( dirname( $this->sFilePath ) . '/include/loader-class-list.php' ); |
|
| 34 | + $_aClassFiles = array(); |
|
| 35 | + include( dirname( $this->sFilePath ).'/include/loader-class-list.php' ); |
|
| 36 | 36 | $this->_aClassFiles = $_aClassFiles; |
| 37 | 37 | return $_aClassFiles; |
| 38 | 38 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ( $_oRequirementCheck->check() ) { |
| 61 | 61 | $_oRequirementCheck->deactivatePlugin( |
| 62 | 62 | $this->sFilePath, |
| 63 | - __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
| 63 | + __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
| 64 | 64 | true // is in the activation hook. This will exit the script. |
| 65 | 65 | ); |
| 66 | 66 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function setLocalization() { |
| 76 | 76 | |
| 77 | 77 | // This plugin does not have messages to be displayed in the front end. |
| 78 | - if ( ! $this->bIsAdmin ) { |
|
| 78 | + if ( !$this->bIsAdmin ) { |
|
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | load_plugin_textdomain( |
| 84 | 84 | AdminPageFrameworkLoader_Registry::TEXT_DOMAIN, |
| 85 | 85 | false, |
| 86 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
| 86 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | 89 | load_plugin_textdomain( |
| 90 | 90 | 'admin-page-framework', |
| 91 | 91 | false, |
| 92 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
| 92 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | 95 | } |
@@ -112,14 +112,14 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Loader plugin admin pages. |
| 114 | 114 | new AdminPageFrameworkLoader_AdminPage( |
| 115 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
| 115 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
| 116 | 116 | $this->sFilePath // caller script path |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | 119 | // Network admin pages. |
| 120 | 120 | if ( is_network_admin() ) { |
| 121 | 121 | new AdminPageFrameworkLoader_NetworkAdmin( |
| 122 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
| 122 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
| 123 | 123 | $this->sFilePath // caller script path |
| 124 | 124 | ); |
| 125 | 125 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | private function _shouldShowAdminPages() { |
| 141 | 141 | |
| 142 | - if ( ! $this->bIsAdmin ) { |
|
| 142 | + if ( !$this->bIsAdmin ) { |
|
| 143 | 143 | return false; |
| 144 | 144 | } |
| 145 | 145 | if ( AdminPageFrameworkLoader_Utility::isSilentMode() ) { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | AdminPageFrameworkLoader_Registry::NAME |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | - if ( $_oRequirementCheck->check() ) { |
|
| 61 | + if ( $_oRequirementCheck->check() ) { |
|
| 62 | 62 | $_oRequirementCheck->deactivatePlugin( |
| 63 | 63 | $this->sFilePath, |
| 64 | 64 | __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function setLocalization() { |
| 77 | 77 | |
| 78 | 78 | // This plugin does not have messages to be displayed in the front end. |
| 79 | - if ( ! $this->bIsAdmin ) { |
|
| 79 | + if ( ! $this->bIsAdmin ) { |
|
| 80 | 80 | return; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function start() { |
| 27 | 27 | |
| 28 | - if ( ! is_admin() ) { |
|
| 28 | + if ( !is_admin() ) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | // When newly installed, the 'welcomed' value is not set. |
| 49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
| 50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
| 50 | + if ( !$_oOption->get( 'welcomed' ) ) { |
|
| 51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
| 52 | 52 | $this->_goToWelcomePage(); // will exit |
| 53 | 53 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | private function _goToWelcomePage() { |
| 74 | 74 | |
| 75 | 75 | $_sWelcomePageURL = apply_filters( |
| 76 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
|
| 76 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_welcome_redirect_url', |
|
| 77 | 77 | add_query_arg( |
| 78 | 78 | array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] ), |
| 79 | 79 | admin_url( 'index.php' ) // Dashboard |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | public function setUp() { |
| 94 | 94 | |
| 95 | 95 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
| 96 | - if ( ! $_oOption->get( 'enable_admin_pages' ) ) { |
|
| 96 | + if ( !$_oOption->get( 'enable_admin_pages' ) ) { |
|
| 97 | 97 | return; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
| 100 | + $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
| 101 | 101 | |
| 102 | 102 | // Root page |
| 103 | 103 | $this->setRootMenuPage( |
@@ -108,12 +108,12 @@ discard block |
||
| 108 | 108 | $this->addSubMenuItems( |
| 109 | 109 | array( |
| 110 | 110 | 'title' => AdminPageFrameworkLoader_Registry::SHORTNAME, |
| 111 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
| 111 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
| 112 | 112 | 'show_in_menu' => false, |
| 113 | 113 | 'style' => array( |
| 114 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/about.css', |
|
| 115 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css', |
|
| 116 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.css', |
|
| 114 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/about.css', |
|
| 115 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css', |
|
| 116 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.css', |
|
| 117 | 117 | version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) |
| 118 | 118 | ? ".about-wrap .introduction h2 { |
| 119 | 119 | padding: 1em; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | }", |
| 128 | 128 | ), |
| 129 | 129 | 'script' => array( |
| 130 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.js', |
|
| 130 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.js', |
|
| 131 | 131 | "jQuery( document ).ready( function() { |
| 132 | 132 | jQuery( '.apf-badge-image' ).mflip(); |
| 133 | 133 | } );", |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it. |
| 139 | 139 | |
| 140 | 140 | // Hook |
| 141 | - add_action( "load_" . $this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
| 142 | - add_action( "load_" . AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
| 141 | + add_action( "load_".$this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
| 142 | + add_action( "load_".AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
| 143 | 143 | |
| 144 | 144 | } |
| 145 | 145 | |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
| 167 | 167 | new AdminPageFrameworkLoader_AdminPageWelcome_Welcome( |
| 168 | - $this, // factory object |
|
| 169 | - $_sPageSlug, // page slug |
|
| 168 | + $this, // factory object |
|
| 169 | + $_sPageSlug, // page slug |
|
| 170 | 170 | array( |
| 171 | 171 | 'tab_slug' => 'welcome', |
| 172 | 172 | // 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
| 173 | 173 | 'style' => array( |
| 174 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css', |
|
| 175 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
| 174 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css', |
|
| 175 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
| 176 | 176 | ), |
| 177 | 177 | ) |
| 178 | 178 | ); |
@@ -201,24 +201,24 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function replyToFilterContentTop( $sContent ) { |
| 203 | 203 | |
| 204 | - $_sVersion = '- ' . AdminPageFrameworkLoader_Registry::VERSION; |
|
| 205 | - $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME . ' ' . $_sVersion; |
|
| 204 | + $_sVersion = '- '.AdminPageFrameworkLoader_Registry::VERSION; |
|
| 205 | + $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME.' '.$_sVersion; |
|
| 206 | 206 | |
| 207 | 207 | $_sBadgeURL = esc_url( AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/icon-128x128.png' ) ); |
| 208 | 208 | |
| 209 | 209 | $_aOutput = array(); |
| 210 | - $_aOutput[] = "<h1>" |
|
| 210 | + $_aOutput[ ] = "<h1>" |
|
| 211 | 211 | . sprintf( __( 'Welcome to %1$s', 'admin-page-framework-loader' ), $_sPluginName ) |
| 212 | 212 | . "</h1>"; |
| 213 | - $_aOutput[] = "<div class='about-text'>" |
|
| 213 | + $_aOutput[ ] = "<div class='about-text'>" |
|
| 214 | 214 | . sprintf( __( 'Thank you for updating to the latest version! %1$s is ready to make your plugin or theme development faster, more organized and better!', 'admin-page-framework-loader' ), $_sPluginName ) |
| 215 | 215 | . "</div>"; |
| 216 | - $_aOutput[] = '' |
|
| 216 | + $_aOutput[ ] = '' |
|
| 217 | 217 | . "<div class='apf-badge'>" |
| 218 | 218 | . "<div class='apf-badge-image m-flip'>" |
| 219 | 219 | . "<img src='{$_sBadgeURL}' />" |
| 220 | 220 | . "</div>" |
| 221 | - . "<span class='label'>" . sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion ) . "</span>" |
|
| 221 | + . "<span class='label'>".sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion )."</span>" |
|
| 222 | 222 | . "</div>"; |
| 223 | 223 | |
| 224 | 224 | return implode( PHP_EOL, $_aOutput ) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | // When newly installed, the 'welcomed' value is not set. |
| 49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
| 50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
| 50 | + if ( ! $_oOption->get( 'welcomed' ) ) { |
|
| 51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
| 52 | 52 | $this->_goToWelcomePage(); // will exit |
| 53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - private function _goToWelcomePage() { |
|
| 73 | + private function _goToWelcomePage() { |
|
| 74 | 74 | |
| 75 | 75 | $_sWelcomePageURL = apply_filters( |
| 76 | 76 | AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function start() { |
| 20 | 20 | |
| 21 | - if ( ! $this->oProp->bIsAdmin ) { |
|
| 21 | + if ( !$this->oProp->bIsAdmin ) { |
|
| 22 | 22 | return; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Allows the user to switch the menu visibility. |
| 26 | - if ( isset( $_GET['enable_apfl_admin_pages'] ) ) { |
|
| 26 | + if ( isset( $_GET[ 'enable_apfl_admin_pages' ] ) ) { |
|
| 27 | 27 | |
| 28 | 28 | // Update the options and reload the page |
| 29 | 29 | $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | public function setUp() { |
| 68 | 68 | |
| 69 | 69 | $_aOptions = $this->oProp->aOptions; |
| 70 | - $_bAdminPageEnabled = ! is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
| 71 | - || ( isset( $_aOptions['enable_admin_pages'] ) && $_aOptions['enable_admin_pages'] ); |
|
| 70 | + $_bAdminPageEnabled = !is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
| 71 | + || ( isset( $_aOptions[ 'enable_admin_pages' ] ) && $_aOptions[ 'enable_admin_pages' ] ); |
|
| 72 | 72 | |
| 73 | 73 | // Set up pages |
| 74 | 74 | if ( $_bAdminPageEnabled ) { |
| 75 | 75 | |
| 76 | 76 | $this->setRootMenuPage( |
| 77 | - AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
| 78 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/image/wp-logo_16x16.png', // menu icon |
|
| 77 | + AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
| 78 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/image/wp-logo_16x16.png', // menu icon |
|
| 79 | 79 | 4 // menu position |
| 80 | 80 | ); |
| 81 | 81 | |
@@ -86,19 +86,19 @@ discard block |
||
| 86 | 86 | 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
| 87 | 87 | 'title' => __( 'Tools', 'admin-page-framework-loader' ), |
| 88 | 88 | 'style' => array( |
| 89 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
| 90 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
| 89 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
| 90 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
| 91 | 91 | ), |
| 92 | 92 | ) |
| 93 | 93 | ); |
| 94 | 94 | new AdminPageFrameworkLoader_AdminPage_Addon( |
| 95 | 95 | $this, |
| 96 | 96 | array( |
| 97 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
| 97 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
| 98 | 98 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
| 99 | 99 | 'style' => array( |
| 100 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
| 101 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
| 100 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
| 101 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
| 102 | 102 | ), |
| 103 | 103 | ) |
| 104 | 104 | ); |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | 'title' => __( 'Help', 'admin-page-framework-loader' ), |
| 110 | 110 | 'order' => 1000, // to be the last menu item |
| 111 | 111 | 'style' => array( |
| 112 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
| 113 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
| 112 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
| 113 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
| 114 | 114 | ), |
| 115 | 115 | ) |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - add_action( 'load_' . $this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
| 118 | + add_action( 'load_'.$this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
| 119 | 119 | |
| 120 | 120 | } |
| 121 | 121 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | private function _addActionLinks( $_bAdminPageEnabled, $_aOptions ) { |
| 130 | 130 | |
| 131 | - if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
| 131 | + if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
| 132 | 132 | return; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -152,24 +152,24 @@ discard block |
||
| 152 | 152 | * @return string |
| 153 | 153 | */ |
| 154 | 154 | private function _getAdminURLTools( $_bAdminPageEnabled ) { |
| 155 | - if ( ! $_bAdminPageEnabled ) { |
|
| 155 | + if ( !$_bAdminPageEnabled ) { |
|
| 156 | 156 | return; |
| 157 | 157 | } |
| 158 | - $_sLink = esc_url( |
|
| 158 | + $_sLink = esc_url( |
|
| 159 | 159 | add_query_arg( |
| 160 | 160 | array( |
| 161 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'], |
|
| 161 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
|
| 162 | 162 | ), |
| 163 | 163 | admin_url( 'admin.php' ) |
| 164 | 164 | ) |
| 165 | 165 | ); |
| 166 | - return "<a href='{$_sLink}'>" . __( 'Tools', 'admin-page-framework-loader' ) . "</a>"; |
|
| 166 | + return "<a href='{$_sLink}'>".__( 'Tools', 'admin-page-framework-loader' )."</a>"; |
|
| 167 | 167 | } |
| 168 | 168 | /** |
| 169 | 169 | * Returns the Enable /Disable Admin Pages link. |
| 170 | 170 | */ |
| 171 | 171 | private function _getAdminPageSwitchLink( $bEnabled ) { |
| 172 | - $_sLink = esc_url( |
|
| 172 | + $_sLink = esc_url( |
|
| 173 | 173 | add_query_arg( |
| 174 | 174 | array( |
| 175 | 175 | 'enable_apfl_admin_pages' => $bEnabled ? 0 : 1, |
@@ -177,19 +177,19 @@ discard block |
||
| 177 | 177 | ) |
| 178 | 178 | ); |
| 179 | 179 | return $bEnabled |
| 180 | - ? "<a href='{$_sLink}'>" . __( 'Disable Admin Pages', 'admin-page-framework-loader' ) . "</a>" |
|
| 181 | - : "<a href='{$_sLink}'>" . __( 'Enable Admin Pages', 'admin-page-framework-loader' ) . "</a>"; |
|
| 180 | + ? "<a href='{$_sLink}'>".__( 'Disable Admin Pages', 'admin-page-framework-loader' )."</a>" |
|
| 181 | + : "<a href='{$_sLink}'>".__( 'Enable Admin Pages', 'admin-page-framework-loader' )."</a>"; |
|
| 182 | 182 | } |
| 183 | 183 | /** |
| 184 | 184 | * Returns the switch link of the demo pages. |
| 185 | 185 | */ |
| 186 | - private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions=array() ) { |
|
| 186 | + private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions = array() ) { |
|
| 187 | 187 | |
| 188 | - if ( ! $_bAdminPageEnabled ) { |
|
| 188 | + if ( !$_bAdminPageEnabled ) { |
|
| 189 | 189 | return ''; |
| 190 | 190 | } |
| 191 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
| 192 | - $_sLink = esc_url( |
|
| 191 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
| 192 | + $_sLink = esc_url( |
|
| 193 | 193 | add_query_arg( |
| 194 | 194 | array( |
| 195 | 195 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | ) |
| 198 | 198 | ); |
| 199 | 199 | return $_bEnabled |
| 200 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
| 201 | - : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
| 200 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
| 201 | + : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
| 202 | 202 | |
| 203 | 203 | } |
| 204 | 204 | |
@@ -214,14 +214,14 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | // Page meta boxes |
| 216 | 216 | new AdminPageFrameworkLoader_AdminPageMetaBox_Notification( |
| 217 | - null, // meta box id - passing null will make it auto generate |
|
| 217 | + null, // meta box id - passing null will make it auto generate |
|
| 218 | 218 | __( 'Notification', 'admin-page-framework-loader' ), // title |
| 219 | 219 | array( // page slugs |
| 220 | 220 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
| 221 | 221 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], |
| 222 | 222 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
| 223 | 223 | ), |
| 224 | - 'side', // context |
|
| 224 | + 'side', // context |
|
| 225 | 225 | 'default' // priority |
| 226 | 226 | ); |
| 227 | 227 | |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | public function replyToLoadPage( $oFactory ) { |
| 20 | 20 | |
| 21 | 21 | new AdminPageFrameworkLoader_AdminPage_Addon_Top( |
| 22 | - $oFactory, // factory object |
|
| 23 | - $this->sPageSlug, // page slug |
|
| 22 | + $oFactory, // factory object |
|
| 23 | + $this->sPageSlug, // page slug |
|
| 24 | 24 | array( // tab definition |
| 25 | 25 | 'tab_slug' => 'top', |
| 26 | 26 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | $this->aCustomFieldTypes, |
| 275 | 275 | array( $sParsingClassName, 'text_domain' ) |
| 276 | 276 | ); |
| 277 | - if ( $_sFieldTypeTextDomain ) { |
|
| 277 | + if ( $_sFieldTypeTextDomain ) { |
|
| 278 | 278 | $_aSearches[] = $_sFieldTypeTextDomain; |
| 279 | 279 | $_aReplaces[] = $_sUserTextDomain; |
| 280 | 280 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'class_name' => 'AceCustomFieldType', |
| 89 | 89 | 'label' => __( 'ACE', 'admin-page-framework-loader' ), |
| 90 | 90 | 'description' => __( 'provides code syntax highlighting in a text area field.', 'admin-page-framework-loader' ), |
| 91 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/ace-custom-field-type', |
|
| 91 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/ace-custom-field-type', |
|
| 92 | 92 | 'archive_file_path' => 'custom-field-types/ace-custom-field-type/AceCustomFieldType.php', |
| 93 | 93 | 'archive_dir_path' => 'custom-field-types/ace-custom-field-type', |
| 94 | 94 | 'text_domain' => 'admin-page-framework', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | 'class_name' => 'GitHubCustomFieldType', |
| 98 | 98 | 'label' => __( 'GitHub Buttons', 'admin-page-framework-loader' ), |
| 99 | 99 | 'description' => __( 'allows you to display GitHub buttons in a field.', 'admin-page-framework-loader' ), |
| 100 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/include/library/github-custom-field-type', |
|
| 100 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/include/library/github-custom-field-type', |
|
| 101 | 101 | 'archive_file_path' => 'custom-field-types/github-custom-field-type/GitHubCustomFieldType.php', |
| 102 | 102 | 'archive_dir_path' => 'custom-field-types/github-custom-field-type', |
| 103 | 103 | 'text_domain' => 'admin-page-framework', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | 'class_name' => 'PathCustomFieldType', |
| 107 | 107 | 'label' => __( 'Path', 'admin-page-framework-loader' ), |
| 108 | 108 | 'description' => __( 'allows the user to select a file path on the server.', 'admin-page-framework-loader' ), |
| 109 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/path-custom-field-type', |
|
| 109 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/path-custom-field-type', |
|
| 110 | 110 | 'archive_file_path' => 'custom-field-types/path-custom-field-type/PathCustomFieldType.php', |
| 111 | 111 | 'archive_dir_path' => 'custom-field-types/path-custom-field-type', |
| 112 | 112 | 'text_domain' => 'admin-page-framework', |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 'class_name' => 'ToggleCustomFieldType', |
| 116 | 116 | 'label' => __( 'Toggle', 'admin-page-framework-loader' ), |
| 117 | 117 | 'description' => __( 'allows the user to switch a button.', 'admin-page-framework-loader' ), |
| 118 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/toggle-custom-field-type', |
|
| 118 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/toggle-custom-field-type', |
|
| 119 | 119 | 'archive_file_path' => 'custom-field-types/toggle-custom-field-type/ToggleCustomFieldType.php', |
| 120 | 120 | 'archive_dir_path' => 'custom-field-types/toggle-custom-field-type', |
| 121 | 121 | 'text_domain' => 'admin-page-framework', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'class_name' => 'NoUISliderCustomFieldType', |
| 125 | 125 | 'label' => __( 'NoUISlider (Range Slider)', 'admin-page-framework-loader' ), |
| 126 | 126 | 'description' => __( 'allows the user to set values in ranges.', 'admin-page-framework-loader' ), |
| 127 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/nouislider-custom-field-type', |
|
| 127 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/nouislider-custom-field-type', |
|
| 128 | 128 | 'archive_file_path' => 'custom-field-types/nouislider-custom-field-type/NoUISliderCustomFieldType.php', |
| 129 | 129 | 'archive_dir_path' => 'custom-field-types/nouislider-custom-field-type', |
| 130 | 130 | 'text_domain' => 'admin-page-framework', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'class_name' => 'Select2CustomFieldType', |
| 134 | 134 | 'label' => __( 'Select2', 'admin-page-framework-loader' ), |
| 135 | 135 | 'description' => __( 'allows the user to select items with autocomplete from a list which can be populated with AJAX.', 'admin-page-framework-loader' ), |
| 136 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/select2-custom-field-type', |
|
| 136 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/select2-custom-field-type', |
|
| 137 | 137 | 'archive_file_path' => 'custom-field-types/select2-custom-field-type/Select2CustomFieldType.php', |
| 138 | 138 | 'archive_dir_path' => 'custom-field-types/select2-custom-field-type', |
| 139 | 139 | 'text_domain' => 'admin-page-framework', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'class_name' => 'PostTypeTaxonomyCustomFieldType', |
| 143 | 143 | 'label' => __( 'Post Type Taxonomy', 'admin-page-framework-loader' ), |
| 144 | 144 | 'description' => __( 'allows the user to select taxonomy terms of selected post types.', 'admin-page-framework-loader' ), |
| 145 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/post_type_taxonomy_field-type', |
|
| 145 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/post_type_taxonomy_field-type', |
|
| 146 | 146 | 'archive_file_path' => 'custom-field-types/post_type_taxonomy_field-type/PostTypeTaxonomyCustomFieldType.php', |
| 147 | 147 | 'archive_dir_path' => 'custom-field-types/post_type_taxonomy_field-type', |
| 148 | 148 | 'text_domain' => 'admin-page-framework', |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // Let third-party scripts add custom field types. |
| 153 | 153 | $this->aCustomFieldTypes = apply_filters( |
| 154 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_custom_field_types', |
|
| 154 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_custom_field_types', |
|
| 155 | 155 | $this->aCustomFieldTypes |
| 156 | 156 | ); |
| 157 | 157 | |
| 158 | - foreach( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
| 158 | + foreach ( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
| 159 | 159 | $this->aCustomFieldTypeLabels[ $_sKey ] = $_aCustomFieldType[ 'label' ] |
| 160 | - . ' - <span class="description">' . $_aCustomFieldType[ 'description' ] . '</span>'; |
|
| 160 | + . ' - <span class="description">'.$_aCustomFieldType[ 'description' ].'</span>'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | } |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | // Check the file extension. |
| 175 | 175 | $_aAllowedExtensions = apply_filters( |
| 176 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', |
|
| 176 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_allowed_file_extensions', |
|
| 177 | 177 | array( 'php', 'css', 'js' ) |
| 178 | 178 | ); |
| 179 | - if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
| 179 | + if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
| 180 | 180 | return $sFileContents; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | private function _getModifiedInclusionList( $sFileContents ) { |
| 207 | 207 | return str_replace( |
| 208 | 208 | ');', // search |
| 209 | - $this->_getClassListOfCustomFieldTypes() . ');', // replace - @todo insert the selected class list here |
|
| 209 | + $this->_getClassListOfCustomFieldTypes().');', // replace - @todo insert the selected class list here |
|
| 210 | 210 | $sFileContents // subject |
| 211 | 211 | ); |
| 212 | 212 | } |
@@ -223,18 +223,18 @@ discard block |
||
| 223 | 223 | $_POST, |
| 224 | 224 | array( |
| 225 | 225 | $this->oFactory->oProp->sOptionKey, |
| 226 | - 'generator', // section id |
|
| 226 | + 'generator', // section id |
|
| 227 | 227 | 'class_prefix' // field id |
| 228 | 228 | ), |
| 229 | 229 | '' |
| 230 | 230 | ); |
| 231 | 231 | $_aOutput = array(); |
| 232 | - foreach( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 233 | - $_aOutput[] = ' "' . $_sClassPrefix . $_sClassName . '"' |
|
| 232 | + foreach ( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 233 | + $_aOutput[ ] = ' "'.$_sClassPrefix.$_sClassName.'"' |
|
| 234 | 234 | . ' => ' |
| 235 | - . 'AdminPageFramework_Registry::$sDirPath . ' . '"/' . ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ) . '",'; |
|
| 235 | + . 'AdminPageFramework_Registry::$sDirPath . '.'"/'.ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ).'",'; |
|
| 236 | 236 | } |
| 237 | - return implode( PHP_EOL, $_aOutput ) . PHP_EOL; |
|
| 237 | + return implode( PHP_EOL, $_aOutput ).PHP_EOL; |
|
| 238 | 238 | |
| 239 | 239 | } |
| 240 | 240 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $this->aCustomFieldTypes // ArchiveFilePaths |
| 253 | 253 | ); |
| 254 | 254 | $_aArchiveFilePaths = array(); |
| 255 | - foreach( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 255 | + foreach ( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
| 256 | 256 | $_aArchiveFilePaths[ $_sClassName ] = $this->oFactory->oUtil->getElement( |
| 257 | 257 | $_aCustomFieldType, |
| 258 | 258 | 'archive_file_path', |
@@ -304,17 +304,17 @@ discard block |
||
| 304 | 304 | array( $sParsingClassName, 'text_domain' ) |
| 305 | 305 | ); |
| 306 | 306 | if ( $_sFieldTypeTextDomain ) { |
| 307 | - $_aSearches[] = $_sFieldTypeTextDomain; |
|
| 308 | - $_aReplaces[] = $_sUserTextDomain; |
|
| 307 | + $_aSearches[ ] = $_sFieldTypeTextDomain; |
|
| 308 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - $_aSearches[] = 'admin-page-framework'; |
|
| 312 | - $_aReplaces[] = $_sUserTextDomain; |
|
| 311 | + $_aSearches[ ] = 'admin-page-framework'; |
|
| 312 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
| 313 | 313 | |
| 314 | 314 | // Return the converted string. |
| 315 | 315 | return str_replace( |
| 316 | - $_aSearches, // search |
|
| 317 | - $_aReplaces, // replace |
|
| 316 | + $_aSearches, // search |
|
| 317 | + $_aReplaces, // replace |
|
| 318 | 318 | $sFileContents // subject |
| 319 | 319 | ); |
| 320 | 320 | |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | ); |
| 333 | 333 | |
| 334 | 334 | return preg_replace( |
| 335 | - $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
| 336 | - $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
| 335 | + $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
| 336 | + $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
| 337 | 337 | $sFileContents // subject |
| 338 | 338 | ); |
| 339 | 339 | |
@@ -346,8 +346,8 @@ discard block |
||
| 346 | 346 | private function _getClassPrefixRegexPatterns( array $aSelectedFieldTypeClassNames ) { |
| 347 | 347 | |
| 348 | 348 | $_aPregSearches = array(); |
| 349 | - foreach( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
| 350 | - $_aPregSearches[] = '/(?<=[^a-zA-Z0-9])(' . $_sClassName . ')/'; |
|
| 349 | + foreach ( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
| 350 | + $_aPregSearches[ ] = '/(?<=[^a-zA-Z0-9])('.$_sClassName.')/'; |
|
| 351 | 351 | } |
| 352 | 352 | return $_aPregSearches; |
| 353 | 353 | |
@@ -359,9 +359,9 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | private function _getClassPrefixRegexReplacements( array $aSelectedFieldTypeClassNames ) { |
| 361 | 361 | |
| 362 | - $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
| 362 | + $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
| 363 | 363 | array_walk( |
| 364 | - $_aPrefixedClassNames, // passed by reference |
|
| 364 | + $_aPrefixedClassNames, // passed by reference |
|
| 365 | 365 | array( $this, '_replyToSetPrefix' ), |
| 366 | 366 | $this->oFactory->oUtil->getElement( |
| 367 | 367 | $_POST, |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | * @callback function array_walk |
| 383 | 383 | * @return string |
| 384 | 384 | */ |
| 385 | - public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix='' ) { |
|
| 386 | - $sClassName = $sPrefix . '$0'; |
|
| 385 | + public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix = '' ) { |
|
| 386 | + $sClassName = $sPrefix.'$0'; |
|
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | |
@@ -404,12 +404,12 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | public function replyToSetAdditionalDirectoriesForGenerator( $aDirPaths ) { |
| 406 | 406 | |
| 407 | - $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
| 407 | + $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
| 408 | 408 | $this->aCustomFieldTypes |
| 409 | 409 | ); |
| 410 | 410 | |
| 411 | 411 | $_aDirPathInfo = array(); |
| 412 | - foreach( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
| 412 | + foreach ( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
| 413 | 413 | |
| 414 | 414 | $_sArchiveDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'archive_dir_path' ); |
| 415 | 415 | $_sSourceDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'directory_path' ); |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | * @return array The array keys of the checked items. |
| 426 | 426 | * @since 3.6.0 |
| 427 | 427 | */ |
| 428 | - private function _getSelectedCustomFieldTypes( array $aSubject=array() ) { |
|
| 428 | + private function _getSelectedCustomFieldTypes( array $aSubject = array() ) { |
|
| 429 | 429 | |
| 430 | 430 | $_aCheckedCustomFieldTypes = $this->oFactory->oUtil->getElementAsArray( |
| 431 | 431 | $_POST, |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | public function replyToDoTab( /* $oFactory */ ) { |
| 22 | 22 | |
| 23 | 23 | echo $this->_getReadmeContents( |
| 24 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', |
|
| 25 | - '', // no TOC |
|
| 24 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', |
|
| 25 | + '', // no TOC |
|
| 26 | 26 | array( 'Support' ) |
| 27 | 27 | ); |
| 28 | 28 | |