2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 * DAO for "themes" table
20 if (!defined('TR_INCLUDE_PATH')) exit;
22 require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
24 class ThemesDAO extends DAO {
27 * Return all theme' information
35 $sql = 'SELECT * FROM '.TABLE_PREFIX.'themes ORDER BY dir_name';
36 return $this->execute($sql);
40 * Return theme by theme dir name
42 * @param dirName : theme dir name
46 function getByID($dirName)
48 $sql = "SELECT * FROM ".TABLE_PREFIX."themes WHERE dir_name='".$dirName."'";
49 if ($rows = $this->execute($sql))
54 * Return all default themes
60 function getDefaultTheme()
62 $sql = "SELECT * FROM ".TABLE_PREFIX."themes WHERE status=".TR_STATUS_DEFAULT;
63 return $this->execute($sql);
67 * Return all enabled themes
73 function getEnabledTheme()
75 $sql = "SELECT * FROM ".TABLE_PREFIX."themes WHERE status in (".TR_STATUS_ENABLED.", ".TR_STATUS_DEFAULT.")";
76 return $this->execute($sql);