1
Will_H
Admin theme probs.
  • 2007/10/5 14:50

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Lright so I am working on this custom theme for my admin panel, and have ran into a problem.

It is all done except this little issue here.

My Admin Index:

Resized Image

My Module Admin Page:

Resized Image

as you can see everything from the "un-installed modules" and down is gone, I cant seem to figure out why.

Heres my cp_functions.

// $Id: cp_functions.php 998 2007-08-17 01:26:05Z dugris $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//  Skin By Mr. Theme Designs http://www.mrtheme.com                         //
//  ------------------------------------------------------------------------ //

define('XOOPS_CPFUNC_LOADED'1);

function 
xoops_cp_header()
{
    global 
$xoopsConfig$xoopsUser;
    if (!
headers_sent()) {
        
header('Content-Type:text/html; charset='._CHARSET);
        
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header('Cache-Control: no-store, no-cache, must-revalidate');
        
header("Cache-Control: post-check=0, pre-check=0"false);
        
header("Pragma: no-cache");
    }
    echo 
"";
    echo 
'._LANGCODE.'" lang="'._LANGCODE.'">
    
    
    ._LANGCODE.'" />
    '</span><span style="color: #007700">.</span><span style="color: #0000BB">htmlspecialchars</span><span style="color: #007700">(</span><span style="color: #0000BB">$xoopsConfig</span><span style="color: #007700">[</span><span style="color: #DD0000">'sitename'</span><span style="color: #007700">], </span><span style="color: #0000BB">ENT_QUOTES</span><span style="color: #007700">).</span><span style="color: #DD0000">' Administration
    .
XOOPS_URL.'/include/xoops.js">
    '
;
    echo 
'.XOOPS_URL.'/xoops.css" />';
        echo 
'.XOOPS_URL.'/modules/system/style.css" />';
        include_once 
XOOPS_CACHE_PATH.'/adminmenu.php';
        
$moduleperm_handler =& xoops_gethandler('groupperm');
        
$admin_mids $moduleperm_handler->getItemIds('module_admin'$xoopsUser->getGroups());
?>











        $logo file_exists(XOOPS_THEME_URL."/".getTheme()."/images/logo.gif") ? XOOPS_THEME_URL."/".getTheme()."/images/logo.gif" XOOPS_URL."/images/logo.gif";
        echo 
"
        

       
        .XOOPS_URL."/modules/system/images/head_tl.png' width='9' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/buttonleft.png' width='6' alt='' border='0' />
        .XOOPS_URL."'>Home
        XOOPS
        Mr.Theme
        .XOOPS_URL."/user.php?op=logout'>Logout
        .XOOPS_URL."/modules/system/images/buttonright.png' width='9' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/trans_tl.png' width='16' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/trans_tc.png); background-repeat: repeat-x; width: 100%;'>
        
                    
            
            
        

        
        .XOOPS_URL."/modules/system/images/trans_tr.png' width='26' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/head_tr.png' width='23' alt='' border='0' />
    


       
        .XOOPS_URL."/modules/system/images/head_bl.png' width='9' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/logo_pic.png' width='382' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/trans_bl.png' width='16' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/trans_bc.png); background-repeat: repeat-x; width: 100%;'>
        
        .XOOPS_URL."/admin.php'>Administration
        

        
        .XOOPS_URL."/modules/system/images/trans_br.png' width='26' alt='' border='0' />
        .XOOPS_URL."/modules/system/images/head_br.png' width='23' alt='' border='0' />
    



    
        

     
            
Main Menu

              ";
        foreach ( 
array_keys($xoops_admin_menu_ft) as $adm ) {
            if ( 
in_array($adm$admin_mids) ) {
                echo 
"".$xoops_admin_menu_ft[$adm]."";
            }
        }
        echo 
"
              
              
            
            
              n"
;
}

function 
xoops_cp_footer()
{
    global 
$xoopsConfig$xoopsLogger;
    echo
"
              

            
          


  
    .XOOPS_URL."/modules/system/images/foot_l.png' width='9' height='43' alt='' border='0' />
    
        Powered by "
.XOOPS_VERSION." © 2001-".date('Y').The XOOPS Project

    
    .XOOPS_URL."/modules/system/images/foot_r.png' width='9' height='43' alt='' />
  
"
;
    include 
XOOPS_CACHE_PATH.'/adminmenu.php';
    echo 
$xoops_admin_menu_dv;
    echo 
"
        
    "
;
    echo 
$GLOBALS['xoopsLogger']->render'' );
    
ob_end_flush();
}

// We need these because theme files will not be included
function OpenTable()
{
    echo 
"n";
}

function 
CloseTable()
{
    echo 
'';
}

