value) && count($this->parameters['sections'])){ $this->value = array(); $query = "select distinct id_section from cms_sections where section_num_parent in(".implode(",",$this->parameters['sections']).")"; $result = pmb_mysql_query($query,$dbh); if(pmb_mysql_num_rows($result)){ while($row=pmb_mysql_fetch_object($result)){ $this->value[] = $row->id_section; } } } return $this->value; } public function get_form(){ global $msg,$charset; $form ="
".$this->gen_select()."
"; return $form; } public function set_from_form(){ global $docwatch_selector_parent_sections_select; $this->parameters['sections'] = $docwatch_selector_parent_sections_select; } protected function _recurse_parent_select($parent=0,$lvl=0){ global $charset; $opts = ""; $rqt = "select id_section, section_title from cms_sections where section_num_parent = '".$parent."'"; $res = pmb_mysql_query($rqt); if(pmb_mysql_num_rows($res)){ while($row = pmb_mysql_fetch_object($res)){ $opts.=" "; $opts.=$this->_recurse_parent_select($row->id_section,$lvl+1); } } return $opts; } protected function gen_select(){ if(!$this->id){ $this->parameters = array(); $this->parameters['sections'] = array(); } $select = " "; return $select; } } // end of docwatch_selector_parent_sections