$lang_global['description_suggest_max'] = sprintf($lang_global['length_suggest_max'], 160); $xtpl = new XTemplate('genealogy.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file); $xtpl->assign('LANG', $lang_module); $xtpl->assign('GLANG', $lang_global); $xtpl->assign('rowcontent', $rowcontent); $xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL); $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE); $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE); $xtpl->assign('MODULE_NAME', $module_name); $xtpl->assign('OP', $op); $xtpl->assign('module_name', $module_name); foreach ($global_array_fam as $fid_i => $array_value) { if (defined('NV_IS_ADMIN_MODULE')) { $check_show = 1; } else { $array_fam = GetfidInParent($fid_i); $check_show = array_intersect($array_fam, $array_fam_check_content); } if (!empty($check_show)) { $space = intval($array_value['lev']) * 30; $fiddisplay = (sizeof($array_fid_in_row) > 1 and in_array($fid_i, $array_fid_in_row)) ? '' : ' display: none;'; $temp = array('fid' => $fid_i, 'space' => $space, 'title' => $array_value['title'], 'disabled' => !in_array($fid_i, $array_fam_check_content) ? ' disabled="disabled"' : '', 'selected' => in_array($fid_i, $array_fid_in_row) ? ' selected="selected"' : '', 'fidchecked' => $fid_i == $rowcontent['fid'] ? ' checked="checked"' : '', 'fiddisplay' => $fiddisplay); $xtpl->assign('FAMS', $temp); $xtpl->parse('main.fid'); } } // list city foreach ($global_array_location_city as $city_i => $rowscity) { $rowscity['selected'] = $city_i == $rowcontent['cityid'] ? ' selected="selected"' : ''; $xtpl->assign('CITY', $rowscity); $xtpl->parse('main.city');
/** * GetfidInParent() * * @param mixed $fid * @return */ function GetfidInParent($fid) { global $global_array_fam; $array_fam = array(); $array_fam[] = $fid; $subfid = explode(',', $global_array_fam[$fid]['subfid']); if (!empty($subfid)) { foreach ($subfid as $id) { if ($id > 0) { if ($global_array_fam[$id]['numsubfam'] == 0) { $array_fam[] = $id; } else { $array_fam_temp = GetfidInParent($id); foreach ($array_fam_temp as $fid_i) { $array_fam[] = $fid_i; } } } } } return array_unique($array_fam); }
$alias = $global_array_fam[$fid]['alias']; $description = $global_array_fam[$fid]['description']; $descriptionhtml = $global_array_fam[$fid]['descriptionhtml']; $viewdescription = $global_array_fam[$fid]['viewdescription']; $image = $global_array_fam[$fid]['image']; $keywords = $global_array_fam[$fid]['keywords']; $groups_view = $global_array_fam[$fid]['groups_view']; $featured = $global_array_fam[$fid]['featured']; if (!defined('NV_IS_ADMIN_MODULE')) { if (!(isset($array_fam_admin[$admin_id][$parentid]) and $array_fam_admin[$admin_id][$parentid]['admin'] == 1)) { Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&parentid=' . $parentid); die; } } $caption = $lang_module['edit_fam']; $array_in_fam = GetfidInParent($fid); } else { $caption = $lang_module['add_fam']; $array_in_fam = array(); } $savefam = $nv_Request->get_int('savefam', 'post', 0); if (!empty($savefam)) { $fid = $nv_Request->get_int('fid', 'post', 0); $parentid_old = $nv_Request->get_int('parentid_old', 'post', 0); $parentid = $nv_Request->get_int('parentid', 'post', 0); $title = $nv_Request->get_title('title', 'post', '', 1); $titlesite = $nv_Request->get_title('titlesite', 'post', '', 1); $keywords = $nv_Request->get_title('keywords', 'post', '', 1); $description = $nv_Request->get_string('description', 'post', ''); $description = nv_nl2br(nv_htmlspecialchars(strip_tags($description)), '<br />'); $descriptionhtml = $nv_Request->get_editor('descriptionhtml', '', NV_ALLOWED_HTML_TAGS);