&$item) { $item['preview'] = str_replace('$skin', $key, $item['preview']); } } return self::$list; } static public function checkSkin($skin) { if ($skin == 'custom' || $skin == 'custom-assistant' || $skin == self::DEFAULT_SKIN) return true; return array_key_exists($skin, self::getList()); } static public function setupFiles($skin, $journal_id) { foreach(self::$_default_files as $file) { $src = LENCRIER_DATA_ROOT . '/skins/' . self::DEFAULT_SKIN . '/' . $file; if (substr($file, -5) == '.html') $dst = LENCRIER_DATA_ROOT . 'documents/' . $journal_id . '/skel_' . $file; else $dst = LENCRIER_DATA_ROOT . 'documents/' . $journal_id . '/' . $file; if (file_exists($dst)) @unlink($dst); if (!@copy($src, $dst)) throw new technicalException("Unable to copy file from $src to $dst"); } return true; } } ?>