publications_states = array(); } protected function fetch_data_cache(){ if($tmp=cms_cache::get_at_cms_cache($this)){ $this->restore($tmp); }else{ $this->fetch_data(); cms_cache::set_at_cms_cache($this); } } protected function restore($cms_object){ foreach(get_object_vars($cms_object) as $propertieName=>$propertieValue){ $this->{$propertieName}=$propertieValue; } } protected function fetch_data(){ $rqt = "select * from cms_editorial_publications_states order by editorial_publication_state_label asc"; $res = pmb_mysql_query($rqt); if(pmb_mysql_num_rows($res)){ while($row = pmb_mysql_fetch_object($res)){ $this->publications_states[] =array( 'id' => $row->id_publication_state, 'label' => $row->editorial_publication_state_label, 'opac_show' => $row->editorial_publication_state_opac_show, 'auth_opac_show' => $row->editorial_publication_state_auth_opac_show, 'class_html' => $row->editorial_publication_state_class_html ); } } } public function get_publications_states(){ if(!$this->publications_states) { $this->fetch_data_cache(); } return $this->publications_states; } public function get_selector_options($selected=0){ global $charset; global $deflt_cms_article_statut; if(!$selected){ $selected=$deflt_cms_article_statut; } $options = ""; $this->get_publications_states(); for($i=0 ; $ipublications_states) ; $i++){ $options.= " "; } return $options; } }