public function __construct($sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array('post'), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'amazon-auto-links') { if (empty($asPostTypeOrScreenID)) { return; } $_sClassName = get_class($this); parent::__construct(isset($this->oProp) ? $this->oProp : new AmazonAutoLinks_AdminPageFramework_Property_MetaBox($this, $_sClassName, $sCapability)); $this->oProp->sMetaBoxID = $sMetaBoxID ? $this->oUtil->sanitizeSlug($sMetaBoxID) : strtolower($_sClassName); $this->oProp->sTitle = $sTitle; $this->oProp->sContext = $sContext; $this->oProp->sPriority = $sPriority; if ($this->oProp->bIsAdmin) { $this->oUtil->registerAction('current_screen', array($this, '_replyToDetermineToLoad')); } }
public function __call($sMethodName, $aArgs = null) { $_sPageSlug = $this->oProp->getCurrentPageSlug(); $_sTabSlug = $this->oProp->getCurrentTabSlug($_sPageSlug); $_mFirstArg = $this->oUtil->getElement($aArgs, 0); $_aKnownMethodPrefixes = array('section_pre_', 'field_pre_', 'load_pre_'); switch ($this->_getCallbackName($sMethodName, $_sPageSlug, $_aKnownMethodPrefixes)) { case 'setup_pre': $this->_doSetUp(); return; case $this->oProp->sClassHash . '_page_' . $_sPageSlug: return $this->_renderPage($_sPageSlug, $_sTabSlug); case 'section_pre_': return $this->_renderSectionDescription($sMethodName); case 'field_pre_': return $this->_renderSettingField($_mFirstArg, $_sPageSlug); case 'load_pre_': return $this->_doPageLoadCall($sMethodName, $_sPageSlug, $_sTabSlug, $_mFirstArg); default: return parent::__call($sMethodName, $aArgs); } }