├── public ├── index.html ├── css │ ├── index.html │ ├── koot │ │ ├── _koot.css │ │ ├── paginator.css │ │ ├── flash.css │ │ ├── logo.css │ │ ├── scaffold.css │ │ ├── icons.css │ │ └── admin.css │ ├── koot.scss │ ├── kumbia │ │ ├── paginator.css │ │ ├── flash.css │ │ ├── scaffold.css │ │ ├── icons.css │ │ └── kumbia.css │ ├── kumbia.min.css │ └── koot.min.css ├── files │ ├── index.html │ └── upload │ │ └── index.html ├── img │ ├── index.html │ ├── upload │ │ └── index.html │ ├── logo.png │ ├── login.jpg │ ├── datepicker │ │ ├── cal.gif │ │ ├── bullet1.gif │ │ ├── bullet2.gif │ │ ├── cal-grey.gif │ │ ├── bg_header.jpg │ │ ├── backstripes.gif │ │ └── gradient-e5e5e5-ffffff.gif │ ├── welcome │ │ ├── user_management.avif │ │ ├── user_management.png │ │ ├── permission_handling.avif │ │ ├── permission_handling.png │ │ ├── resource_management.avif │ │ ├── resource_management.png │ │ ├── role_based_access_control.avif │ │ └── role_based_access_control.png │ ├── kumbia.svg │ ├── icons │ │ ├── edit.svg │ │ └── delete.svg │ ├── php7.svg │ ├── koot.svg │ └── kumbiaphp.svg ├── temp │ └── index.html ├── javascript │ ├── index.html │ └── jquery │ │ ├── jquery.kumbiaphp.min.js │ │ └── jquery.kumbiaphp.js ├── js │ ├── app.js │ └── minimal-theme-switcher.js ├── robots.txt ├── favicon.ico ├── .htaccess ├── web.config ├── .user.ini └── index.php ├── koot ├── temp │ ├── cache │ │ └── empty │ ├── logs │ │ └── empty │ └── sqlite │ │ └── ku_admin.db ├── .htaccess ├── extensions │ ├── console │ │ └── empty │ ├── filters │ │ └── empty │ ├── helpers │ │ └── empty │ └── scaffolds │ │ └── empty ├── bin │ ├── phpserver │ └── metrics ├── models │ ├── permissions.php │ ├── users_roles.php │ ├── users.php │ ├── resources.php │ └── roles.php ├── config │ ├── mysql │ │ ├── ku_admin.mwb │ │ └── ku_admin.sql │ ├── exception.php │ ├── databases.php │ ├── routes.php │ └── config.php ├── locale │ └── es_ES │ │ └── LC_MESSAGES │ │ ├── default.mo │ │ └── default.po ├── views │ ├── _shared │ │ ├── templates │ │ │ ├── json.phtml │ │ │ ├── csv.phtml │ │ │ ├── xml.phtml │ │ │ ├── default.phtml │ │ │ ├── admin.phtml │ │ │ └── login │ │ │ │ └── login.phtml │ │ ├── partials │ │ │ ├── kumbia │ │ │ │ └── footer.phtml │ │ │ └── paginators │ │ │ │ ├── classic.phtml │ │ │ │ └── digg.phtml │ │ ├── scaffolds │ │ │ ├── kumbia │ │ │ │ ├── crear.phtml │ │ │ │ ├── ver.phtml │ │ │ │ └── index.phtml │ │ │ └── lite │ │ │ │ ├── show.phtml │ │ │ │ └── page.phtml │ │ └── errors │ │ │ └── 404.phtml │ ├── admin │ │ ├── roles │ │ │ └── create.phtml │ │ ├── users │ │ │ └── create.phtml │ │ └── resources │ │ │ └── create.phtml │ ├── index │ │ └── index.phtml │ └── pages │ │ └── kumbia │ │ └── status.phtml ├── controllers │ ├── admin │ │ ├── roles_controller.php │ │ ├── users_controller.php │ │ └── resources_controller.php │ ├── index_controller.php │ └── pages_controller.php ├── libs │ ├── bootstrap.php │ ├── pages_trait.php │ ├── view.php │ ├── active_record.php │ ├── lite_record.php │ ├── app_controller.php │ ├── controller_rest.php │ ├── controller_admin.php │ ├── controller_scaffold.php │ ├── controller_scaffold_lite.php │ └── httpk.php ├── phpunit.xml.dist └── tests │ ├── bootstrap.php │ ├── KumbiaTestTrait.php │ └── Controller │ └── PagesControllerTest.php ├── .gitignore ├── .github └── FUNDING.yml ├── .travis.yml ├── README.md ├── composer.json ├── phpunit.xml.dist └── LICENSE /public/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/temp/cache/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/temp/logs/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/css/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/files/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/temp/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/upload/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/javascript/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all 2 | -------------------------------------------------------------------------------- /koot/extensions/console/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/extensions/filters/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/extensions/helpers/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/extensions/scaffolds/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/files/upload/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/js/app.js: -------------------------------------------------------------------------------- 1 | // New KumbiaJS 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /koot/bin/phpserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | php -S 0.0.0.0:8001 -t ../public -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumbiaPHP/Koot/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumbiaPHP/Koot/HEAD/public/img/logo.png -------------------------------------------------------------------------------- /koot/models/permissions.php: -------------------------------------------------------------------------------- 1 | status = 1; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /koot/models/resources.php: -------------------------------------------------------------------------------- 1 | status = 1; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /koot/controllers/admin/resources_controller.php: -------------------------------------------------------------------------------- 1 | [] 7 | ]; 8 | -------------------------------------------------------------------------------- /public/css/koot/_koot.css: -------------------------------------------------------------------------------- 1 | /*! Koot 2024 */ 2 | @import "pico.css"; 3 | /* @import "admin.css"; */ 4 | @import "flash.css"; 5 | @import "icons.css"; 6 | @import "logo.css"; 7 | @import "paginator.css"; 8 | -------------------------------------------------------------------------------- /public/img/kumbia.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /koot/models/roles.php: -------------------------------------------------------------------------------- 1 | 'Super Admin', 7 | 2 => 'Editor', 8 | 3 => 'Author' 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /koot/libs/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | © 2020 - Koot Team 3 |

