1 <?php
2 3 4 5 6 7 8
9 if ( ! class_exists( 'AdminPageFramework_MetaBox_Page_Router' ) ) :
10 11 12 13 14 15 16 17
18 abstract class AdminPageFramework_MetaBox_Page_Router extends AdminPageFramework_MetaBox_Base {
19
20 21 22 23 24
25 function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) {
26
27 parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain );
28
29 $this->oUtil->addAndDoAction( $this, "start_{$this->oProp->sClassName}", $this );
30
31 }
32
33 34 35 36
37 protected function _isInstantiatable() {
38
39
40 if ( isset( $GLOBALS['pagenow'] ) && 'admin-ajax.php' === $GLOBALS['pagenow'] ) {
41 return false;
42 }
43 return true;
44
45 }
46
47 48 49 50 51 52
53 protected function _isInThePage() {
54
55 if ( ! $this->oProp->bIsAdmin ) {
56 return false;
57 }
58
59 if ( ! isset( $_GET['page'] ) ) {
60 return false;
61 }
62
63 return in_array( $_GET['page'], $this->oProp->aPageSlugs );
64
65 }
66 }
67 endif;