Changeset 484 for trunk/xpressme_integration_kit/blocks/block_common.php
- Timestamp:
- Dec 11, 2009, 2:48:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/blocks/block_common.php
r447 r484 103 103 104 104 $option = "<option value=\"0\" "; 105 if ($isAll) $ form.= " selected=\"selected\"";105 if ($isAll) $option .= " selected=\"selected\""; 106 106 $option .= ">"._MB_XP2_ALL ."</option>"; 107 107 … … 146 146 endif; 147 147 148 if(!function_exists("block_template_setting")): 149 function block_template_setting($mydirname,$option_name = '',$value='') 150 { 151 $temp_parm = explode(':' , $value); 152 if (empty($temp_parm[1])) { 153 $filename=$temp_parm[0]; 154 $temp_type = 'db'; 155 } else { 156 $filename=$temp_parm[1]; 157 $temp_type = $temp_parm[0]; 158 } 159 160 $none_prefix_filename = ''; 161 $pattern = '^' . $mydirname . '_(.*).html'; 162 if (preg_match('/' . $pattern . '/' , $filename, $match)){ // file prefix check 163 $none_prefix_filename = $match[1]; 164 } 165 166 $output = _MB_XP2_THISTEMPLATE . "\n"; 167 $output .= '<input type="hidden" size="50" name="' . $option_name . '" value="' . $value .'"/>' . "\n"; 168 $output .= ' <select name="template_type" onclick="Template_Make()">' ."\n"; 169 switch ($temp_type){ 170 case 'db': 171 case 'DB': 172 $output .= '<option value="0" selected="selected">db</option>'; 173 $output .= '<option value="1">file</option>'; 174 break; 175 default: 176 $output .= '<option value="0">db</option>'; 177 $output .= '<option value="1" selected="selected">file</option>'; 178 } 179 $output .= '</select>'; 180 $output .= '<b>:'.$mydirname . '_</b>'; 181 $output .= '<input type="text" size="30" name="none_prefix_file" value="'. $none_prefix_filename. '" onChange="Template_Make()"/><b>.html</b><br />'; 182 $output .= ' 183 <script type="text/javascript"> 184 function Template_Make(){ 185 var type_element = document.getElementsByName("template_type").item(0); 186 var name_element = document.getElementsByName("none_prefix_file").item(0); 187 var real_element = document.getElementsByName("' .$option_name . '").item(0); 188 189 var file_name = "' . $mydirname . '_" + name_element.value + ".html"; 190 if (type_element.value ==0) var tmp_type = "db:"; else var tmp_type = "file:"; 191 real_element.value = tmp_type + file_name; 192 } 193 </script> 194 '; 195 196 return $output; 197 198 } 199 endif; 148 200 149 201 ?>
Note: See TracChangeset
for help on using the changeset viewer.