4 | -------------------------------------------------------------------------------- /public/img/icons/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/css/koot.scss: -------------------------------------------------------------------------------- 1 | // Import Flash 2 | @import "koot/flash"; 3 | 4 | // Import Icons 5 | @import "koot/icons"; 6 | 7 | // Import Admin 8 | @import "koot/admin"; 9 | 10 | // Import Paginator 11 | @import "koot/paginator"; 12 | 13 | // Import Pico 14 | @import "koot/pico"; 15 | 16 | // Import Scaffold 17 | @import "koot/scaffold"; 18 | 19 | // Import Logo 20 | @import "koot/logo"; -------------------------------------------------------------------------------- /koot/libs/active_record.php: -------------------------------------------------------------------------------- 1 | 2 |

3 |
4 | 5 | 8 | 9 | 10 | 11 |
12 |
13 | 14 |
-------------------------------------------------------------------------------- /koot/views/_shared/scaffolds/kumbia/crear.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |

$action_name" ?>

4 | 5 |
6 | 7 |
8 | 9 |
10 | Listado 11 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /public/img/icons/delete.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/css/kumbia/paginator.css: -------------------------------------------------------------------------------- 1 | .paginator .nextprev { 2 | color: #000; 3 | } 4 | 5 | .paginator a { 6 | border: 1px solid #e8ebf1; 7 | padding: .5em; 8 | text-decoration: none; 9 | margin: .5em .1em; 10 | background: #FFF; 11 | } 12 | 13 | .paginator a:hover { 14 | background: #e8ebf1; 15 | } 16 | 17 | .paginator strong { 18 | background: #e8ebf1; 19 | border: 1px solid #e8ebf1; 20 | padding: .5em; 21 | margin: .5em .1em; 22 | } -------------------------------------------------------------------------------- /koot/views/_shared/templates/csv.phtml: -------------------------------------------------------------------------------- 1 | getFields()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /public/css/koot/flash.css: -------------------------------------------------------------------------------- 1 | /* Formatea los mensajes Flash::xxx() de KumbiaPHP */ 2 | 3 | .flash { 4 | margin: 5px 0; 5 | min-height: 32px; 6 | padding: 3px 10px 3px 50px; 7 | background-repeat: no-repeat; 8 | background-position: 10px center; 9 | line-height: 32px; 10 | border-radius: 2px; 11 | } 12 | 13 | .error { 14 | color: #D8000C; 15 | background-color: #FFBABA; 16 | } 17 | 18 | .info { 19 | color: #00529B; 20 | background-color: #BDE5F8; 21 | } 22 | 23 | .valid { 24 | color: #4F8A10; 25 | background-color: #DFF2BF; 26 | } 27 | 28 | .warning { 29 | color: #9F6000; 30 | background-color: #FEEFB3; 31 | } -------------------------------------------------------------------------------- /public/css/kumbia/flash.css: -------------------------------------------------------------------------------- 1 | /* Formatea los mensajes Flash::xxx() de KumbiaPHP */ 2 | 3 | .flash { 4 | margin: 5px 0; 5 | min-height: 32px; 6 | padding: 3px 10px 3px 50px; 7 | background-repeat: no-repeat; 8 | background-position: 10px center; 9 | line-height: 32px; 10 | border-radius: 2px; 11 | } 12 | 13 | .error { 14 | color: #D8000C; 15 | background-color: #FFBABA; 16 | } 17 | 18 | .info { 19 | color: #00529B; 20 | background-color: #BDE5F8; 21 | } 22 | 23 | .valid { 24 | color: #4F8A10; 25 | background-color: #DFF2BF; 26 | } 27 | 28 | .warning { 29 | color: #9F6000; 30 | background-color: #FEEFB3; 31 | } -------------------------------------------------------------------------------- /koot/libs/app_controller.php: -------------------------------------------------------------------------------- 1 | 2 |

3 |
4 | 5 |
6 | 9 | 10 | 13 |
14 | 17 | 18 | 19 | 20 |
21 |
22 | 23 |
-------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: kumbiaphp 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | DirectoryIndex index.php 2 | # Si esta mod_rewrite habilitado 3 | 4 | # Activar modo de reescritura 5 | RewriteEngine On 6 | 7 | # Directorio de instalacion, puede ser necesario si 8 | # la aplicacion se ubica en public_html 9 | #RewriteBase / 10 | 11 | # No permite reescritura si el archivo o directorio existe 12 | RewriteCond %{REQUEST_FILENAME} !-f 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | 15 | # Para peticiones que no son archivos ni directorios 16 | # Reescribe a index.php/ 17 | RewriteRule (.*) index.php/$1 [L] 18 | 19 | # Reescribe a index.php?_url=URL 20 | #RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] 21 | 22 | -------------------------------------------------------------------------------- /public/img/php7.svg: -------------------------------------------------------------------------------- 1 | PHP7PHP7readyready -------------------------------------------------------------------------------- /koot/bin/metrics: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PATH=./vendor/bin:../../vendor/bin:~/.config/composer/vendor/bin:~/.composer/vendor/bin:$PATH 4 | 5 | phpmetrics --report-html="./temp/metrics" --exclude="tests,temp,features" . 6 | 7 | if [[ $? > 0 ]]; then 8 | #do log_error; 9 | echo 10 | echo phpmetrics not installed. Install with: 11 | echo composer global require phpmetrics/phpmetrics 12 | echo 13 | exit 1; 14 | fi 15 | 16 | echo 17 | echo Control+click to open: 18 | echo file://$PWD/temp/metrics/index.html 19 | echo 20 | # If you want open it in browser directly 21 | # xdg-open file://$PWD/temp/metrics/index.html 22 | # in Mac 23 | # open file://$PWD/temp/metrics/index.html 24 | 25 | # composer global require 'phpmetrics/phpmetrics' -------------------------------------------------------------------------------- /public/css/koot/logo.css: -------------------------------------------------------------------------------- 1 | /* Dark color scheme (Auto) */ 2 | /* Automatically enabled if user has Dark mode enabled */ 3 | @media only screen and (prefers-color-scheme: dark) { 4 | :root:not([data-theme]) { 5 | --koot-logo-wordmark: #bdecee; 6 | } 7 | } 8 | 9 | /* Can be forced with data-theme="light" */ 10 | [data-theme="light"], 11 | :root:not([data-theme="dark"]) { 12 | --koot-logo-wordmark: #002741; 13 | } 14 | 15 | [data-theme="dark"], 16 | :root:not([data-theme="light"]) { 17 | --koot-logo-wordmark: #bdecee; 18 | } 19 | 20 | svg.logo { 21 | width: 5rem; 22 | height: auto; 23 | margin: -.5rem; 24 | } 25 | 26 | @media (min-width: 576px) { 27 | svg.logo { 28 | width: 10rem; 29 | margin: -1rem; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /public/css/kumbia/scaffold.css: -------------------------------------------------------------------------------- 1 | #scaffold table a { 2 | color: #333; 3 | font-weight: normal; 4 | } 5 | 6 | #scaffold table a:hover { 7 | color: #0ac; 8 | text-decoration: none; 9 | } 10 | 11 | #scaffold table { 12 | width: 100% 13 | } 14 | 15 | #scaffold th { 16 | text-align: left; 17 | } 18 | 19 | #scaffold caption { 20 | font-size: 2em; 21 | text-align: left; 22 | } 23 | 24 | #scaffold .show { 25 | list-style: none; 26 | padding: 1em 27 | } 28 | 29 | #scaffold .show strong { 30 | width: 30%; 31 | display: inline-block; 32 | } 33 | 34 | #scaffold .show li { 35 | padding: 8px; 36 | line-height: 1.5; 37 | border-top: 1px solid #ddd; 38 | } 39 | 40 | #scaffold .show li:hover { 41 | background-color: #f5f5f5 42 | } 43 | -------------------------------------------------------------------------------- /public/css/koot/scaffold.css: -------------------------------------------------------------------------------- 1 | /* #scaffold table a { 2 | color: #333; 3 | font-weight: normal; 4 | } 5 | 6 | #scaffold table a:hover { 7 | color: #0ac; 8 | text-decoration: none; 9 | } */ 10 | 11 | #scaffold table { 12 | width: 100% 13 | } 14 | 15 | #scaffold th { 16 | text-align: left; 17 | } 18 | 19 | #scaffold caption { 20 | font-size: 2em; 21 | text-align: left; 22 | } 23 | 24 | #scaffold .show { 25 | list-style: none; 26 | padding: 1em 27 | } 28 | 29 | #scaffold .show strong { 30 | width: 30%; 31 | display: inline-block; 32 | } 33 | 34 | #scaffold .show li { 35 | padding: 8px; 36 | line-height: 1.5; 37 | border-top: 1px solid #ddd; 38 | } 39 | 40 | #scaffold .show li:hover { 41 | background-color: #f5f5f5 42 | } 43 | -------------------------------------------------------------------------------- /koot/config/databases.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'dsn' => 'mysql:host=127.0.0.1;dbname=ku_admin;charset=utf8', 9 | 'username' => 'root', 10 | 'password' => '', 11 | 'params' => [ 12 | //PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', //UTF8 en PHP < 5.3.6 13 | \PDO::ATTR_PERSISTENT => \true, //conexión persistente 14 | \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION 15 | ] 16 | ] 17 | ];*/ 18 | 19 | /** 20 | * Ejemplo de SQLite 21 | */ 22 | return ['default' => [ 23 | 'dsn' => 'sqlite:'.APP_PATH.'temp/sqlite/ku_admin.db', 24 | 'pdo' => 'On', 25 | ] 26 | ]; 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | dist: bionic 3 | 4 | php: 5 | - 7.4 6 | - 8.0 7 | - master 8 | 9 | matrix: 10 | allow_failures: 11 | - php: master 12 | # 7.2 and 7.3 for the Mockery class 13 | 14 | notifications: 15 | slack: kumbiaphp:51JaKQTXASwf52D8b32OyWb9 16 | # irc: "irc.freenode.org#kumbiaphp" 17 | # email: 18 | # - xxxxx@gmail.com 19 | 20 | 21 | # env: 22 | # - DB=mysql 23 | # - DB=pgsql 24 | # - DB=sqlite 25 | 26 | install: 27 | - composer install 28 | 29 | script: 30 | - vendor/bin/phpunit --configuration phpunit.xml.dist 31 | # - phpunit --configuration core/phpunit.xml.dist --coverage-text --colors --coverage-clover=coverage.clover 32 | # - wget https://scrutinizer-ci.com/ocular.phar 33 | # - php ocular.phar code-coverage:upload --format=php-clover coverage.clover -------------------------------------------------------------------------------- /public/css/koot/icons.css: -------------------------------------------------------------------------------- 1 | /* Using https://feathericons.com/ */ 2 | .icon { 3 | filter: invert(0.5); 4 | } 5 | 6 | .icon:hover { 7 | filter: none 8 | } 9 | 10 | /* .actions .icon { 11 | border: 1px solid gray; 12 | padding: .5em; 13 | border-radius: 6px; 14 | } */ 15 | /* .delete { 16 | 17 | } 18 | 19 | .edit { 20 | /* background-image: url("data:image/svg+xml;utf8,") 21 | background-image: url(/img/edit.svg); 22 | } */ -------------------------------------------------------------------------------- /public/css/kumbia/icons.css: -------------------------------------------------------------------------------- 1 | /* Using https://feathericons.com/ */ 2 | .icon { 3 | filter: invert(0.5); 4 | } 5 | 6 | .icon:hover { 7 | filter: none 8 | } 9 | 10 | /* .actions .icon { 11 | border: 1px solid gray; 12 | padding: .5em; 13 | border-radius: 6px; 14 | } */ 15 | /* .delete { 16 | 17 | } 18 | 19 | .edit { 20 | /* background-image: url("data:image/svg+xml;utf8,") 21 | background-image: url(/img/edit.svg); 22 | } */ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Koot logo](https://raw.githubusercontent.com/KumbiaPHP/Koot/master/public/img/koot.svg) 2 | 3 | ## Koot 4 | 5 | Community backend to avoid repeating ourselves in new applications. 6 | 7 | ### Requirements 8 | 9 | * PHP >= 8.0 10 | * Composer 11 | * Multi language 12 | 13 | ### Install 14 | 15 | 1. Clone or download this repository 16 | 2. Rename folder to `koot` 17 | 3. Open the console and enter the `koot/` folder 18 | 4. Run command `composer install` to get the dependencies 19 | 20 | ### Run 21 | 22 | 1. Open the console and enter the `koot/app/` folder 23 | 2. Run command `bin/phpserver` 24 | 3. Open http://0.0.0.0:8001 in your browser 25 | 26 | ### Support us 27 | 28 | [Donate our collective](https://opencollective.com/kumbiaphp) 29 | 30 | Chat with us 31 | 32 | -------------------------------------------------------------------------------- /public/css/koot/admin.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 992px) { 2 | #develop { 3 | --block-spacing-horizontal: calc(var(--spacing) * 1.75); 4 | grid-column-gap: calc(var(--block-spacing-horizontal)); 5 | display: grid; 6 | grid-template-columns:200px auto; 7 | height: 100vh; 8 | padding: 0 9 | } 10 | 11 | #develop > aside { 12 | border-right: 1px solid var(--muted-border-color) 13 | } 14 | 15 | #doc > nav { 16 | border-bottom: 1px solid var(--muted-border-color) 17 | } 18 | 19 | #menu { 20 | background-color: var(); 21 | } 22 | 23 | .settings { 24 | text-decoration: none; 25 | position: absolute; 26 | bottom: 0; 27 | padding-bottom: 1em; 28 | width: 200px; 29 | border-top: 1px solid solid var(--muted-border-color) 30 | } 31 | } -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /koot/libs/controller_rest.php: -------------------------------------------------------------------------------- 1 | 'controlador2/accion2/valor_id2' 11 | * 12 | * Ej: 13 | * Enrutar cualquier petición a posts/adicionar a posts/insertar/* 14 | * '/posts/adicionar/*' => 'posts/insertar/*' 15 | * 16 | * Otros ejemplos: 17 | * 18 | * '/prueba/ruta1/*' => 'prueba/ruta2/*', 19 | * '/prueba/ruta2/*' => 'prueba/ruta3/*', 20 | */ 21 | return [ 22 | 'routes' => [ 23 | /** 24 | * Muestra la info relacionado con el framework 25 | */ 26 | '/' => 'index/index', 27 | /** 28 | * Status del config.php/config.ini 29 | */ 30 | '/status' => 'pages/kumbia/status' 31 | 32 | ], 33 | ]; 34 | -------------------------------------------------------------------------------- /koot/views/_shared/scaffolds/kumbia/ver.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

$action_name" ?>

5 |
    6 | fields as $field) : ?> 7 |
  • alias[$field]?> : $field) ?>
  • 8 | 9 |
