Changeset 9369 for extensions/PWG_Stuffs/include/class.inc.php
- Timestamp:
- Feb 24, 2011, 4:45:43 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/include/class.inc.php
r7855 r9369 7 7 var $user_groups = array(); 8 8 var $modules = array(); 9 10 9 var $blocks = array(); 10 var $pos = 'begin'; 11 11 12 12 function stuffs() … … 36 36 37 37 $query = ' 38 SELECT id, name, type, datas, groups, show_title, id_line, width38 SELECT id, name, path, parent, datas, groups, show_title, id_line, width 39 39 FROM ' . STUFFS_TABLE . ' 40 40 WHERE users LIKE "%' . $user['status'] . '%" … … 68 68 function process_modules() 69 69 { 70 global $pwg_loaded_plugins; 71 70 72 foreach ($this->modules as $module) 71 73 { 72 if ($module[' type'] == 'MainBlock')73 { 74 74 if ($module['name'] == 'MainBlock') 75 { 76 $this->pos = 'end'; 75 77 if (!empty($module['datas']) 76 78 and $datas = unserialize($module['datas']) … … 79 81 add_event_handler('loc_end_index', 'hide_main_block'); 80 82 } 81 continue; 82 } 83 if (!empty($module['groups'])) 84 { 85 $authorized_groups = explode(',', $module['groups']); 86 if (array_intersect($this->user_groups, $authorized_groups) == array()) continue; 87 } 88 89 $datas = (!empty($module['datas']) ? unserialize($module['datas']) : false); 83 continue; 84 } 85 if (isset($module['parent']) and !isset($pwg_loaded_plugins[$module['parent']])) 86 { 87 continue; 88 } 89 if (!empty($module['groups'])) 90 { 91 $authorized_groups = explode(',', $module['groups']); 92 if (array_intersect($this->user_groups, $authorized_groups) == array()) continue; 93 } 94 95 $datas = (!empty($module['datas']) ? unserialize($module['datas']) : false); 90 96 $block = array(); 91 97 92 if ((include(STUFFS_PATH . 'modules/' . $module['type'] . '/main.inc.php')) === false) continue; 93 94 $block['ID'] = $module['id']; 95 if ($module['show_title'] == 'true') 96 { 97 $block['TITLE'] = trigger_event('render_stuffs_name', $module['name']); 98 } 99 if (is_admin()) 100 { 101 $block['U_EDIT'] = PHPWG_ROOT_PATH.'admin.php?page=plugin&section='.STUFFS_DIR.'%2Fadmin%2Fadd_module.php&type='.$module['type'].'&edit='.$module['id']; 102 } 103 $block['TEMPLATE'] = 'stuffs_'.strtolower($module['type']).'.tpl'; 104 $this->set_tpl_block($block, $module); 98 include($module['path'].'main.inc.php'); 99 100 if (!empty($block['TEMPLATE'])) 101 { 102 $block['ID'] = $module['id']; 103 if ($module['show_title'] == 'true') 104 { 105 $block['TITLE'] = trigger_event('render_stuffs_name', $module['name']); 106 } 107 if (is_admin()) 108 { 109 $block['U_EDIT'] = PHPWG_ROOT_PATH.'admin.php?page=plugin&section='.STUFFS_DIR.'%2Fadmin%2Fadmin.php&tab=edit_module&edit='.$module['id'].'&redirect='.urlencode(urlencode($_SERVER['REQUEST_URI'])); 110 } 111 $this->set_tpl_block($block, $module); 112 } 105 113 } 106 114 } 107 115 /* Set template blocks */ 108 109 110 116 function set_tpl_block($block, $module) 117 { 118 if (!empty($module['id_line'])) 111 119 { 112 120 $block['id_line'] = $module['id_line']; … … 172 180 $block['end_line'] = true; 173 181 $block['CLASS'] = 'middle_block'; 174 175 182 $this->blocks[$this->pos][] = $block; 183 } 176 184 177 185 static function prefilter_index_css($source, &$smarty)
Note: See TracChangeset
for help on using the changeset viewer.