Plugins  LAST
 All Data Structures Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 /*
23 /*!\file
24  * \brief main file for : change
25  * - skel with code of the plugin
26  * - Route n : with real name
27  */
28 
29 /*
30  * load javascript
31  */
32 
33 ob_start();
34 require_once('skel_javascript.js');
35 $j=ob_get_contents();
36 ob_end_clean();
37 echo create_script($j);
38 global $version_plugin;
39 $version_plugin=SVNINFO;
40 Extension::check_version(1000);
41 
42 $url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
43 
44 $menu=array (
45  array($url.'&sa=dec',_('Route 1'),_('Première route'),1),
46  array($url.'&sa=li',_('Route 2'),_('Seconde route'),2)
47  );
48 
49 $sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:0;
50 $def=0;
51 switch($sa)
52  {
53  case 'dec':
54  $def=1;
55  break;
56  case 'li':
57  $def=2;
58  break;
59  default :
60  $def=2;
61 
62  }
63 
64 $cn=Dossier::connect();
65 if ( $cn->exist_schema('skeleton') == false)
66  {
67  require_once('include/class_install_plugin.php');
68 
69  $iplugn=new Install_Plugin($cn);
70  $iplugn->install();
71  /**
72  *@todo améliorer le message, peu cosmétique
73  */
74  echo_warning(_("L'extension est installée, pourriez-vous en vérifier le paramètrage ?"));
75  $def=2;
76  }
77 
78 // show menu
79 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=skel" target="_blank">Aide</a>'.
80 '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
81 '</div>';
82 echo '<div class="menu2">';
83 echo ShowItem($menu,'H','mtitle ','mtitle ',$def,'class="mtitle"');
84 echo '</div>';
85 
86 // include the right file
87 if ($def==1)
88  {
89  require_once('include/route1.inc.php');
90  exit();
91  }
92 
93 /* listing intracomm */
94 if ($def==2)
95  {
96  require_once('include/route2.inc.php');
97  exit();
98  }
99 ?>