setting.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. {include="header"}
  2. <div class="row">
  3. <div class="span3 bs-docs-sidebar">
  4. <ul class="nav nav-tabs nav-stacked">
  5. <li {if="isset($_['section']) && $_['section']=='plugin'"}class="active"{/if}><a href="setting.php?section=plugin"><i class="fa fa-angle-right"></i> Plugins</a></li>
  6. <li {if="isset($_['section']) && $_['section']=='user'"}class="active"{/if}><a href="setting.php?section=user"><i class="fa fa-angle-right"></i> Utilisateurs</a></li>
  7. <li {if="isset($_['section']) && $_['section']=='access'"}class="active"{/if}><a href="setting.php?section=access"><i class="fa fa-angle-right"></i> Accès</a></li>
  8. {function="Plugin::callHook("setting_menu", array())"}
  9. </ul>
  10. </div>
  11. <div class="span9">
  12. <!-- SECTION RANK -->
  13. {if="@$_['section']=='access'"}
  14. <div class="span9 accessBloc">
  15. {function="Plugin::callHook("access_pre_display", array(&$accesss))"}
  16. <h1>Rangs</h1>
  17. <p>Gestion des rangs du programme</p>
  18. <form action="action.php?action=access_add_rank" method="POST">
  19. <fieldset>
  20. <legend>{$description}</legend>
  21. <label for="labelRank">Libellé</label>
  22. {if="isset($id_modrank)"}<input type="hidden" name="id" value="{$id_modrank}">{/if}
  23. <input {if="isset($label_rank)"}value="{$label_rank}"{/if} type="text" id="labelRank" name="labelRank" placeholder="Libellé du rang…"/>
  24. <label for="descriptionRank">Description</label>
  25. <textarea name="descriptionRank" id="descriptionRank" placeholder="Description courte du rang…" >{if="isset($description_rank)"}{$description_rank}{/if}</textarea>
  26. <div class="clear"></div>
  27. <br/><button type="submit" class="btn">{$button}</button>
  28. </fieldset>
  29. <br/>
  30. </form>
  31. <table class="table table-striped table-bordered table-hover">
  32. <thead>
  33. <tr>
  34. <th>Libellé</th>
  35. <th>Description</th>
  36. <th></th>
  37. </tr>
  38. </thead>
  39. {loop="ranks"}
  40. <tr>
  41. <td>{$value->getLabel()}</td>
  42. <td>{$value->getDescription()}</td>
  43. <td><a class="btn btn-warning" href="setting.php?section=right&id={$value->getId()}"><i class="icon-white fa fa-check-circle-o"></i></a>
  44. <a class="btn btn-danger" href="setting.php?section=access&id_rank={$value->getId()}"><i class="fa fa-pencil icon-white"></i></a>
  45. <a class="btn btn-danger" href="action.php?action=access_delete_rank&id={$value->getId()}"><i class="fa fa-times icon-white"></i></a></td>
  46. </tr>
  47. {/loop}
  48. </table>
  49. </div>
  50. {/if}
  51. <!-- SECTION ACCES -->
  52. {if="@$_['section']=='right'"}
  53. <div class="span9 accessBloc">
  54. {function="Plugin::callHook("access_pre_display", array(&$accesss))"}
  55. <h1>Droits : {$rank->getLabel()}</h1>
  56. <p>Gestion des droits du rang <code>{$rank->getLabel()}</code></p>
  57. <table class="table table-striped table-bordered table-hover">
  58. <thead>
  59. <tr>
  60. <th>Section</th>
  61. <th>Ajout</th>
  62. <th>Consultation</th>
  63. <th>Modification</th>
  64. <th>Suppression</th>
  65. <th></th>
  66. </tr>
  67. </thead>
  68. {loop="$sections"}
  69. <tr>
  70. <td>{$value->getLabel()}</td>
  71. <td><input type="checkbox" onclick="setRankAccess({$rank->getId()},{$value->getId()},'c',this)" {if="@$rights[$value->getId()]['c']"}checked="checked"{/if} /></td>
  72. <td><input type="checkbox" onclick="setRankAccess({$rank->getId()},{$value->getId()},'r',this)" {if="@$rights[$value->getId()]['r']"}checked="checked"{/if} /></td>
  73. <td><input type="checkbox" onclick="setRankAccess({$rank->getId()},{$value->getId()},'u',this)" {if="@$rights[$value->getId()]['u']"}checked="checked"{/if} /></td>
  74. <td><input type="checkbox" onclick="setRankAccess({$rank->getId()},{$value->getId()},'d',this)" {if="@$rights[$value->getId()]['d']"}checked="checked"{/if} /></td>
  75. <td>
  76. <a class="btn btn-danger" title="supprimer les droits du rang pour cette section" href="action.php?action=access_delete_right&amp;id={$value->getId()}&amp;rank={$rank->getId()}"><i class="fa fa-times icon-white"></i></a>
  77. </td>
  78. </tr>
  79. {/loop}
  80. </table>
  81. </div>
  82. {/if}
  83. <!-- SECTION PLUGIN -->
  84. {if="@$_['section']=='plugin'"}
  85. <div class="span9 pluginBloc">
  86. <h1>Plugins</h1>
  87. <p>Voici la liste des plugins installés :</p>
  88. <ul class="nav nav-tabs">
  89. <li {if="@$_['block']=='actif' || !isset($_['block'])"}class="active"{/if}><a href="setting.php?section=plugin&block=actif"><i class="fa fa-angle-right"></i> Actif</a></li>
  90. <li {if="@$_['block']=='inactif'"}class="active"{/if}><a href="setting.php?section=plugin&block=inactif"><i class="fa fa-angle-right"></i> Inactif</a></li>
  91. <li {if="@$_['block']=='market'"}class="active"{/if}><a href="setting.php?section=plugin&block=market"><i class="fa fa-angle-right"></i> Market</a></li>
  92. </ul>
  93. {if="@$_['block']=='market'"}
  94. <br/><p>Recherchez et ajoutez les plugins proposés par la communauté<br/>en utilisant le formulaire ci dessous ! (<a href="http://market.idleman.fr/index.php?software=yana-server&amp;page=submit">Proposer un nouveau plugin</a>)</p>
  95. <form class="form-inline">
  96. <input type="text" id="keywordPlugin"> <button class="btn" id="btnSearchPlugin" onclick="searchPlugin($('#keywordPlugin').val());return false;">Rechercher</button>
  97. </form>
  98. <ul id="resultsPlugin"></ul>
  99. <br/><br/>
  100. {else}
  101. <ul class="pluginList">
  102. {if="count($plugins)==0"}
  103. Aucun plugin n'est installé pour le moment.
  104. {else}
  105. {loop="plugins"}
  106. {if="$value->getType()!='component' && $value->getState() == (@$_['block']=='inactif' ?0:1)"}
  107. <li>
  108. <ul>
  109. <li><h4>Nom: </h4>{$value->getName()}</li>
  110. <li><h4>Auteur: </h4><a href="mailto:{$value->getMail()}">{$value->getAuthor()}</a></li>
  111. <li><h4>Licence: </h4>{$value->getLicence()}</li>
  112. <li><h4>Version: </h4><code>{$value->getVersion()}</code></li>
  113. <li><h4>Site web: </h4><a href="{$value->getLink()}">{$value->getLink()}</a></li>
  114. <li>{$value->getDescription()}</li>
  115. <li><a href="action.php?action=changePluginState&plugin={$value->getUid()}&state={$value->getState()}&amp;block={$_['block']}" class="button">{$value->getState()=="0"?"Activer":"Désactiver"}</a></li>
  116. </ul>
  117. </li>
  118. {/if}
  119. {/loop}
  120. {/if}
  121. </ul>
  122. {/if}
  123. </div>
  124. {/if}
  125. <!-- SECTION USER -->
  126. {if="@$_['section']=='user'"}
  127. <div class="span9 userBloc">
  128. <h1>Utilisateurs</h1>
  129. <p>Gestion des utilisateurs du programme</p>
  130. <form action="action.php?action=user_add_user" method="POST">
  131. <fieldset>
  132. <legend>{$description}</legend>
  133. <div class="left">
  134. {if="isset($id_modusers)"}<input type="hidden" name="id" value="{$id_modusers}">{/if}
  135. <label for="loginUser">Identifiant</label>
  136. <input {if="isset($login)"}value="{$login}"{/if} type="text" id="loginUser" name="loginUser" placeholder="Identifiant utilisateur…"/>
  137. <label for="passwordUser">Mot de passe</label>
  138. <input type="password" name="passwordUser" id="passwordUser" />
  139. </div>
  140. <div class="left marginLeftMedium">
  141. <label for="nameUser">Nom</label>
  142. <input {if="isset($lastname)"}value="{$lastname}"{/if} type="text" id="nameUser" name="nameUser" placeholder="Nom"/>
  143. <label for="firstNameUser">Prenom</label>
  144. <input {if="isset($firstname)"}value="{$firstname}"{/if} type="text" id="firstNameUser" name="firstNameUser" placeholder="Prenom"/>
  145. </div>
  146. <div class="left marginLeftMedium">
  147. <label for="mailUser">E-mail</label>
  148. <input {if="isset($email)"}value="{$email}"{/if} type="text" id="mailUser" name="mailUser" placeholder="Email"/>
  149. <label for="rankUser">Rang</label>
  150. <select type="text" id="rankUser" name="rankUser">
  151. {loop="ranks"}
  152. <option {if="($userrank==$value->getId())"}selected{/if} value="{$value->getId()}">{$value->getLabel()}</option>
  153. {/loop}
  154. </select>
  155. </div>
  156. <div class="clear"></div>
  157. <br/><button type="submit" class="btn">{$button}</button>
  158. </fieldset>
  159. <br/>
  160. </form>
  161. <table class="table table-striped table-bordered table-hover">
  162. <thead>
  163. <tr>
  164. <th>Login</th>
  165. <th>Utilisateur</th>
  166. <th>Email</th>
  167. <th>Rang</th>
  168. <td></td>
  169. </tr>
  170. </thead>
  171. {loop="$users"}
  172. <tr>
  173. <td>{$value->getLogin()}</td>
  174. <td style="width:100px">{function="Functions::truncate($value->getFullName(),20)"}</td>
  175. <td><a href="mailto:{$value->getMail()}">{$value->getMail()}</a></td>
  176. <td>{$ranksLabel[$value->getRank()]}</td>
  177. <td>
  178. {if="$value->getId()!='' && $myUser->can('user','d')"}
  179. <a href="action.php?action=delete_user&amp;id={$value->getId()}" class="btn btn-danger"><i class="fa fa-times icon-white"></i></a>
  180. <a class="btn btn-danger" href="setting.php?section=user&id_user={$value->getId()}"><i class="fa fa-pencil icon-white"></i></a></td>
  181. {/if}
  182. </td>
  183. </tr>
  184. {/loop}
  185. </table>
  186. </div>
  187. {/if}
  188. <!-- SECTION DEBUG -->
  189. {if="@$_['section']=='debug'"}
  190. <div class="span9 accessBloc">
  191. <h1>Débug vocal</h1>
  192. <p>Test de débugages vocaux, si le client est bien connecté, yana à du monologuer</p>
  193. {/if}
  194. {function="Plugin::callHook("setting_bloc", array())"}
  195. </div>
  196. </div>
  197. {include="footer"}