Changeset 12266


Ignore:
Timestamp:
Sep 29, 2011, 6:38:24 PM (9 years ago)
Author:
flop25
Message:

deleting the "spreadmenu" system
adding a check for config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/hr_os_xl/themeconf.inc.php

    r10825 r12266  
    99*/
    1010$themeconf = array(
    11   'name'                                        => 'hr_os_xl',
     11  'name'          => 'hr_os_xl',
    1212  'parent'        => 'default',
    1313  'icon_dir'      => 'themes/hr_os_xl/icon',
    1414  'mime_icon_dir' => 'themes/hr_os_xl/icon/mimetypes/',
    15   'local_head'          => 'local_head.tpl',
    16   'activable'                   => true,
    17         'add_menu_on_public_pages'                      => true,        # activation
    18         'Exclude'                               => array('theNBMPage','thePopuphelpPage',),     # Excluded pages
     15  'local_head'    => 'local_head.tpl',
     16  'activable'     => true,
    1917);
    20 @include(PHPWG_ROOT_PATH. 'local/config/hr_os_xl.inc.php');
    21 if (isset($conf['local_dir_site']))
    22 {
    23   @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/hr_os_xl.inc.php');
    24 }
     18  if (!isset($conf['hr_os_xl']))
     19  {
     20    $config = array(
     21      'home'       => true,
     22      'categories' => true,
     23      'picture'    => false,
     24      'other'      => true,
     25      );
     26     
     27    $query = '
     28INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
     29VALUES ("hr_os_xl" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_os_xl parameters");';
     30
     31    pwg_query($query);
     32    load_conf_from_db();
     33  }
    2534
    2635// thx to P@t
     
    4857  $template->assign('display_hr_os_xl_banner', $header);
    4958}
    50 // thx to Vdigital and his plugin spreadmenus
    51 if ( !function_exists( 'add_menu_on_public_pages' ) ) {
    52         if ( defined('IN_ADMIN') and IN_ADMIN ) return false;
    53         add_event_handler('loc_after_page_header', 'add_menu_on_public_pages', 20);
    54 
    55         function  add_menu_on_public_pages() {
    56           if ( function_exists( 'initialize_menu') ) return false; # The current page has already the menu
    57           if ( !get_themeconf('add_menu_on_public_pages') ) return false; # The current page has already the menu
    58           global $template, $page, $conf;
    59           if ( isset($page['body_id']) and in_array($page['body_id'], get_themeconf('Exclude')) ) return false;
    60 
    61           $template->set_filenames(array(
    62                 'add_menu_on_public_pages' => dirname(__FILE__) . '/template/add_menu_on_public_pages.tpl',
    63           ));
    64           include_once(PHPWG_ROOT_PATH.'include/menubar.inc.php');
    65           $template->parse('add_menu_on_public_pages');
    66          
    67           if (is_admin())
    68                 {
    69           $template->assign(
    70         'U_ADMIN', get_root_url().'admin.php?page=picture_modify'
    71       .'&cat_id='.(isset($page['category']) ? $page['category']['id'] : '')
    72       .( isset($page['image_id']) ? '&image_id='.$page['image_id'] : '')
    73       );
    74                 }
    75          
    76         }
    77 }
    7859?>
Note: See TracChangeset for help on using the changeset viewer.