[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/templates/acl/ -> acl.inc (source)

   1  <script type="text/javascript">
   2  <!--
   3  function selectRule(num)
   4  {
   5  <?php if (isset($js_right)): ?>
   6      var users = new Array(<?php echo $js_user ?>);
   7  
   8  <?php foreach ($js_right as $key => $val): ?>
   9      var <?php echo $key ?> = new Array(<?php echo $val ?>);
  10  <?php endforeach; ?>
  11  <?php endif; ?>
  12  
  13  <?php if ($canEdit): ?>
  14      if (num == <?php echo count($curr_acl) ?>) {
  15          resetForm();
  16      } else {
  17          document.acl.share_user.value = users[num];
  18          document.acl.share_user.disabled = true;
  19  <?php if (!empty($js_right)): ?>
  20  <?php foreach ($js_right as $key => $val): ?>
  21          if (<?php echo $key ?>[num] > 0) {
  22              document.acl.elements['acl[<?php echo $key ?>]'].checked = true;
  23          } else {
  24              document.acl.elements['acl[<?php echo $key ?>]'].checked = false;
  25          }
  26  <?php endforeach; ?>
  27  <?php endif; ?>
  28          document.acl.actionID.value = 'imp_acl_edit';
  29          document.acl.fbutton.value = '<?php echo addslashes(_("Modify")) ?>';
  30      }
  31  <?php endif; ?>
  32  }
  33  
  34  function resetForm()
  35  {
  36      document.acl.reset();
  37      document.acl.share_user.disabled = false;
  38      document.acl.actionID.value = 'imp_acl_set';
  39      document.acl.fbutton.value = '<?php echo addslashes(_("Create")) ?>';
  40      if (document.acl.number) {
  41          for (var i = 0; i < document.acl.number.length -1 ; i++) {
  42              document.acl.number[i].checked = false;
  43          }
  44      }
  45  }
  46  
  47  var loading;
  48  function ACLFolderChange(clear)
  49  {
  50      if (document.folders.folder[document.folders.folder.selectedIndex].value != '') {
  51          if (loading == null || clear != null) {
  52              loading = true;
  53              disableButtons();
  54              document.folders.submit();
  55          }
  56      }
  57  }
  58  
  59  function disableButtons() {
  60      if (document.acl.fbutton) {
  61          document.acl.fbutton.disabled = true;
  62      }
  63      if (document.acl.resetbut) {
  64          document.acl.resetbut.disabled = true;
  65      }
  66      if (document.acl.back) {
  67          document.acl.back.disabled = true;
  68      }
  69      if (document.acl.number) {
  70          for (var i = 0; i < document.acl.number.length; i++) {
  71              document.acl.number[i].disabled = true;
  72          }
  73      }
  74      return true;
  75  }
  76  
  77  
  78  // -->
  79  </script>
  80  
  81  <form method="post" name="folders" action="<?php echo Horde::applicationUrl('acl.php') ?>">
  82  <input type="hidden" name="actionID" value="" />
  83  <?php Util::pformInput() ?>
  84  <div class="header">
  85    <?php Prefs_UI::generateNavigationCell('acl') ?>
  86    <?php echo _("Share mail folders") ?>
  87  </div>
  88  
  89  <div class="header">
  90    <ul>
  91      <li>
  92        <?php echo Horde::link('#', _("Change Folder"), 'smallheader', '', 'ACLFolderChange(true); return false;') ?><?php echo Horde::img('shared.png', _("Change Folder")) ?></a><select name="folder" onchange="ACLFolderChange()"><?php echo $options ?></select>&nbsp;
  93      </li>
  94    </ul>
  95    <?php printf(_("Current access to %s"), String::convertCharset($folder, 'UTF7-IMAP')) ?>
  96  </div>
  97  </form>
  98  
  99  <form method="post" name="acl" action="<?php echo Horde::applicationUrl('acl.php') ?>">
 100    <input type="hidden" name="actionID" value="imp_acl_set" />
 101    <input type="hidden" name="folder" value="<?php echo $folder ?>" />
 102    <?php Util::pformInput() ?>
 103  <table cellspacing="0" width="100%">
 104  <?php if (!count($curr_acl)): ?>
 105    <tr>
 106      <td colspan="2" class="item leftAlign">
 107        <em><strong>&nbsp;<?php echo _("The current list of users with access to this folder could not be retrieved") ?></strong></em>
 108      </td>
 109    </tr>
 110  <?php else: ?>
 111  <?php $i = 1; foreach ($curr_acl as $index => $rule): ?>
 112    <tr>
 113      <td class="light rightAlign">
 114        <strong><?php echo $i++ ?>&nbsp;</strong>
 115      </td><td class="item leftAlign">
 116        <input class="item" type="radio" name="number" value="<?php echo $i-2 ?>" <?php if (in_array($index, $protected)) echo 'disabled ' ?>onclick="selectRule(<?php echo $i - 2 ?>)" />&nbsp;&nbsp;
 117        <strong><?php echo $index ?></strong>&nbsp;&nbsp;
 118      <?php foreach ($rule as $key => $val): ?><?php echo $key ?>,&nbsp;<?php endforeach; ?>
 119      </td>
 120    </tr>
 121  <?php endforeach; ?>
 122    <tr>
 123      <td class="light rightAlign">
 124        <strong><?php echo _("New") ?>&nbsp;</strong>
 125      </td><td class="item leftAlign">
 126        <input class="item" type="radio" checked name="number" value="<?php echo $i - 1 ?>" onclick="selectRule(<?php echo $i - 1 ?>)" />&nbsp;&nbsp;
 127      </td>
 128    </tr>
 129  <?php endif; ?>
 130  
 131    <tr>
 132      <td>&nbsp;</td>
 133    </tr>
 134    <tr>
 135      <td colspan="2" class="header">
 136        <span class="smallheader"><?php echo _("Grant access") ?></span>
 137      </td>
 138    </tr>
 139  
 140  <?php if ($canEdit): ?>
 141    <tr>
 142      <td class="light rightAlign">
 143        <strong><?php echo _("User") ?>&nbsp;</strong>
 144      </td><td class="item leftAlign">
 145        &nbsp;<input class="fixed" type="text" name="share_user" />
 146      </td>
 147    </tr>
 148  <?php foreach ($rights as $right => $desc): ?>
 149    <tr>
 150      <td class="light rightAlign">
 151        <strong><?php echo $right ?>&nbsp;:&nbsp;</strong>
 152      </td><td class="item leftAlign">
 153        <input type="checkbox" name="acl[<?php echo $right ?>]" />
 154      &nbsp;<?php echo $desc ?>
 155      </td>
 156    </tr>
 157  <?php endforeach; ?>
 158    <tr>
 159      <td>&nbsp;</td>
 160      <td class="header" valign="middle">
 161        <input type="button" class="button" name="fbutton" onclick="disableButtons(); document.acl.share_user.disabled = false; document.acl.submit();" value="<?php echo _("Create") ?>" />
 162        <input type="button" class="button" name="resetbut" onclick="resetForm()" value="<?php echo _("Reset") ?>" />
 163        <input type="button" class="button" name="back" onclick="disableButtons(); document.location.href='<?php echo $prefs_url ?>'" value="<?php echo _("Return to Options") ?>" />
 164      </td>
 165    </tr>
 166  
 167  <?php else: ?>
 168    <tr>
 169      <td colspan="2" class="item leftAlign">
 170        <em><strong>&nbsp;<?php echo _("You do not have permission to change access to this folder") ?></strong></em>
 171      </td>
 172    </tr>
 173    <tr>
 174      <td colspan="2" class="header" valign="middle">
 175        <input type="button" class="button" name="back" onclick="disableButtons(); document.location.href='<?php echo $prefs_url ?>'" value="<?php echo _("Return to Options") ?>" />
 176      </td>
 177    </tr>
 178  <?php endif; ?>
 179  </table>
 180  </form>


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics