00001 <?php 00002 class MContent extends MControl 00003 { 00004 var $path; 00005 var $home; 00006 00007 function __construct($module = false, $name = false, $home = false) 00008 { 00009 parent::__construct(); 00010 $this->path = $this->manager->GetModulePath($module, $name); 00011 $this->home = $home; 00012 } 00013 00014 function GenerateInner() 00015 { 00016 $content_array = file($this->path); 00017 $content = implode("", $content_array); 00018 $this->inner = new MDiv('', $content, 'm-theme-content'); 00019 } 00020 } 00021 00022 class MFileContent extends MContent 00023 { 00024 var $isSource; 00025 00026 function __construct($filename = null, $isSource = false, $home = false) 00027 { 00028 parent::__construct(); 00029 $this->path = $filename; 00030 $this->isSource = $isSource; 00031 } 00032 00033 function SetFile($filename) 00034 { 00035 $this->path = $filename; 00036 } 00037 00038 function GenerateInner() 00039 { 00040 if ($this->isSource) 00041 { 00042 $content = highlight_file($this->path, true); 00043 $t[] = new MDiv('', $this->path, ''); 00044 $t[] = new MDiv('', $content, 'm-filecontent'); 00045 $this->inner = $t; 00046 } 00047 else 00048 { 00049 parent::GenerateInner(); 00050 } 00051 } 00052 } 00053 00054 ?>