From 6318917d59247121b3a9dd2f4a8fe2854535141c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 13 Sep 2012 23:16:51 +0000 Subject: [PATCH] CSS tweaks, fix WYSIWYG centering --- app/modules/meta/models/data_model.php | 168 +++++++++++---------- app/modules/meta/views/category_detail.php | 19 +-- app/modules/meta/views/genre_detail.php | 22 ++- app/modules/meta/views/genres.php | 7 +- app/modules/meta/views/outline.php | 2 +- app/modules/meta/views/section_detail.php | 6 +- app/views/footer.php | 3 +- app/views/header.php | 7 +- app/views/theme_footer.php | 2 + app/views/theme_header.php | 6 + assets/css/theme.css | 66 ++++++-- assets/css/tinyeditor.css | 2 +- assets/js/meta.js | 38 ++--- sys/db | 2 +- 14 files changed, 193 insertions(+), 157 deletions(-) create mode 100644 app/views/theme_footer.php create mode 100644 app/views/theme_header.php diff --git a/app/modules/meta/models/data_model.php b/app/modules/meta/models/data_model.php index 0d8041c..1c5c255 100644 --- a/app/modules/meta/models/data_model.php +++ b/app/modules/meta/models/data_model.php @@ -280,27 +280,6 @@ class data_model extends \miniMVC\Model { // ! Data Retrieval // -------------------------------------------------------------------------- - /** - * Get the id of the last item of the type - * - * @param string $type - * @return int - */ - public function get_last_id($type) - { - $query = $this->db->select('id') - ->from($type) - ->order_by('id', 'DESC') - ->limit(1) - ->get(); - - $r = $query->fetch(\PDO::FETCH_ASSOC); - - return $r['id']; - } - - // -------------------------------------------------------------------------- - /** * Get breadcrumb data for section * @@ -364,26 +343,6 @@ class data_model extends \miniMVC\Model { // -------------------------------------------------------------------------- - /** - * Gets the name of the category from its id - * - * @param int - * @return string - */ - public function get_category_by_id($id) - { - $query = $this->db->select('category') - ->from('category') - ->where('id', (int) $id) - ->get(); - - $row = $query->fetch(\PDO::FETCH_ASSOC); - - return $row['category']; - } - - // -------------------------------------------------------------------------- - /** * Get the genre name by category id * @@ -405,46 +364,6 @@ class data_model extends \miniMVC\Model { // -------------------------------------------------------------------------- - /** - * Gets the name of the section from its id - * - * @param int - * @return string - */ - public function get_section_by_id($id) - { - $query = $this->db->select('section') - ->from('section') - ->where('id', (int) $id) - ->get(); - - $row = $query->fetch(\PDO::FETCH_ASSOC); - - return $row['section']; - } - - // -------------------------------------------------------------------------- - - /** - * Gets the data for the specified id - * - * @param int $id - * @return array - */ - public function get_data_by_id($id) - { - $query = $this->db->select('key, value') - ->from('data') - ->where('id', (int) $id) - ->get(); - - $row = $query->fetch(\PDO::FETCH_ASSOC); - - return $row; - } - - // -------------------------------------------------------------------------- - /** * Get the categories for the specified genre * @@ -470,6 +389,26 @@ class data_model extends \miniMVC\Model { // -------------------------------------------------------------------------- + /** + * Gets the name of the category from its id + * + * @param int + * @return string + */ + public function get_category_by_id($id) + { + $query = $this->db->select('category') + ->from('category') + ->where('id', (int) $id) + ->get(); + + $row = $query->fetch(\PDO::FETCH_ASSOC); + + return $row['category']; + } + + // -------------------------------------------------------------------------- + /** * Get the sections for the specified category id * @@ -496,7 +435,27 @@ class data_model extends \miniMVC\Model { // -------------------------------------------------------------------------- /** - * Get the data fro the section + * Gets the name of the section from its id + * + * @param int + * @return string + */ + public function get_section_by_id($id) + { + $query = $this->db->select('section') + ->from('section') + ->where('id', (int) $id) + ->get(); + + $row = $query->fetch(\PDO::FETCH_ASSOC); + + return $row['section']; + } + + // -------------------------------------------------------------------------- + + /** + * Get the data from the section * * @param int * @return array @@ -520,6 +479,26 @@ class data_model extends \miniMVC\Model { // -------------------------------------------------------------------------- + /** + * Gets the data for the specified id + * + * @param int $id + * @return array + */ + public function get_data_by_id($id) + { + $query = $this->db->select('key, value') + ->from('data') + ->where('id', (int) $id) + ->get(); + + $row = $query->fetch(\PDO::FETCH_ASSOC); + + return $row; + } + + // -------------------------------------------------------------------------- + /** * Get sections and data for a general data outline * @@ -551,7 +530,7 @@ class data_model extends \miniMVC\Model { while($row = $d_query->fetch(\PDO::FETCH_ASSOC)) { - $d_array[$row['section_id']][$row['key']] = $row['value']; + $d_array[$row['section_id']][$row['id']] = array($row['key'] => $row['value']); } } @@ -658,6 +637,29 @@ class data_model extends \miniMVC\Model { return in_array(strtolower($str), $valid); } + // -------------------------------------------------------------------------- + + /** + * Get the id of the last item of the type + * + * @param string $type + * @return int + */ + public function get_last_id($type) + { + $query = $this->db->select('id') + ->from($type) + ->order_by('id', 'DESC') + ->limit(1) + ->get(); + + $r = $query->fetch(\PDO::FETCH_ASSOC); + + return $r['id']; + } + + // -------------------------------------------------------------------------- + } // End of data_model.php \ No newline at end of file diff --git a/app/modules/meta/views/category_detail.php b/app/modules/meta/views/category_detail.php index e44b3bc..8bf3609 100644 --- a/app/modules/meta/views/category_detail.php +++ b/app/modules/meta/views/category_detail.php @@ -1,10 +1,8 @@ -

- -
" method="post"> +" method="post">
Add Section
@@ -17,7 +15,8 @@
- + +

Sections