Changeset 8181


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

Tabs removed: All in one page

Location:
extensions/LCAS/trunk
Files:
4 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?>
  • extensions/LCAS/trunk/admin/template/global.tpl

    r8148 r8181  
    11{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    22{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
     3{known_script id="jquery.tablesorter" src=$LCAS_PATH|@cat:"admin/template/js/jquery.tablesorter.js"}
     4{known_script id="jquery.tablesorter.pager" src=$LCAS_PATH|@cat:"admin/template/js/jquery.tablesorter.pager.js"}
    35
    46{html_head}<link rel="stylesheet" type="text/css" href="{$LCAS_PATH}admin/template/lcas.css">{/html_head}
     
    2426  {rdelim}
    2527{rdelim}
     28$(document).ready(function()
     29    {ldelim}
     30      $("#sorting")
     31      .tablesorter({ldelim}sortList:[[3,0]], headers: {ldelim} 1: {ldelim} sorter: false {rdelim}, 4: {ldelim} sorter: false {rdelim}, 5: {ldelim} sorter: false {rdelim} {rdelim} {rdelim})
     32      .tablesorterPager({ldelim}container: $("#pager"), positionFixed: false, size: 20, totalPages: 0{rdelim});
     33    {rdelim}
     34);
     35function UpdateAUser(UserId) {ldelim}
     36        document.UserList.UserToUpdate.value=UserId;document.UserList.submit();
     37{rdelim}
    2638</script>
    2739
     
    3244<form method="post" action="" class="general">
    3345
    34   <p>
    35     <input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}>
    36   </p>
    37 
    3846  <input name="nb_para" id="nb_para" type="text" value="{$nb_para}" style="display:none">
    3947  <input name="nb_para2" id="nb_para2" type="text" value="{$nb_para2}" style="display:none">
    40 
    4148
    4249  <div id="instructionConfig2" class="instructionBlock" >
     
    7784        </ul>
    7885      </fieldset>
     86            <div style="text-align: center;"><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
    7987    </div>
    8088  </div>
    8189
    82 
    83   <p>
    84     <input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} >
    85   </p>
    8690</form>
    8791
    88   <div id="currentPWGConfig" class="instructionBlock" >
     92<br/><br/>
    8993
    90     <div id="currentPWGConfig_header" class="instructionBlockHeader">
    91       <span class="cluetip" title="{'LCAS_currentPWGConfigTitle'|translate}|{'LCAS_currentPWGConfigTitle_d'|translate}">
    92         {'LCAS_currentPWGConfigHeader'|@translate}
    93       </span>
    94     </div>
    95  
    96     <div id="Config2" class="instructionBlockContent" style="display:block">
    97       <fieldset>
    98         <ul>
    99           <li>
    100             <label class="cluetip" title="{'LCAS_currentPWGConfig'|translate}|{'LCAS_currentPWGConfig_d'|translate}">
    101               $conf['insensitive_case_logon'] =
     94<div id="usersToBeUpdated" class="instructionBlock" >
     95
     96  <div id="usersToBeUpdated_header" class="instructionBlockHeader">
     97    <span class="cluetip" title="{'LCAS_userlistTitle'|translate}|{'LCAS_userlistTitle_d'|translate}">
     98      {'LCAS_UserList_Title'|@translate}
     99    </span>
     100  </div>
     101  <div id="Config2" class="instructionBlockContent" style="display:block">
     102                <fieldset>
     103                  <form method="post" name="UserList" id="UserList" action="" class="general">
     104                        <input type="hidden" id="UserToUpdate" name="UserToUpdate" value="-1" />
     105                {if count($users) > 0}
     106                      <table id="sorting" class="table2" width="97%" summary="">
     107                                        <thead>
     108                                        <tr class="throw">
     109                                        <th>{'Username'|@translate}</th>
     110                            <th>{'Profile'|@translate}</th>
     111                                        <th>{'Email address'|@translate}</th>
     112                                        <th>{'LCAS_Compare_value_h'|@translate}</th>
     113                            <th>{'LCAS_Update_h'|@translate}</th>
     114                            <th>{'LCAS_Notify_h'|@translate}</th>
     115                                        </tr>
     116                                        </thead>
     117                        <tbody>
     118                        {foreach from=$users item=user name=users_loop}
     119                          <tr class="{if $smarty.foreach.users_loop.index is odd}row1{else}row2{/if}">
     120                            <td><input class="LCAS_textfields" type="text" name="user-{$user.ID}" id="user-{$user.ID}" value="{$user.USERNAME}" /></td>
     121                            <td style="text-align:center;"><a href="./admin.php?page=profile&amp;user_id={$user.ID}" title="{'Profile'|@translate}" onclick="window.open(this.href); return false;"><img src="{$LCAS_PATH}admin/template/icon/edit_s.png"></a></td>
     122                            <td>{$user.EMAIL}</td>
     123                {if $user.DISPLAY == 'orange'}
     124                            <td style="color:orange;text-align:center;">{$user.COMPARE}</td>
     125                {else}
     126                            <td style="text-align:center;">{$user.COMPARE}</td>
     127                {/if}
     128                            <td style="text-align:center;"><a href="javascript:UpdateAUser({$user.ID});">{'LCAS_Update_User'|@translate}</a></td>
     129                            <td style="text-align:center;"><a href="javascript:alert('to do - {$user.ID}');">{'LCAS_Send_Email'|@translate}</a></td>
     130                            {foreach from=$user.plugin_columns item=data}
     131                              <td>{$data}</td>
     132                            {/foreach}                         
     133                          </tr>
     134                        {/foreach}
     135                        </tbody>
     136                      </table>
     137                <div id="pager" class="pager">
     138                        <form>
     139                                <img src="{$LCAS_PATH}admin/template/icon/first.png" class="first">
     140                                <img src="{$LCAS_PATH}admin/template/icon/prev.png" class="prev">
     141                                <input type="text" class="pagedisplay">
     142                                <img src="{$LCAS_PATH}admin/template/icon/next.png" class="next">
     143                                <img src="{$LCAS_PATH}admin/template/icon/last.png" class="last">
     144                                <select class="pagesize">
     145                                        <option  value="10">10</option>
     146                                        <option selected="selected" value="20">20</option>
     147                                        <option value="30">30</option>
     148                                        <option value="40">40</option>
     149                                </select>
     150                        </form>
     151                </div>
     152                        <br>
     153                {else}
     154                <div>
     155                        {'LCAS_No_User'|@translate}
     156                </div>
     157                {/if}
     158                </form>
     159                </fieldset>
     160
     161  </div>
     162</div>
     163<br/><br/>
     164<div id="currentPWGConfig" class="instructionBlock" >
     165
     166  <div id="currentPWGConfig_header" class="instructionBlockHeader">
     167    <span class="cluetip" title="{'LCAS_currentPWGConfigTitle'|translate}|{'LCAS_currentPWGConfigTitle_d'|translate}">
     168      {'LCAS_currentPWGConfigHeader'|@translate}
     169    </span>
     170  </div>
     171
     172  <div id="Config2" class="instructionBlockContent" style="display:block">
     173    <fieldset>
     174      <ul>
     175        <li>
     176          <label class="cluetip" title="{'LCAS_currentPWGConfig'|translate}|{'LCAS_currentPWGConfig_d'|translate}">
     177            $conf['insensitive_case_logon'] =
    102178{if $PWG_insensitive_case_logon == 'true'}
    103179        <span style="color: green;">{$PWG_insensitive_case_logon}</span>;
     
    105181        <span style="color: red;">{$PWG_insensitive_case_logon}</span>;
    106182{/if}
    107              
    108              
    109              
    110             </label>
    111             <br><br>
    112           </li>
    113         </ul>
    114       </fieldset>
    115     </div>
     183          </label>
     184          <br><br>
     185        </li>
     186      </ul>
     187    </fieldset>
    116188  </div>
     189</div>
    117190
    118 
    119 <fieldset>
    120   {'LCAS_Support_txt'|@translate}
    121 </fieldset>
    122191
    123192<script type="text/javascript">
  • extensions/LCAS/trunk/language/en_UK/plugin.lang.php

    r8164 r8181  
    5555$lang['LCAS_save_config'] = 'Paramètres enregistrés<br/>Veuillez vérifier les éventuels utilisateurs problématiques sur le second onglet.';
    5656
     57$lang['submit'] = 'Sauvegarder les paramètres';
     58
    5759?>
  • extensions/LCAS/trunk/language/fr_FR/plugin.lang.php

    r8174 r8181  
    5353$lang['LCAS_save_config'] = 'Paramètres enregistrés<br/>Veuillez vérifier les éventuels utilisateurs problématiques sur le second onglet.';
    5454
     55$lang['submit'] = 'Sauvegarder les paramètres';
     56
     57
    5558?>
Note: See TracChangeset for help on using the changeset viewer.