Changeset 7540 for extensions/PWG_Stuffs
- Timestamp:
- Nov 1, 2010, 3:16:26 PM (14 years ago)
- Location:
- extensions/PWG_Stuffs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/admin/add_module.php
r6230 r7540 9 9 load_language('plugin.lang', STUFFS_PATH); 10 10 11 if (!isset($_GET['type']) or !is_dir(STUFFS_PATH . 'modules/' . $_GET['type']))11 if (!isset($_GET['type']) or ($_GET['type'] != 'MainBlock' and !is_dir(STUFFS_PATH . 'modules/' . $_GET['type']))) 12 12 { 13 13 die('Wrong parameters...'); … … 24 24 if (isset($_POST['submit']) and !is_adviser()) 25 25 { 26 include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');26 @include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php'); 27 27 if (empty($page['errors'])) 28 28 { 29 if ($type == 'MainBlock') 30 { 31 $_POST['module_name'] = 'MainBlock'; 32 $_POST['show_title'] = true; 33 $_POST['on_home'] = true; 34 $_POST['on_cats'] = true; 35 $_POST['on_picture'] = true; 36 } 29 37 if (empty($_POST['module_name'])) 30 38 { … … 105 113 $template->assign(array( 106 114 'STUFFS_TITLE' => l10n('stuffs_edit_mod') . ' <i>' . trigger_event('render_stuffs_name', $module['name']) . '</i>', 115 'MODULE_ID' => $_GET['edit'], 107 116 'MODULE_NAME' => $module['name'], 108 117 'DESC_VALUE' => (isset($module['descr']) ? $module['descr'] : ''), … … 139 148 140 149 // Configuration du module 141 include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');150 @include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php'); 142 151 143 152 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/add_module.tpl')); -
extensions/PWG_Stuffs/admin/manage.php
r7340 r7540 19 19 } 20 20 21 pwg_query('22 UPDATE ' . STUFFS_TABLE . '23 SET datas = "'.addslashes(serialize(array('hide' => isset($_POST['hidemb'])))).'"24 WHERE id=0;');25 26 21 array_push($page['infos'], l10n('stuffs_order_saved')); 27 22 } 28 23 29 24 // Affichage des modules et de leur position 30 $q = 'SELECT id, name, descr, type, id_line, width , datas25 $q = 'SELECT id, name, descr, type, id_line, width 31 26 FROM ' . STUFFS_TABLE . ' 32 27 ORDER BY pos ASC;'; … … 64 59 'ID' => $module['id'], 65 60 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&type=' . $module['type'] . '&edit=' . $module['id'], 66 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '',61 'U_DELETE' => !is_adviser() and $module['id'] != 0 ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '', 67 62 )); 68 69 if ($module['type'] == 'MainBlock' and !empty($module['datas']))70 {71 $datas = unserialize($module['datas']);72 $template->assign('HIDEMB', $datas['hide']);73 }74 63 } 75 64 -
extensions/PWG_Stuffs/admin/template/add_module.tpl
r3609 r7540 11 11 <fieldset> 12 12 <legend>{'stuffs_module_config'|@translate}</legend> 13 {if $MODULE_ID == 0}<p>{'This module can be hidden only on homepage'|@translate}</p>{/if} 13 14 <table> 14 15 15 16 <tr><td colspan="3"><br></td></tr> 16 17 18 {if $MODULE_ID != 0} 17 19 <tr> 18 20 <td><b>{'stuffs_module_title'|@translate} </b></td> … … 30 32 <td colspan="2">{'stuffs_only_for_admin'|@translate}</td> 31 33 </tr> 34 {/if} 32 35 33 36 <tr><td colspan="3"><br></td></tr> … … 61 64 </fieldset> 62 65 66 {if $MODULE_ID != 0} 63 67 <fieldset> 64 68 <legend>{'stuffs_visual_config'|@translate}</legend> … … 81 85 <tr><td colspan="2"><br></td></tr> 82 86 </table> 83 84 85 87 </fieldset> 86 88 … … 89 91 {$MODULE_OPTIONS} 90 92 </fieldset> 93 {/if} 91 94 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/></p> 92 95 </form> -
extensions/PWG_Stuffs/admin/template/manage.tpl
r7340 r7540 51 51 52 52 <li class="categoryLi virtual_cat" id="module_{$module.ID}"> 53 {if $module.TYPE != 'MainBlock'}54 53 <ul class="categoryActions"> 54 {if $module.TYPE != 'MainBlock'} 55 55 <li class="stuffs_line"> 56 56 {'stuffs_id_ligne'|@translate} … … 63 63 <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > % 64 64 </li> 65 {/if} 65 66 <li><a href="{$module.U_EDIT}" title="{'stuffs_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'stuffs_edit'|@translate}"/></a></li> 66 67 {if !empty($module.U_DELETE) } … … 68 69 {/if} 69 70 </ul> 70 {/if}71 71 72 72 <p> … … 78 78 {if !empty($module.DESC)} 79 79 <p style="margin-left: 30px;"><i>{$module.DESC}</i></p> 80 {elseif $module.TYPE == 'MainBlock'}81 <p style="margin-left: 30px;"><input name="hidemb" type="checkbox" {if $HIDEMB}checked="checked"{/if}> {'Hide on home page'|@translate}</p>82 80 {/if} 83 81 -
extensions/PWG_Stuffs/include/class.inc.php
r7402 r7540 54 54 else return; 55 55 56 if (!$page['is_homepage']) 57 { 58 $query .= ' OR id = 0'; 59 } 60 56 61 $query .= ' 57 62 ORDER BY pos ASC;'; … … 73 78 { 74 79 $this->pos = 'end'; 75 if (!empty($module['datas'])76 and $datas = unserialize($module['datas'])77 and $datas['hide'])78 {79 add_event_handler('loc_end_index', 'hide_main_block');80 }81 80 continue; 82 81 } … … 103 102 $block['TEMPLATE'] = 'stuffs_'.strtolower($module['type']).'.tpl'; 104 103 $this->set_tpl_block($block, $module); 104 } 105 if ($this->pos == 'begin') 106 { 107 add_event_handler('loc_end_index', 'hide_main_block'); 105 108 } 106 109 }
Note: See TracChangeset
for help on using the changeset viewer.