-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
2,769 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# License Agreement | ||
|
||
This license is a legal agreement between you and the Modular Gaming Team for the use of Modular Gaming (the "Software"). | ||
By obtaining the Software you agree to comply with the terms and conditions of this license. | ||
|
||
Copyright 2008-2013 Modular Gaming | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of the author nor the names of other | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
# Developer's Certificate of Origin 1.1 | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
(a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
|
||
(b) The contribution is based upon previous work that, to the best | ||
of my knowledge, is covered under an appropriate open source | ||
license and I have the right under that license to submit that | ||
work with modifications, whether created in whole or in part | ||
by me, under the same open source license (unless I am | ||
permitted to submit under a different license), as indicated | ||
in the file; or | ||
|
||
(c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
|
||
(d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including all | ||
personal information I submit with it, including my sign-off) is | ||
maintained indefinitely and may be redistributed consistent with | ||
this project or the open source license(s) involved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
core | ||
==== | ||
# [Modular Gaming Core](http://www.modulargaming.com) | ||
|
||
Modular Gaming core module. | ||
A modular [persistent browser based game](http://www.pbbg.org) framework using [Kohana 3.3](https://github.com/kohana/core) with [ORM](https://github.com/kohana/orm) and [KOstache](https://github.com/zombor/KOstache). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
abstract class Abstract_Controller_Ajax extends MG_Abstract_Controller_Ajax {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
abstract class Abstract_Controller_Frontend extends MG_Abstract_Controller_Frontend {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
abstract class Abstract_Tab extends MG_Abstract_Tab {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
/** | ||
* Abstract base view for normal purposes. | ||
* | ||
* @package Modular Gaming | ||
* @category View | ||
* @author Modular Gaming Team | ||
* @copyright (c) 2012-2013 Modular Gaming Team | ||
* @license BSD http://modulargaming.com/license | ||
*/ | ||
abstract class Abstract_View extends MG_Abstract_View {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
/** | ||
* Abstract base view for email purposes. | ||
* | ||
* @package Modular Gaming | ||
* @category View | ||
* @author Modular Gaming Team | ||
* @copyright (c) 2012-2013 Modular Gaming Team | ||
* @license BSD http://modulargaming.com/license | ||
*/ | ||
abstract class Abstract_View_Email extends MG_Abstract_View_Email {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
abstract class Abstract_View_Tab extends MG_Abstract_View_Tab {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Controller extends MG_Controller {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Controller_Assets extends MG_Controller_Assets {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Controller_Error extends MG_Controller_Error { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Controller_Search extends MG_Controller_Search {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Controller_Welcome extends MG_Controller_Welcome {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Date extends MG_Date {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Email extends MG_Email { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Event extends MG_Event {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class HTTP_Exception extends MG_HTTP_Exception {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class HTTP_Exception_401 extends MG_HTTP_Exception_401 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class HTTP_Exception_404 extends MG_HTTP_Exception_404 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Hint extends MG_Hint {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
interface Interface_Property extends MG_Interface_Property {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Journal extends MG_Journal {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Kostache_Email extends MG_Kostache_Email {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
|
||
class Kostache_Layout extends MG_Kostache_Layout {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
/** | ||
* Abstract base controller for ajax. | ||
* | ||
* @package MG/Core | ||
* @category Controller | ||
* @author Modular Gaming Team | ||
* @copyright (c) 2012-2013 Modular Gaming Team | ||
* @license BSD http://modulargaming.com/license | ||
*/ | ||
abstract class MG_Abstract_Controller_Ajax extends Controller { | ||
|
||
public function before() | ||
{ | ||
parent::before(); | ||
|
||
$this->response->headers('Content-Type', 'application/json'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
/** | ||
* Abstract base controller for frontend controllers. | ||
* | ||
* @package MG/Core | ||
* @category Controller | ||
* @author Modular Gaming Team | ||
* @copyright (c) 2012-2013 Modular Gaming Team | ||
* @license BSD http://modulargaming.com/license | ||
*/ | ||
abstract class MG_Abstract_Controller_Frontend extends Controller { | ||
|
||
/** | ||
* @var Abstract_View view to render | ||
*/ | ||
protected $view = NULL; // View to render. | ||
|
||
/** | ||
* @var string layout file. | ||
*/ | ||
protected $layout = 'layout'; | ||
|
||
/** | ||
* Run CSRF check and load frontend assets. | ||
*/ | ||
public function before() | ||
{ | ||
parent::before(); | ||
|
||
$this->_validate_csrf(); | ||
} | ||
|
||
/** | ||
* Set the response body to $this->view if $this->view is defined.. | ||
*/ | ||
public function after() | ||
{ | ||
if ($this->view != NULL) | ||
{ | ||
$renderer = Kostache_Layout::factory(); | ||
$renderer->set_layout($this->layout); | ||
$this->response->body($renderer->render($this->view)); | ||
} | ||
} | ||
|
||
/** | ||
* Check to ensure POST requests contains CSRF. | ||
* @throws HTTP_Exception | ||
*/ | ||
private function _validate_csrf() | ||
{ | ||
if ($this->request->method() == HTTP_Request::POST) | ||
{ | ||
$validation = Validation::factory($this->request->post()) | ||
->rule('csrf', 'not_empty') | ||
->rule('csrf', 'Security::check'); | ||
|
||
if ( ! $validation->check()) | ||
{ | ||
throw HTTP_Exception::Factory(403, 'CSRF check failed!'); | ||
} | ||
} | ||
} | ||
|
||
} // End Frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php defined('SYSPATH') OR die('No direct script access.'); | ||
/** | ||
* | ||
* | ||
* @package MG/Core | ||
* @category View | ||
* @author Modular Gaming Team | ||
* @copyright (c) 2012-2013 Modular Gaming Team | ||
* @license BSD http://modulargaming.com/license | ||
*/ | ||
abstract class MG_Abstract_Tab { | ||
|
||
/** | ||
* @var Abstract_View_Tab $view | ||
*/ | ||
protected $view; | ||
|
||
public function render() | ||
{ | ||
$renderer = Kostache::factory(); | ||
return $renderer->render($this->view); | ||
} | ||
|
||
} |
Oops, something went wrong.