Changeset 28843 for extensions


Ignore:
Timestamp:
Jun 29, 2014, 4:23:14 PM (10 years ago)
Author:
mistic100
Message:

use new maintain class

Location:
extensions/header_manager
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/header_manager/admin/add.php

    r26308 r28843  
    1515 
    1616  $conf['header_manager']['keep_ratio'] = isset($_POST['keep_ratio']);
    17   conf_update_param('header_manager', serialize($conf['header_manager']));
     17  conf_update_param('header_manager', $conf['header_manager']);
    1818 
    1919  $banner = get_banner($_POST['picture_file']);
     
    113113  $conf['header_manager']['width'] = intval($_POST['width']);
    114114  $conf['header_manager']['height'] = intval($_POST['height']);
    115   conf_update_param('header_manager', serialize($conf['header_manager']));
     115  conf_update_param('header_manager', $conf['header_manager']);
    116116
    117117  $picture['banner_src'] = HEADER_MANAGER_DIR . $picture['filename'];
  • extensions/header_manager/admin/config.php

    r26298 r28843  
    66{
    77  $conf['header_manager']['image'] = pwg_get_session_var('added_banner');
    8   conf_update_param('header_manager', serialize($conf['header_manager']));
     8  conf_update_param('header_manager', $conf['header_manager']);
    99  pwg_unset_session_var('added_banner');
    1010}
     
    1616  if ($_POST['display'] == 'with_text')
    1717  {
    18     $conf['page_banner'] = $_POST['conf_page_banner'];
    19     conf_update_param('page_banner', $conf['page_banner']);
     18    conf_update_param('page_banner', $_POST['conf_page_banner'], true);
    2019  }
    2120 
     
    2726    'banner_on_picture' => isset($_POST['banner_on_picture']),
    2827    );
    29   conf_update_param('header_manager', serialize($conf['header_manager']));
     28  conf_update_param('header_manager', $conf['header_manager']);
    3029 
    3130  $page['infos'][] = l10n('Information data registered in database');
     
    4443    {
    4544      $conf['header_manager']['image'] = 'random';
    46       conf_update_param('header_manager', serialize($conf['header_manager']));
     45      conf_update_param('header_manager', $conf['header_manager']);
    4746    }
    4847   
  • extensions/header_manager/main.inc.php

    r26298 r28843  
    1111defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    1212
    13 global $prefixeTable;
     13global $prefixeTable, $conf;
     14
    1415define('HEADER_MANAGER_PATH',    PHPWG_PLUGINS_PATH . 'header_manager/');
    1516define('HEADER_MANAGER_ADMIN',   get_root_url() . 'admin.php?page=plugin-header_manager');
    1617define('HEADER_MANAGER_DIR',     PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners/');
    1718define('HEADER_MANAGER_TABLE',   $prefixeTable . 'category_banner');
    18 define('HEADER_MANAGER_VERSION', 'auto');
     19
     20include_once(HEADER_MANAGER_PATH . 'include/functions.inc.php');
     21include_once(HEADER_MANAGER_PATH . 'include/header_manager.inc.php');
    1922
    2023
    21 add_event_handler('init', 'header_manager_init');
     24$conf['header_manager'] = safe_unserialize($conf['header_manager']);
     25
    2226 
    2327if (defined('IN_ADMIN'))
     
    3236}
    3337
    34 include_once(HEADER_MANAGER_PATH . 'include/functions.inc.php');
    35 include_once(HEADER_MANAGER_PATH . 'include/header_manager.inc.php');
    36 
    37 
    38 /**
    39  * initialization
    40  */
    41 function header_manager_init()
    42 {
    43   global $conf, $pwg_loaded_plugins, $page;
    44  
    45   include_once(HEADER_MANAGER_PATH . 'maintain.inc.php');
    46   $maintain = new header_manager_maintain('header_manager');
    47   $maintain->autoUpdate(HEADER_MANAGER_VERSION, 'install');
    48  
    49   $conf['header_manager'] = unserialize($conf['header_manager']);
    50 }
    5138
    5239/**
Note: See TracChangeset for help on using the changeset viewer.