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); }
public static function getSRCFromPath($sFilePath) { $oWPStyles = new WP_Styles(); $sRelativePath = AmazonAutoLinks_AdminPageFramework_Utility::getRelativePath(ABSPATH, $sFilePath); $sRelativePath = preg_replace("/^\\.[\\/\\\\]/", '', $sRelativePath, 1); $sHref = trailingslashit($oWPStyles->base_url) . $sRelativePath; unset($oWPStyles); return esc_url($sHref); }
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; }