. */ /** * @brief Script called by an ajax object to process the document type change from the details page * * @file change_doctype_details.php * @author Claire Figueras * @date $date$ * @version $Revision$ * @ingroup indexing_searching_mlb */ require_once('apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR."class_types.php"); $core = new core_tools(); $core->load_lang(); $type = new types(); if(!isset($_REQUEST['type_id']) || empty($_REQUEST['type_id'])) { $_SESSION['error'] = _DOCTYPE.' '._IS_EMPTY; echo "{status : 1, error_txt : '".addslashes($_SESSION['error'])."'}"; exit(); } $mandatory_indexes = $type->get_mandatory_indexes($_REQUEST['type_id'], 'letterbox_coll'); $indexes = $type->get_indexes($_REQUEST['type_id'], 'letterbox_coll'); $opt_indexes = ''; if (preg_match("/MSIE 6.0/", $_SERVER["HTTP_USER_AGENT"])) { $browser_ie = true; $display_value = 'block'; } elseif(preg_match('/msie/i', $_SERVER["HTTP_USER_AGENT"]) && !preg_match('/opera/i', $HTTP_USER_AGENT) ) { $browser_ie = true; $display_value = 'block'; } else { $browser_ie = false; $display_value = 'table-row'; } $opt_indexes = ''; if(count($indexes) > 0) { $i=0; foreach(array_keys($indexes) as $key) { $mandatory = false; if(in_array($key, $mandatory_indexes)) { $mandatory = true; } if($i%2 != 1 || $i==0) // pair { $opt_indexes .= ''; } $opt_indexes .= ''; if(isset($indexes[$key]['img'])) { $opt_indexes .= ''; } $opt_indexes .= ''; $opt_indexes .= ''; $opt_indexes .= $indexes[$key]['label'].' :'; $opt_indexes .= ''; $opt_indexes .= ''; if($indexes[$key]['type_field'] == 'input') { if($indexes[$key]['type'] == 'string' || $indexes[$key]['type'] == 'float' || $indexes[$key]['type'] == 'integer') { $opt_indexes .= ''; } else if($indexes[$key]['type'] == 'date') { $opt_indexes .= ''; } } else { $opt_indexes .= ''; } $opt_indexes .= ''; if($i%2 == 1 && $i!=0) // impair { $opt_indexes .= ''; } else { { if($i+1 == count($indexes)) $opt_indexes .= ' '; } } $i++; } } echo "{status : 0, new_opt_indexes : '".addslashes($opt_indexes)."'}"; exit(); ?>