Source for file CMS3_LogViewer.php

Documentation is available at CMS3_LogViewer.php

  1. <?php     
  2. //          (F)
  3. // CMS3 - A Three Content Management System.
  4. // Copyright (C) 2007  Jop... (Jonas F. Jensen).
  5. // 
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU General Public License
  8. // as published by the Free Software Foundation; either version 2
  9. // of the License, or (at your option) any later version.
  10. // 
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software
  18. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  19.  
  20. /**
  21. *This file defines CMS3_LogViewer
  22. *
  23. @package    LogViewer
  24. @author    Jonas F. Jensen <jopsen@gmail.com>
  25. @copyright    2007 Jonas F. Jensen.
  26. @license    http://www.gnu.org/licenses/gpl.txt
  27. */
  28.  
  29. /*
  30. *LogViewer provides a frontend for viewing logfiles.
  31. */
  32. class CMS3_LogViewer extends CMS3_System_Plugin implements IConfigure //TODO: Perhaps implement IProvidesHelp
  33. {
  34.  
  35.     //IConfigure implementation
  36.  
  37.     
  38.     /**
  39.     * Gets an absolute address of an icon for this plugin
  40.     */
  41.     public function GetControlCenterIcon(){
  42.         return $this->Owner->GetCMS3URL("bin/" $this->GetPluginID("/LogICO.png";
  43.     }
  44.  
  45.     /**
  46.     * Gets menu entry string
  47.     */
  48.     public function GetControlCenterMenuEntry(){
  49.         //TODO: i18n
  50.         return "View system log";
  51.     }
  52.  
  53.     /**
  54.      * Gets a dojo based ajax guide for configuration of the plugin.
  55.      *
  56.      * @param IEmbedmentOutputHandler OutputHandler
  57.      * @return IEmbedmentOutputHandler 
  58.      * @access public
  59.      */
  60.     public function &Configure($Identifier null&$EmbedmentOutputHandler ){
  61.         //Load templates from files
  62.         $Head file_get_contents($this->Owner->GetCMS3Path("data/" $this->GetPluginID("/ConfigHead.htm");
  63.         $Body file_get_contents($this->Owner->GetCMS3Path("data/" $this->GetPluginID("/ConfigBody.htm");
  64.  
  65.         $LogFile file_get_contents($this->Owner->GetCMS3Path("data/System/System.log");
  66.  
  67.         $Body str_replace("LOGFILE",$LogFile ,$Body);
  68.  
  69.         //Parse the output
  70.         $EmbedmentOutputHandler->ExtentHeader($Head);
  71.         $EmbedmentOutputHandler->SetBody($Body);
  72.         return $EmbedmentOutputHandler;
  73.     }
  74.  
  75.  
  76.         //Implementation of IPlugin
  77.  
  78.     
  79.     /**
  80.      * Gets the pluginID of the plugin.
  81.      *
  82.      * @return string 
  83.      * @access public
  84.      */
  85.     public function GetPluginID)
  86.     {
  87.         return "LogViewer";
  88.     }
  89.  
  90.  
  91. }
  92.  
  93.  
  94. ?>

Documentation generated on Mon, 30 Apr 2007 01:59:04 +0200 by phpDocumentor 1.3.1