10 | 11 |
12 | Listado 13 | Crear registro 14 | Editar 15 | Borrar 16 |
17 | 18 | 19 |

No existe

20 |
21 | Listado 22 | Crear registro 23 |
24 | 25 |
26 | -------------------------------------------------------------------------------- /koot/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ./tests 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ./tests 27 | ../../core 28 | ../../vendor 29 | 30 | 31 | -------------------------------------------------------------------------------- /koot/libs/controller_admin.php: -------------------------------------------------------------------------------- 1 | 2 |

3 |
4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 | 25 |
26 |
-------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kumbia/koot", 3 | "description": "KumbiaPHP admin", 4 | "keywords": [ 5 | "KumbiaPHP", 6 | "admin" 7 | ], 8 | "type": "project", 9 | "homepage": "https://kumbiaphp.com", 10 | "license": "BSD-3-Clause", 11 | "support": { 12 | "issues": "https://github.com/KumbiaPHP/Koot/issues", 13 | "slack": "https://slack.kumbiaphp.com" 14 | }, 15 | "authors": [ 16 | { 17 | "name": "Kumbia Community", 18 | "homepage": "https://github.com/KumbiaPHP/Koot/graphs/contributors" 19 | } 20 | ], 21 | "require": { 22 | "php": ">=8.0", 23 | "ext-pdo": "*", 24 | "ext-json": "*", 25 | "ext-curl": "*", 26 | "ext-gettext": "*", 27 | "kumbia/framework": "^1", 28 | "kumbia/activerecord": "^0.5" 29 | }, 30 | "require-dev": { 31 | "phpunit/phpunit": "^9" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "Koot\\": "koot/" 36 | } 37 | }, 38 | "config": { 39 | "optimize-autoloader": true, 40 | "sort-packages": true 41 | }, 42 | "funding": [ 43 | { 44 | "type": "Open Collective", 45 | "url": "https://opencollective.com/kumbiaphp" 46 | } 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /koot/views/_shared/scaffolds/kumbia/index.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |

