app/code/community/Aoe/TemplateHints/Helper/BlockInfo.php
public function getBlockInfo(Mage_Core_Block_Abstract $block, $fullInfo=true) {
        $info = array(
            'name' => $block->getNameInLayout(),
            'alias' => $block->getBlockAlias(),
        );

        if (!$fullInfo) {
            return $info;
        }

        $info['class'] = get_class($block);

        if ($this->getRemoteCallEnabled()) {
            $fileAndLine = Mage::helper('aoe_templatehints/classInfo')->findFileAndLine($info['class']);
            if ($fileAndLine) {
                $url = sprintf($this->getRemoteCallUrlTemplate(), $fileAndLine['file'], $fileAndLine['line']);
                $info['class'] = sprintf($this->getRemoteCallLinkTemplate(),
                    $url,
                    $info['class']
                );
            }
        }

        $info['module'] = $block->getModuleName();

        if ($block instanceof Mage_Cms_Block_Block) {
            $info['cms-blockId'] = $block->getBlockId();
        }
        if ($block instanceof Mage_Cms_Block_Page) {
            $info['cms-pageId'] = $block->getPage()->getIdentifier();
        }
        $templateFile = $block->getTemplateFile();
        if ($templateFile) {
            $info['template'] = $templateFile;

            if ($this->getRemoteCallEnabled()) {
                $url = sprintf($this->getRemoteCallUrlTemplate(), Mage::getBaseDir('design') . DS . $templateFile, 0);
                $info['template'] = sprintf($this->getRemoteCallLinkTemplate(),
                    $url,
                    $templateFile
                );
            }

        }

        // cache information
        $info['cache-status'] = self::TYPE_NOTCACHED;

        $cacheLifeTime = $block->getCacheLifetime();
        if (!is_null($cacheLifeTime)) {

            $info['cache-lifetime'] = (intval($cacheLifeTime) == 0) ? 'forever' : intval($cacheLifeTime) . ' sec';
            $info['cache-key'] = $block->getCacheKey();
            $info['cache-key-info'] = is_array($block->getCacheKeyInfo())
                        ? implode(', ', $block->getCacheKeyInfo())
                        : $block->getCacheKeyInfo()
                    ;
            $info['tags'] = implode(',', $block->getCacheTags());

            $info['cache-status'] = self::TYPE_CACHED;
        } elseif ($this->isWithinCachedBlock($block)) {
            $info['cache-status'] = self::TYPE_IMPLICITLYCACHED; // not cached, but within cached
        }

        $info['methods'] = $this->getClassMethods(get_class($block));

        return $info;
    }
public function getBlockInfo(Mage_Core_Block_Abstract $block, $fullInfo=true) {
        $info = array(
            'name' => $block->getNameInLayout(),
            'alias' => $block->getBlockAlias(),
        );

        if (!$fullInfo) {
            return $info;
        }

        $info['class'] = get_class($block);

        if ($this->getRemoteCallEnabled()) {
            $fileAndLine = Mage::helper('aoe_templatehints/classInfo')->findFileAndLine($info['class']);
            if ($fileAndLine) {
                $url = sprintf($this->getRemoteCallUrlTemplate(), $fileAndLine['file'], $fileAndLine['line']);
                $info['class'] = sprintf($this->getRemoteCallLinkTemplate(),
                    $url,
                    $info['class']
                );
            }
        }

        $info['module'] = $block->getModuleName();

        if ($block instanceof Mage_Cms_Block_Block) {
            $info['cms-blockId'] = $block->getBlockId();
        }
        if ($block instanceof Mage_Cms_Block_Page) {
            $info['cms-pageId'] = $block->getPage()->getIdentifier();
        }
        $templateFile = $block->getTemplateFile();
        if ($templateFile) {
            $info['template'] = $templateFile;

            if ($this->getRemoteCallEnabled()) {
                $url = sprintf($this->getRemoteCallUrlTemplate(), Mage::getBaseDir('design') . DS . $templateFile, 0);
                $info['template'] = sprintf($this->getRemoteCallLinkTemplate(),
                    $url,
                    $templateFile
                );
            }

        }

        // cache information
        $info['cache-status'] = self::TYPE_NOTCACHED;

        $cacheLifeTime = $block->getCacheLifetime();
        if (!is_null($cacheLifeTime)) {

            $info['cache-lifetime'] = (intval($cacheLifeTime) == 0) ? 'forever' : intval($cacheLifeTime) . ' sec';
            $info['cache-key'] = $block->getCacheKey();
            $info['cache-key-info'] = is_array($block->getCacheKeyInfo())
                        ? implode(', ', $block->getCacheKeyInfo())
                        : $block->getCacheKeyInfo()
                    ;
            $info['tags'] = implode(',', $block->getCacheTags());

            $info['cache-status'] = self::TYPE_CACHED;
        } elseif ($this->isWithinCachedBlock($block)) {
            $info['cache-status'] = self::TYPE_IMPLICITLYCACHED; // not cached, but within cached
        }

        $info['methods'] = $this->getClassMethods(get_class($block));

        return $info;
    }