function 
themecenterposts($title$content)
{
    echo 
''.$title.''.$content.'';
}

function 
myTextForm($url $value)
{
    return 
'.$url.'" method="post">.$value.'" />';
}

function 
xoopsfwrite()
{
    if (
$_SERVER['REQUEST_METHOD'] != 'POST') {
        return 
false;
    } else {

    }
    if (!
xoops_refcheck()) {
        return 
false;
    } else {

    }
    return 
true;
}

function 
xoops_module_get_admin_menu()
{
    
/************************************************************
    * Based on:
    * - PHP Layers Menu 1.0.7(c)2001,2002 Marco Pratesi 
    * - TreeMenu 1.1 - Bjorge Dijkstra 
    ************************************************************
    * - php code Optimized by DuGris
    ************************************************************/

    
$left 105;
    
$top 135;
    
$js "";
    
$moveLayers "";
    
$shutdown "";
    
$firstleveltable "";
    
$menu_layers "";

    
$module_handler =& xoops_gethandler('module');
    
$criteria = new CriteriaCompo();
    
$criteria->add(new Criteria('hasadmin'1));
    
$criteria->add(new Criteria('isactive'1));
    
$criteria->setSort('mid');
    
$mods $module_handler->getObjects($criteria);

    foreach (
$mods as $mod) {

      
$mid                 $mod->getVar('mid');
        
$module_name    $mod->getVar('name');
        
$module_url        "".XOOPS_URL."/modules/".$mod->getVar('dirname')."/".trim($mod->getInfo('adminindex'));
        
$module_img        ".XOOPS_URL."/modules/".$mod->getVar('dirname')."/".$mod->getInfo('image')."' alt='' />";
        
$module_desc    ""._VERSION.": "
.round($mod->getVar('version')/100 2).""._DESCRIPTION.": "
.$mod->getInfo('description');

        
$top $top 15;

        
$js .= "nfunction popUpL" $mid "() {n    shutdown();n    popUp('L" $mid "',true);}";
        
$moveLayers .= "n    setleft('L" $mid "'," $left ");n    settop('L" $mid "'," $top ");";
        
$shutdown .= "n    popUp('L" $mid "',false);";
        
$firstleveltable .= "$" "xoops_admin_menu_ft[".$mid."] = "<a href='" . $module_url . "' title='" . $module_name . "' onmouseover='moveLayerY(\"L" . $mid . "\", currentY, event) ; popUpL" . $mid . "(); ' />" . $module_img . "a><br />";n";
        
$menu_layers .= "n$mid "' style='position: absolute; visibility: hidden; z-index:1000;' >nn$module_name "n";

        
$adminmenu $mod->getAdminMenu();

        if (
$mod->getVar('hasnotification') || ($mod->getInfo('config') && is_array($mod->getInfo('config'))) || ($mod->getInfo('comments') && is_array($mod->getInfo('comments')))) {
            
$adminmenu[] = array('link' => '".XOOPS_URL."/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid'title' => _PREFERENCES'absolute' => true);
        }
        if ( 
count($adminmenu) != ) {
            
$currenttarget "";
            foreach ( 
$adminmenu as $menuitem ) {
                
$menu_link        trim($menuitem['link']);
                
$menu_title        trim($menuitem['title']);
                
$menu_target    = isset($menuitem['target']) ? " target='" trim($menuitem['target']) . "'" '';
                if (isset(
$menuitem['absolute']) && $menuitem['absolute']) {
                    
$menu_link = (empty($menu_link)) ? "#" $menu_link;
                } else {
                    
$menu_link = (empty($menu_link)) ? "#" "".XOOPS_URL."/modules/".$mod->getVar('dirname')."/".$menu_link;
                }

                
$menu_layers .= "n.XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' /> $menu_link "'" $menu_target ." onmouseover='popUpL" $mid "' />" .$menu_title"n";
            }
        }

        
$menu_layers .= "n["._CLOSE."]
$module_img "$module_desc "
n";
    }

    
$menu_layers .= "nnnn";

    
$content "<"."?phpn";
    
$content .= "$xoops_admin_menu_js = "".$js."n";nn";
    
$content .= "$xoops_admin_menu_ml = "".$moveLayers."n";nn";
    
$content .= "$xoops_admin_menu_sd = "".$shutdown."n";nn";
    
$content .= $firstleveltable "n";
    
$content .= "$xoops_admin_menu_dv = "".$menu_layers."";n";
    
$content .= "n?".">";

   return 
$content;
}

function 
xoops_module_write_admin_menu($content)
{
    if (!
xoopsfwrite()) {
        return 
false;
    }
    
$filename XOOPS_CACHE_PATH.'/adminmenu.php';
    if ( !
$file fopen($filename"w") ) {
        echo 
'failed open file';
        return 
false;
    }
    if ( 
fwrite($file$content) == -) {
        echo 
'failed write file';
        return 
false;
    }
    
fclose($file);

    
// write index.html file in cache folder
    // file is delete after clear_cache (smarty)
    
xoops_write_index_fileXOOPS_CACHE_PATH );
    return 
true;
}

