Ignore:
Timestamp:
Dec 17, 2010, 8:41:01 PM (13 years ago)
Author:
Whiler
Message:

Tabs removed: All in one page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LCAS/trunk/admin/LCAS_admin.php

    r8164 r8181  
    1414//ini_set('display_errors', true);
    1515
    16 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    17 include_once (PHPWG_ROOT_PATH.'/include/constants.php');
     16//include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
     17include_once(PHPWG_ROOT_PATH.'include/constants.php');
     18include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    1819$my_base_url = get_admin_plugin_menu_link(__FILE__);
    1920
     
    2122load_language('help/plugin.lang', LCAS_PATH);
    2223
    23 $page['global'] = array();
    2424$error = array();
    25 $pattern = '/;/';
    26 $replacement = '.';
    27 
    28 $LCAS_Password_Test_Score = 0;
    29 $LCAS_Exclusionlist_Error = false;
    30 
    31 // +-----------------------------------------------------------------------+
    32 // |                            Tabssheet                                  |
    33 // +-----------------------------------------------------------------------+
    34 if (!isset($_GET['tab']))
    35         $page['tab'] = 'global';
    36 else
    37   $page['tab'] = $_GET['tab'];
    38 
    39 $tabsheet = new tabsheet();
    40 $tabsheet->add('global',
    41                l10n('LCAS_Tab_Global'),
    42                $my_base_url.'&tab=global');
    43   $tabsheet->add('userlist',
    44                  l10n('LCAS_Tab_UserList'),
    45                  $my_base_url.'&tab=userlist');
    46 $tabsheet->select($page['tab']);
    47 $tabsheet->assign();
    48 
    4925
    5026// +-----------------------------------------------------------------------+
     
    5329$plugin =  LCAS_PluginInfos(LCAS_PATH);
    5430$version = $plugin['version'];
    55 
    56 // +-----------------------------------------------------------------------+
    57 // |                            Tabssheet select                           |
    58 // +-----------------------------------------------------------------------+
    59 
    60 switch ($page['tab'])
    61 {
    62 // *************************************************************************
    63 // +-----------------------------------------------------------------------+
    64 // |                           Global Config                               |
    65 // +-----------------------------------------------------------------------+
    66 // *************************************************************************
    67   case 'global':
    6831
    6932        if (isset($_POST['submit']) and !is_adviser() and isset($_POST['LCAS_Case_Sensitive']) and isset($_POST['LCAS_Accent_Sensitive']) )
     
    9154  }
    9255
     56        $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']);
    9357
    94   $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']);
    95 
    96 
    97 /* Save last opened paragraph in configuration tab */
    98   $nb_para=(isset($_POST["nb_para"])) ? $_POST["nb_para"]:"";
    99   $nb_para2=(isset($_POST["nb_para2"])) ? $_POST["nb_para2"]:"";
    100 
    101   $template->assign(
    102     array(
    103     'nb_para'                        => $nb_para,
    104     'nb_para2'                       => $nb_para2,
    105     'LCAS_VERSION'                   => $version,
    106     'LCAS_PATH'                      => LCAS_PATH,
    107     'PWG_insensitive_case_logon'     => $conf['insensitive_case_logon']? 'true'              : 'false',
    108                 'LCAS_Case_Sensitive_TRUE'       => $conf_LCAS[0]=='true'          ? 'checked="checked"' : '' ,
    109                 'LCAS_Case_Sensitive_FALSE'      => $conf_LCAS[0]=='false'         ? 'checked="checked"' : '' ,
    110                 'LCAS_Accent_Sensitive_TRUE'     => $conf_LCAS[1]=='true'          ? 'checked="checked"' : '' ,
    111                 'LCAS_Accent_Sensitive_FALSE'    => $conf_LCAS[1]=='false'         ? 'checked="checked"' : ''
    112     )
    113   );
    114 
    115 
    116 // +-----------------------------------------------------------------------+
    117 // |                             errors display                            |
    118 // +-----------------------------------------------------------------------+
    119   if (isset ($errors) and count($errors) != 0)
    120   {
    121           $template->assign('errors',array());
    122           foreach ($errors as $error)
    123           {
    124                   array_push($page['errors'], $error);
    125                 }
    126         } 
    127 
    128 // +-----------------------------------------------------------------------+
    129 // |                           templates display                           |
    130 // +-----------------------------------------------------------------------+
    131   $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/global.tpl');
    132   $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    133 
    134   break;
    135 
    136 
    137 // *************************************************************************
    138 // +-----------------------------------------------------------------------+
    139 // |                           Users list page                             |
    140 // +-----------------------------------------------------------------------+
    141 // *************************************************************************
    142   case 'userlist':
    143  
    144   $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']);
    145  
    14658  if ((isset($conf_LCAS[0]) and $conf_LCAS[0]=='true') || (isset($conf_LCAS[1]) and $conf_LCAS[1]=='true'))
    14759  {
     
    14961// |                           initialization                              |
    15062// +-----------------------------------------------------------------------+
    151 
    152                 if (!defined('PHPWG_ROOT_PATH'))
    153     {
    154         die('Hacking attempt!');
    155     }
    156          
    157     include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    158 
    159 // +-----------------------------------------------------------------------+
    160 // | Check Access and exit when user status is not ok                      |
    161 // +-----------------------------------------------------------------------+
    162                 check_status(ACCESS_ADMINISTRATOR);
    16363
    16464    $lcas_UserToUpdate = -1;
     
    254154                } 
    255155
     156  }
     157
     158
     159  $template->assign(
     160    array(
     161    'LCAS_VERSION'                   => $version,
     162    'LCAS_PATH'                      => LCAS_PATH,
     163    'PWG_insensitive_case_logon'     => $conf['insensitive_case_logon']? 'true'              : 'false',
     164                'LCAS_Case_Sensitive_TRUE'       => $conf_LCAS[0]=='true'          ? 'checked="checked"' : '' ,
     165                'LCAS_Case_Sensitive_FALSE'      => $conf_LCAS[0]=='false'         ? 'checked="checked"' : '' ,
     166                'LCAS_Accent_Sensitive_TRUE'     => $conf_LCAS[1]=='true'          ? 'checked="checked"' : '' ,
     167                'LCAS_Accent_Sensitive_FALSE'    => $conf_LCAS[1]=='false'         ? 'checked="checked"' : ''
     168    )
     169  );
     170
     171
     172// +-----------------------------------------------------------------------+
     173// |                             errors display                            |
     174// +-----------------------------------------------------------------------+
     175  if (isset ($errors) and count($errors) != 0)
     176  {
     177          $template->assign('errors',array());
     178          foreach ($errors as $error)
     179          {
     180                  array_push($page['errors'], $error);
     181                }
     182        } 
     183
    256184// +-----------------------------------------------------------------------+
    257185// |                           templates display                           |
    258186// +-----------------------------------------------------------------------+
    259                 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/userlist.tpl');
    260     $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');         
    261   }
    262   else
    263   {
    264                 array_push($page['errors'], l10n('LCAS_Err_Userlist_Settings'));
    265   }
    266   break;
     187  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/global.tpl');
     188  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    267189
    268 }
    269190?>
Note: See TracChangeset for help on using the changeset viewer.