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

Revision 10937, 951 bytes checked in by grum, 8 years ago (diff)

fix bug:2305 - local file is hardcoded

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.PWG_LOCAL_DIR."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.