| 1 | <?php |
||
| 39 | class AdminPageFramework_PointerToolTip extends AdminPageFramework_WPUtility { |
||
|
2 ignored issues
–
show
|
|||
| 40 | |||
| 41 | static private $_bResourceLoaded = false; |
||
|
1 ignored issue
–
show
|
|||
| 42 | |||
| 43 | /** |
||
| 44 | * Stores pointer data. |
||
| 45 | */ |
||
| 46 | static private $aPointers = array(); |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Stores the pointer tool box id for the class instance. |
||
| 50 | */ |
||
| 51 | public $sPointerID; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Stores the pointer tool box defintion for the class instance. |
||
| 55 | */ |
||
| 56 | public $aPointerData; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * User set screen IDs. Accepts APF page slugs. |
||
| 60 | */ |
||
| 61 | public $aScreenIDs = array(); |
||
| 62 | |||
| 63 | |||
| 64 | /** |
||
| 65 | * Sets up hooks and properties. |
||
| 66 | * |
||
| 67 | * @since DEVVER |
||
| 68 | * @see https://codex.wordpress.org/Plugin_API/Admin_Screen_Reference |
||
| 69 | * @param array|strin $asScreenIDs Screen IDs or page slug. |
||
| 70 | * @param string $sPointerID A unique pointer ID. |
||
| 71 | * @Param array $aPointerData The pointer data. |
||
| 72 | */ |
||
| 73 | public function __construct( $asScreenIDs, $sPointerID, array $aPointerData ) { |
||
| 88 | /** |
||
| 89 | * Sets up hooks. |
||
| 90 | * @since DEVVER |
||
| 91 | */ |
||
| 92 | private function _setHooks( $aScreenIDs ) { |
||
| 117 | /** |
||
| 118 | * @return boolean |
||
| 119 | */ |
||
| 120 | private function _hasBeenCalled() { |
||
| 127 | |||
| 128 | /** |
||
| 129 | * @callback filter {class name}-{screen id} |
||
| 130 | * @return array |
||
| 131 | */ |
||
| 132 | public function _replyToSetPointer( $aPointers ) { |
||
| 137 | |||
| 138 | /** |
||
| 139 | * Checks the screen id and page slug and add items if they match the current screen |
||
| 140 | * |
||
| 141 | * @callback action admin_enqueue_scripts |
||
| 142 | * @since DEVVER |
||
| 143 | * @return void |
||
| 144 | */ |
||
| 145 | public function _replyToLoadPointers( /* $hook_suffix */ ) { |
||
| 158 | /** |
||
| 159 | * Get pointers for this screen. |
||
| 160 | * @since DEVVER |
||
| 161 | * @return array |
||
| 162 | */ |
||
| 163 | private function _getPointers() { |
||
| 177 | |||
| 178 | /** |
||
| 179 | * @return array |
||
| 180 | * @since DEVVER |
||
| 181 | */ |
||
| 182 | private function _getValidPointers( $_aPointers ) { |
||
| 218 | |||
| 219 | /** |
||
| 220 | * @return boolean |
||
| 221 | * @since DEVVER |
||
| 222 | */ |
||
| 223 | private function _shouldSkip( $_iPointerID, $_aDismissed, $_aPointer ) { |
||
| 243 | |||
| 244 | /** |
||
| 245 | * Enqueues scripts. |
||
| 246 | */ |
||
| 247 | private function _enqueueScripts() { |
||
| 262 | |||
| 263 | /** |
||
| 264 | * @since DVVER |
||
| 265 | * @callback action admin_print_footer_scripts |
||
| 266 | */ |
||
| 267 | public function _replyToInsertInlineScript() { |
||
| 276 | /** |
||
| 277 | * Returns an inline JavaScript script. |
||
| 278 | * |
||
| 279 | * @since DEVVER |
||
| 280 | * @return string |
||
| 281 | */ |
||
| 282 | public function _getInlineScript( $aPointers=array() ) { |
||
| 309 | |||
| 310 | } |
||
|
1 ignored issue
–
show
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.