X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ficonbar.c;h=bb9a4e41711258f5f0b71dc456fc38ea21b194c6;hb=694a3ea878536e2deda1c0168e51837a31b81af7;hp=8090c1c2ca6c8c505d6057cec376d2c1d32bccd4;hpb=63deece5bd2380725f32c42b5af0e74272afa140;p=citadel.git diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 8090c1c2c..bb9a4e417 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -1,41 +1,62 @@ /* * $Id$ - * - * Displays and customizes the iconbar. */ - +/** + * \defgroup IconBar Displays and customizes the iconbar. + * \ingroup MenuInfrastructure + */ +/*@{*/ #include "webcit.h" -/* Values for ib_displayas */ -#define IB_PICTEXT 0 -#define IB_PICONLY 1 -#define IB_TEXTONLY 2 +/** Values for ib_displayas */ +#define IB_PICTEXT 0 /**< picture and text */ +#define IB_PICONLY 1 /**< just a picture */ +#define IB_TEXTONLY 2 /**< just text */ + + +/** + * \brief draw the icon bar????? + */ +void do_selected_iconbar(void) { + if (WC->current_iconbar == current_iconbar_roomlist) { + do_iconbar_roomlist(); + } + else { + do_iconbar(); + } +} +/** + * \brief draw the icon bar??? + */ void do_iconbar(void) { char iconbar[SIZ]; char buf[SIZ]; char key[SIZ], value[SIZ]; int i; - /* The initialized values of these variables also happen to + WC->current_iconbar = current_iconbar_menu; + + /** + * The initialized values of these variables also happen to * specify the default values for users who haven't customized * their iconbars. These should probably be set in a master * configuration somewhere. */ - int ib_displayas = 0; /* pictures and text, pictures, text */ - int ib_logo = 0; /* Site logo */ - int ib_summary = 1; /* Summary page icon */ - int ib_inbox = 1; /* Inbox icon */ - int ib_calendar = 1; /* Calendar icon */ - int ib_contacts = 1; /* Contacts icon */ - int ib_notes = 1; /* Notes icon */ - int ib_tasks = 1; /* Tasks icon */ - int ib_rooms = 1; /* Rooms icon */ - int ib_users = 1; /* Users icon */ - int ib_chat = 1; /* Chat icon */ - int ib_advanced = 1; /* Advanced Options icon */ - int ib_citadel = 1; /* 'Powered by Citadel' logo */ + int ib_displayas = 0; /**< pictures and text, pictures, text */ + int ib_logo = 0; /**< Site logo */ + int ib_summary = 1; /**< Summary page icon */ + int ib_inbox = 1; /**< Inbox icon */ + int ib_calendar = 1; /**< Calendar icon */ + int ib_contacts = 1; /**< Contacts icon */ + int ib_notes = 1; /**< Notes icon */ + int ib_tasks = 1; /**< Tasks icon */ + int ib_rooms = 1; /**< Rooms icon */ + int ib_users = 1; /**< Users icon */ + int ib_chat = 1; /**< Chat icon */ + int ib_advanced = 1; /**< Advanced Options icon */ + int ib_citadel = 1; /**< 'Powered by Citadel' logo */ /* */ @@ -85,6 +106,9 @@ void do_iconbar(void) { _("CITADEL") ); + wprintf("
  • "); + wprintf(_("switch to room list")); + wprintf("
    "); if (ib_summary) { wprintf("
  • \n"); } - if (1) { - wprintf("
  • " - "", - _("Log off"), - _("Log off now?") - - ); - if (ib_displayas != IB_TEXTONLY) { - wprintf(""); - } - if (ib_displayas != IB_PICONLY) { - wprintf(_("Log off")); - } - wprintf("
  • \n"); + wprintf("
  • " + "", + _("Log off"), + _("Log off now?") + + ); + if (ib_displayas != IB_TEXTONLY) { + wprintf(""); + } + if (ib_displayas != IB_PICONLY) { + wprintf(_("Log off")); } + wprintf("
  • \n"); wprintf( "
  • " @@ -305,12 +327,103 @@ void do_iconbar(void) { _("customize this menu") ); - wprintf("\n" - "
    \n"); + wprintf("\n"); } +/** + * \brief roomtree view of the iconbar + * If the user has toggled the icon bar over to a room list, here's where + * we generate its innerHTML... + */ +void do_iconbar_roomlist(void) { + char iconbar[SIZ]; + char buf[SIZ]; + char key[SIZ], value[SIZ]; + int i; + + WC->current_iconbar = current_iconbar_roomlist; + + /** + * The initialized values of these variables also happen to + * specify the default values for users who haven't customized + * their iconbars. These should probably be set in a master + * configuration somewhere. + */ + int ib_displayas = 0; /* pictures and text, pictures, text */ + int ib_logo = 0; /* Site logo */ + int ib_citadel = 1; /* 'Powered by Citadel' logo */ + /* + */ + + get_preference("iconbar", iconbar, sizeof iconbar); + for (i=0; i\n" + "\n"); + + /** embed the room list */ + list_all_rooms_by_floor("iconbar"); + + wprintf("\n"); +} + + +/** + * \brief display a customized version of the iconbar + */ void display_customize_iconbar(void) { char iconbar[SIZ]; char buf[SIZ]; @@ -318,24 +431,25 @@ void display_customize_iconbar(void) { int i; int bar = 0; - /* The initialized values of these variables also happen to + /** + * The initialized values of these variables also happen to * specify the default values for users who haven't customized * their iconbars. These should probably be set in a master * configuration somewhere. */ - int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */ - int ib_logo = 0; /* Site logo */ - int ib_summary = 1; /* Summary page icon */ - int ib_inbox = 1; /* Inbox icon */ - int ib_calendar = 1; /* Calendar icon */ - int ib_contacts = 1; /* Contacts icon */ - int ib_notes = 1; /* Notes icon */ - int ib_tasks = 1; /* Tasks icon */ - int ib_rooms = 1; /* Rooms icon */ - int ib_users = 1; /* Users icon */ - int ib_chat = 1; /* Chat icon */ - int ib_advanced = 1; /* Advanced Options icon */ - int ib_citadel = 1; /* 'Powered by Citadel' logo */ + int ib_displayas = IB_PICTEXT; /**< pictures and text, pictures, text */ + int ib_logo = 0; /**< Site logo */ + int ib_summary = 1; /**< Summary page icon */ + int ib_inbox = 1; /**< Inbox icon */ + int ib_calendar = 1; /**< Calendar icon */ + int ib_contacts = 1; /**< Contacts icon */ + int ib_notes = 1; /**< Notes icon */ + int ib_tasks = 1; /**< Tasks icon */ + int ib_rooms = 1; /**< Rooms icon */ + int ib_users = 1; /**< Users icon */ + int ib_chat = 1; /**< Chat icon */ + int ib_advanced = 1; /**< Advanced Options icon */ + int ib_citadel = 1; /**< 'Powered by Citadel' logo */ /* */ @@ -370,7 +484,7 @@ void display_customize_iconbar(void) { "\n
    \n" ); - wprintf("
    " + wprintf("
    " "
    "); wprintf("
    \n"); @@ -518,7 +632,7 @@ void display_customize_iconbar(void) { ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")), (ib_rooms ? "CHECKED" : ""), _("Rooms"), - _("Clicking this icon displays a list of all accesible " + _("Clicking this icon displays a list of all accessible " "rooms (or folders) available.") ); @@ -602,7 +716,9 @@ void display_customize_iconbar(void) { wDumpContent(2); } - +/** + * \brief commit the changes of an edited iconbar ???? + */ void commit_iconbar(void) { char iconbar[SIZ]; int i; @@ -652,3 +768,7 @@ void commit_iconbar(void) { wprintf("
    \n"); wDumpContent(2); } + + + +/*@}*/