Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ModuleInfoInc.class.php

Go to the documentation of this file.
00001 <?php
00009 include_once("core/modules/moduleinformation/IModuleInfo.class.php");
00010 include_once("core/modules/moduleinformation/backends/ModuleInfoIncPermission.class.php");
00011 include_once("core/modules/moduleinformation/backends/ModuleInfoIncConfig.class.php");
00012 
00013 define("ERROR_OPEN", 1);
00014 define("ERROR_NO_NAME", 2);
00015 define("ERROR_NOT_VALID", 3);
00016 
00017 class ModuleInfoInc extends IModuleInfo
00018 {
00019         var $filename;          
00020         
00021         /* Module information */
00022         var $name;
00023         var $screenname;
00024         var $permissions;
00025         var $config;
00026         var $sql;
00027         
00033         function ModuleInfoInc($name)
00034         {
00035                 $this->filename = $name;
00036                 $error = $this->_ProcessInc();
00037                 if (JSystem::IsError($error))
00038                         $this->RaiseConstructorError($error);           
00039         }
00040         
00044         function _ProcessInc()
00045         {
00046                 $res = @include($this->filename);       
00047         
00048                 // If it fails including the file, then we return an error
00049                 if (! $res)
00050                         return $this->RaiseError(ERROR_NO_FILE);
00051                 
00052                 // Getting attributes
00053                 $this->name = $realname;
00054                 if (! $this->name)
00055                         return $this->RaiseError(ERROR_NO_NAME);
00056                         
00057                 $this->screenname = $friendlyname;
00058                                         
00059                 $this->_ProcessIncPermissions($perms);
00060                 $this->_ProcessIncConfig($config);
00061                 $this->sql = $sqlQuery;
00062         }
00063         
00064         function _ProcessIncPermissions($perms)
00065         {
00066                 if(count($perms) > 0)
00067                 {
00068                         foreach($perms as $perm)
00069                         {
00070                                 $miiperm = new ModuleInfoIncPermission($perm);
00071                                 $this->permissions[$miiperm->getName()] = $miiperm;
00072                         }
00073                 }
00074         }
00075         
00076         function _ProcessIncConfig($config)
00077         {
00078                 if (count($config) > 0)
00079                 {
00080                         foreach($config as $conf)
00081                         {
00082                                 $miiconf = new ModuleInfoIncConfig($conf);
00083                                 $this->config[$miiconf->getName()] = $miiconf;
00084                         }
00085                 }
00086         }
00087         
00088         function GetName()
00089         {
00090                 return $this->name;
00091         }
00092         
00093         function GetVersion()
00094         {
00095                 return 0;
00096         }
00097         
00098         function GetScreenNames()
00099         {
00100                 return array($this->screenname);
00101         } 
00102         
00103         function GetPermissions()
00104         {
00105                 return $this->permissions;
00106         }
00107         
00108         function GetConfig()
00109         {
00110                 return $this->config;
00111         }
00112         
00113         function GetImplements()
00114         {
00115                 return array();
00116         }
00117         
00118         function Implements($string)
00119         {
00120                 return false;
00121         }
00122         
00123         function GetRequires()
00124         {
00125                 return array();
00126         }
00127         
00128         function Requires($string)
00129         {
00130                 return false;
00131         }
00132         
00133         function GetSql()
00134         {
00135                 return $this->sql;
00136         }
00137         
00138         function getError()
00139         {
00140                 return $this->error;
00141         }       
00142 }
00143 ?>

Generated on Wed Nov 19 20:29:35 2003 for James by doxygen 1.3.4