6 * Loads all Caption Formats and return an array with class names
\r
10 static public function ccFormatsLoad()
\r
12 global $rosettaCCSettings; // load global vars
\r
14 $ccFormats = array(); // stores all caption formats allowed
\r
16 $dir = $rosettaCCSettings['ccformats'];
\r
17 $ccFormatsString = '';
\r
18 $ccFileNameFormatRegex = '/cc_(.*?)_format/'; // (e.g. "cc_(QTtext)_format.php")
\r
21 // verify if the directory exists
\r
22 if ($handle = opendir($dir))
\r
24 // read all files in the dir and include Caption Format files
\r
25 while (false !== ($file = readdir($handle)))
\r
29 // build a string with all file names
\r
30 $ccFormatsString .= ''.$file.';';
\r
32 // include the caption format file
\r
33 include_once($dir.'/'.$file);
\r
39 // close dir handler
\r
42 // get all Class names from the string using regex
\r
43 preg_match_all($ccFileNameFormatRegex, $ccFormatsString, $ccFormatsPat);
\r
45 // add Class names to $ccFormats global Array
\r
46 for ($j=0;$j<count($ccFormatsPat[1]);$j++)
\r
48 $ccFormats[] = $ccFormatsPat[1][$j];
\r
50 // sort $ccFormats array
\r
55 } // ccFormatsLoad() end
\r
60 } // end class CcUtilEssential
\r