AdminPageFramework_Resource_Base::_printClassSpecificScripts PHP Метод

_printClassSpecificScripts() защищенный Метод

protected _printClassSpecificScripts ( $sIDPrefix )
    protected function _printClassSpecificScripts($sIDPrefix)
    {
        static $_iCallCount = 1;
        $_sScript = $this->addAndApplyFilters($this->oProp->oCaller, array("script_{$this->oProp->sClassName}"), $this->oProp->sScript);
        $_sScript = trim($_sScript);
        if ($_sScript) {
            $_iCallCount++;
            echo "<script type='text/javascript' id='" . esc_attr("{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}") . "'>" . '/* <![CDATA[ */' . $_sScript . '/* ]]> */' . "</script>";
        }
        $this->oProp->sScript = '';
    }

Usage Example

 protected function _printClassSpecificScripts($sIDPrefix)
 {
     static $_bLoaded = false;
     if ($_bLoaded) {
         parent::_printClassSpecificScripts($sIDPrefix);
         return;
     }
     $_bLoaded = true;
     $_oCaller = $this->oProp->_getCallerObject();
     $_sPageSlug = $this->_getCurrentPageSlugForFilter();
     $_sTabSlug = $this->_getCurrentTabSlugForFilter($_sPageSlug);
     if ($_sPageSlug && $_sTabSlug) {
         $this->oProp->sScript = $this->oUtil->addAndApplyFilters($_oCaller, "script_{$_sPageSlug}_{$_sTabSlug}", $this->oProp->sScript);
     }
     if ($_sPageSlug) {
         $this->oProp->sScript = $this->oUtil->addAndApplyFilters($_oCaller, "script_{$_sPageSlug}", $this->oProp->sScript);
     }
     parent::_printClassSpecificScripts($sIDPrefix);
 }