function parse_content_tpl($params) { global $TMS, $Adm; $tms = new TMutiSection(true); $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'edit_content')), true), true); $tms->AddFileSection(Common::get_site_tpl($this->_module_name, $params['tpl_file'])); if ($tms->Extended) { foreach ($tms->Extended['xtr_content'] as $field_name => $ext) { switch ($ext['type']) { case 'ARTICLE': if ($cnt = $this->_tree->Search('', true, array('obj_type' => array('_CONTENT', '_CONTENTGROUP')))) { while (list($id, $cntObj) = each($cnt)) { if ($cntObj['obj_type'] == '_CONTENT') { $cntNew[$id] = $cnt[$cntObj['ancestor']]['basic'] . '/' . $cntObj['basic']; } } if ($cntNew) { asort($cntNew); $articlesList = XHTML::as_select_opt($cntNew); } } $TMS->AddReplace($ext['type'], '_field_initial', $articlesList); $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->parseSection($ext['type'], true); break; case 'IMAGE': case 'TEXT': case 'INPUT': $TMS->AddReplace($ext['type'], '_field_name', $field_name); $TMS->AddMassReplace($ext['type'], $ext); $TMS->parseSection($ext['type'], true); break; } } $this->result['fields'] = $TMS->parseSection('fields'); } }
function get_childs($params) { if (!$params[0]['obj_type']) { $obj_type = array('obj_type' => array('_CATOBJ', '_CATGROUP')); } if ($nodes = $this->_tree->GetChildsParam($params[0]['id'], '%', true, $obj_type)) { switch ($params[0]['as']) { case 'options': return XHTML::as_select_opt(XARRAY::arr_to_lev($nodes, 'id', 'params', 'Name'), $params[0]['selected']); break; default: return $nodes; } } }