settings.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. {include="header"}
  2. <!--
  3. @nom: settings
  4. @auteur: Idleman (idleman@idleman.fr)
  5. @description: Page de gestion de toutes les préférences/configurations administrateur
  6. -->
  7. {if="($configurationManager->get('articleDisplayAnonymous')=='1') || ($myUser!=false)"}
  8. <div id="main" class="wrapper clearfix settings">
  9. <div id="menuBar">
  10. <aside>
  11. <h3>{function="_t('FEED_OPTION')"}</h3>
  12. <ul>
  13. <li><a class="toggle" href="#manageBloc">{function="_t('FEED_MANAGING')"}</a></li>
  14. <li><a class="toggle" href="#synchronizeBloc">{function="_t('MANUAL_FEED_UPDATE')"}</a></li>
  15. <li><a class="toggle" href="#preferenceBloc">{function="_t('PREFERENCES')"}</a></li>
  16. <li><a class="toggle" href="#importBloc">{function="_t('IMPORT')"}</a></li>
  17. <li><a class="toggle" href="#exportBloc">{function="_t('EXPORT')"}</a></li>
  18. <li><a class="toggle" href="#bookBloc">{function="_t('BOOKMARKLET')"}</a></li>
  19. <li><a class="toggle" href="#pluginBloc">{function="_t('AVAILABLES_PLUGINS')"}</a></li>
  20. <li class="pointer" onclick="if(confirm('{function="_t('CONFIRM_TRASH_EVENTS')"}')){window.location='action.php?action=purge';}">{function="_t('TRASH_EVENTS')"}</li>
  21. </ul>
  22. <h3>{function="_t('PLUGINS_INSTALLED')"}</h3>
  23. <ul>
  24. {function="Plugin::callHook("setting_post_link", array(&$myUser))"}
  25. </ul>
  26. </aside>
  27. </div>
  28. <article>
  29. <section class="manageBloc">
  30. <h2>{function="_t('FEED_MANAGING')"} :</h2>
  31. <form action="action.php?action=addFeed" method="POST">
  32. <section class="addBloc">
  33. <h3>{function="_t('ADD_FEED')"}</h3>
  34. <p>{function="_t('FEED_RSS_LINK')"} : <input type="text" name="newUrl" placeholder="http://monflux.com/rss"/>&nbsp;
  35. <select name="newUrlCategory">
  36. {loop="$folders"}
  37. <option {if="$value->getId()==1"}selected="selected"{/if} value="{$value->getId()}">{$value->getName()}</option>
  38. {/loop}
  39. </select>
  40. <button>{function="_t('ADD')"}</button></p>
  41. </section>
  42. </form>
  43. <section class="addBloc">
  44. <h3>{function="_t('ADD_FOLDER')"}</h3>
  45. <form method="POST" action="action.php?action=addFolder">
  46. {function="_t('NEW_FOLDER')"} <input type="text" name="newFolder"> <button>{function="_t('ADD')"}</button>
  47. </form>
  48. </section>
  49. <section class="addBloc">
  50. <h3>{function="_t('FEED_OPTION')"}</h3>
  51. <span>{function="_t('FEED_OPTION_ISVERBOSE')"}</span>
  52. {if="$optionFeedIsVerbose==0"}
  53. <input class="" onclick="toggleOptionFeedVerbose(this,1)" type="checkbox" checked>
  54. {else}
  55. <input class="" onclick="toggleOptionFeedVerbose(this,0)" type="checkbox">
  56. {/if}
  57. </section>
  58. <ul class="clear nochip">
  59. {$feedsForFolder=""}
  60. {loop="$folders"}
  61. {$feedsForFolder=$value->getFeeds()}
  62. <li>{if="$value->getId()==1"}<a id="defaultFolder"></a>{/if}
  63. <h1 class="folder left" ><span>{$value->getName()}</span> ({function="count($feedsForFolder)"})
  64. <button onclick="renameFolder(this,{$value->getId()})">{function="_t('RENAME')"}</button>
  65. {if="$value->getId()!='1'"}
  66. <button onclick="if(confirm('{function="_t('CONFIRM_DELETE_FOLDER')"}'))window.location='action.php?action=removeFolder&amp;id={$value->getId()}'">{function="_t('DELETE')"}</button>
  67. {/if}
  68. <div class="clear"></div>
  69. </h1>
  70. <div class="clear"></div>
  71. <ul class="feedsList">
  72. {if="count($feeds)!=0"}
  73. {loop="$feedsForFolder"}
  74. {if="$value->getLastSyncInError()==0"}
  75. <li class="feedListItem">
  76. <span class="feedTitle js-feedTitle">
  77. <a href="index.php?action=selectedFeed&feed={$value2->getId();}">{function="Functions::truncate($value2->getName(),40)"}</a><a href="{$value2->getUrl()}" class="underlink">{$value2->getUrl()}</a>
  78. {else}
  79. <!-- feed dernière synchro en erreur -->
  80. <li class="feedListItem errorSync">
  81. <span class="feedTitle js-feedTitle" title="{function="_t('SYNCHRONISATION_ERROR')"}">
  82. <a class="inError" href="index.php?action=selectedFeed&feed={$value2->getId();}">{function="Functions::truncate($value2->getName(),40)"}</a><a href="{$value2->getUrl()}" class="underlink">{$value2->getUrl()}</a>
  83. {/if}
  84. </span>
  85. <div class="feedButtons">
  86. <button class="feedRename" onclick="renameFeed(this,{$value2->getId()})">{function="_t('RENAME')"}</button>
  87. <button class="feedDelete" onclick="if(confirm('{function="_t('CONFIRM_DELETE_FEED')"}')){window.location='action.php?action=removeFeed&id={$value2->getId()}';}">{function="_t('DELETE')"}</button>
  88. </div>
  89. <div class="feedAction"">
  90. <select class="feedFolder" onchange="changeFeedFolder(this,{$value2->getId()});">
  91. {loop="$folders"}
  92. <option {if="$value2->getFolder()==$value3->getId()"}selected="selected"{/if} value="{$value3->getId()}">{$value3->getName()}</option>
  93. {/loop}
  94. </select>
  95. {if="$optionFeedIsVerbose==0"}
  96. {if="$value2->getIsverbose()==0"}
  97. <input class="feedVerbose" onclick="toggleFeedVerbose(this,{$value2->getIsverbose()},{$value2->getId()})" type="checkbox" title="{function="_t('HIDE_FEED_IS_VERBOSE')"}">
  98. {else}
  99. <input class="feedVerbose" onclick="toggleFeedVerbose(this,{$value2->getIsverbose()},{$value2->getId()})" type="checkbox" title="{function="_t('HIDE_FEED_IS_VERBOSE')"}" checked>
  100. {/if}
  101. {else}
  102. {if="$value2->getIsverbose()==0"}
  103. <input class="feedVerbose" style="display: none;" onclick="toggleFeedVerbose(this,{$value2->getIsverbose()},{$value2->getId()})" type="checkbox" title="{function="_t('HIDE_FEED_IS_VERBOSE')"}">
  104. {else}
  105. <input class="feedVerbose" style="display: none;" onclick="toggleFeedVerbose(this,{$value2->getIsverbose()},{$value2->getId()})" type="checkbox" title="{function="_t('HIDE_FEED_IS_VERBOSE')"}" checked>
  106. {/if}
  107. {/if}
  108. </div>
  109. </li>
  110. {/loop}
  111. {/if}
  112. </ul>
  113. </li>
  114. {/loop}
  115. </ul>
  116. </section>
  117. <section class="synchronizeBloc">
  118. <h2>{function="_t('FEED_SYNCHRONISATION')"} :</h2>
  119. <iframe class="importFrame" src="action.php?action=synchronizeForm" name="idFrameSynchro" id="idFrameSynchro" width="100%" height="300" ></iframe>
  120. </section>
  121. {if="(isset($myUser)) && ($myUser!=false)"}
  122. <section class="preferenceBloc">
  123. <h2>{function="_t('PREFERENCES')"} :</h2>
  124. <form method="POST" action="action.php?action=updateConfiguration">
  125. <section>
  126. <h3>{function="_t('GENERALITY')"}</h3>
  127. <p><label for="root">{function="_t('PROJECT_ROOT')"} :</label> <input type="text" id="root" name="root" value="{$configurationManager->get('root')}"></p>
  128. <h4>{function="_t('LET_SLASH_AT_END')"}</h4>
  129. </section>
  130. <section>
  131. <h3>{function="_t('USER')"}</h3>
  132. <p><label for="login">{function="_t('LOGIN')"} :</label> <input type="text" id="login" name="login" value="{$myUser->getLogin()}"></p>
  133. <p><label for="password">{function="_t('PASSWORD')"} :</label> <input type="text" id="password" name="password" autocomplete="off" value="" placeholder="{function="_t('INSTALL_DISPLAY_CLEAR')"}"></p>
  134. <h4>{function="_t('LET_EMPTY_IF_NO_PASS_CHANGE')"}</h4>
  135. <h4>{function="_t('HOWTO_RESET_PASSWORD')"}</h4>
  136. </section>
  137. <section>
  138. <h3>{function="_t('SYNCHRONISATION')"}</h3>
  139. <p><input type="radio" {if="$synchronisationType=='auto'"} checked="checked" {/if} value="auto" id="synchronisationTypeComplete" name="synchronisationType"> <label for="synchronisationTypeComplete"><strong>
  140. {function="_t('AUTOMATIC_FULL')"} :</strong></label> {function="_t('AUTOMATIC_FULL_DESC')"}</p>
  141. <p><input type="radio" {if=" $synchronisationType=='graduate'"} checked="checked" {/if} value="graduate" id="synchronisationTypeGraduated" name="synchronisationType"> <label for="synchronisationTypeGraduated"><strong>{function="_t('AUTOMATIC_GRADUATE')"} :</strong></label> {function="_t('AUTOMATIC_GRADUATE_DESC')"}</p>
  142. <p><strong>{function="_t('SYNCHRONISATION_CODE')"} :</strong>
  143. {$synchronisationCode}
  144. </p>
  145. <p><strong>{function="_t('SYNCHRONISATION_OPTION')"}</strong>
  146. <fieldset>
  147. <legend>{function="_t('ENABLE_CACHE')"}</legend>
  148. <input type="radio" {if="$synchronisationEnableCache"} checked="checked" {/if} value="1" id="synchronisationEnableCacheYes" name="synchronisationEnableCache" /><label for="synchronisationEnableCacheYes">{function="_t('YES')"}</label>
  149. <input type="radio" {if="!$synchronisationEnableCache"} checked="checked" {/if} value="0" id="synchronisationEnableCacheNo" name="synchronisationEnableCache" /><label for="synchronisationEnableCacheNo">{function="_t('NO')"}</label>
  150. <p>{function="_t('ENABLE_CACHE_DESC')"}</p>
  151. </fieldset>
  152. <fieldset>
  153. <legend>{function="_t('FORCE_INTEGRATION')"}</legend>
  154. <input type="radio" {if="$synchronisationForceFeed"} checked="checked" {/if} value="1" id="synchronisationForceFeedYes" name="synchronisationForceFeed" /><label for="synchronisationForceFeedYes">{function="_t('YES')"}</label>
  155. <input type="radio" {if="!$synchronisationForceFeed"} checked="checked" {/if} value="0" id="synchronisationForceFeedNo" name="synchronisationForceFeed" /><label for="synchronisationForceFeedNo">{function="_t('NO')"}</label>
  156. <p>{function="_t('FORCE_INTEGRATION_DESC')"}</p>
  157. </fieldset>
  158. </p>
  159. </section>
  160. <section>
  161. {if="$myUser!=false"}
  162. <h3>{function="_t('PREFERENCES')"}</h3>
  163. <fieldset>
  164. <legend>{function="_t('ALLOW_ANONYMOUS_READ')"}</legend>
  165. <input type="radio" {if="$articleDisplayAnonymous=='1'"} checked="checked" {/if} value="1" id="articleDisplayAnonymousYes" name="articleDisplayAnonymous" /><label for="articleDisplayAnonymousYes">{function="_t('YES')"}</label>
  166. <input type="radio" {if="$articleDisplayAnonymous=='0'"} checked="checked" {/if} value="0" id="articleDisplayAnonymousNo" name="articleDisplayAnonymous" /><label for="articleDisplayAnonymousNo">{function="_t('NO')"}</label>
  167. <h4>{function="_t('ALLOW_ANONYMOUS_READ_DESC')"}</h4>
  168. </fieldset>
  169. <fieldset>
  170. <legend><label for="articlePerPages">{function="_t('EVENT_NUMBER_PER_PAGES')"}</label></legend>
  171. <input type="text" value="{$configurationManager->get('articlePerPages')}" id="articlePerPages" name="articlePerPages" size="4" />
  172. </fieldset>
  173. <fieldset>
  174. <legend>{function="_t('SORT_BY_RECENT_EVENT_HOME')"}</legend>
  175. <input type="radio" {if="$articleDisplayHomeSort"} checked="checked" {/if} value="1" id="articleDisplayHomeSortYes" name="articleDisplayHomeSort" /><label for="articleDisplayHomeSortYes">{function="_t('YES')"}</label>
  176. <input type="radio" {if="!$articleDisplayHomeSort"} checked="checked" {/if} value="0" id="articleDisplayHomeSortNo" name="articleDisplayHomeSort" /><label for="articleDisplayHomeSortNo">{function="_t('NO')"}</label>
  177. </fieldset>
  178. <fieldset>
  179. <legend>{function="_t('SORT_BY_RECENT_EVENT_FOLDER')"}</legend>
  180. <input type="radio" {if="$articleDisplayFolderSort"} checked="checked" {/if} value="1" id="articleDisplayFolderSortYes" name="articleDisplayFolderSort" /><label for="articleDisplayFolderSortYes">{function="_t('YES')"}</label>
  181. <input type="radio" {if="!$articleDisplayFolderSort"} checked="checked" {/if} value="0" id="articleDisplayFolderSorttNo" name="articleDisplayFolderSort" /><label for="articleDisplayFolderSortNo">{function="_t('NO')"}</label>
  182. </fieldset>
  183. <fieldset>
  184. <legend>{function="_t('SHOW_EVENT_LINK')"}</legend>
  185. <input type="radio" {if="$articleDisplayLink=='1'"} checked="checked" {/if}value="1" id="articleDisplayLinkYes" name="articleDisplayLink" /><label for="articleDisplayLinkYes">{function="_t('YES')"}</label>
  186. <input type="radio" {if="$articleDisplayLink=='0'"} checked="checked" {/if} value="0" id="articleDisplayLinkNo" name="articleDisplayLink" /><label for="articleDisplayLinkNo">{function="_t('NO')"}</label>
  187. </fieldset>
  188. <fieldset>
  189. <legend>{function="_t('SHOW_EVENT_DATE')"}</legend>
  190. <input type="radio" {if="$articleDisplayDate=='1'"} checked="checked" {/if} value="1" id="articleDisplayDateYes" name="articleDisplayDate" /><label for="articleDisplayDateYes">{function="_t('YES')"}</label>
  191. <input type="radio" {if="$articleDisplayDate=='0'"} checked="checked" {/if} value="0" id="articleDisplayDateNo" name="articleDisplayDate" /><label for="articleDisplayDateNo">{function="_t('NO')"}</label>
  192. </fieldset>
  193. <fieldset>
  194. <legend>{function="_t('SHOW_EVENT_AUTHOR')"}</legend>
  195. <input type="radio" {if="$articleDisplayAuthor=='1'"} checked="checked" {/if} value="1" id="articleDisplayAuthorYes" name="articleDisplayAuthor" /><label for="articleDisplayAuthorYes">{function="_t('YES')"}</label>
  196. <input type="radio" {if="$articleDisplayAuthor=='0'"} checked="checked" {/if} value="0" id="articleDisplayAuthorNo" name="articleDisplayAuthor" /><label for="articleDisplayAuthorNo">{function="_t('NO')"}</label>
  197. </fieldset>
  198. <fieldset>
  199. <legend>{function="_t('SHOW_EVENT_CONTENT')"}</legend>
  200. <input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='1'"} checked="checked" {/if} value="1" id="articleDisplayContentYes" name="articleDisplayContent" /><label for="articleDisplayContentYes">{function="_t('YES')"}</label>
  201. <input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='0'"} checked="checked" {/if} value="0" id="articleDisplayContentNo" name="articleDisplayContent" /><label for="articleDisplayContentNo">{function="_t('NO')"}</label>
  202. <div class="articleView"{$articleDisplayContent==0 ? 'style="display: none;"':''}>
  203. <input type="radio" {if="$articleView=='partial'"} checked="checked" {/if} value="partial" id="articleViewPartial" name="articleView"{if="$articleDisplayContent=='0'"} disabled="disabled"{/if} /><label for="articleViewPartial">{function="_t('PARTIAL')"}</label>
  204. <input type="radio" {if="$articleView=='complete'"} checked="checked" {/if} value="complete" id="articleViewComplete" name="articleView"{if="$articleDisplayContent=='0'"} disabled="disabled"{/if} /><label for="articleViewComplete">{function="_t('FULL')"}</label>
  205. </div>
  206. <h4>{function="_t('SHOW_PARTIAL_CONTENT_DESC')"}</h4>
  207. </fieldset>
  208. <fieldset>
  209. <legend>{function="_t('KEEP_LAST_X_EVENTS_FEED',array('<input type="text" value="'.$configurationManager->get('feedMaxEvents').'" name="feedMaxEvents" size="4" />'))"}</legend>
  210. <h4>{function="_t('KEEP_LAST_X_EVENTS_FEED_DESC')"}</h4>
  211. </fieldset>
  212. </section>
  213. <button name="installButton">{function="_t('SAVE')"}</button>
  214. </form>
  215. {else}
  216. <p>{function="_t('YOU_MUST_BE_CONNECTED_BOOKMARK')"}</p>
  217. {/if}
  218. </section>
  219. {/if}
  220. <section class="importBloc">
  221. <h2>{function="_t('IMPORT_FEED_OPML_FORMAT')"}</h2>
  222. <iframe class="importFrame" src="action.php?action=importForm" name="idFrame" id="idFrame" width="100%" height="300" ></iframe>
  223. </section>
  224. <section class="exportBloc">
  225. <form action="action.php?action=exportFeed" method="POST">
  226. <h2>{function="_t('EXPORT_FEED_OPML_FORMAT')"}</h2>
  227. <p>{function="_t('OPML_FILE')"} : <button name="exportButton">{function="_t('EXPORT')"}</button></p>
  228. </form>
  229. </section>
  230. <section class="bookBloc">
  231. <h2>{function="_t('USE_BOOKMARK')"} :</h2>
  232. {if="$myUser!=false"}
  233. <a class="button" href="javascript:document.location='{$configurationManager->get('root')}action.php?action=login&newUrl='+escape(document.location)+'&usr={function="$myUser->getToken()"}'">+ {function="_t('ADD_TO_LEED')"}</a>
  234. <p>{function="_t('USE_BOOKMARK_DESC')"}</p>
  235. {else}
  236. <p>{function="_t('YOU_MUST_BE_CONNECTED_BOOKMARK')"}</p>
  237. {/if}
  238. </section>
  239. <section class="pluginBloc">
  240. <h2>{function="_t('PLUGINS')"} :</h2>
  241. <p>{function="_t('CAN_DOWNLOAD_PLUGINS')"} : <a href="https://github.com/ldleman/Leed-market/"> Leed Market</a>.</p>
  242. <h3>{function="_t('AVAILABLE_PLUGIN_LIST')"} :</h3>
  243. {if="$myUser!=false"}
  244. <ul class="pluginList">
  245. {if="count($plugins)==0"}
  246. {function="_t('NO_INSTALLED_PLUGINS')"}
  247. {else}
  248. {loop="$plugins"}
  249. <li>
  250. <ul>
  251. <li><h4>{function="_t('NAME')"}: </h4>{$value->getName()}</li>
  252. <li><h4>{function="_t('AUTHOR')"}: </h4><a href="mailto:{$value->getMail()}">{$value->getAuthor()}</a></li>
  253. <li><h4>{function="_t('LICENCE')"}: </h4>{$value->getLicence()}</li>
  254. <li><h4>{function="_t('VERSION')"}: </h4><code>{$value->getVersion()}</code></li>
  255. <li><h4>{function="_t('SITE')"}: </h4><a href="{$value->getLink()}">{$value->getLink()}</a></li>
  256. <li>{$value->getDescription()}</li>
  257. <li><a href="action.php?action=changePluginState&plugin={$value->getUid()}&state={$value->getState()}" class="button">{$value->getState()=="0"?_t('ENABLE'):_t('DISABLE')}</a></li>
  258. </ul>
  259. </li>
  260. {/loop}
  261. {/if}
  262. </ul>
  263. {else}
  264. <p>{function="_t('YOU_MUST_BE_CONNECTED_PLUGIN')"}</p>
  265. {/if}
  266. </section>
  267. {function="Plugin::callHook("setting_post_section", array(&$myUser))"}
  268. </article>
  269. </div> <!-- #main -->
  270. {else}
  271. <div id="main" class="wrapper clearfix">
  272. <article>
  273. <h3>{function="_t('YOU_MUST_BE_CONNECTED_FEED')"}</h3>
  274. <p>{function="_t('IF_ADMIN_THEN_CONFIG')"}</p>
  275. </article>
  276. </div>
  277. {/if}
  278. {include="footer"}