function getDateField($module, $aow_field, $view = 'EditView', $value, $field_option = true) { global $app_list_strings; $value = json_decode(html_entity_decode_utf8($value), true); if (!file_exists('modules/AOBH_BusinessHours/AOBH_BusinessHours.php')) { unset($app_list_strings['aow_date_type_list']['business_hours']); } $field = ''; if ($view == 'EditView') { $field .= "<select type='text' name='{$aow_field}" . '[0]' . "' id='{$aow_field}" . '[0]' . "' title='' tabindex='116'>" . getDateFields($module, $view, $value[0], $field_option) . "</select> "; $field .= "<select type='text' name='{$aow_field}" . '[1]' . "' id='{$aow_field}" . '[1]' . "' onchange='date_field_change(\"{$aow_field}\")' title='' tabindex='116'>" . get_select_options_with_id($app_list_strings['aow_date_operator'], $value[1]) . "</select> "; $display = 'none'; if ($value[1] == 'plus' || $value[1] == 'minus') { $display = ''; } $field .= "<input type='text' style='width:40px; display:{$display}' name='{$aow_field}" . '[2]' . "' id='{$aow_field}" . '[2]' . "' title='' value='{$value['2']}' tabindex='116'> "; $field .= "<select type='text' style='display:{$display}' name='{$aow_field}" . '[3]' . "' id='{$aow_field}" . '[3]' . "' title='' tabindex='116'>" . get_select_options_with_id($app_list_strings['aow_date_type_list'], $value[3]) . "</select>"; } else { $field = getDateFields($module, $view, $value[0], $field_option) . ' ' . $app_list_strings['aow_date_operator'][$value[1]]; if ($value[1] == 'plus' || $value[1] == 'minus') { $field .= ' ' . $value[2] . ' ' . $app_list_strings['aow_date_type_list'][$value[3]]; } } return $field; }
function getBlogFileFromRequest($request) { //$request = preg_replace("/^blog\//","/",$request); $date = getDateFields($request); $year = $date["year"]; $month = $date["month"]; $day = $date["day"]; $request = preg_replace("/^blog\\//", "", $request); $request = preg_replace("/(\\/\\w+)\$/", "", $request); $file = str_replace("{$year}/{$month}/{$day}", "", $request); $file = str_replace("/", "", $file); //print "blog found from the request : $year$month$day.$file.text<br/>"; return "{$year}{$month}{$day}.{$file}.text"; }