xoops forums

olivee

Just popping in
Posted on: 2014/2/3 21:42
olivee
olivee (Show more)
Just popping in
Posts: 24
Since: 2014/1/28
#1

Admin interface for theme

This is my little project for XOOPS quickly done. I want to make an admin interface for my theme. I started using the theme maitscorporate of Mariane.
it can be integrated with any other theme once ok.

This is just to show you what I did until now so it's not finished yet. I can say that this is an alpha version. it is necessary to test locally and do not use it on a website online until the confirmation.

I want to share with you for testing and improve based on your feedback ...

In all there are 5 parts

/themes/maitscocorporate/admin/cf-admin.php?page=dashboard
It is a summary or an overview of configuration.

/themes/maitscocorporate/admin/cf-admin.php?page=menu
create, edit and delete an endless menus with 5 skins PREDEFINED

/themes/maitscocorporate/admin/cf-admin.php?page=slider
create, edit and delete an infinite sliders with 5 skins PREDEFINED

/themes/maitscocorporate/admin/cf-admin.php?page=messages
modify the predefined settings in the theme

/themes/maitscocorporate/admin/cf-admin.php?page=theme
drag & drop & resize & add element to theme.html. COMING SOON




Download

Bleekk

Theme Designer
Posted on: 2014/2/4 8:30
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 934
Since: 2002/12/14
#2

Re: Admin interface for theme

hi,

this looks very interesting and very cool. Is it possible to make a module to make this changes in the xoops administration.

Does this only work with the maitsco theme? what does to be made to make it work with other themes?

I have some errors and the design is broken:
Strict Standards: Declaration of menu::process() should be compatible with olivee::process($arr) in C:\xampp\htdocs\xoops256\themes\maitscocorporate\admin\admin.class.php on line 249

Strict Standards: Declaration of menu::generate() should be compatible with olivee::generate($arr) in themes\maitscocorporate\admin\admin.class.php on line 249

Strict Standards: Declaration of slider::process() should be compatible with olivee::process($arr) in themes\maitscocorporate\admin\admin.class.php on line 638

Strict Standards: Declaration of slider::generate() should be compatible with olivee::generate($arr) in themes\maitscocorporate\admin\admin.class.php on line 638

Bleekk

Theme Designer
Posted on: 2014/2/4 8:37
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 934
Since: 2002/12/14
#3

Re: Admin interface for theme

one more thing, the administration is changing the database. There are 2 tables created.
Can you please give some backup to the user when you create new tables. This is again a reason to have this theme interface as module :)

olivee

Just popping in
Posted on: 2014/2/4 12:40
olivee
olivee (Show more)
Just popping in
Posts: 24
Since: 2014/1/28
#4

Re: Admin interface for theme

function news_TableExists($tablename){
        global 
$xoopsDB;
        
$result=$xoopsDB->queryF("SHOW TABLES LIKE '$tablename'");
        return(
$xoopsDB->getRowsNum($result) > 0);
    }
    global 
$xoopsDB;
    
// 1) Create, if it does not exists, the config_theme table
    
if(!news_TableExists($xoopsDB->prefix('config_theme'))){

        
$sqlinstall 'CREATE TABLE '.$xoopsDB->prefix('config_theme')." (
        
          conf_id smallint(5) unsigned NOT NULL AUTO_INCREMENT,
          conf_modid smallint(5) unsigned NOT NULL DEFAULT '0',
          conf_catid smallint(5) unsigned NOT NULL DEFAULT '0',
          conf_name varchar(25) NOT NULL DEFAULT '',
          conf_title varchar(255) NOT NULL DEFAULT '',
          conf_value text,
          url varchar(255) DEFAULT NULL,
          conf_desc varchar(255) NOT NULL DEFAULT '',
          conf_formtype varchar(15) NOT NULL DEFAULT '',
          conf_valuetype varchar(10) NOT NULL DEFAULT '',
          conf_order smallint(5) unsigned NOT NULL DEFAULT '0',
          PRIMARY KEY (conf_id),
          KEY conf_mod_cat_id (conf_modid,conf_catid),
          KEY conf_order (conf_order)
        ) ENGINE=MyISAM;"
