extern char* static_dirs[];
void display_mime_icon(void)
{
- char diskette[SIZ];
+ char FileBuf[SIZ];
+ const char *FileName;
- snprintf (diskette, SIZ, "%s%s", static_dirs[0], "/diskette_24x.gif");
- output_static(diskette);
+ FileName = GetIconFilename(bstr("type"), strlen(bstr("type")));
+
+ if (FileName == NULL)
+ snprintf (FileBuf, SIZ, "%s%s", static_dirs[0], "/diskette_24x.gif");
+ else
+ snprintf (FileBuf, SIZ, "%s%s", static_dirs[3], FileName);
+ output_static(FileBuf);
}
#include "webserver.h"
#include "groupdav.h"
+inline const char *PrintPref(void *Prefstr)
+{
+ return Prefstr;
+}
+
/*
* display preferences dialog
*/
char *Key;
Hash = WC->hash_prefs;
- PrintHash(Hash);
+ PrintHash(Hash, PrintPref, NULL);
HashPos = GetNewHashPos();
while (GetNextHashPos(Hash, HashPos, &len, &Key, (void**)&Value)!=0)
{
void *hash_value = NULL;
strcpy(value, "");
- PrintHash(WC->hash_prefs);
+ PrintHash(WC->hash_prefs, PrintPref, NULL);
if (GetHash(WC->hash_prefs, key, strlen(key), &hash_value) == 0)
return;
#define CLIENT_ID 4
#define CLIENT_VERSION 730 /* This version of WebCit */
#define MINIMUM_CIT_VERSION 730 /* min required Citadel ver */
-#define LIBCITADEL_MIN 105 /* min required libcitadel ver */
+#define LIBCITADEL_MIN 106 /* min required libcitadel ver */
#define DEFAULT_HOST "localhost" /* Default Citadel server */
#define DEFAULT_PORT "504"
#define LB (1) /* Internal escape chars */
static const char editor_absolut_dir[PATH_MAX]=EDITORDIR; /* nailed to what configure gives us. */
static char static_dir[PATH_MAX]; /* calculated on startup */
static char static_local_dir[PATH_MAX]; /* calculated on startup */
+static char static_icon_dir[PATH_MAX]; /* where should we find our mime icons? */
char *static_dirs[]={ /* needs same sort order as the web mapping */
(char*)static_dir, /* our templates on disk */
(char*)static_local_dir, /* user provided templates disk */
- (char*)editor_absolut_dir /* the editor on disk */
+ (char*)editor_absolut_dir, /* the editor on disk */
+ (char*)static_icon_dir /* our icons... */
};
/*
COMPUTE_DIRECTORY(socket_dir);
basedir=WWWDIR "/static";
COMPUTE_DIRECTORY(static_dir);
+ basedir=WWWDIR "/static/icons";
+ COMPUTE_DIRECTORY(static_icon_dir);
basedir=WWWDIR "/static.local";
COMPUTE_DIRECTORY(static_local_dir);
lprintf(9, "Changing directory to %s\n", socket_dir);
if (chdir(webcitdir) != 0) {
perror("chdir");
- }
+ }
+ LoadIconDir(static_icon_dir);
initialize_viewdefs();
initialize_axdefs();