| | |
| | | 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; |
| | |
| | | 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)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | function asciiwords($str) |
| | | { |
| | | return preg_replace('/[^a-z0-9.-_]/i', '', $str); |
| | | return preg_replace('/[^a-z0-9._-]/i', '', $str); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | 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"); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | // 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); |
| | | } |