Projekt

Allgemein

Profil

Statistiken
| Revision:

keywords2categories / admin / includes / modules / system / category_keywords.php @ 4

Historie | Anzeigen | Annotieren | Download (3,83 KB)

1
<?php
2
/* -----------------------------------------------------------------------------------------
3
   Modul Kategorie-Keywords f?r modified eCommerce Shopsoftware 2.0.6.0     
4
   Autor: Daniel Lonn [www.webknecht.net]
5
   Released under the GNU General Public License
6
   ---------------------------------------------------------------------------------------*/
7

    
8
defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
9

    
10
if (!class_exists('category_keywords')) {
11
    class category_keywords
12
    {             
13
        var $code, $title, $description, $enabled;
14

    
15
        function __construct() 
16
        {
17
            $this->code = 'category_keywords';
18
            $this->enabled = ((MODULE_CATEGORY_KEYWORDS_STATUS == 'True') ? true : false);
19
            $this->title =  MODULE_CATEGORY_KEYWORDS_TEXT_TITLE;
20
            $this->description = MODULE_CATEGORY_KEYWORDS_TEXT_INFO;
21
            $this->sort_order = MODULE_CATEGORY_KEYWORDS_SORT_ORDER;                  
22
        }
23

    
24
        function process($file) 
25
        {
26
            //...
27
        }
28

    
29
        function display() 
30
        {
31
            return array('text' => '<br>' . MODULE_CATEGORY_KEYWORDS_TEXT_DESCRIPTION  .
32
                    '<br>' . '<br>' . xtc_button(BUTTON_REVIEW_APPROVE) . '&nbsp;' .
33
                    xtc_button_link(BUTTON_CANCEL, xtc_href_link(FILENAME_MODULE_EXPORT, 'set=' . $_GET['set'] . '&module='.$this->code))
34
                    );
35
        }
36

    
37
        function check() 
38
        {    
39
            if(!isset($this->_check)) {
40
              $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_CATEGORY_KEYWORDS_STATUS'");
41
              $this->_check = xtc_db_num_rows($check_query);
42
            }
43
            return $this->_check;
44
        }
45
 
46
        function install() 
47
        {                                                                                                                                                                                          
48
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_CATEGORY_KEYWORDS_STATUS', 'True',  '6', '1', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
49
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_CATEGORY_KEYWORDS_SHOW', 'True',  '6', '2', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
50
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_CATEGORY_KEYWORDS_INCLUDE_CATEGORIES', 'True',  '6', '3', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
51
            
52
            $this->install_db(); 
53
        }
54

    
55
        function remove()
56
        {                
57
            xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_CATEGORY_KEYWORDS_%'");
58
            $this->uninstall_db();
59
        }
60

    
61
        function keys() 
62
        {
63
            return array('MODULE_CATEGORY_KEYWORDS_STATUS', 'MODULE_CATEGORY_KEYWORDS_SHOW', 'MODULE_CATEGORY_KEYWORDS_INCLUDE_CATEGORIES');
64
        }
65
        
66
        function install_db() 
67
        {  
68
            $this->uninstall_db(); 
69
            xtc_db_query("ALTER TABLE " . TABLE_CATEGORIES_DESCRIPTION . " ADD categories_keywords VARCHAR( 255 ) NOT NULL AFTER categories_description");
70
        }
71
        
72
        function uninstall_db() 
73
        {      
74
            xtc_db_query("ALTER TABLE " . TABLE_CATEGORIES_DESCRIPTION . " DROP categories_keywords");
75
        }
76
    }
77
}
78
?>