function 
xoops_write_index_file$path '') {
    if ( empty(
$path) ) {
        return 
false;
    }
    if (!
xoopsfwrite()) {
        return 
false;
    }

    
$path substr($path, -1) == "/" substr($path0, -1) : $path;
    
$filename $path '/index.html';
    if ( !
$file fopen($filename"w") ) {
        echo 
'failed open file';
        return 
false;
    }
    if ( 
fwrite($file"") == -) {
        echo 
'failed write file';
        return 
false;
    }
    
fclose($file);
    return 
true;
}
?>


I think its a table that didn't close in the correct sequence, but I can't find it.

Any help?
TIA

2
markesh
Re: Admin theme probs.
  • 2007/10/5 16:42

  • markesh

  • Just popping in

  • Posts: 79

  • Since: 2007/7/14


Hi, Will,

this looks great so far

I had the same problem from time to time without having manipulated the admin php files. The problem was a renamed xoops_version.php (.txt for peaking into it...) of an uninstalled module.

Does everything look alright with the standard theme?

kind regards
markesh / karim
First German XOOPS book: XOOPS-Buch.de

3
Will_H
Re: Admin theme probs.
  • 2007/10/5 17:00

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


yeah the theme is great, perfect in every way. Compliant and all that.

and every other page in admin looks completely flawless, other than module admin this is a 100% fluid design, front to back....

I will check into the xoopsversion and see if that solves it. Thanks.

4
Will_H
Re: Admin theme probs.
  • 2007/10/5 17:09

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


HAZAH! if I could +rep you I would

It was the xoops_version of a beta module.

Thanks!

Resized Image

5
Anonymous
Re: Admin theme probs.
  • 2007/10/5 17:29

  • Anonymous

  • Posts: 0

  • Since:


And you'll be releasing this to the rest of the community when?

6
markesh
Re: Admin theme probs.
  • 2007/10/5 17:47

  • markesh

  • Just popping in

  • Posts: 79

  • Since: 2007/7/14


Hi, Will,

I'm glad I could help YOU I really appreciate all your input here at xoops.org...

As I often play around with modules and translate them, this problem belongs to my daily repertoire... (sigh... when will I ever learn?) So my suggestion was the first idea that came into my mind when I read your post. I had looked over the code but couldn't find any unclosed table tag.

I very often thought about changing this admin theme, and one of my aims was to take the mexican one (EXM, I think) one day.


kind regards
markesh / karim
First German XOOPS book: XOOPS-Buch.de

7
script_fu
Re: Admin theme probs.

One word...

ThatsHot!

8
phppp
Re: Admin theme probs.
  • 2007/10/5 21:46

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Great

I was just opening a topic on core dev site before reading your post:
http://sourceforge.net/forum/forum.php?thread_id=1839386&forum_id=347994

9
tom
Re: Admin theme probs.
  • 2007/10/6 2:41

  • tom

  • Friend of XOOPS

  • Posts: 1359

  • Since: 2002/9/21


I really like the admin theme, I'm hoping it's not long before the admin can be easily themed like in XOOPS 2.2. That would just rock.

Will you be doing and releasing many themes like this Will?
Kind Regards.
Tom

http://bassmanthemes.com
http://www.xoopslance.com

10
markesh
Re: Admin theme probs.
  • 2007/10/6 6:23

  • markesh

  • Just popping in

  • Posts: 79

  • Since: 2007/7/14


@phppp:

I'm glad to here that there are finally "official" discussions on improving the XOOPS admin theme

just have a look at the mambo/joomla! admin interface (see demo here). Some years ago, before I came to XOOPS, I had worked with Mambo and I appreciated its interface. Then in XOOPS I rubbed my eyes and thought I was dreaming...

btw: This post does not mean "Joomla! is better than XOOPS", but it means "look over the edge and, if it's useful, learn from others"

Maybe it's not necessary to have a "fully customizable" interface or a changeable theme (like for the frontend). But some things could be done easier. You see, there are two aspects: optics and working. Will's theme seems to bring better optics. As far as I understood, it also improves a little bit the internal behaviour. What we also need (IMHO) is a better working in the admin area.


kind regards
markesh / karim
First German XOOPS book: XOOPS-Buch.de

Login

Who's Online

333 user(s) are online (258 user(s) are browsing Support Forums)


Members: 0


Guests: 333


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits