PageRenderTime 27ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/beamer/class/beamer_display.class.php

http://lansuite.googlecode.com/
PHP | 210 lines | 161 code | 47 blank | 2 comment | 25 complexity | 32f378c64a959682f1b39a306097a917 MD5 | raw file
Possible License(s): LGPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. class beamer_display {
  3. function __construct(){
  4. }
  5. function viewModulMainPage() {
  6. global $dsp, $lang, $beamermodul, $bcid, $beamerid;
  7. $dsp->NewContent( t('Beamer&uuml;bersicht') ,"");
  8. $dsp->AddSingleRow('<br/>'.t('Mit diesem Modul kannst du Texte und anderen Daten f&uuml;r eine Beamerpr&auml;sentation aufbereiten.').'<br/><br/>'.
  9. t('Aktive Inhalte: ').$beamermodul->countContent("1").'<br/>'.
  10. t('Inhalte gesamt: ').$beamermodul->countContent().
  11. '<p />' );
  12. $dsp->AddSingleRow('<br />' . t('Das Modul arbeitet derzeit nur mit dem Template /\'/simple/\'/ und /\'/beamer/\'/ zusammen. F&uuml;r eine schnelle L&ouml;sung erstelle einen zus&auml;tzlichen Account der das Beamer-Template verwendet. Damit hast du die besten Ergebnisse im Fullscreen Mode. <p/>Damit es mit jedem anderen Template funktioniert, musst du in deinem Template im Bereich der Meta-Angaben folgende Codezeilen hinzuf&uuml;gen:<p/> if( $_GET[/\'/sitereload/\'/] ) { echo ... (Restlichen Anweisungsblock bitte as der Design-index.php entnehmen.) } ') );
  13. $dsp->AddSingleRow("<br />");
  14. $dsp->AddContent();
  15. }
  16. function viewCurrentContent() {
  17. global $dsp, $lang, $beamermodul, $bcid, $beamerid, $func;
  18. $dsp->NewContent( "","");
  19. //$dsp->AddIFrame("localhost/pma/","1024","500");
  20. $dsp->AddSingleRow( $func->AllowHTML($beamermodul->getCurrentContent( $beamerid )) );
  21. $dsp->AddSingleRow( HTML_NEWLINE."");
  22. $dsp->AddContent();
  23. }
  24. function viewContent () {
  25. global $dsp, $lang, $beamermodul, $bcid, $beamerid;
  26. // private ms2 funktionen
  27. function formatContentType ( $var ) {
  28. if ( $var == "text" ) { return '<img src="design/images/icon_text.png" alt="Text" border="0">'; }
  29. if ( $var == "wrapper" ) { return '<img src="design/images/icon_url.png" alt="Bild" border="0">'; }
  30. if ( $var == "turnier" ) { return '<img src="design/images/icon_tree.png" alt="Bild" border="0">'; }
  31. }
  32. function formatBStatus ( $var, $bcid , $beamerid ) {
  33. if ( $var == "1" ) { return '<a href="index.php?mod=beamer&action=togglebeameractive&bcid='.$bcid.'&beamerid='.$beamerid.'"><img src="design/images/icon_active_sm.png" alt="Aktiv" border="0"></a>'; }
  34. if ( $var == "0" ) { return '<a href="index.php?mod=beamer&action=togglebeameractive&bcid='.$bcid.'&beamerid='.$beamerid.'"><img src="design/images/icon_deactive_sm.png" alt="Deaktiv" border="0"></a>'; }
  35. }
  36. function formatBeamer1Status ( $var , $bcid ) { return formatBStatus( $var , $bcid, "1"); }
  37. function formatBeamer2Status ( $var , $bcid ) { return formatBStatus( $var , $bcid, "2"); }
  38. function formatBeamer3Status ( $var , $bcid ) { return formatBStatus( $var , $bcid, "3"); }
  39. function formatBeamer4Status ( $var , $bcid ) { return formatBStatus( $var , $bcid, "4"); }
  40. function formatBeamer5Status ( $var , $bcid ) { return formatBStatus( $var , $bcid, "5"); }
  41. function formatActiveStatus ( $var, $var2 ) {
  42. if ( $var == "1" ) { return '<a href="index.php?mod=beamer&action=toggleactive&bcid='.$var2.'"><img src="design/images/icon_active.png" alt="Aktiv" border="0"></a>'; }
  43. if ( $var == "0" ) { return '<a href="index.php?mod=beamer&action=toggleactive&bcid='.$var2.'"><img src="design/images/icon_deactive.png" alt="Deaktiv" border="0"></a>'; }
  44. }
  45. $dsp->NewContent( t('Auflistung der Inhalte') );
  46. $dsp->AddSingleRow("<br/><div align=\"middle\">". $dsp->FetchCssButton( t('Inhalte hinzuf&uuml;gen') ,'index.php?mod=beamer&action=newcontent','Ein neues Inhaltselement hinzuf&uuml;gen.'."</div>"));
  47. include_once('modules/mastersearch2/class_mastersearch2.php');
  48. $ms2 = new mastersearch2('beamer');
  49. $ms2->query['from'] = '%prefix%beamer_content';
  50. $ms2->AddResultField('-A-', 'active', 'formatActiveStatus','',35);
  51. $ms2->AddResultField(t('Typ'), 'contentType', 'formatContentType',"",35);
  52. $ms2->AddResultField(t('Titel'), 'caption');
  53. $ms2->AddResultField(t('Zuletzt angezeigt'), 'lastView' , 'MS2GetTime','',80);
  54. $ms2->AddResultField('B.1', 'b1', 'formatBeamer1Status','',25);
  55. $ms2->AddResultField('B.2', 'b2', 'formatBeamer2Status','',25);
  56. $ms2->AddResultField('B.3', 'b3', 'formatBeamer3Status','',25);
  57. $ms2->AddResultField('B.4', 'b4', 'formatBeamer4Status','',25);
  58. $ms2->AddResultField('B.5', 'b5', 'formatBeamer5Status','',25);
  59. $ms2->AddIconField('reset_timestamp','index.php?mod=beamer&action=set2first&bcid=',t('An den Anfang der Spielliste setzen'));
  60. $ms2->AddIconField('edit','index.php?mod=beamer&action=editcontent&bcid=',t('Bearbeiten'));
  61. $ms2->AddIconField('delete','index.php?mod=beamer&action=askfordelete&bcid=',t('L&ouml;schen'));
  62. $ms2->PrintSearch('index.php?mod=beamer&action=content', 'bcID');
  63. $dsp->AddSingleRow("<br/><div align=\"middle\">".
  64. "Das Beamermodul zeigt immer den &auml;ltesten Eintrag von \"Zuletzt angezeigt\". Durch Klick auf das Icon <img src=\"design/images/icon_reset_timestamp.png\" alt=\"Set2First\" border=\"0\"> setzt man den Zeitstempel, wann das Element zuletzt angezeigt wurde, auf Null.</div>");
  65. $dsp->AddSingleRow("<br/><div align=\"middle\">". $dsp->FetchCssButton( t('Inhalte hinzuf&uuml;gen') ,'index.php?mod=beamer&action=newcontent','Ein neues Inhaltselement hinzuf&uuml;gen.'."</div>"));
  66. $dsp->AddContent();
  67. }
  68. function viewStartSite() {
  69. global $dsp, $lang, $beamermodul, $bcid, $beamerid,$cfg;
  70. $a1 = $beamermodul->countContent("1","1");
  71. $a2 = $beamermodul->countContent("1","2");
  72. $a3 = $beamermodul->countContent("1","3");
  73. $a4 = $beamermodul->countContent("1","4");
  74. $a5 = $beamermodul->countContent("1","5");
  75. $dsp->NewContent( t('Beamerinhalte pr&auml;sentieren') ,"");
  76. $dsp->AddDoubleRow('Seiteninterval in Sekunden: ',$cfg['beamer_duration_default'] );
  77. if ( $a1 > 0 ) { $btn1 = $dsp->FetchSpanButton(t('Beamerfenster starten'), "index.php?mod=beamer&action=viewcontent&beamerid=1&design=beamer&sitereload=".$cfg['beamer_duration_default'].'" target="_blank'); }
  78. if ( $a2 > 0 ) { $btn2 = $dsp->FetchSpanButton(t('Beamerfenster starten'), "index.php?mod=beamer&action=viewcontent&beamerid=2&design=beamer&sitereload=".$cfg['beamer_duration_default'].'" target="_blank'); }
  79. if ( $a3 > 0 ) { $btn3 = $dsp->FetchSpanButton(t('Beamerfenster starten'), "index.php?mod=beamer&action=viewcontent&beamerid=3&design=beamer&sitereload=".$cfg['beamer_duration_default'].'" target="_blank'); }
  80. if ( $a4 > 0 ) { $btn4 = $dsp->FetchSpanButton(t('Beamerfenster starten'), "index.php?mod=beamer&action=viewcontent&beamerid=4&design=beamer&sitereload=".$cfg['beamer_duration_default'].'" target="_blank'); }
  81. if ( $a5 > 0 ) { $btn5 = $dsp->FetchSpanButton(t('Beamerfenster starten'), "index.php?mod=beamer&action=viewcontent&beamerid=5&design=beamer&sitereload=".$cfg['beamer_duration_default'].'" target="_blank'); }
  82. $dsp->AddSingleRow( HTML_NEWLINE." <font size=\"4\">1.</font> ".t('Beamerfenster ').$btn1." - ".t('Aktive Inhalte: ').$a1."<p/><br/>");
  83. $dsp->AddSingleRow( HTML_NEWLINE." <font size=\"4\">2.</font> ".t('Beamerfenster ').$btn2." - ".t('Aktive Inhalte: ').$a2."<p/><br/>");
  84. $dsp->AddSingleRow( HTML_NEWLINE." <font size=\"4\">3.</font> ".t('Beamerfenster ').$btn3." - ".t('Aktive Inhalte: ').$a3."<p/><br/>");
  85. $dsp->AddSingleRow( HTML_NEWLINE." <font size=\"4\">4.</font> ".t('Beamerfenster ').$btn4." - ".t('Aktive Inhalte: ').$a4."<p/><br/>");
  86. $dsp->AddSingleRow( HTML_NEWLINE." <font size=\"4\">5.</font> ".t('Beamerfenster ').$btn5." - ".t('Aktive Inhalte: ').$a5."<p/><br/>");
  87. $dsp->AddSingleRow( HTML_NEWLINE );
  88. $dsp->AddContent();
  89. }
  90. function viewAddNewContent1() {
  91. global $dsp, $lang, $beamermodul, $bcid, $beamerid;
  92. $dsp->NewContent( t('Inhalte hinzuf&uuml;gen') );
  93. $dsp->AddSingleRow( HTML_NEWLINE.t("Bitte w&auml;hle einen Inhaltstyp aus:").HTML_NEWLINE.HTML_NEWLINE);
  94. $dsp->SetForm("index.php?mod=beamer&action=newcontent2");
  95. $dsp->AddRadioRow("ctype", t("<strong>Text</strong><br /> (FCKeditor, HTML/Bilder/Flash m&ouml;glich)") , 'text' , $errortext = NULL, $optional = NULL, $checked = TRUE, $disabled = NULL);
  96. $dsp->AddRadioRow("ctype", t("<strong>Wrapper</strong><br /> (IFrame f&uuml;r Webseiten oder sonstigen Content)") , 'wrapper' , $errortext = NULL, $optional = NULL, $checked = FALSE, $disabled = NULL);
  97. $dsp->AddRadioRow("ctype", t("<strong>Turnierbaum</strong><br />") , 'turnier' , $errortext = NULL, $optional = NULL, $checked = FALSE, $disabled = NULL);
  98. $dsp->AddFormSubmitRow("next");
  99. $dsp->AddContent();
  100. }
  101. function viewAddNewContent2() {
  102. global $dsp, $lang, $beamermodul, $bcid, $beamerid, $ctype;
  103. $dsp->NewContent( t('Inhalte hinzuf&uuml;gen') . " - 2" );
  104. $dsp->SetForm("index.php?mod=beamer&action=savecontent&ctype=".$ctype);
  105. if($ctype=='text') {
  106. $dsp->AddTextFieldRow("ccaption", t("Bezeichnung: "), "", "", '50');
  107. ob_start();
  108. include_once("ext_scripts/FCKeditor/fckeditor.php");
  109. $oFCKeditor = new FCKeditor('FCKeditor1') ;
  110. $oFCKeditor->BasePath = 'ext_scripts/FCKeditor/';
  111. $oFCKeditor->Value = "";
  112. $oFCKeditor->Height = 380;
  113. $oFCKeditor->Create();
  114. $fcke_content = ob_get_contents();
  115. ob_end_clean();
  116. $dsp->AddSingleRow($fcke_content);
  117. }
  118. if($ctype=='wrapper') {
  119. $dsp->AddTextFieldRow("ccaption", t("Bezeichnung: "), "", "", '50');
  120. $dsp->AddTextFieldRow("curl", t("IFrame URL: "), "", "", '80');
  121. $dsp->AddTextFieldRow("choehe", t("IFrame H&ouml;he: "), "550", "", '4');
  122. $dsp->AddTextFieldRow("cbreite", t("IFrame Breite: "), "980", "", '4');
  123. }
  124. if($ctype=='turnier') {
  125. $dsp->AddDropDownFieldRow("ctid", t("Turnier: "), $beamermodul->getAllTournamentsAsOptionList() , $errortext, $optional = NULL);
  126. }
  127. $dsp->AddBackButton();
  128. $dsp->AddFormSubmitRow("save");
  129. $dsp->AddContent();
  130. }
  131. function viewEditContent () {
  132. global $dsp, $func, $lang, $beamermodul, $bcid, $beamerid, $ctype;
  133. $content = $beamermodul->getContent( $bcid );
  134. $dsp->NewContent( t('Inhalt bearbeiten') );
  135. $dsp->SetForm("index.php?mod=beamer&action=savecontent&ctype={$content['contentType']}&bcid=".$bcid);
  136. if($content['contentType']=='text') {
  137. $dsp->AddTextFieldRow("ccaption", "Bezeichnung: ", $content['caption'], "", '50');
  138. ob_start();
  139. include_once("ext_scripts/FCKeditor/fckeditor.php");
  140. $oFCKeditor = new FCKeditor('FCKeditor1') ;
  141. $oFCKeditor->BasePath = 'ext_scripts/FCKeditor/';
  142. $oFCKeditor->Value = $func->AllowHTML($content['contentData']);
  143. $oFCKeditor->Height = 380;
  144. $oFCKeditor->Create();
  145. $fcke_content = ob_get_contents();
  146. ob_end_clean();
  147. $dsp->AddSingleRow($fcke_content);
  148. }
  149. if($content['contentType']=='wrapper') {
  150. $arr = explode( "*" , $content['contentData'] );
  151. $dsp->AddTextFieldRow("ccaption", t("Bezeichnung: "), $content['caption'], "", '50');
  152. $dsp->AddTextFieldRow("curl", t("IFrame URL: "), $arr[0] , "", '80');
  153. $dsp->AddTextFieldRow("choehe", t("IFrame H&ouml;he: "), $arr[1], "", '4');
  154. $dsp->AddTextFieldRow("cbreite", t("IFrame Breite: "), $arr[2], "", '4');
  155. }
  156. if($content['contentType']=='turnier') {
  157. $dsp->AddDropDownFieldRow("ctid", t("Turnier: "), $beamermodul->getAllTournamentsAsOptionList() , $errortext, $optional = NULL);
  158. }
  159. $dsp->AddFormSubmitRow("save");
  160. $dsp->AddContent();
  161. }
  162. }
  163. ?>