getCollection(); foreach($collection as $category) { $options[$category->getCategoryId()] = $category->getName(); } return $options; } public static function getCategoryOptions2($store_id = null) { $options = array(); $collection = Mage::getModel('quickfaq/category') ->setStoreId($store_id) ->getCollection(); foreach($collection as $category) { $option = array(); $option['label'] = $category->getName(); $option['value'] = $category->getCategoryId(); $options[] = $option; } return $options; } public function getOptionApplied() { return array( array('value'=>0,'label'=>$this->__('Use default value')), array('value'=>1,'label'=>$this->__('Yes')), array('value'=>2,'label'=>$this->__('No')), ); } public function getTablePrefix() { $tableName = Mage::getResourceModel('quickfaq/quickfaq')->getTable('quickfaq'); $prefix = str_replace('quickfaq','',$tableName); return $prefix; } public function normalizeUrlKey($urlKey) { for($i=0;$i<5;$i++) { $urlKey = str_replace(" "," ",$urlKey); } $urlKey = str_replace(" ","-",$urlKey); $urlKey = str_replace(",","",$urlKey); $urlKey = str_replace("?","",$urlKey); $urlKey = str_replace(":","-",$urlKey); $urlKey = str_replace("!","-",$urlKey); $urlKey = str_replace("'","-",$urlKey); $urlKey = strtolower($urlKey); return $urlKey; } public function getFaqUrl() { $url = $this->_getUrl("quickfaq/index", array()); return $url; } }