Skip to content

Commit

Permalink
Merge pull request #213 from bmlt-enabled/Major-Refactor
Browse files Browse the repository at this point in the history
Major refactor
  • Loading branch information
otrok7 authored Dec 10, 2024
2 parents f39656e + d508a0a commit b8b2b31
Show file tree
Hide file tree
Showing 147 changed files with 19,710 additions and 9,094 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.vscode/*
.DS_Store
.idea
.phpunit.result.cache
vendor/
logs/
build/
3 changes: 2 additions & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
custom standard so you don't have to specify the
patterns on the command line.
-->
<exclude-pattern>mpdf/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>

<!--
You can add specific global ignores to different
Expand All @@ -50,6 +50,7 @@
</rule>
<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
</ruleset>
77 changes: 0 additions & 77 deletions BreadOptions.php.bak

This file was deleted.

339 changes: 339 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
COMMIT := $(shell git rev-parse --short=8 HEAD)
ZIP_FILENAME := $(or $(ZIP_FILENAME), $(shell echo "$${PWD\#\#*/}.zip"))
BUILD_DIR := $(or $(BUILD_DIR),build)
VENDOR_AUTOLOAD := mpdf/vendor/autoload.php
VENDOR_AUTOLOAD := vendor/autoload.php
ZIP_FILE := build/bread.zip

ifeq ($(PROD)x, x)
Expand All @@ -19,7 +19,7 @@ $(VENDOR_AUTOLOAD):
$(ZIP_FILE): $(VENDOR_AUTOLOAD)
git archive --format=zip --output=${ZIP_FILENAME} $(COMMIT)
$(shell ./simplify-mpdf.sh)
zip -r ${ZIP_FILENAME} mpdf/
zip -r ${ZIP_FILENAME} vendor/
mkdir -p ${BUILD_DIR} && mv ${ZIP_FILENAME} ${BUILD_DIR}/

.PHONY: build
Expand All @@ -34,8 +34,8 @@ composer: $(VENDOR_AUTOLOAD) ## Runs composer install

.PHONY: lint
lint: $(VENDOR_AUTOLOAD) ## PHP Lint
mpdf/vendor/squizlabs/php_codesniffer/bin/phpcs
vendor/squizlabs/php_codesniffer/bin/phpcs

.PHONY: lint-fix
lint-fix: $(VENDOR_AUTOLOAD) ## PHP Lint Fix
mpdf/vendor/squizlabs/php_codesniffer/bin/phpcbf
vendor/squizlabs/php_codesniffer/bin/phpcbf
50 changes: 50 additions & 0 deletions admin/class-bmltenabled-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/**
* Creates the main item in the admin menu, where both bread and crouton admins can live.
*
* @package Bread
* @subpackage Bread/admin
* @author bmlt-enabled <help@bmlt.app>
*/
class BmltEnabled_Admin
{
private bool $menu_created = false;
/**
* Initialize the class and set its properties.
*
* @since 2.8.0
* @param string $plugin_name The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct()
{
}
public function createdMenu()
{
$this->menu_created = true;
}
function admin_menu_link()
{
if ($this->menu_created) {
return;
}
$cap = 'manage_options';
if (!current_user_can($cap)) {
$cap = 'manage_bread';
}
$slugs = apply_filters('BmltEnabled_Slugs', []);
$icon = apply_filters("BmltEnabled_IconSVG", 'dashicons-locations-alt');
$slug = $slugs[0];
add_menu_page(
'Meeting List',
'Meeting List',
$cap,
$slug,
'',
$icon,
null
);
do_action('BmltEnabled_Submenu', $slug);
}
}
Loading

0 comments on commit b8b2b31

Please sign in to comment.