コード例 #1
0
 public function __construct($isOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'amazon-auto-links')
 {
     if (!$this->_isInstantiatable()) {
         return;
     }
     parent::__construct($isOptionKey, $sCallerPath ? trim($sCallerPath) : ($sCallerPath = is_admin() && (isset($GLOBALS['pagenow']) && in_array($GLOBALS['pagenow'], array('plugins.php')) || isset($_GET['page'])) ? AmazonAutoLinks_AdminPageFramework_Utility::getCallerScriptPath(__FILE__) : null), $sCapability, $sTextDomain);
     $this->oUtil->addAndDoAction($this, 'start_' . $this->oProp->sClassName, $this);
 }
コード例 #2
0
 private function _getCallerScriptPath($sCallerPath)
 {
     $sCallerPath = trim($sCallerPath);
     if ($sCallerPath) {
         return $sCallerPath;
     }
     if (!is_admin()) {
         return null;
     }
     $_sPageNow = AmazonAutoLinks_AdminPageFramework_Utility::getElement($GLOBALS, 'pagenow');
     if (in_array($_sPageNow, array('edit.php', 'post.php', 'post-new.php', 'plugins.php', 'tags.php', 'edit-tags.php'))) {
         return AmazonAutoLinks_AdminPageFramework_Utility::getCallerScriptPath(__FILE__);
     }
     return null;
 }