loadDatabase($id, $field_id); } function loadDatabase() { } function save($debug=false) { return $this->saveDatabase($debug); } function saveDatabase() { } function delete($id=false, $field_id="id") { return $this->deleteDatabase($id, $field_id); } function deleteDatabase() { } } excludes as $exclude) { // check with regular expression if (preg_match($exclude, $entry)) return false; } return true; } /** * Wrapper method to fetch all entries from a given directory * * @param $path Path to be scanned * @param $recursive true or false * @param $only process only "files" or "dirs". Default "both" * @param $assoc return an associative array of files/dirs * @param $entries The current array of already processed entries (needed for recursion) * @return array of files/directories with full path * @author Reza Esmaili (me@dfox.info) */ function _getEntries($path, $recursive, $only=false, $assoc=false, $entries=array()) { $dir = opendir($path); $files = array(); if (!is_resource($dir)) { return $entries; } while (false !== ($entryName = readdir($dir))){ $entry = $path."/".$entryName; $valid = $this->checkExcludes($entryName); if ($valid === true) { switch ($only) { case "dirs": if (is_dir($entry)) array_push($entries, htmlentities($entry)); break; case "files": if (is_file($entry)) array_push($files, htmlentities($entry)); break; default: if (is_file($entry)) array_push($files, htmlentities($entry)); if (is_dir($entry)) array_push($entries, htmlentities($entry)); } if (is_dir($entry) && $recursive === true) $entries = array_merge($entries, $this->_getEntries($entry, $recursive, $only, $assoc)); } } $entries = array_merge($files,$entries); closedir($dir); return $entries; } /** * Creates a directory with optional permissions * * @param $path The path to the directory to be created * @param $rights Optional. * @author Reza Esmaili (me@dfox.info) */ function createDir($path, $rights=0775) { if (!file_exists($path)) mkdir($path, $rights); } /** * Alias for the method createDir * * @param $path The path to the directory to be created * @param $rights Optional. * @author Reza Esmaili (me@dfox.info) */ function create($path, $rights=0755) { $this->createDir($path, $rights); } /** * Fetches a list of all directories inside a given path * * @param $path The path to the directory to be scanned * @param $recursive Optional. * @param $assoc Optional. * @author Reza Esmaili (me@dfox.info) */ function getDirs($path, $recursive=false, $assoc=false) { return $this->_getEntries($path, $recursive, "dirs", $assoc); } /** * Fetches a list of all files inside a given path * * @param $path The path to the directory to be scanned * @param $recursive Optional. * @param $assoc Optional. * @author Reza Esmaili (me@dfox.info) */ function getFiles($path, $recursive=false, $assoc=false) { return $this->_getEntries($path, $recursive, "files", $assoc); } /** * Deletes a file from the filesystem * * @param $path The path to the file to be deleted * @author Reza Esmaili (me@dfox.info) */ function remove($path) { if (file_exists($path)) unlink($path); } /** * Deletes as files from a given directory * * @param $path The path to the file to be deleted * @param $recursive * @author Reza Esmaili (me@dfox.info) */ function emptyDir($path, $recursive=false) { $this->_removeDir($path, $recursive, false); } /** * Deletes as files from a given directory (recursive) * * @param $path The path to the file to be deleted * @param $recursive * @author Reza Esmaili (me@dfox.info) */ function removeDir($path) { $this->_removeDir($path, true, true); } /** * Wrapper method to delete all files from a given directory * * @param $path The path to the file to be deleted * @param $recursive * @param $removeLast Removes the given directory itself upon completion * @param $level current Level of recursion * @author Reza Esmaili (me@dfox.info) */ function _removeDir($path, $recursive=false, $removeLast=false, $level=0) { $dir = opendir($path); while($entryName = readdir($dir)){ $entry = $path."/".$entryName; $valid = $this->checkExcludes($entryName); if ($valid === true) { if (is_dir($entry) && $recursive === true) $this->_removeDir($entry, $recursive, $removeLast, $level++); elseif (is_file($entry)) $this->remove($entry); } } closedir($dir); if (($level == 0 && $removeLast === true) || $level > 0) @rmdir($path); } } = 3) { $date = strtotime($date); } elseif (count(explode(".", $date)) >= 3) { $day = substr($date, 0, 2); $month = substr($date, 3, 2); $year = substr($date, 6, 4); $hours = substr($date, 11); $date = strtotime($year."-".$month."-".$day." ".$hours); } } return $date; } function convertToJSCalendar($dateFormat=false) { // format to something like this: d + "." + m + "." + y; global $__currentLocale; if ($dateFormat === false) $dateFormat = plGetConfig("language", "date_format", $__currentLocale); $dateFormat = strtolower($dateFormat); $divider = substr($dateFormat, 2, 1); $dateFormat = str_replace("%", "", $dateFormat); $dateFormatArray = explode($divider, $dateFormat); $jScript = implode(" + \".\" + ", $dateFormatArray); return $jScript; } }
Fatal error: 'break' not in the 'loop' or 'switch' context in /home/dualgdps213/public_html/explosive-party26/_system/image.class.php on line 871