$action_name" ?>

4 |
5 | 6 |
7 | items) && (count($data->items) > 0)) : ?> 8 | 9 | 10 | items)->fields as $field) : ?> 11 | 12 | 13 | 14 | 15 | 16 | items as $item) : ?> 17 | 18 | fields as $field) : ?> 19 | 20 | 21 | 25 | 26 | 27 | 28 |
items)->get_alias($field))?>Acciones
$field)?>id", 'Ver')?> | 22 | id", 'Editar')?> | 23 | id", 'Borrar', 'onclick="return confirm(\'¿Está seguro?\')"') ?> 24 |
29 | $data ,'url' => Router::get('controller_path').'/index')) ?> 30 | 31 | 32 |

No hay ningún registro

33 | 34 |
35 | -------------------------------------------------------------------------------- /koot/views/_shared/scaffolds/lite/show.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

_('Record not found')

6 |
7 | Listado 8 | Crear registro 9 |
10 | 11 |

12 |
    13 | getFields() as $key => $field) : ?> 14 |
  • getAlias()[$key] ?> $field) ?>
  • 15 | 16 |
17 | 18 |
19 | 20 | 21 | <?= _('Edit') ?> 22 | <?= _('Delete') ?> 23 |
24 | 25 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | . 14 | 15 | 16 | app/tests 17 | app/temp 18 | vendor 19 | app/config 20 | 21 | 22 | 23 | 24 | app/tests/ 25 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | -------------------------------------------------------------------------------- /koot/controllers/pages_controller.php: -------------------------------------------------------------------------------- 1 | 26 | * Muestra un enlace que al hacer click irá a dominio.com/pages/aviso 27 | * 28 | */ 29 | class PagesController extends AppController 30 | { 31 | protected function before_filter() 32 | { 33 | // If is AJAX, send only the view 34 | if (Input::isAjax()) { 35 | View::template(null); 36 | } 37 | } 38 | 39 | public function __call($name, $params) 40 | { 41 | View::select(implode('/', [$name, ...$params])); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /koot/config/config.php: -------------------------------------------------------------------------------- 1 | [ 8 | /** 9 | * name: es el nombre de la aplicacion 10 | */ 11 | 'name' => 'KuAdmin', 12 | /** 13 | * database: base de datos a utilizar 14 | */ 15 | 'database' => 'development', 16 | /** 17 | * dbdate: formato de fecha por defecto de la aplicacion 18 | */ 19 | 'dbdate' => 'YYYY-MM-DD', 20 | /** 21 | * debug: muestra los errores en pantalla (On/off) 22 | */ 23 | 'debug' => 'On', 24 | /** 25 | * log_exceptions: muestra las excepciones en pantalla (On/off) 26 | */ 27 | 'log_exceptions' => 'On', 28 | /** 29 | * cache_template: descomentar para habilitar cache de template 30 | */ 31 | //'cache_template' => 'On', 32 | /** 33 | * cache_driver: driver para la cache (file, sqlite, memsqlite) 34 | */ 35 | 'cache_driver' => 'file', 36 | /** 37 | * metadata_lifetime: tiempo de vida de la metadata en cache 38 | */ 39 | 'metadata_lifetime' => '+1 year', 40 | /** 41 | * namespace_auth: espacio de nombres por defecto para Auth 42 | */ 43 | 'namespace_auth' => 'default', 44 | /** 45 | * routes: descomentar para activar routes en routes.php 46 | */ 47 | //'routes' => '1', 48 | ], 49 | ]; 50 | -------------------------------------------------------------------------------- /koot/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | assertSame( 29 | $code, 30 | $actual, 31 | "Status code is not $code but $actual." 32 | ); 33 | } 34 | /** 35 | * Request to Controller 36 | * 37 | * @param string $method HTTP method 38 | * @param string $url controller/method/arg|uri 39 | * @param array $params POST parameters/Query string 40 | */ 41 | protected function request($method, $url, $params = []) 42 | { 43 | $_SERVER['REQUEST_METHOD'] = $method; 44 | 45 | ob_start(); 46 | $start_ob_level = ob_get_level(); 47 | ob_start(); 48 | View::render(Router::execute($url)); 49 | while (ob_get_level() > $start_ob_level) { 50 | ob_end_flush(); 51 | } 52 | 53 | //$content = $this->getActualOutput(); 54 | return ob_get_clean(); 55 | } 56 | /** 57 | * GET Request to Controller 58 | * 59 | * @param string $url controller/method/arg|uri 60 | * @param array $params Query string 61 | */ 62 | public function get($url, $params = []) 63 | { 64 | return $this->request('GET', $url, $params); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /koot/views/_shared/errors/404.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ERROR 404 6 | 7 | 8 | 40 | 41 | 42 |
43 | 44 |

404

45 |

¡OOPS! Esta página no existe.

46 |

Ir a la página de inicio

47 |
48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /koot/tests/Controller/PagesControllerTest.php: -------------------------------------------------------------------------------- 1 | get('/pages/kumbia/status/'); 31 | $this->assertStringContainsString('

config.php', $actual); 32 | $this->assertResponseCode(200); 33 | } 34 | /** 35 | * Test no page to show 36 | */ 37 | public function testDisplayNoPage(): void 38 | { 39 | $this->expectWarning(); 40 | $this->expectWarningMessageMatches('/No such file or directory/'); 41 | 42 | $actual = $this->get('/pages/no_page/'); 43 | 44 | $this->expectException(KumbiaException::class); 45 | $this->assertResponseCode(404); 46 | $this->assertStringContainsString('

Vista "pages/no_page.phtml" no encontrada

', $actual); 47 | } 48 | 49 | /** 50 | * Test for bad people 51 | */ 52 | public function testBadPeople(): void 53 | { 54 | $this->expectException(KumbiaException::class); 55 | $actual = $this->get('/pages/../no_page/'); 56 | 57 | $this->assertResponseCode(404); 58 | $this->assertStringContainsString("Posible intento de hack en URL: '/pages/../no_page/'", $actual); 59 | } 60 | 61 | public function testObLevel(): void 62 | { 63 | $this->assertEquals(1, ob_get_level()); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /koot/views/_shared/templates/xml.phtml: -------------------------------------------------------------------------------- 1 | $value) { 9 | if (is_numeric($key)) { 10 | $key = $nodeName; 11 | } 12 | $xml .= '<' . $key . '>' . "\n" . generate_xml_from_array($value, $nodeName) . '' . "\n"; 13 | } 14 | } else { 15 | $xml = htmlspecialchars($array, ENT_QUOTES) . "\n"; 16 | } 17 | return $xml; 18 | } 19 | 20 | function generate_valid_xml_from_array($array, $nodeBlock = 'nodes', $nodeName = 'node') 21 | { 22 | $xml = '' . "\n"; 23 | $xml .= '<' . $nodeBlock . '>' . "\n"; 24 | $xml .= generate_xml_from_array($array, $nodeName); 25 | $xml .= '' . "\n"; 26 | return $xml; 27 | } 28 | 29 | //First element 30 | $first = is_array($data) ? $data[key($data)] : $data; 31 | $block = $first == $data && is_object($first) ? strtolower(get_class($first)) : 'data'; 32 | $node = is_object($first) ? strtolower(get_class($first)) : 'node'; 33 | 34 | echo generate_valid_xml_from_array($data, $block, $node); 35 | /* 36 | TODO use Simple XML 37 | function printElem($xml, $elem){ 38 | $xml->startElement(); 39 | $a = get_object_vars($elem); 40 | foreach($a as $key=>$value) { 41 | $xml->startElement($key); 42 | $xml->text($value); 43 | $xml->endElement(); 44 | } 45 | $xml->endElement(); 46 | } 47 | 48 | $xml=new XMLWriter(); 49 | $xml->openMemory(); 50 | $xml->startDocument('1.0','UTF-8'); 51 | $xml->startElement('xml'); 52 | $xml->setIndent(true); 53 | 54 | if(is_array($data)){ 55 | foreach($data as $elem) { 56 | printElem($xml, $elem); 57 | } 58 | }else{ 59 | printElem($xml, $data); 60 | } 61 | 62 | $xml->endElement(); 63 | echo $xml->outputMemory(true); 64 | */ 65 | -------------------------------------------------------------------------------- /public/js/minimal-theme-switcher.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Minimal theme switcher 3 | * 4 | * Pico.css - https://picocss.com 5 | * Copyright 2019-2023 - Licensed under MIT 6 | * Copyright 2024 Updated for Koot 7 | */ 8 | 9 | const themeSwitcher = { 10 | // Config 11 | buttonsTarget: ".theme-switcher", 12 | rootAttribute: "data-theme", 13 | localStorageKey: "kootPreferredColorScheme", 14 | 15 | // Init 16 | init() { 17 | this.scheme = this.schemeFromLocalStorage ?? this.preferredColorScheme 18 | this.initSwitchers() 19 | }, 20 | 21 | // Get color scheme from local storage 22 | get schemeFromLocalStorage() { 23 | return window.localStorage?.getItem(this.localStorageKey) 24 | }, 25 | 26 | // Preferred color scheme 27 | get preferredColorScheme() { 28 | return window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"; 29 | }, 30 | 31 | // Init switchers 32 | initSwitchers() { 33 | const buttons = document.querySelectorAll(this.buttonsTarget) 34 | buttons.forEach((button) => { 35 | button.addEventListener( 36 | "click", 37 | (event) => { 38 | event.preventDefault() 39 | // Set scheme 40 | this.toogleScheme() 41 | }, 42 | false 43 | ) 44 | }) 45 | }, 46 | 47 | // Set scheme 48 | set scheme(scheme) { 49 | if (! scheme in ["dark", "light"]) { 50 | return 51 | } 52 | this._scheme = scheme 53 | this.applyScheme() 54 | this.schemeToLocalStorage() 55 | }, 56 | 57 | // Get scheme 58 | get scheme() { 59 | return this._scheme 60 | }, 61 | 62 | toogleScheme() { 63 | this.scheme = "dark" == this.scheme ? "light" : "dark" 64 | }, 65 | // Apply scheme 66 | applyScheme() { 67 | document.querySelector("html").setAttribute(this.rootAttribute, this.scheme) 68 | }, 69 | 70 | // Store scheme to local storage 71 | schemeToLocalStorage() { 72 | window.localStorage?.setItem(this.localStorageKey, this.scheme) 73 | }, 74 | } 75 | 76 | // Init 77 | themeSwitcher.init() 78 | -------------------------------------------------------------------------------- /koot/views/_shared/scaffolds/lite/page.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 |
5 | 6 |
7 | 8 |

9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | getAlias() as $alias) : ?> 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | getFields() as $field) : ?> 27 | 28 | 29 | 33 | 34 | 35 | 36 |
id" ?>">$field) ?> 30 | id" ?>" class="icon"><?= _('Edit') ?> 31 | id" ?>" class="icon" title="" onclick="return confirm('');"><?= _('Delete') ?> 32 |
37 |
38 | $data]) ?> 39 | 40 | -------------------------------------------------------------------------------- /koot/views/_shared/partials/paginators/classic.phtml: -------------------------------------------------------------------------------- 1 | totalPages(); 31 | $prev = $page->prevPage(); 32 | $next = $page->nextPage(); 33 | $page = $page->page(); 34 | // Calculando el inicio de paginador centrado 35 | if ($page <= $half) { 36 | $start = 1; 37 | } elseif (($pagetotal - $page) < $half) { 38 | $start = $pagetotal - $show + 1; 39 | if ($start < 1) { 40 | $start = 1; 41 | } 42 | } else { 43 | $start = $page - $half; 44 | } 45 | 46 | if ($pagetotal > 1) : ?> 47 | 66 | 67 | count(), ' items.' ?> -------------------------------------------------------------------------------- /koot/views/index/index.phtml: -------------------------------------------------------------------------------- 1 |
2 |

