Class SGL_Util

Description

Various utility methods.

Located in /SGL/Util.php (line 48)


	
			
Method Summary
 static array getAllModuleDirs ([bool $onlyRegistered = true])
 static array listDir (string $path, [int $list = FILE_LIST_ALL], [int $sort = FILE_SORT_NONE], [mixed $cb = null])
 void getAllClassesFromFolder ([ $folder = ''], [ $filter = '.*'])
 void getAllManagersPerModule ( $moduleDir)
 void getAllThemes ()
 array getLangsDescriptionMap ([ $aSelected = array()], [ $langKeyType = null])
 string getSortBy (string $frmSortBy, int $callingPage)
 string getSortOrder (string $sortOrder)
 string getTmpDir ()
 array loadParams ([ $ini_file = ''], [ $aSavedParams = array()], [ $aCurrentParams = array()])
 void makeIniUnreadable (string $file)
 void themeFilterCallback ( $str)
Methods
static getAllModuleDirs (line 155)

Returns an hash of strings listing the installed (and registered) Modules

  • access: public
array getAllModuleDirs ([bool $onlyRegistered = true])
  • bool $onlyRegistered
static listDir (line 285)

Wrapper for the File_Util::listDir method.

Instead of returning an array of objects, it returns an array of strings (filenames).

The final argument, $cb, is a callback that either evaluates to true or false and performs a filter operation, or it can also modify the directory/file names returned. To achieve the latter effect use as follows:

  1.  function uc(&$filename{
  2.      $filename strtoupper($filename);
  3.      return true;
  4.  }
  5.  $entries File_Util::listDir('.'FILE_LIST_ALLFILE_SORT_NONE'uc');
  6.  foreach ($entries as $e{
  7.      echo $e->name"\n";
  8.  }

  • access: public
array listDir (string $path, [int $list = FILE_LIST_ALL], [int $sort = FILE_SORT_NONE], [mixed $cb = null])
  • string $path
  • int $list
  • int $sort
  • mixed $cb
getAllActionMethodsPerMgr (line 194)
void getAllActionMethodsPerMgr ( $mgr)
  • $mgr
getAllClassesFromFolder (line 235)
void getAllClassesFromFolder ([ $folder = ''], [ $filter = '.*'])
  • $folder
  • $filter
getAllManagersPerModule (line 177)
void getAllManagersPerModule ( $moduleDir)
  • $moduleDir
getAllThemes (line 120)
void getAllThemes ()
getLangsDescriptionMap (line 319)

Returns a hash of the form array('en-iso-8859-15' => 'English (en-iso-8859-15),) etc.

array getLangsDescriptionMap ([ $aSelected = array()], [ $langKeyType = null])
  • $aSelected
  • $langKeyType
getSortBy (line 90)

Determines which column results should be sorted by.

If no value passed from Request, returns last value from session

  • return: value to sort by
  • access: public
string getSortBy (string $frmSortBy, int $callingPage)
  • string $frmSortBy: column name passed from Request
  • int $callingPage: table relevant to sortby
getSortOrder (line 64)

Used by list pages to determine last sort order.

If no value passed from Request, returns last value from session

  • access: public
string getSortOrder (string $sortOrder)
  • string $sortOrder: Output object containing validated input
getTmpDir (line 395)

Returns the system's tmp directory.

Mactel doesn't supply tmp path in most of the normal places.

  • return: Path to tmp dir
string getTmpDir ()
loadParams (line 349)

Returns params from ini file.

array loadParams ([ $ini_file = ''], [ $aSavedParams = array()], [ $aCurrentParams = array()])
  • $ini_file
  • $aSavedParams
  • $aCurrentParams
makeIniUnreadable (line 305)

Ini file protection.

By giving ini files a php extension, and inserting some PHP die() code, we can improve security in situations where browsers might be able to read them. Thanks to Georg Gell for the idea.

void makeIniUnreadable (string $file)
  • string $file: Path to ini file
themeFilterCallback (line 131)
void themeFilterCallback ( $str)
  • $str

Documentation generated on Tue, 23 Feb 2010 18:14:34 +0000 by phpDocumentor 1.4.3