Permalink
Browse files

Cleaning up files and comments to use new standards. Updated admin su…

…bmit form js to use jQuery for browser compatability.
  • Loading branch information...
1 parent 563d040 commit 1e5710ba555b3a2fffb4e6a042bdb0c67d0c1a08 @geekforbrains committed Mar 21, 2012
Showing with 377 additions and 614 deletions.
  1. +0 −1 .htaccess
  2. +1 −1 README.md
  3. +1 −1 core/admin/admin.php
  4. +0 −11 core/admin/controllers/admin.php
  5. +0 −7 core/admin/setup.php
  6. +6 −0 core/admin/views/css/main.css
  7. +12 −0 core/admin/views/errors/500.php
  8. +1 −1 core/admin/views/errors/{401.php → access_denied.php}
  9. +2 −1 core/admin/views/includes/footer.php
  10. +5 −0 core/admin/views/js/admin.js
  11. +1 −1 core/db/controllers/db.php
  12. +12 −12 core/db/db_query.php
  13. +5 −0 core/db/setup.php
  14. +2 −4 core/html/html.php
  15. +1 −0 core/html/html_a.php
  16. +35 −68 core/html/html_form.php
  17. +27 −4 core/html/html_img.php
  18. +14 −2 core/html/html_js.php
  19. +0 −5 core/html/html_list.php
  20. +0 −76 core/html/html_table.php
  21. +6 −3 core/input/input.php
  22. 0 core/media/{ → assets}/phpthumb/GdThumb.inc.php
  23. 0 core/media/{ → assets}/phpthumb/PHPThumb.php
  24. 0 core/media/{ → assets}/phpthumb/PhpThumb.inc.php
  25. 0 core/media/{ → assets}/phpthumb/ThumbBase.inc.php
  26. 0 core/media/{ → assets}/phpthumb/ThumbLib.inc.php
  27. 0 core/media/{ → assets}/phpthumb/thumb_plugins/gd_reflection.inc.php
  28. +1 −4 core/media/controllers/file.php
  29. +4 −10 core/media/controllers/image.php
  30. +12 −40 core/media/media_file.php
  31. +13 −24 core/media/media_image.php
  32. +8 −36 core/media/media_imager.php
  33. +130 −115 core/media/media_uploader.php
  34. +3 −19 core/media/media_video.php
  35. +0 −3 core/media/setup.php
  36. +5 −41 core/menu/menu.php
  37. +0 −16 core/message/message.php
  38. +1 −20 core/multiarray/multiarray.php
  39. +4 −2 core/multilanguage/controllers/admin_language.php
  40. +3 −2 core/multilanguage/controllers/admin_module.php
  41. +8 −4 core/multilanguage/controllers/admin_string.php
  42. +41 −49 core/user/controllers/admin_role.php
  43. +2 −2 core/user/controllers/admin_user.php
  44. +0 −10 core/user/setup.php
  45. +0 −2 core/validate/validate_matches.php
  46. +0 −2 core/validate/validate_min.php
  47. +0 −2 core/validate/validate_numeric.php
  48. +0 −2 core/validate/validate_required.php
  49. +0 −3 core/view/controllers/view.php
  50. +3 −4 core/view/setup.php
  51. +4 −3 modules/page/controllers/admin_page.php
  52. +1 −1 modules/page/controllers/page.php
  53. +3 −0 setup.php
