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
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Widget_Accordion_Item extends Mage_Adminhtml_Block_Widget
00035 {
00036 protected $_accordion;
00037
00038 public function __construct()
00039 {
00040 parent::__construct();
00041 }
00042
00043 public function setAccordion($accordion)
00044 {
00045 $this->_accordion = $accordion;
00046 return $this;
00047 }
00048
00049 public function getTarget()
00050 {
00051 return ($this->getAjax()) ? 'ajax' : '';
00052 }
00053
00054 public function getTitle()
00055 {
00056 $title = $this->getData('title');
00057 $url = $this->getContentUrl() ? $this->getContentUrl() : '#';
00058 $title = '<a href="'.$url.'" class="'.$this->getTarget().'">'.$title.'</a>';
00059
00060 return $title;
00061 }
00062
00063 public function getContent()
00064 {
00065 $content = $this->getData('content');
00066 if (is_string($content)) {
00067 return $content;
00068 }
00069 if ($content instanceof Mage_Core_Block_Abstract) {
00070 return $content->toHtml();
00071 }
00072 return null;
00073 }
00074
00075 public function getClass()
00076 {
00077 $class = $this->getData('class');
00078 if ($this->getOpen()) {
00079 $class.= ' open';
00080 }
00081 return $class;
00082 }
00083
00084 protected function _toHtml()
00085 {
00086 $content = $this->getContent();
00087 $html = '<dt id="dt-'.$this->getHtmlId().'" class="'.$this->getClass().'">';
00088 $html.= $this->getTitle();
00089 $html.= '</dt>';
00090 $html.= '<dd id="dd-'.$this->getHtmlId().'" class="'.$this->getClass().'">';
00091 $html.= $content;
00092 $html.= '</dd>';
00093 return $html;
00094 }
00095 }