diff options
Diffstat (limited to 'public/catalog/model/design/layout.php')
-rw-r--r-- | public/catalog/model/design/layout.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/public/catalog/model/design/layout.php b/public/catalog/model/design/layout.php new file mode 100644 index 0000000..f2a08ba --- /dev/null +++ b/public/catalog/model/design/layout.php @@ -0,0 +1,18 @@ +<?php +class ModelDesignLayout extends Model { + public function getLayout($route) { + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_route WHERE '" . $this->db->escape($route) . "' LIKE route AND store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY route DESC LIMIT 1"); + + if ($query->num_rows) { + return (int)$query->row['layout_id']; + } else { + return 0; + } + } + + public function getLayoutModules($layout_id, $position) { + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_module WHERE layout_id = '" . (int)$layout_id . "' AND position = '" . $this->db->escape($position) . "' ORDER BY sort_order"); + + return $query->rows; + } +}
\ No newline at end of file |