A set of plugins to help on managing geographic information

This commit is contained in:
ahwelp
2023-01-24 20:41:37 +00:00
parent 616a97f16c
commit a60cfcec3a
61 changed files with 7895 additions and 0 deletions
+111
View File
@@ -0,0 +1,111 @@
<?php
namespace App\Geo\Params;
use \App\Core\Template\Output as Output;
use \App\Geo\Params\Classes\Params as Params;
class ParamsController {
/**
* Index
* Show the main Params list
*/
function index(){
Output::setView('index');
$list = Array();
for($i = 0; $i <= 10; $i++){
$obj = Array();
$obj['id'] = $i;
$obj['value'] = md5($i);
$obj['description'] = sha1($i);
$list[] = $obj;
}
Output::addValue('list', $list );
Output::render();
}
/**
* Create
*
* Render the main Params formulary
*/
function create(){
Output::setView('form', ['id' => 0]);
Output::render();
}
/**
* Store
*
* Store the param on the database
* @param Params $params
*/
function store(Params $params){
}
/**
* Search
*
* Store the param on the database
* @param Params $params
*/
function search(){
}
/**
* Show
*
* Render one register
*
* @param Params $params
*/
function show(Params $params){
}
/**
* Edit
*
* Render the formular for a database Params
*
* @param Params $params
*/
function edit(Params $params){
Output::setView('form', $params);
Output::render();
}
/**
* Update
* Store the changes of the param on the database
*
* @param Params $params
*/
function update(Params $params){
}
/**
* Destroy
* If the object has soft delete.
*
* @param Params $params
*/
function destroy(Params $params){
}
/**
* Purge
* Remove object even with soft delete.
*
* @param Params $params
*/
function purge(Params $params){
}
}
+14
View File
@@ -0,0 +1,14 @@
<?php
use App\Core\Template\Output as Output;
use Routes\RouteCollection as RouteCollection;
//Menu itens
RouteCollection::get('*', function() {
//Output::addMenu('/params', 'params', "<i class='fa fa-fa-cubes'></i>", ['class' => 'nav-link']);
Output::addOnSubmenu('geo', '/params', 'Parametrização', "", ['class' => 'nav-link']);
}, -10)->doIgnore();
RouteCollection::group("/params", function(){
});
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Geo\Params\Classes;
use ORM\Entity as Entity;
class Params extends Entity {
//const _idPolice = Array("type" => "", "min" => 0, "max" => 100000, "step" => 2);
const _tableName = "params";
/*const _properties = Array(
"id" => ['listable' => true, 'searcheble' => false, 'orderable' => false],
"name" => ['listable' => true, 'searcheble' => true]);
*/
//const _timestamps = true;
//const _softdelete = true;
//const _connectionName = "";
}
+25
View File
@@ -0,0 +1,25 @@
<?php
use Schema\Wrapper as Wrapper;
use App\Core\Sanity\MigratorController as Migrator;
function geo_params_upgrade($pluginversion) {
if ($pluginversion < "0.0.1") {
$table = Wrapper::get_table("geo_params");
$table->addColumn("table", "string", Array("null" => false));
$table->addColumn("key", "string", Array("null" => false));
$table->addColumn("value", "string", Array("null" => false));
$table->create();
Migrator::getInstance()->update_plugin_version("geo_params", "1.0.0");
return;
}
}
function geo_params_rollback($pluginversion) {
if($pluginversion > "0.0.1"){
$table = Wrapper::get_table("geo_params");
$table->drop();
return;
}
}
+2
View File
@@ -0,0 +1,2 @@
<?php
$lang["params"]["module_name"] = "Params";
+2
View File
@@ -0,0 +1,2 @@
<?php
$lang["params"]["module_name"] = "Params";
+6
View File
@@ -0,0 +1,6 @@
<?php
$plugin->name = "geo_params";
$plugin->version = "1.0.0";
//$plugin->require = Array( ["name" => "plugin_name", "version" => "x.x.x"] );
+10
View File
@@ -0,0 +1,10 @@
{{@ if( {{id}} ): @}}
<form method="POST" action="/params/{{id}}/edit">
<input type="hidden" name="id" value="{{id}}" />
<input type="hidden" name="_method" value="put" />
{{@ else: @}}
<form method="POST" action="/params">
<input type="hidden" name="id" value="" />
{{@ endif; @}}
</form>
+4
View File
@@ -0,0 +1,4 @@
<a href='/params/form' >Adicionar </a>
<div class="table-responsive">
</div>