initEditor(); if ( !empty($_GET['section']) ) { $_GET['section'] = ereg_replace("[^0-9]", '', $_GET['section']); if ( !$SECTION->checkRecord($_GET['section']) ) { $HTML->generateDefaultError(); return exit; } } else $_GET['section'] = '0'; //------------------------------------------------------------------------------------- // TRATAMINETO DE LOS DATOS ENVIADOS POR POST $secciones_segundo_nivel = $SECTION->getCategoriesSecondLevel(); if ( count($_POST) > 0 ) { strip_slashes($_POST); $action_result = $SECTION->manageRecord($_POST, $_FILES); if ( ereg("^0+$", $action_result) ) { if ( $_GET['reload'] == 1 ) { $HTML->generateClosePage($CONF['sys_http_server'] . $CONF['ws_js'] . $CONF['js_forms']); return exit; } else $js_onload = ' afterInsert();'; } else $error_string = manage_error_string($action_result); } //------------------------------------------------------------------------------------- // CARGAR VALORES PARA UN REGISTRO DADO if ( count($_POST) > 0 ) { $record = $_POST['record_id']; $DATA_SOURCE = &$_POST; } elseif ( !empty($_GET['id']) ) { if ( $SECTION->checkRecord($_GET['id']) ) { $DATA_SOURCE = $SECTION->getRecordValues($_GET['id']); $DATA_SOURCE['visualizar'] = split(',', $DATA_SOURCE['visualizar']); $record = $_GET['id']; } else unset($_GET['id']); } else { if ( $_GET['id_padre'] ) { $_GET['id_padre'] = ereg_replace("[^0-9]", '', $_GET['id_padre']); if ( $SECTION->checkRecord($_GET['id_padre']) ) $DATA_SOURCE['id_padre'] = $_GET['id_padre']; } } html_special_chars($DATA_SOURCE); //------------------------------------------------------------------------------------- // GENERAR PAGINA $js_vars = array( 'JS_CALENDAR_SRC' => $CONF['sys_http_server'] . $CONF['pg_calendar'], 'JS_ACTION_SAVE' => $LNG['js_action_save_ok'] ); $buttons = array(); if ( !($DATA_SOURCE['id_padre'] > 0 && !in_array($DATA_SOURCE['id_padre'], $secciones_segundo_nivel)) ) { $buttons[] = array( 'href' => $CONF['pg_subsections'] . '?id_padre=' . $record, 'title' => $LNG['button_sections'], 'img' => 'boton_secciones_peq.gif', 'img_des' => 'boton_secciones_peq_des.gif', 'status' => ( $record ? true : false ), 'params' => 'class="separation"' ); } if ( $DATA_SOURCE['id_padre'] > 0 && !in_array($DATA_SOURCE['id_padre'], $secciones_segundo_nivel) ) { $buttons[] = array( 'href' => $CONF['pg_section_docs'] . '?section=section&sId=' . $record, 'title' => $LNG['button_docs'], 'img' => 'boton_documentos_peq.gif', 'img_des' => 'boton_documentos_peq_des.gif', 'status' => ( $record ? true : false ), 'params' => 'class="separation"' ); $buttons[] = array( 'href' => $CONF['pg_section_files'] . '?section=section&sId=' . $record, 'title' => $LNG['button_files'], 'img' => 'boton_ficheros_peq.gif', 'img_des' => 'boton_ficheros_peq_des.gif', 'status' => ( $record ? true : false ) ); } $HTML->generateHeader(array($CONF['css_forms']), array($CONF['js_general'],$CONF['js_forms']), $js_vars, ' onLoad="init();' . $js_onload . '"'); if ( !empty($error_string) ) $HTML->generateErrorDiv($error_string); $HTML->generateFormButtons($buttons, $button_actions); echo '
' . "\n"; echo '
' . "\n"; if ( !empty($record) ) echo ' ' . "\n"; $categories = array(); if ( $DATA_SOURCE['id_padre'] > 0 && $DATA_SOURCE['visualizar']) { //$SECTION->generateCategoriesTree($SECTION->getCategoriesSelectablesList(implode(",",$DATA_SOURCE['visualizar'])),$categories); $SECTION->generateCategoriesTreeExcluding($SECTION->getCategoriesSelectablesList(implode(",",$DATA_SOURCE['visualizar'])),$categories,$record); } else { $SECTION->generateCategoriesTree($SECTION->getCategoriesList(),$categories); //$SECTION->generateCategoriesTreeExcluding($SECTION->getCategoriesList(),$categories); } $form_status = array( '0' => $LNG['form_status_0'], '1' => $LNG['form_status_1'] ); $form_zones = array( '1' => $LNG['site_zone_1'], '2' => $LNG['site_zone_2'], '3' => $LNG['site_zone_3']); ?>
0 ) { ?>

generateSelectField($form_status, 'estado', $DATA_SOURCE['estado'], true); ?>

generateSelectField($categories, 'id_padre', $DATA_SOURCE['id_padre'], true, ((empty($record))?'disabled':'')); ?>

' . $DATA_SOURCE['rollover'] ?>

generateSelectField($form_zones, 'visualizar[]', $DATA_SOURCE['visualizar'], true, 'multiple style="height: 75px;"'); ?>

' . $DATA_SOURCE['imagen']; ?>

' . $DATA_SOURCE['rollover_prof_pub'] ?>

' . $DATA_SOURCE['imagen_peq_prof_pub'] ?>

' . $DATA_SOURCE['rollover_peq_prof_pub'] ?>

0 && in_array($DATA_SOURCE['id_padre'], $secciones_segundo_nivel) ) { ?>

generateSelectField($form_zones, 'visualizar[]', $DATA_SOURCE['visualizar'], true, 'multiple style="height: 75px;"');*/ ?> generateSelectField($SECTION->getVisualizacionList($DATA_SOURCE['id_padre'],$form_zones), 'visualizar[]', $DATA_SOURCE['visualizar'], true, 'multiple style="height: 75px;"'); ?>

generateIconListSections(getFileImages($CONF['fs_application'] . $CONF['ws_img_icons']), $CONF['sys_http_server'] . $CONF['ws_img_icons'], '') ?>

generateSelectField($form_zones, 'visualizar[]', $DATA_SOURCE['visualizar'], true, 'multiple style="height: 75px;"'); ?>

' . "\n"; $HTML->generateFooterPage(); ?>