source: extensions/gally/gally-default/admin/GallyFunctions.class.inc.php @ 7400

Last change on this file since 7400 was 6956, checked in by grum, 14 years ago

error on GallyFunctions::expandMenuEvent
'missing token' message when user try to change theme
+some minor bugs & improvements not referenced
bug:1714, bug:1864

File size: 943 bytes
Line 
1<?php
2
3include_once('Conf.class.inc.php');
4
5
6class GallyFunctions {
7
8  /**
9   * expand the menu of a theme, according to the .conf file
10   *
11   * @param String $themeDir : the theme directory
12   */
13  static public function expandMenu($themeDir)
14  {
15    $config = new Conf();
16    $config->setFileName(PHPWG_THEMES_PATH.$themeDir.'/conf/default.conf');
17    $config->read();
18    $config->setFileName(PHPWG_ROOT_PATH."local/themes/".$themeDir."/conf/local.conf");
19    $config->read(false);
20
21    if($config->getConfValue('expandMenu')=='yes')
22    {
23      add_event_handler('get_categories_menu_sql_where', Array('GallyFunctions', 'expandMenuEvent'));
24    }
25  }
26
27  /**
28   * function used with the 'get_categories_menu_sql_where' function
29   *
30   * DO NOT USE IT DIRECTLY
31   */
32  static public function expandMenuEvent($where)
33  {
34    $where=get_sql_condition_FandF(array('visible_categories' => 'id'), null, true);
35    return($where);
36  }
37}
38
39
40
41
42
43?>
Note: See TracBrowser for help on using the repository browser.