diff --git a/app/config/routes.php b/app/config/routes.php
index f8a56c7..adcd071 100644
--- a/app/config/routes.php
+++ b/app/config/routes.php
@@ -34,6 +34,7 @@ return [
'default_controller' => 'welcome',
'default_module' => 'meta',
'genre' => 'meta/genre/index',
+ 'genre/add' => 'meta/genre/add',
'genre/add_category' => 'meta/genre/add_category',
'category' => 'meta/category/index',
'category/add_section' => 'meta/category/add_section',
diff --git a/app/modules/meta/controllers/category.php b/app/modules/meta/controllers/category.php
index 32266ea..4a05575 100644
--- a/app/modules/meta/controllers/category.php
+++ b/app/modules/meta/controllers/category.php
@@ -74,7 +74,7 @@ class category extends meta\controller {
$this->page->set_message('error', 'Section already exists for this category');
}
- $this->detail($id);
+ $this->index($id);
}
}
diff --git a/app/modules/meta/controllers/genre.php b/app/modules/meta/controllers/genre.php
index 19f3133..144460e 100644
--- a/app/modules/meta/controllers/genre.php
+++ b/app/modules/meta/controllers/genre.php
@@ -97,6 +97,9 @@ class genre extends meta\controller {
$this->load_view('genre_detail', $data);
}
+ /**
+ * Adds a category to the current genre
+ */
public function add_category()
{
// Strip away tags for the sake of security
diff --git a/app/modules/meta/controllers/section.php b/app/modules/meta/controllers/section.php
index 04d572b..f13a59d 100644
--- a/app/modules/meta/controllers/section.php
+++ b/app/modules/meta/controllers/section.php
@@ -62,7 +62,10 @@ class section extends meta\controller {
$keys = filter_var_array($_POST['name'], FILTER_SANITIZE_STRING);
- $vals = filter_var_array($_POST['val'], FILTER_SANITIZE_STRING);
+
+ // Raw to allow use of HTML formatting
+ // Prepared statements keep the database safe here.
+ $vals = $_POST['val'];
$data = array_combine($keys, $vals);
diff --git a/app/modules/meta/models/model.php b/app/modules/meta/models/model.php
index c5a31ff..f3a0e9a 100644
--- a/app/modules/meta/models/model.php
+++ b/app/modules/meta/models/model.php
@@ -106,8 +106,8 @@ class model extends \miniMVC\Model {
// Fetch the data as a workaround
// for databases that do not support
// grabbing result counts (SQLite / Firebird)
- $array = $query->fetchAll();
- if (empty($array))
+ $array = $query->fetchAll(\PDO::FETCH_ASSOC);
+ if (count($array) < 1)
{
$this->db->set('genre', $genre)
->insert('genre');
diff --git a/app/modules/meta/views/category_detail.php b/app/modules/meta/views/category_detail.php
index 8e7e0be..2415262 100644
--- a/app/modules/meta/views/category_detail.php
+++ b/app/modules/meta/views/category_detail.php
@@ -13,7 +13,7 @@
- Add Section
+ Add Section
@@ -23,6 +23,10 @@
+
+ Edit
+ Delete
+
@@ -30,7 +34,10 @@
") !== FALSE) ? 'multiline' : 'pair' ?>
- = $k ?>
+
+ = $k ?>
+
+
= $v ?>
diff --git a/app/modules/meta/views/genre_detail.php b/app/modules/meta/views/genre_detail.php
index caab403..8049090 100644
--- a/app/modules/meta/views/genre_detail.php
+++ b/app/modules/meta/views/genre_detail.php
@@ -13,14 +13,20 @@
- Add Category
+ Add Category
diff --git a/app/modules/meta/views/genres.php b/app/modules/meta/views/genres.php
index 85cce01..603f4f7 100644
--- a/app/modules/meta/views/genres.php
+++ b/app/modules/meta/views/genres.php
@@ -9,13 +9,21 @@
- Add Genre
+ Add Genre
\ No newline at end of file
diff --git a/app/modules/meta/views/section_detail.php b/app/modules/meta/views/section_detail.php
index cc00275..17c13aa 100644
--- a/app/modules/meta/views/section_detail.php
+++ b/app/modules/meta/views/section_detail.php
@@ -16,10 +16,10 @@
Value:
-
+
- Save Data
+ Save Data
diff --git a/assets/config/config.php b/assets/config/config.php
index 2f44507..c1748dd 100755
--- a/assets/config/config.php
+++ b/assets/config/config.php
@@ -13,6 +13,7 @@
// --------------------------------------------------------------------------
+
/**
* Asset management configuration file
*
@@ -53,7 +54,7 @@ $css_root = $document_root. 'css/';
| Path fragment to rewrite in css files
|
*/
-$path_from = '';
+$path_from = './images/';
/*
|--------------------------------------------------------------------------
@@ -63,7 +64,7 @@ $path_from = '';
| The path fragment replacement for the css files
|
*/
-$path_to = '';
+$path_to = '//github.timshomepage.net/meta/assets/images/';
/*
|--------------------------------------------------------------------------
diff --git a/assets/config/css_groups.php b/assets/config/css_groups.php
index cb100fe..2113b50 100644
--- a/assets/config/css_groups.php
+++ b/assets/config/css_groups.php
@@ -23,7 +23,8 @@ return array(
'css' => array(
'normalize.css',
'message.css',
- 'theme.css'
+ 'theme.css',
+ 'tinyeditor.css'
)
);
// End of css_groups.php
\ No newline at end of file
diff --git a/assets/config/js_groups.php b/assets/config/js_groups.php
index 811ef79..663235a 100755
--- a/assets/config/js_groups.php
+++ b/assets/config/js_groups.php
@@ -28,6 +28,7 @@ return array(
'js' => array(
'kis-lite-dom-min.js',
+ 'tinyeditor.js',
'meta.js'
),
);
\ No newline at end of file
diff --git a/assets/css.php b/assets/css.php
index c6059ab..44bc32d 100755
--- a/assets/css.php
+++ b/assets/css.php
@@ -113,6 +113,10 @@ if ($last_modified === $requested_time)
exit();
}
+// Correct paths that have changed due to concatenation
+// based on rules in the config file
+$css = str_replace($path_from, $path_to, $css);
+
if (!isset($_GET['debug']))
{
$css = compress($css);
diff --git a/assets/css/theme.css b/assets/css/theme.css
index d939611..5722b0d 100644
--- a/assets/css/theme.css
+++ b/assets/css/theme.css
@@ -11,6 +11,10 @@ html, body {
button {
color:#312;
+ padding:5px;
+ border:1px solid #555;
+ border-radius:5px;
+ box-shadow:1px 1px #a98;
}
a {
@@ -30,7 +34,6 @@ legend:hover {
}
h1,h2 {
- display:-moz-inline-box;
display:inline-block;
vertical-align:middle;
width:25%;
@@ -43,8 +46,8 @@ fieldset dl {
/* form styles */
form dt, form dd {
- display:-moz-inline-box; /* For older versions of Mozilla/Firefox */
display:inline-block;
+ vertical-align:top;
padding:0.25em 0;
}
@@ -60,7 +63,40 @@ form dd {
padding-left:.25em;
}
-/* Outline styles */
+/* ! Edit buttons */
+.modify {
+ position:absolute;
+ display:none;
+ margin-left:1em;
+}
+
+li:hover .modify, dt:hover .modify {
+ display:inline-block;
+}
+
+button.save {
+ background:#797;
+ color:#eee;
+}
+
+button.save:hover {
+ background:#595;
+}
+
+button.edit {
+
+}
+
+button.delete {
+ background:#977;
+ color:#eee;
+}
+
+button.delete:hover {
+ background:#955;
+}
+
+/* ! Outline styles */
.list {
padding:0;
margin:0;
@@ -74,7 +110,11 @@ form dd {
list-style:none;
}
-/* Data listing styles */
+li h4 {
+ display:inline;
+}
+
+/* ! Data listing styles */
dl.multiline, dl.pair {
border-bottom:1px dotted #312;
}
@@ -92,7 +132,6 @@ dl.multiline dd {
}
dl.pair dt, dl.pair dd {
- display:-moz-inline-block;
display:inline-block;
padding:0.25em 0;
}
diff --git a/assets/css/tinyeditor.css b/assets/css/tinyeditor.css
new file mode 100755
index 0000000..af30fb8
--- /dev/null
+++ b/assets/css/tinyeditor.css
@@ -0,0 +1,57 @@
+.te {
+ border: 1px solid #bbb;
+ padding: 0 1px 1px;
+ font: 12px Verdana,Arial;
+}
+ .te iframe { border: none }
+.teheader {
+ height: 31px;
+ border-bottom: 1px solid #bbb;
+ background: url(./images/header-bg.gif) repeat-x;
+ padding-top: 1px;
+ overflow: hidden;
+}
+.testyle { margin-right: 12px }
+.tedivider {
+ float: left;
+ width: 1px;
+ height: 30px;
+ background: #ccc;
+}
+.tecontrol {
+ float: left;
+ width: 34px;
+ height: 30px;
+ cursor: pointer;
+ background-image: url(./images/icons.png);
+}
+.tecontrol:hover {
+ background-color: #fff;
+ background-position: 30px 0;
+}
+.tefooter {
+ height: 32px;
+ border-top: 1px solid #bbb;
+ background: #f5f5f5;
+}
+.toggle {
+ float: left;
+ background: url(./images/icons.png) -34px 2px no-repeat;
+ padding: 9px 13px 0 31px;
+ height: 23px;
+ border-right: 1px solid #ccc;
+ cursor: pointer;
+ color: #666;
+}
+.toggle:hover { background-color: #fff }
+.resize {
+ float: right;
+ height: 32px;
+ width: 32px;
+ background: url(./images/resize.gif) 15px 15px no-repeat;
+ cursor: s-resize;
+}
+#editor {
+ cursor: text;
+ margin: 10px;
+}
\ No newline at end of file
diff --git a/assets/images/header-bg.gif b/assets/images/header-bg.gif
new file mode 100755
index 0000000..a23a14d
Binary files /dev/null and b/assets/images/header-bg.gif differ
diff --git a/assets/images/icons.png b/assets/images/icons.png
new file mode 100755
index 0000000..e88b564
Binary files /dev/null and b/assets/images/icons.png differ
diff --git a/assets/images/resize.gif b/assets/images/resize.gif
new file mode 100755
index 0000000..385ec27
Binary files /dev/null and b/assets/images/resize.gif differ
diff --git a/assets/js/cache/js b/assets/js/cache/js
index 215d404..f61d7b4 100644
--- a/assets/js/cache/js
+++ b/assets/js/cache/js
@@ -1,17 +1,34 @@
-(function(){if("undefined"!==typeof document.querySelector){var d,e,b,c;d=function(a){c="undefined"===typeof a?"undefined"!==typeof d.el?d.el:document.documentElement:"object"!==typeof a?e(a):a;d.prototype.el=c;var a=b(d),f;for(f in a)"object"===typeof a[f]&&(a[f].el=c);a.el=c;return a};e=function(a,f){var b;if("string"!=typeof a||"undefined"===typeof a)return a;b=null!=f&&1===f.nodeType?f:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);b=b.querySelectorAll(a);
-return 1===b.length?b[0]:b};b=function(a){var f;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);f=typeof a;if(!("object"!==f&&"function"!==f))return f=function(){},f.prototype=a,new f}};d.ext=function(a,f){f.el=c;d[a]=f};d.ext("each",function(a){if("undefined"!==typeof c.length&&c!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(c,a);else{var f=c.length;if(0!==f)for(var b,d=0;d"],["Header 1",""],["Header 2",""],["Header 3",""],["Header 4",""],["Header 5",""],["Header 6",""]];k=m.length;h=0;
+g.className="testyle";g.onchange=new Function(this.n+'.ddaction(this,"formatblock")');for(h;h";f=a.bodyid?' id="'+a.bodyid+'"':"";a.cssfile&&(b+=' ');a.css&&(b+='");
+b+=""+(a.content||this.t.value);this.e.write(b+"