User Login    
 + Register
  • Main navigation
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Who's Online
73 user(s) are online (7 user(s) are browsing XoopsWiki)

Members: 0
Guests: 73

more...
[Main Page]

Dev:module layout standards

From XOOPS Project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

Contents

Rules of a professional look

Here are some guidelines to define the layout of the admin side of core modules.

standards1.jpg

1. Breadcrumbs

We will use breadcrumbs to let the user be aware of her position in the admin area. To represent the module name we will use:

   ".$xoopsModule->name()."

We will detail the breacrumbs all the way until a category level.

standards2.jpg

2.Menubar

To create a consistent menu, we'll use a variant of the following function:

function adminmenu($currentoption=0,$breadcrumb)

    {

        global $xoopsModule, $xoopsConfig; $tblColors=Array(); $tblColors0?$tblColors1?$tblColors2?=$tblColors3?=$tblColors4? =$tblColors5?=$tblColors6?=$tblColors7? = '#DDE'; $tblColors[$currentoption?]'white'; echo "<table width=100% class'outer'><tr><td align=right>

            <font size=2>"._MD_A_MODULEADMIN."".$xoopsModule->name().":".$breadcrumb."</font> </td></tr></table>< br>";

        echo "<div id=\"navcontainer\"><ul style=\"padding: 3px 0; margin-left
            0;font: bold 12px Verdana, sans-serif; \">";

        echo "<li style=\"list-style: none; margin: 0; display: inline; \">

            <a href=\"admin_forum_manager.php?mode=manage\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; background: ".$tblColors0?."; text-decoration: none; \">"._MD_A_FORUM_MANAGER ."</a></li>";

        echo "<li style=\"list-style: none; margin: 0; display: inline; \">

            <a href=\"admin_cat_manager.php?op=manage\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; background: ".$tblColors1?."; text-decoration: none; \">"._MD_A_CATADMIN."</a></li>";

        echo "<li style=\"list-style: none; margin: 0; display: inline; \">

            <a href=\"admin_forum_manager.php?mode=sync\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; background: ".$tblColors2?."; text-decoration: none; \">"._MD_A_SYNCFORUM."</a></li>";

        echo "<li style=\"list-style: none; margin: 0; display: inline; \">

            <a href=\"admin_forum_reorder.php\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778;background: ".$tblColors3?."; text-decoration: none; \">". _MD_A_SETFORUMORDER ."</a></li></div></ul>";

Second row if needed

echo "<div id=\"navcontainer\"><ul style=\"padding: 3px 0; margin-left
    0; font: bold 12px Verdana, sans-serif; \">";

    echo "<li style=\"list-style: none; margin: 0; display: inline; \">

        <a href=\"admin_forum_manager.php?mode=addforum\" style=\"padding: 3px 0.5em; margin-left:3px; border: 1px solid #778; background: ".$tblColors4?."; text-decoration: none; \">"._MD_A_ADDAFORUM ."</a></li>";

    echo "<li style=\"list-style: none; margin: 0; display: inline; \">

        <a href=\"admin_cat_manager.php\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; background: ".$tblColors5?."; text-decoration: none; \">"._MD_A_ADDACAT. "</a></li>";

    echo "<li style=\"list-style: none; margin: 0; display: inline; \">

        <a href=\"admin_forum_prune.php\" style=\"padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; background: ".$tblColors6?."; text-decoration: none; \">"._MD_A_PRUNE_TITLE."</a></li>";

    echo "<li style=\"list-style: none; margin: 0; display: inline; \">

        <a href=\"../../system/admin.php?fct=preferences&op=showmod&mod= ".$xoopsModule -> getVar( 'mid' )."\ " style=\"padding: 3px 0.5em; margin-left: 3px;border: 1px solid #778; background: ".$tblColors7?."; text-decoration: none; \">"._MD_A_GENERALSET ."</a></li></div></ul>";

    echo "< br>< br>";

    }

3. Fieldsets

Below the menubar, we'll give content a common look by using fieldset and label tags, such as in this example:

A fieldset declaration begins with

    echo "<fieldset><legend style='font-weight: bold; color: #900;'>". _MD_A_EDITTHISFORUM . "</legend>";

and ends with

    echo "</fieldset>";

Between this you can use your table tags or whatever you need to build the admin interface.

These items will be henceforth a standard for the core modules. If the rest of the developers accept this standard as well, we'll be able to provide XOOPS with a common visual personality. Examples of use

case "mod"

        $fc = new !ForumCat?($cat_id); xoops_cp_header(); adminmenu(1,_MD_A_EDITCATEGORY.$fc->cat_title ); echo "<fieldset><legend style='font-weight: bold; color: #900;'>

            " . _MD_A_EDITCATEGORY . "</legend>";

        echo "< br>< br><table width='100%' border='0' cellspacing='1' class='outer'>

            <tr><td class=\"odd\">";

        editcat($cat_id);

        echo "</td></tr></table>"; echo "</fieldset>"; xoops_cp_footer(); break;

Back to the Main Page

Retrieved from "http://www.xoops.org/modules/mediawiki/index.php/Dev:module_layout_standards"

This page has been accessed 543 times. This page was last modified 17:25, 15 December 2007. Content is available under XOOPS Project.


Developers for Hire
Developers for Hire
Local Support Sites
Make a donation
Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Powered by
XOOPS Code hosted on SourceForge

Powered by PHP

PHP 5

Powered by MySQL

Powered by Smarty

OSI certified

GPL

All content on this site is subject to the Creative Commons License
Top Tags
Theme (5) news (2) security (2) sport (1) Arabic (1) wiki (1) Christmas (1) jQuery (1) tag (1) module (1) SEO (1) comments (1)
Advertisement