index.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. {include="header"}
  2. <!--
  3. @nom: index
  4. @auteur: Idleman (idleman@idleman.fr)
  5. @description: Page d'accueil et de lecture des flux
  6. -->
  7. {if="($configurationManager->get('articleDisplayAnonymous')=='1') || ($myUser!=false)"}
  8. <div id="helpPanel">
  9. <h3>Raccourcis clavier</h3>
  10. <ul>
  11. <li>{function="_t('HELP_M')"}</li>
  12. <li>{function="_t('HELP_L')"}</li>
  13. <li>{function="_t('HELP_S')"}</li>
  14. <li>{function="_t('HELP_N')"}</li>
  15. <li>{function="_t('HELP_V')"}</li>
  16. <li>{function="_t('HELP_P')"}</li>
  17. <li>{function="_t('HELP_SPC')"}</li>
  18. <li>{function="_t('HELP_K')"}</li>
  19. <li>{function="_t('HELP_O_ENTER')"}</li>
  20. <li>{function="_t('HELP_H')"}</li>
  21. </ul>
  22. </div>
  23. <div id="main" class="wrapper clearfix index">
  24. <!-- -->
  25. <!-- MENU -->
  26. <!-- -->
  27. <div id="menuBar">
  28. {function="Plugin::callHook("menu_pre_folder_menu", array(&$myUser))"}
  29. <aside>
  30. <!-- TITRE MENU + OPTION TOUT MARQUER COMME LU -->
  31. <h3 class="left">{function="_t('FEED')"}</h3> <button style="margin: 25px 0px 0px 10px;" onclick="if(confirm('{function="_t('CONFIRM_MARK_ALL_AS_READ')"}'))window.location='action.php?action=readAll'">{function="_t('MARK_ALL_AS_READ')"}</button>
  32. <button class="right" onclick="toggleUnreadFeedFolder(this,{$displayOnlyUnreadFeedFolder_reverse});" title="{function="_t('DISPLAY_ONLY_UNREAD_FEEDFOLDER')"}" style="margin: 25px 4px 0px 10px;">&#8597;</button>
  33. {function="Plugin::callHook("menu_post_header_options", array(&$myUser))"}
  34. <ul class="clear">
  35. <!--Pour chaques dossier-->
  36. {loop="folders"}
  37. {$feeds=""}
  38. <!--on récupere tous les flux lié au dossier-->
  39. {if="isset($allFeedsPerFolder[$value->getId()])"}
  40. {$feeds=$allFeedsPerFolder[$value->getId()]}
  41. {/if}
  42. {if="isset($allEvents[$value->getId()])"}
  43. {$unreadEventsForFolder=$allEvents[$value->getId()]}
  44. {/if}
  45. <!-- DOSSIER -->
  46. <li>
  47. {if="$displayOnlyUnreadFeedFolder=='true'"}
  48. <!-- affichage uniquement des dossiers comportant des articles non lus -->
  49. {if="$unreadEventsForFolder>0"}
  50. <!-- cas de dossier avec des non lus -->
  51. <h1 class="folder">
  52. {function="Plugin::callHook("menu_pre_folder_link", array(&$value))"}
  53. <a title="{function="_t('READ_FOLDER_ITEMS')"}" href="index.php?action=selectedFolder&amp;folder={$value->getId()}">{$value->getName()}</a> <a class="readFolder" title="{function="_t('FOLD_UNFOLD_FOLDER')"}" onclick="toggleFolder(this,{$value->getId()});" >{if="!$value->getIsopen()"}{function="_t('UNFOLD')"}{else}{function="_t('FOLD')"}{/if}</a> {if="$unreadEventsForFolder!=0"}<a class="unreadForFolder" title="{function="_t('MARK_AS_READ_FOLDER_ITEMS',array($unreadEventsForFolder))"}" onclick="if(confirm('{function="_t('READ_ALL_FOLDER_CONFIRM')"}'))window.location='action.php?action=readFolder&amp;folder={$value->getId()}';">{$unreadEventsForFolder} {function="_t('UNREAD')"}</a>{/if}
  54. {function="Plugin::callHook("menu_post_folder_link", array(&$value))"}
  55. </h1>
  56. {else}
  57. <!-- cas de dossier sans non lus -->
  58. <h1 class="folder hidefeed" style="display:none;">
  59. {function="Plugin::callHook("menu_pre_folder_link", array(&$value))"}
  60. <a title="{function="_t('READ_FOLDER_ITEMS')"}" href="index.php?action=selectedFolder&amp;folder={$value->getId()}">{$value->getName()}</a> <a class="readFolder" title="{function="_t('FOLD_UNFOLD_FOLDER')"}" onclick="toggleFolder(this,{$value->getId()});" >{if="!$value->getIsopen()"}{function="_t('UNFOLD')"}{else}{function="_t('FOLD')"}{/if}</a> {if="$unreadEventsForFolder!=0"}<a class="unreadForFolder" title="{function="_t('MARK_AS_READ_FOLDER_ITEMS',array($unreadEventsForFolder))"}" onclick="if(confirm('{function="_t('READ_ALL_FOLDER_CONFIRM')"}'))window.location='action.php?action=readFolder&amp;folder={$value->getId()}';">{$unreadEventsForFolder} {function="_t('UNREAD')"}</a>{/if}
  61. {function="Plugin::callHook("menu_post_folder_link", array(&$value))"}
  62. </h1>
  63. {/if}
  64. {else}
  65. <!-- affichage de tous les dossiers -->
  66. {if="$unreadEventsForFolder>0"}
  67. <!-- cas de dossier avec des non lus -->
  68. <h1 class="folder">
  69. {function="Plugin::callHook("menu_pre_folder_link", array(&$value))"}
  70. <a title="{function="_t('READ_FOLDER_ITEMS')"}" href="index.php?action=selectedFolder&amp;folder={$value->getId()}">{$value->getName()}</a> <a class="readFolder" title="{function="_t('FOLD_UNFOLD_FOLDER')"}" onclick="toggleFolder(this,{$value->getId()});" >{if="!$value->getIsopen()"}{function="_t('UNFOLD')"}{else}{function="_t('FOLD')"}{/if}</a> {if="$unreadEventsForFolder!=0"}<a class="unreadForFolder" title="{function="_t('MARK_AS_READ_FOLDER_ITEMS',array($unreadEventsForFolder))"}" onclick="if(confirm('{function="_t('READ_ALL_FOLDER_CONFIRM')"}'))window.location='action.php?action=readFolder&amp;folder={$value->getId()}';">{$unreadEventsForFolder} {function="_t('UNREAD')"}</a>{/if}
  71. {function="Plugin::callHook("menu_post_folder_link", array(&$value))"}
  72. </h1>
  73. {else}
  74. <!-- cas de dossier sans non lus donc à cacher si on passe dans l'autre mode -->
  75. <h1 class="folder hidefeed">
  76. {function="Plugin::callHook("menu_pre_folder_link", array(&$value))"}
  77. <a title="{function="_t('READ_FOLDER_ITEMS')"}" href="index.php?action=selectedFolder&amp;folder={$value->getId()}">{$value->getName()}</a> <a class="readFolder" title="{function="_t('FOLD_UNFOLD_FOLDER')"}" onclick="toggleFolder(this,{$value->getId()});" >{if="!$value->getIsopen()"}{function="_t('UNFOLD')"}{else}{function="_t('FOLD')"}{/if}</a> {if="$unreadEventsForFolder!=0"}<a class="unreadForFolder" title="{function="_t('MARK_AS_READ_FOLDER_ITEMS',array($unreadEventsForFolder))"}" onclick="if(confirm('{function="_t('READ_ALL_FOLDER_CONFIRM')"}'))window.location='action.php?action=readFolder&amp;folder={$value->getId()}';">{$unreadEventsForFolder} {function="_t('UNREAD')"}</a>{/if}
  78. {function="Plugin::callHook("menu_post_folder_link", array(&$value))"}
  79. </h1>
  80. {/if}
  81. {/if}
  82. <!-- FLUX DU DOSSIER -->
  83. <ul {if="!$value->getIsopen()"}style="display:none;"{/if}>
  84. {if="count($feeds)!=0"}
  85. {loop="feeds"}
  86. {if="$displayOnlyUnreadFeedFolder=='true'"}
  87. <!-- Affichage des feeds ayant des articles non lus -->
  88. {if="isset($unread[$value2['id']])"}
  89. {if="$feedState->getById($value2['id'])->getLastSyncInError()==0"}
  90. <li>
  91. {else}
  92. <li class="errorSync" title="{function="_t('SYNCHRONISATION_ERROR')"}">
  93. {/if}
  94. {function="Plugin::callHook("menu_pre_feed_link", array(&$value))"} <a href="index.php?action=selectedFeed&amp;feed={$value2['id']}" title="{$value2['url']}">{function="Functions::truncate($value2['name'],37)"} </a>
  95. <button class="right" style="margin:5px 0 0 10px;" onclick="if(confirm('{function="_t('CONFIRM_MARK_FEED_AS_READ')"}'))window.location='action.php?action=readAll&amp;feed={$value2['id']}';">
  96. <span title="{function="_t('MARK_AS_READ')"}">{$unread[$value2['id']]}</span>
  97. </button>
  98. {function="Plugin::callHook("menu_post_feed_link", array(&$value))"}
  99. </li>
  100. {else}
  101. <!-- On cache les feeds n'ayant pas d'article non lus -->
  102. {if="$feedState->getById($value2['id'])->getLastSyncInError()==0"}
  103. <li class="hidefeed" style="display:none;">
  104. {else}
  105. <li class="hidefeed errorSync" style="display:none;" title="{function="_t('SYNCHRONISATION_ERROR')"}">
  106. {/if}
  107. {function="Plugin::callHook("menu_pre_feed_link", array(&$value))"} <a href="index.php?action=selectedFeed&amp;feed={$value2['id']}" title="{$value2['url']}">{function="Functions::truncate($value2['name'],37)"} </a>
  108. {if="isset($unread[$value2['id']])"}
  109. <button class="right" style="margin:5px 0 0 10px;" onclick="if(confirm('{function="_t('CONFIRM_MARK_FEED_AS_READ')"}'))window.location='action.php?action=readAll&amp;feed={$value2['id']}';">
  110. <span title="{function="_t('MARK_AS_READ')"}">{$unread[$value2['id']]}</span>
  111. </button>
  112. {/if}
  113. {function="Plugin::callHook("menu_post_feed_link", array(&$value))"}
  114. </li>
  115. {/if}
  116. {else}
  117. <!-- Affichage de tous les feeds -->
  118. {if="isset($unread[$value2['id']])"}
  119. {if="$feedState->getById($value2['id'])->getLastSyncInError()==0"}
  120. <li>
  121. {else}
  122. <li class="errorSync" title="{function="_t('SYNCHRONISATION_ERROR')"}">
  123. {/if}
  124. {else} <!-- On affiche même ceux qui non pas d'article non lus -->
  125. {if="$feedState->getById($value2['id'])->getLastSyncInError()==0"}
  126. <li class="hidefeed">
  127. {else}
  128. <li class="hidefeed errorSync" title="{function="_t('SYNCHRONISATION_ERROR')"}">
  129. {/if}
  130. {/if}
  131. {function="Plugin::callHook("menu_pre_feed_link", array(&$value))"} <a href="index.php?action=selectedFeed&amp;feed={$value2['id']}" title="{$value2['url']}">{function="Functions::truncate($value2['name'],37)"} </a>
  132. {if="isset($unread[$value2['id']])"}
  133. <button class="right" style="margin:5px 0 0 10px;" onclick="if(confirm('{function="_t('CONFIRM_MARK_FEED_AS_READ')"}'))window.location='action.php?action=readAll&amp;feed={$value2['id']}';">
  134. <span title="{function="_t('MARK_AS_READ')"}">{$unread[$value2['id']]}</span>
  135. </button>
  136. {/if}
  137. {function="Plugin::callHook("menu_post_feed_link", array(&$value))"}
  138. </li>
  139. {/if}
  140. {/loop}
  141. {/if}
  142. </ul>
  143. <!-- FIN FLUX DU DOSSIER -->
  144. </li>
  145. <!-- FIN DOSSIER -->
  146. {$unreadEventsForFolder=0}
  147. {/loop}
  148. </ul>
  149. </aside>
  150. {function="Plugin::callHook("menu_post_folder_menu", array(&$myUser))"}
  151. </div>
  152. <!-- -->
  153. <!-- ARTICLES -->
  154. <!-- -->
  155. <article>
  156. <!-- ENTETE ARTICLE -->
  157. <header class="articleHead">
  158. {if="$action=='selectedFeed' || ($action=='selectedFeedNonLu')"}
  159. <!-- AFFICHAGE DES EVENEMENTS D'UN FLUX EN PARTICULIER -->
  160. <h1 class="articleSection"><a target="_blank" href="{$currentFeed->getWebSite()}">{$currentFeed->getName()}</a></h1>
  161. <div class="clear"></div>
  162. {$currentFeed->getDescription()}
  163. {function="_t('SEE_THE')"}
  164. <a href="index.php?action=selectedFeedNonLu&amp;feed={$_['feed']}&amp;page={$page}">{function="ucfirst(_t('UNREAD'))"}</a> |
  165. <a href="index.php?action=selectedFeed&amp;feed={$_['feed']}&amp;page={$page}&amp;order=older">{function="_t('OLDER')"}</a> {function="_t('IN_FIRST')"}
  166. {/if}
  167. {if="$action=='selectedFolder'"}
  168. <!-- AFFICHAGE DES EVENEMENTS D'UN DOSSIER EN PARTICULIER -->
  169. <h1 class="articleSection">{function="_t('FOLDER')"} : {$currentFolder->getName()}</h1>
  170. <p>{function="_t('SEE_EVENTS_FOR_FOLDER',array($currentFolder->getName()))"}</p>
  171. {/if}
  172. {if="$action=='favorites'"}
  173. <!-- AFFICHAGE DES EVENEMENTS FAVORIS -->
  174. <h1 class="articleSection">{function="_t('FAVORITES_EVENTS',array('<span id="nbarticle">'.$numberOfItem.'</span>'))"}</h1>
  175. {/if}
  176. {if="($action=='unreadEvents') || ($action=='')"}
  177. <!-- AFFICHAGE DES EVENEMENTS NON LU (COMPORTEMENT PAR DEFAUT) -->
  178. <h1 class="articleSection">{function="_t('UNREAD')"} (<span id="nbarticle">{$numberOfItem}</span>)</h1><div class="pointer right readUnreadButton" onmouseout="document.getElementById( 'helpPanel' ).style.display = 'none'" onmouseover="document.getElementById( 'helpPanel' ).style.display = 'block'" title="{function="_t('HELP_H_?')"}">?</div>
  179. {/if}
  180. <div class="clear"></div>
  181. </header>
  182. {include="article"}
  183. </article>
  184. </div> <!-- #main -->
  185. {else}
  186. <div id="main" class="wrapper clearfix">
  187. <article>
  188. <h3>{function="_t('YOU_MUST_BE_LOGGED')"}</h3>
  189. <p>{function="_t('IF_ADMIN_THEN_CONFIG')"}</p>
  190. </article>
  191. </div>
  192. {/if}
  193. {include="footer"}