thomascube
2008-07-28 0ece58dfaffa79fe86d9e981f39d4902736fe67d
program/include/main.inc
@@ -76,14 +76,15 @@
  if (!empty($opt))
    {
    $db = &rcmail::get_instance()->db;
    if($db->db_provider=='pgsql') // just for sure
    $dbclass = 'rcube_mdb2';
    if ($db->db_provider=='pgsql' && ($db instanceof $dbclass))
      {
      $db->db_handle->setOption('disable_smart_seqname', true);
      $db->db_handle->setOption('seqname_format', '%s');
      }
      }
  
    return $CONFIG[$opt];
    return $opt;
    }
    
  return $sequence;
@@ -128,18 +129,7 @@
function rcmail_url($action, $p=array(), $task=null)
{
  $app = rcmail::get_instance();
  $qstring = '';
  $base = $app->comm_path;
  if ($task && in_array($task, rcmail::$main_tasks))
    $base = ereg_replace('_task=[a-z]+', '_task='.$task, $app->comm_path);
  if (is_array($p))
    foreach ($p as $key => $val)
      $qstring .= '&'.urlencode($key).'='.urlencode($val);
  return $base . ($action ? '&_action='.$action : '') . $qstring;
  return $app->url((array)$p + array('_action' => $action, 'task' => $task));
}
@@ -475,7 +465,7 @@
 */
function asciiwords($str)
{
  return preg_replace('/[^a-z0-9.-_]/i', '', $str);
  return preg_replace('/[^a-z0-9._-]/i', '', $str);
}
/**
@@ -500,22 +490,6 @@
{
  return preg_replace('/[\r\n]/', '', $str);
}
/**
 * Check if a specific template exists
 *
 * @param string Template name
 * @return boolean True if template exists
 */
function template_exists($name)
  {
  global $CONFIG;
  $skin_path = $CONFIG['skin_path'];
  // check template file
  return is_file("$skin_path/templates/$name.html");
  }
/**
@@ -780,6 +754,8 @@
    // month name (long)
    else if ($format{$i}=='F')
      $out .= rcube_label('long'.strtolower(date('M', $timestamp)));
    else if ($format{$i}=='x')
      $out .= strftime('%x %X', $timestamp);
    else
      $out .= date($format{$i}, $timestamp);
    }