1
olivee
Admin interface for theme
  • 2014/2/3 21:42

  • olivee

  • Just popping in

  • Posts: 24

  • Since: 2014/1/28


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

2
Bleekk
Re: Admin interface for theme
  • 2014/2/4 8:30

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


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

3
Bleekk
Re: Admin interface for theme
  • 2014/2/4 8:37

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


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 :)

4
olivee
Re: Admin interface for theme
  • 2014/2/4 12:40

  • olivee

  • Just popping in

  • Posts: 24

  • Since: 2014/1/28


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 
'install failed1';
        }else{
            echo 
'
table config_theme est installé
'
;
            
$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 
'
table config_theme déjà installé
'
;
    }
    
        
// 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 
'install failed2';
        }else{
            echo 
'
table config_theme_menu est installé
'
;
        }
    }else{
    echo 
'
table config_theme_menu déjà installé
'
;
    }


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

5
Bleekk
Re: Admin interface for theme
  • 2014/2/4 16:57

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


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

6
Bleekk
Re: Admin interface for theme
  • 2014/2/4 22:48

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


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?

7
olivee
Re: Admin interface for theme
  • 2014/2/5 9:04

  • olivee

  • Just popping in

  • Posts: 24

  • Since: 2014/1/28


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

8
noo-b
Re: Admin interface for theme
  • 2014/2/6 0:05

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


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.php?storyid=6557&com_id=57009&com_rootid=57009&#comment57009



9
olivee
Re: Admin interface for theme
  • 2014/2/18 0:15

  • olivee

  • Just popping in

  • Posts: 24

  • Since: 2014/1/28





10
Mamba
Re: Admin interface for theme
  • 2014/2/19 13:21

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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.11 | Docs | Modules | Bugs

Login

Who's Online

210 user(s) are online (69 user(s) are browsing Support Forums)


Members: 0


Guests: 210


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