upload_file($uploaddir,$image_file,true,true,'image'); if( $file == false) { $message[] = ' For showcased network '.($counter + 1).', '.$uploader->error; $networks_data[$counter]['network_image'] = null; } else { $networks_data[$counter]['network_image'] = $file; } } else if (!empty($_POST['current_network_image'][$counter])) { //getting the previously added image from the hidden form field. $networks_data[$counter]['network_image'] = $_POST['current_network_image'][$counter]; } else { //setting the image to null. $networks_data[$counter]['network_image'] = null; } }//end for } else if ($section == 'network_of_moment') { if (empty($_POST['network_caption'])) { $message[] = 'No caption given to network of moment'; } else { $networks_data['network_caption'] = $_POST['network_caption']; } if (empty($_POST['network_url'])) { $message[] = 'Please provide url for network of moment'; } else { $networks_data['network_url'] = Validation::validate_url($_POST['network_url']); } } else if ($section == 'video_tours') { if (empty($_POST['video_url'])) { $message[] = 'No video url provided for video tours'; } else { $networks_data['video_url'] = $_POST['video_url']; } } else if ($section == 'configure') { if (!empty($_POST['show_splash_page']) && $_POST['show_splash_page'] == ACTIVE) { $networks_data['show_splash_page'] = ACTIVE; } else { $networks_data['show_splash_page'] = INACTIVE; } } //code for fields which are common to some sections like description, image if ($section == 'video_tours' || $section == 'register_today' || $section == 'network_of_moment') { if (empty($_POST['description'])) { $message[] = 'No description provided for network of moment'; } else { $networks_data['description'] = $_POST['description']; } $image_file = 'network_image'; if (!empty($_FILES[$image_file]['name'])) { //validating and then uploading the network image. $uploader = new FileUploader; //creating instance of file. $file = $uploader->upload_file($uploaddir,$image_file,true,true,'image'); if( $file == false) { $message[] = ' For network of moment, '.$uploader->error; $networks_data['network_image'] = null; } else { $networks_data['network_image'] = $file; } } else if (!empty($_POST['current_network_image'])) { //getting the previously added image from the hidden form field. $networks_data['network_image'] = $_POST['current_network_image']; } else { //setting the image to null. $networks_data['network_image'] = null; } } $networks_data = serialize($networks_data); if ($action == 'save') { ModuleData::save($networks_data, $section); } else { ModuleData::update($networks_data, $section); } $networks_data = ModuleData::get($section); $networks_data = unserialize($networks_data); //TODO: display the error messages. }//end if function setup_module($column, $module, $obj) { global $permission_denied_msg, $featured_network, $showcased_networks, $networks_data, $section; if($permission_denied_msg) return 'skip'; switch ($module) { default: $obj->mode = $section; $obj->showcased_networks = $showcased_networks; $obj->networks_data = $networks_data; } } $page = new PageRenderer("setup_module", PAGE_CONFIGURE_SPLASH_PAGE, "Configure Splash Page", 'container_two_column.tpl', 'header.tpl', PRI, HOMEPAGE, $network_info); if (count($message)) { $msg_tpl = & new Template(CURRENT_THEME_FSPATH."/display_message.tpl"); $msg_tpl->set('message', $message); $m = $msg_tpl->fetch(); $page->add_module("middle", "top", $m); } $page->html_body_attributes ='class="no_second_tier network_config"'; $css_array = get_network_css(); if (is_array($css_array)) { foreach ($css_array as $key => $value) { $page->add_header_css($value); } } $css_data = inline_css_style(); if (!empty($css_data['newcss']['value'])) { $css_data = ''; $page->add_header_html($css_data); } echo $page->render(); ?>