public function getBlockInfo ( Mage_Core_Block_Abstract $ block , $ fullInfo = true ) { $ info = array ( 'name' => $ block -> getNameInLayout ( ) , 'alias' => $ block -> getBlockAlias ( ) , ) ; if ( ! $ fullInfo ) { return $ info ; } $ info [ 'class' ] = get_class ( $ block ) ; if ( $ this -> getRemoteCallEnabled ( ) ) { $ fileAndLine = Mage :: helper ( 'aoe_templatehints/classInfo' ) -> findFileAndLine ( $ info [ 'class' ] ) ; if ( $ fileAndLine ) { $ url = sprintf ( $ this -> getRemoteCallUrlTemplate ( ) , $ fileAndLine [ 'file' ] , $ fileAndLine [ 'line' ] ) ; $ info [ 'class' ] = sprintf ( $ this -> getRemoteCallLinkTemplate ( ) , $ url , $ info [ 'class' ] ) ; } } $ info [ 'module' ] = $ block -> getModuleName ( ) ; if ( $ block instanceof Mage_Cms_Block_Block ) { $ info [ 'cms-blockId' ] = $ block -> getBlockId ( ) ; } if ( $ block instanceof Mage_Cms_Block_Page ) { $ info [ 'cms-pageId' ] = $ block -> getPage ( ) -> getIdentifier ( ) ; } $ templateFile = $ block -> getTemplateFile ( ) ; if ( $ templateFile ) { $ info [ 'template' ] = $ templateFile ; if ( $ this -> getRemoteCallEnabled ( ) ) { $ url = sprintf ( $ this -> getRemoteCallUrlTemplate ( ) , Mage :: getBaseDir ( 'design' ) . DS . $ templateFile , 0 ) ; $ info [ 'template' ] = sprintf ( $ this -> getRemoteCallLinkTemplate ( ) , $ url , $ templateFile ) ; } } // cache information $ info [ 'cache-status' ] = self :: TYPE_NOTCACHED ; $ cacheLifeTime = $ block -> getCacheLifetime ( ) ; if ( ! is_null ( $ cacheLifeTime ) ) { $ info [ 'cache-lifetime' ] = ( intval ( $ cacheLifeTime ) == 0 ) ? 'forever' : intval ( $ cacheLifeTime ) . ' sec' ; $ info [ 'cache-key' ] = $ block -> getCacheKey ( ) ; $ info [ 'cache-key-info' ] = is_array ( $ block -> getCacheKeyInfo ( ) ) ? implode ( ', ' , $ block -> getCacheKeyInfo ( ) ) : $ block -> getCacheKeyInfo ( ) ; $ info [ 'tags' ] = implode ( ',' , $ block -> getCacheTags ( ) ) ; $ info [ 'cache-status' ] = self :: TYPE_CACHED ; } elseif ( $ this -> isWithinCachedBlock ( $ block ) ) { $ info [ 'cache-status' ] = self :: TYPE_IMPLICITLYCACHED ; // not cached, but within cached } $ info [ 'methods' ] = $ this -> getClassMethods ( get_class ( $ block ) ) ; return $ info ; }
Get block information

@param Mage_Core_Block_Abstract $block
@param bool $fullInfo
@return array
Get block information