View
@@ -1,7 +1,6 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?r=$1 [L,QSA]
</IfModule>
View
@@ -5,7 +5,7 @@ A simple PHP framework that combines modules through the use of routes and event
Requirements
------------
-* PHP 5.2
+* PHP 5.2+
* MySQL/PDO (more databases coming soon)
* Web server (Apache, Nginx, etc) with mod rewrite
View
@@ -18,7 +18,7 @@ public static function setInAdmin($boolean) {
*/
public static function isConfigured()
{
- if(User::user()->where('is_admin', '>', 0)->first())
+ if(User::user()->where('is_admin', '>', 0)->limit(1)->first())
return true;
return false;
}
@@ -10,17 +10,6 @@ public static function redirect() {
}
/**
- * TODO
- */
- public static function dashboard()
- {
- return array(
- 'title' => 'Dashboard',
- 'content' => '<p>Dashboard is under development.</p>'
- );
- }
-
- /**
* Used to run the admin install if it hasn't been created yet.
*/
public static function install()
View
@@ -14,13 +14,6 @@
'title' => 'Admin',
'callback' => array('admin', 'redirect'),
),
- /*
- 'admin/dashboard' => array(
- 'title' => 'Dashboard',
- 'callback' => array('admin', 'dashboard'),
- 'permissions' => array('admin.access') // User must at least have access to admin to view dashboard
- ),
- */
'admin/install' => array(
'title' => 'Install',
'callback' => array('admin', 'install'),
@@ -123,6 +123,12 @@ a:hover {
color: #660000;
}
+.messages p.info {
+ background-color: #FFFFE5;
+ border: 1px solid #CCCC00;
+ color: #808000;
+}
+
.content h1,
.content h2 {
font-weight: bold;
@@ -0,0 +1,12 @@
+<? View::insert('includes/header'); ?>
+
+<!-- start content -->
+<div class="content container_12">
+ <div class="grid_4 prefix_4 spacer">
+ <h1>500: Internal Server Error</h1>
+ <p>Dont panic, but an internal error has occured. You might want to come back later.</p>
+ </div>
+</div>
+<!-- end content -->
+
+<? View::insert('includes/footer'); ?>
@@ -3,7 +3,7 @@
<!-- start content -->
<div class="content container_12">
<div class="grid_4 prefix_4 spacer">
- <h1>401: Access Denied</h1>
+ <h1>Access Denied</h1>
<p>You do not have permission to access this page.</p>
</div>
</div>
@@ -1,7 +1,8 @@
<!-- start footer -->
<div class="footer container_12">
<div class="grid_12">
- Powered by <a href="http://github.com/geekforbrains/caffeine" target="_blank">Caffeine <?= VERSION; ?></a>
+ System Time: <?= date('M jS, Y - h:i A'); ?> (<?= Config::get('system.timezone'); ?>)
+ <a style="float: right" href="http://github.com/geekforbrains/caffeine" target="_blank">Caffeine <?= VERSION; ?></a>
</div>
<div class="clear">&nbsp;</div>
</div>
@@ -1,4 +1,9 @@
$(function() {
+ $('.submitter').click(function(e){
+ e.preventDefault();
+ $(this).closest('form').submit();
+ });
+
$('table tr').mouseover(function() {
$(this).addClass('hover')
});
@@ -43,7 +43,7 @@ public static function runner($cmd, $force = false)
exit();
}
else
- return ERROR_NOTFOUND;
+ return ERROR_404;
}
}
View
@@ -136,7 +136,7 @@ public function addIndex($key) {
}
/**
- * TODO
+ * TODO Comments
*/
public function select()
{
@@ -153,7 +153,7 @@ public function select()
}
/**
- * TODO
+ * TODO Comments
*/
public function insert($data, $getInsertId = true)
{
@@ -183,7 +183,7 @@ public function insert($data, $getInsertId = true)
}
/**
- * TODO
+ * TODO Comments
*/
public function update($data)
{
@@ -206,7 +206,7 @@ public function update($data)
}
/**
- * TODO
+ * TODO Comments
*/
public function delete($id = null)
{
@@ -222,7 +222,7 @@ public function delete($id = null)
}
/**
- * TODO
+ * TODO Comments
*/
public function truncate()
{
@@ -231,7 +231,7 @@ public function truncate()
}
/**
- * TODO
+ * TODO Comments
*/
public function describe()
{
@@ -269,7 +269,7 @@ public function exists($force = false)
}
/**
- * TODO
+ * TODO Comments
*/
public function distinct()
{
@@ -349,7 +349,7 @@ public function count($column = '*') {
}
/**
- * TODO
+ * TODO Comments
*/
public function orderBy($column, $direction = 'ASC')
{
@@ -363,7 +363,7 @@ public function orderBy($column, $direction = 'ASC')
}
/**
- * TODO
+ * TODO Comments
*/
public function limit($limit, $offset = null)
{
@@ -395,7 +395,7 @@ public function where($column, $operator, $value, $modifier = null)
}
/**
- * TODO
+ * TODO Comments
*/
public function andWhere($column, $operator, $value)
{
@@ -404,7 +404,7 @@ public function andWhere($column, $operator, $value)
}
/**
- * TODO
+ * TODO Comments
*/
public function orWhere($column, $operator, $value)
{
@@ -429,7 +429,7 @@ public function join($table, $column1, $operator, $column2, $modifier = 'INNER')
}
/**
- * TODO
+ * TODO Comments
*/
public function leftJoin($table, $column1, $operator, $column2)
{
View
@@ -10,6 +10,11 @@
'db.enable_url_runner' => false
),
+ /**
+ * The following routes are used for calling commands in the db runner, such as
+ * install, update and optimize. The ability to run these commands must bet set
+ * in the setup.php config before they'll work.
+ */
'routes' => array(
'db/:slug' => array(
'callback' => array('db', 'runner')
View
@@ -7,17 +7,15 @@ class Html extends Module {
* classes "get" method will be called automatically. Alternatively, you can chain methods
* to call other methods within the class.
*
- * Short-hand calls are echoed automatically.
- *
* Example of short-hand method:
- * Html::a('some/path', 'My Title'); Is the same as: echo Html::a()->get('some/path', 'My Title');
+ * Html::a('some/path', 'My Title'); Is the same as: Html::a()->get('some/path', 'My Title');
*
* Example of method chaining:
* Html::form()->open('some/path');
*
* @param string $name The name of the HTML helper class to call
* @param mixed $args Optional params to be passed to the called method directly, used for short-hand calls
- * @return mixed If using short hand, nothing is returned but the HTML is echoed. Otherwise the helper object is returned.
+ * @return mixed
*/
public static function __callStatic($name, $args)
{
View
@@ -7,6 +7,7 @@ class Html_A {
* be added to the attributes.
*
* Basic Example:
+ * Html::a('My Text', 'some/path'); // Short hand
* Html::a()->get('My Text', 'some/path');
*
* Attributes Example:
Oops, something went wrong.

0 comments on commit 1e5710b

Please sign in to comment.