;
        if (!
$xoopsDB->queryF($sqlinstall)) {
            echo 
'<br />install failed1';
        }else{
            echo 
'<br>table config_theme est installé<br>';
            
$new 'a:2:{i:0;a:3:{s:4:"type";s:6:"column";s:4:"size";s:3:"1/4";s:6:"fields";a:1:{s:7:"content";s:4:"test";}}i:1;a:3:{s:4:"type";s:6:"column";s:4:"size";s:3:"1/4";s:6:"fields";a:1:{s:7:"content";s:4:"iiii";}}}';
            
$sqltemplateinsert "INSERT INTO " $xoopsDB -> prefix('config_theme') . " (conf_id, conf_catid, conf_name, conf_value) VALUES ('1', '3', 'template', '$new')";

                    
$resultsqltemplate $xoopsDB->queryF($sqltemplateinsert);
                     
                    if(!
$resultsqltemplate){
                        echo 
'probleme_INSERT_config_template' ;
                    }else{
                     
                        echo  
'INSERT_config_template_ok' ;
                    }
        }
    }else{
    echo 
'<br>table config_theme déjà installé<br>';
    }
    
        
// 1) Create, if it does not exists, the config_theme_menu table
    
if(!news_TableExists($xoopsDB->prefix('config_theme_menu'))){

        
$sqlinstall2 'CREATE TABLE '.$xoopsDB->prefix('config_theme_menu')." (
        
                id int(11) NOT NULL AUTO_INCREMENT,
              catmenu varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
              label varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
              link varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '#',
              image varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
              parent int(11) NOT NULL DEFAULT '0',
              sort int(11) DEFAULT NULL,
              PRIMARY KEY (id)
            ) ENGINE=MyISAM;"
;
        if (!
$xoopsDB->queryF($sqlinstall2)) {
            echo 
'<br />install failed2';
        }else{
            echo 
'<br>table config_theme_menu est installé<br>';
        }
    }else{
    echo 
'<br>table config_theme_menu déjà installé<br>';
    }


the first table is a copy of config table of xoops with the config of theme. the second is for storing menus and sliders.

==> after official release we can integrate this with all theme by copying admin folder and 4 file php. I will explan this after finish.

I can't reproduce the error, it looks like a probleme with php version.

I can't see how can i do this with a module, perheps we can have a link or a redirect to admin folder in the interface of xoops. I will think of this

Bleekk

Theme Designer
Posted on: 2014/2/4 16:57
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 934
Since: 2002/12/14
#5

Re: Admin interface for theme

the module could create global variables for slider, images and other stuff that can be used in the theme or css

Bleekk

Theme Designer
Posted on: 2014/2/4 22:48
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 934
Since: 2002/12/14
#6

Re: Admin interface for theme

let's say your administration will keep with the theme. can you bring a standardisation to this so we can use is for all themes?

olivee

Just popping in
Posted on: 2014/2/5 9:04
olivee
olivee (Show more)
Just popping in
Posts: 24
Since: 2014/1/28
#7

Re: Admin interface for theme

I think I can do this but I must have time.
for now I should finish theme builder part and than that will be easy for module.

what about menus and slider construct can you have the output like you want to have

noo-b

Just can't stay away
Posted on: 2014/2/6 0:05
noo-b
noo-b (Show more)
Just can't stay away
Posts: 456
Since: 2007/10/23
#8

Re: Admin interface for theme

Nice work ..hope this can turn into a module

Quote:
xFreshUi admin theme coming...
XOOPS don't stop ;)


btw..Angelrocha is also working on admin theme

https://xoops.org/modules/news/article ... ootid=57009&#comment57009


olivee

Just popping in
Posted on: 2014/2/18 0:15
olivee
olivee (Show more)
Just popping in
Posts: 24
Since: 2014/1/28
#9

Re: Admin interface for theme



Mamba

Moderator
Posted on: 2014/2/19 13:21
Mamba
Mamba (Show more)
Moderator
Posts: 10818
Since: 2004/4/23
#10

Re: Admin interface for theme

That looks interesting!

When will you be able to share the code for others to test it?

If you can, please get in touch with Angelo, so you guys can maybe join forces on what he is trying to do.

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs