1
dynek
Hide main menu
  • 2005/2/2 8:07

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


Hi!

First of all I'm sorry if it's not the correct forum to post this to but I couldn't find any other that would fit better.

I'm developing a module for XOOPS and I'd like to open a window using javascript and in this window I need to have access to the forms controls and db controls of Xoops.
I did it but the only way to have access to these controls is to include the header.php file. In this file there's the menu and I need to get rid off it in this window.

Is there any way in PHP to hide it only in this window ?

Thanks for your help!

2
Mithrandir
Re: Hide main menu

Erhm... form and db controls are available after including mainfile.php - header.php is not needed.

In order to be able to use the THEME system (Smarty) you will either have to include header.php (and get the blocks etc.) or manually include XOOPS_ROOT_PATH."/class/template.php" and instantiate the XoopsTpl object
include '../../mainfile.php';
include 
XOOPS_ROOT_PATH."/class/template.php";
$xoopsTpl = new XoopsTpl();
[...]

3
dynek
Re: Hide main menu
  • 2005/2/2 10:36

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


oh ok. I have the DB controls but still no template I guess.

I did what you said but I still don't see my form.

4
Mithrandir
Re: Hide main menu

Are you going to write a bit of code or shall I have to guess what you are doing and where the problem is?

5
dynek
Re: Hide main menu
  • 2005/2/2 11:32

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


In the main windows I open a smaller one with javascript.
Here's a part of the code of the window I open:

require_once "../../mainfile.php";
require_once 
XOOPS_ROOT_PATH."/class/template.php";
require_once 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";

$xoopsTpl = new XoopsTpl();
global 
$xoopsDB;

$my_form = new XoopsThemeForm(_SOUS_ENVOYES_WINDOW,"myform",$_SERVER['PHP_SELF']);
$ctrldate = new XoopsFormTextDateSelect(null"date"nullstrtotime($db_date));
$my_form->addElement($ctrldate,true);
$ctrlnobl = new XoopsFormText("Le no bl""nobl"1515$db_nobl);
$my_form->addElement($ctrlnobl,true);
$hidden = new XoopsFormHidden("param_op","save");
$my_form->addElement($hidden);
$hidden2 = new XoopsFormHidden("sous_pk",$sous_pk);
$my_form->addElement($hidden2);
$hidden3 = new XoopsFormHidden("exist"$exist);
$my_form->addElement($hidden3);
$send = new XoopsFormButton(null,"save",_SOUS_ENVOYES_BUTTON,"submit");
$my_form->addElement($send);
$my_form->assign($xoopsTpl);


The problem is that I assign $xoopsTpl...
Because if I use ->display I see my form. But I'd need the template (colors and style).

Thanks for your help

6
Mithrandir
Re: Hide main menu

I see. And where in the code do you specify the template to use? *hint* *hint*

($xoopsOption['template_main'] = "name_of_template.ext";)

7
dynek
Re: Hide main menu
  • 2005/2/2 14:11

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


.ext ?

I use the default template.. Don't understand what you mean.

8
dynek
Re: Hide main menu
  • 2005/2/3 6:02

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


I took some time yesterday to check what you said and I really don't understand.

When I create a module I use $myform->assign($xoopsTpl); and it uses a template.

What should I specify template_main if I want to use the template of the default theme?

Thanks a lot for your help

9
dynek
Re: Hide main menu
  • 2005/2/7 12:17

  • dynek

  • Just popping in

  • Posts: 8

  • Since: 2005/2/2 8


I still don't have any colors or font style. Can you please help?

10
Mithrandir
Re: Hide main menu

Templates vs. Theme <-- I think you could use this.

There is a big difference between themes and templates. Your theme decides the colours etc. but you will have to have a template to specify how things are positioned - and that is specified with giving a value to $xoopsOption['template_main'].

Login

Who's Online

332 user(s) are online (264 user(s) are browsing Support Forums)


Members: 0


Guests: 332


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