source: extensions/DynamicResize/DynamicResize.class.php @ 27153

Last change on this file since 27153 was 12179, checked in by arno, 13 years ago

feature : commit initial, suite

File size: 982 bytes
Line 
1<?php
2class DynamicResize {
3   var $my_config;
4    function load_config()
5    {
6        $x = @file_get_contents( dirname(__FILE__).'/data.dat' );
7        if ($x!==false)
8        {
9            $c = unserialize($x);
10            // do some more tests here
11            $this->my_config = $c;
12        }
13
14        if ( !isset($this->my_config)
15            or empty($this->my_config['DynamicResize']) )
16        {
17            $this->my_config['DynamicResize'] = 'active';
18            $this->save_config();
19        }
20    }
21    function save_config()
22    {
23        $file = fopen( dirname(__FILE__).'/data.dat', 'w' );
24        fwrite($file, serialize($this->my_config) );
25        fclose( $file );
26    }
27    function plugin_admin_menu($menu) {
28        array_push($menu,
29            array(
30                'NAME' => 'DynamicResize',
31                'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/dynamic_resize_admin.php')
32            )
33        );
34        return $menu;
35    }
36}
37?>
Note: See TracBrowser for help on using the repository browser.