Welcome to Koot

3 |

Koot is your go-to community backend solution, built on the robust and fast KumbiaPHP framework.

4 |
5 | 6 |
7 |

Features

8 | 9 |
10 |
11 | 12 | 13 | Diverse Group of Avatars Representing Users 14 | 15 | 16 |

User Management

17 |

Handle user registrations, logins, and profiles efficiently.

18 |
19 | 20 |
21 | 22 | 23 | Hierarchical Structure of User Roles 24 | 25 | 26 |

Role-Based Access Control

27 |

Define roles and assign them to users for granular access control.

28 |
29 | 30 |
31 | 32 | 33 | Digital Library of Resources 34 | 35 | 36 |

Resource Management

37 |

Manage your application's resources with ease.

38 |
39 | 40 |
41 | 42 | 43 | Security Themed Image for Permissions 44 | 45 | 46 |

Permission Handling

47 |

Fine-tune permissions for different user roles.

48 |
49 |
50 |
51 | 52 |
53 |

About Koot

54 |

Koot is designed to streamline backend development, minimizing repetitive tasks and focusing on unique features of your applications.

55 |
56 | 57 | 58 |
59 |

Contact Us

60 |

Have questions or want to get involved? Chat us or visit our GitHub page.

61 |
-------------------------------------------------------------------------------- /public/img/koot.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/libs/controller_scaffold.php: -------------------------------------------------------------------------------- 1 | data = (new $this->model)->paginate("page: $page", 'order: id desc'); 22 | } 23 | 24 | /** 25 | * Crea un Registro 26 | */ 27 | public function crear() 28 | { 29 | if (Input::hasPost($this->model)) { 30 | 31 | $obj = new $this->model; 32 | //En caso que falle la operación de guardar 33 | if (!$obj->save(Input::post($this->model))) { 34 | Flash::error('Falló Operación'); 35 | //se hacen persistente los datos en el formulario 36 | $this->{$this->model} = $obj; 37 | return; 38 | } 39 | return Redirect::to(); 40 | } 41 | // Sólo es necesario para el autoForm 42 | $this->{$this->model} = new $this->model; 43 | } 44 | 45 | /** 46 | * Edita un Registro 47 | */ 48 | public function editar($id) 49 | { 50 | View::select('crear'); 51 | 52 | //se verifica si se ha enviado via POST los datos 53 | if (Input::hasPost($this->model)) { 54 | $obj = new $this->model; 55 | if (!$obj->update(Input::post($this->model))) { 56 | Flash::error('Falló Operación'); 57 | //se hacen persistente los datos en el formulario 58 | $this->{$this->model} = Input::post($this->model); 59 | } else { 60 | return Redirect::to(); 61 | } 62 | } 63 | 64 | //Aplicando la autocarga de objeto, para comenzar la edición 65 | $this->{$this->model} = (new $this->model)->find((int) $id); 66 | } 67 | 68 | /** 69 | * Borra un Registro 70 | */ 71 | public function borrar($id) 72 | { 73 | if (!(new $this->model)->delete((int) $id)) { 74 | Flash::error('Falló Operación'); 75 | } 76 | //enrutando al index para listar los articulos 77 | Redirect::to(); 78 | } 79 | 80 | /** 81 | * Ver un Registro 82 | */ 83 | public function ver($id) 84 | { 85 | $this->data = (new $this->model)->find_first((int) $id); 86 | } 87 | } -------------------------------------------------------------------------------- /public/img/kumbiaphp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /koot/views/pages/kumbia/status.phtml: -------------------------------------------------------------------------------- 1 |
2 | '; 6 | } else { 7 | echo strftime("%e de %B del %Y") , '
'; 8 | } 9 | 10 | 11 | /** 12 | * Verificando permisos del dir temp/ 13 | */ 14 | if (!is_writable(APP_PATH.'temp')) { 15 | $tmp = "Debes darle permiso a: '".basename(APP_PATH)."/temp/'"; 16 | } else { 17 | $tmp = 'Directorio temp... ok'; 18 | } 19 | 20 | $status = PRODUCTION ? 'Production' : 'Development'; 21 | 22 | 23 | /** 24 | * Configuracion del config.ini 25 | */ 26 | $config = Config::read('config'); 27 | 28 | if (isset($config['application']['cache_driver'])) { 29 | $cahe_driver = $config['application']['cache_driver']; 30 | } else { 31 | $cache_driver = 'No ha seleccionado un driver para la cache'; 32 | } 33 | 34 | $locale = str_replace(';', '
', setlocale(LC_ALL, '0')); 35 | 36 | if (! $timezone = date_default_timezone_get()) { 37 | $timezone = 'No se ha especificado un Timezone.'; 38 | } 39 | ?> 40 |

config.php de

41 | 42 |
43 |

Directorio temp/:

44 |

45 | 46 |

Estado Actual del Framework:

47 |

Ver Modos de ejecución

48 | 49 |

Base de Datos:

50 |

Datos de la conexión a la BD que será utilizada, ver configuración databases.ini.

51 | 52 |

Cache Driver:

53 |

Driver que se utilizará para realizar las operaciones de cache.

54 | 55 |

Charset:

56 |

Codificación de caracteres. Recomendado UTF-8

57 | 58 |

Valores del servidor

59 |

Como cambiar estos valores enlace TODO

60 | 61 |

TimeZone:

62 |

Zona horaria que usará la aplicación.

63 | 64 |

Locale:

65 | 66 |

Localización. Característica que depende de los locale instalados en el servidor.

67 |
68 |
69 | -------------------------------------------------------------------------------- /public/javascript/jquery/jquery.kumbiaphp.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | http://wiki.kumbiaphp.com/Licencia New BSD License 3 | */ 4 | (function(a){a.KumbiaPHP={publicPath:null,plugin:[],cConfirm:function(b){var c=a(this);confirm(c.data("msg"))||b.preventDefault()},cFx:function(b){return function(c){c.preventDefault();c=a(this);a("#"+c.data("to"))[b]()}},cRemote:function(b){var c=a(this),c=a("#"+c.data("to"));b.preventDefault();c.load(this.href)},cRemoteConfirm:function(b){var c=a(this),d=a("#"+c.data("to"));b.preventDefault();confirm(c.data("msg"))&&d.load(this.href)},cFRemote:function(b){b.preventDefault();este=a(this);var c=a("[type=submit]", 5 | este);c.attr("disabled","disabled");b=este.attr("action");var d=este.attr("data-to");a.post(b,este.serialize(),function(b){var e=a("#"+d);e.html(b);e.hide();e.show("slow");c.attr("disabled",null)})},cUpdaterSelect:function(){var b=a(this),c=a("#"+b.data("update"));url=b.data("url");c.empty();a.get(url,{id:b.val()},function(b){for(i in b){var f=a("