Ejemplo n.º 1
0
function replace_site_extras_in_template($template, $extras)
{
    $extra_names = get_site_extras_names();
    $ret = $template;
    foreach ($extra_names as $extra_name) {
        $ret = str_replace('${extra:' . $extra_name . '}', empty($extras[$extra_name]) ? '' : $extras[$extra_name]['data'], $ret);
    }
    return $ret;
}
    print_options('day_template', $option);
}
echo '
          </td>
        </tr>
        <tr>
          <td valign="top"><label>' . translate('Event template') . ':</label></td>
          <td><textarea rows="12" cols="60" name="event_template" id="event_template">' . htmlentities($event_template, ENT_COMPAT, $charset) . '</textarea></td>
          <td class="aligntop cursoradd" width="150px">';
foreach ($event_options as $option) {
    print_options('event_template', $option);
}
echo '
          </td>
          <td class="aligntop cursoradd">';
$extra_names = get_site_extras_names(EXTRA_DISPLAY_REPORT);
if (count($extra_names) > 0) {
    echo '
            <label>' . translate('Site Extras') . '</label><br />';
}
foreach ($extra_names as $name) {
    print_options('event_template', 'extra:' . $name);
}
echo '
          </td>
        </tr>
        <tr>
          <td colspan="4">
            <input type="submit" value="' . translate('Save') . '" />' . ($adding_report ? '' : '&nbsp;&nbsp;
            <input type="submit" name="delete" value="' . translate('Delete') . '" onclick="return confirm( \'' . str_replace('XXX', translate('report'), translate('Are you sure you want to delete this XXX?')) . '\');" />');
ob_end_flush();