00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 class Mage_Core_Model_Design_Source_Design extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
00029 {
00030 public function getAllOptions($withEmpty = true)
00031 {
00032 if (is_null($this->_options)) {
00033 $design = Mage::getModel('core/design_package')->getThemeList();
00034 $options = array();
00035 foreach ($design as $package=>$themes){
00036 $packageOption = array('label'=>$package);
00037 $themeOptions = array();
00038 foreach ($themes as $theme) {
00039 $themeOptions[] = array('label'=>$theme, 'value'=>$package . '/' . $theme);
00040 }
00041
00042 $packageOption['value'] = $themeOptions;
00043
00044 $options[] = $packageOption;
00045 }
00046 $this->_options = $options;
00047 }
00048
00049 $options = $this->_options;
00050 if ($withEmpty) {
00051 array_unshift($options, array('value'=>'', 'label'=>Mage::helper('core')->__('-- Please Select --')));
00052 }
00053 return $options;
00054 }
00055
00056
00057
00058
00059
00060
00061
00062 public function getOptionText($value)
00063 {
00064 $options = $this->getAllOptions(false);
00065
00066 return $value;
00067 }
00068 }