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

![[Main Page]](/modules/mediawiki/images/mediawiki.png)






