Mage_Tag_Block_All Class Reference

Inheritance diagram for Mage_Tag_Block_All:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getTags ()
 getMaxPopularity ()
 getMinPopularity ()

Protected Member Functions

 _loadTags ()
 _getHeadText ()

Protected Attributes

 $_tags
 $_minPopularity
 $_maxPopularity


Detailed Description

Definition at line 35 of file All.php.


Member Function Documentation

_getHeadText (  )  [protected]

Definition at line 88 of file All.php.

00089     {
00090         return Mage::helper('tag')->__('All Tags');
00091     }

_loadTags (  )  [protected]

Definition at line 42 of file All.php.

00043     {
00044         if (empty($this->_tags)) {
00045             $this->_tags = array();
00046             $tags = Mage::getModel('tag/tag')->getPopularCollection()
00047                 ->joinFields(Mage::app()->getStore()->getId())
00048                 ->limit(100)
00049                 ->load()
00050                 ->getItems();
00051 
00052             if( count($tags) == 0 ) {
00053                 return $this;
00054             }
00055 
00056             $this->_maxPopularity = reset($tags)->getPopularity();
00057             $this->_minPopularity = end($tags)->getPopularity();
00058             $range = $this->_maxPopularity - $this->_minPopularity;
00059             $range = ( $range == 0 ) ? 1 : $range;
00060             foreach ($tags as $tag) {
00061                 if( !$tag->getPopularity() ) {
00062                     continue;
00063                 }
00064                 $tag->setRatio(($tag->getPopularity()-$this->_minPopularity)/$range);
00065                 $this->_tags[$tag->getName()] = $tag;
00066             }
00067             ksort($this->_tags);
00068         }
00069         return $this;
00070     }

getMaxPopularity (  ) 

Definition at line 78 of file All.php.

00079     {
00080         return $this->_maxPopularity;
00081     }

getMinPopularity (  ) 

Definition at line 83 of file All.php.

00084     {
00085         return $this->_minPopularity;
00086     }

getTags (  ) 

Definition at line 72 of file All.php.

00073     {
00074         $this->_loadTags();
00075         return $this->_tags;
00076     }


Member Data Documentation

$_maxPopularity [protected]

Definition at line 40 of file All.php.

$_minPopularity [protected]

Definition at line 39 of file All.php.

$_tags [protected]

Definition at line 38 of file All.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:52 2009 for Magento by  doxygen 1.5.8