Ignore:
Timestamp:
Nov 1, 2010, 3:16:26 PM (13 years ago)
Author:
patdenice
Message:

Main block can be hidden according to user status or user group.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/admin/add_module.php

    r6230 r7540  
    99load_language('plugin.lang', STUFFS_PATH);
    1010
    11 if (!isset($_GET['type']) or !is_dir(STUFFS_PATH . 'modules/' . $_GET['type']))
     11if (!isset($_GET['type']) or ($_GET['type'] != 'MainBlock' and !is_dir(STUFFS_PATH . 'modules/' . $_GET['type'])))
    1212{
    1313  die('Wrong parameters...');
     
    2424if (isset($_POST['submit']) and !is_adviser())
    2525{
    26   include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
     26  @include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
    2727  if (empty($page['errors']))
    2828  {
     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    }
    2937    if (empty($_POST['module_name']))
    3038    {
     
    105113  $template->assign(array(
    106114    'STUFFS_TITLE' => l10n('stuffs_edit_mod') . ' <i>' . trigger_event('render_stuffs_name', $module['name']) . '</i>',
     115    'MODULE_ID' => $_GET['edit'],
    107116    'MODULE_NAME' => $module['name'],
    108117    'DESC_VALUE' => (isset($module['descr']) ? $module['descr'] : ''),
     
    139148
    140149// Configuration du module
    141 include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
     150@include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
    142151
    143152$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/add_module.tpl'));
Note: See TracChangeset for help on using the changeset viewer.