Plugin Directory

Changeset 2910104


Ignore:
Timestamp:
05/09/2023 10:39:22 AM (3 years ago)
Author:
rockschtar
Message:

Rewrite

Location:
colored-admin-post-list/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • colored-admin-post-list/trunk/colored-admin-post-list.php

    r1397400 r2910104  
    22
    33/*
    4 Plugin Name: Colored Admin Post List
    5 Plugin URI: http://wordpress.org/plugins/colored-admin-post-list/
    6 Description: Highlights the background of draft, pending, future, private, and published posts in the wordpress admin. Also supports custom post statuses!
    7 Author: Stevie
    8 Author URI: http://www.eracer.de
    9 Version: 2.1
    10  */
     4* Plugin Name: Colored Admin Post List
     5* Plugin URI: http://wordpress.org/plugins/colored-admin-post-list/
     6* Description: Highlights the background of draft, pending, future, private, and published posts in the wordpress admin. Also supports custom post statuses!
     7* Author: Rockschtar
     8* Author URI: http://www.eracer.de
     9* Version: 3.0
     10* Requires at least: 6.2
     11* Requires PHP: 8.0
     12* License: MIT
     13* Text Domain: colored-admin-post-list
     14* Domain Path: /languages
     15*/
     16
     17use Rockschtar\WordPress\ColoredAdminPostList\Controller\PluginController;
    1118
    1219define("CAPL_PLUGIN", plugin_basename(__FILE__));
     
    1421define("CAPL_PLUGIN_URL", plugin_dir_url(__FILE__));
    1522define("CAPL_PLUGIN_RELATIVE_DIR", dirname(plugin_basename(__FILE__)));
    16 define("CAPL_PLUGIN_FILE", __FILE__);
    17 define("CAPL_TEXTDOMAIN", "capl_textdomain");
    18 define("CAPL_VERSION", 2.0);
     23const CAPL_PLUGIN_FILE = __FILE__;
     24const CAPL_VERSION = 3.0;
    1925
    20 require_once(CAPL_PLUGIN_DIR . "classes/class-constants.php");
    21 require_once(CAPL_PLUGIN_DIR . "classes/class-helper.php");
    22 require_once(CAPL_PLUGIN_DIR . "controller/class-plugin-controller.php");
    23 require_once(CAPL_PLUGIN_DIR . "controller/class-settings-controller.php");
    24 require_once(CAPL_PLUGIN_DIR . "controller/class-dashboard-widget-controller.php");
     26spl_autoload_register(function ($class) {
     27    $namespace = 'Rockschtar\\WordPress\\ColoredAdminPostList\\';
     28    if (!str_starts_with($class, $namespace)) {
     29        return;
     30    }
    2531
    26 new CAPL_PluginController();
     32    $class = str_replace($namespace, '', $class);
     33    $class = str_replace('\\', DIRECTORY_SEPARATOR, $class);
     34    $file = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $class . '.php';
     35
     36    if (file_exists($file)) {
     37        require $file;
     38    }
     39});
     40
     41PluginController::init();
  • colored-admin-post-list/trunk/readme.txt

    r1397400 r2910104  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=B2WSC5FR2L8MU
    44Tags: wp-admin, admin, color, colored, post, list, highlight
    5 Requires at least: 3.5
    6 Tested up to: 4.5
    7 Stable tag: 2.1
    8 License: GPLv2 or later
    9 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     5Requires at least: 6.2
     6Tested up to: 6.2
     7Stable tag: 3.0
     8License: MIT
     9License URI: https://opensource.org/license/mit/
    1010
    1111Highlights the background of draft, pending, future, private, and published posts in the wordpress admin. Also supports custom post statuses!
  • colored-admin-post-list/trunk/views/settings.php

    r991375 r2910104  
    11<?php
    2 if (!empty($_SERVER['SCRIPT_FILENAME']) && basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])):
     2
     3if (!empty($_SERVER['SCRIPT_FILENAME']) && basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])) {
    34    die('Please do not load this screen directly. Thanks!');
    4 endif;
     5}
    56
    6 if (isset($_POST["capl-submit-reset"])):
    7     CAPL_SettingsController::reset_colors();
    8 endif;
     7use Rockschtar\WordPress\ColoredAdminPostList\Enums\Setting;
     8
    99?>
    10 
    1110<div class="wrap">
    1211    <div id="icon-themes" class="icon32"><br></div>
    1312    <h2><?php echo __("Colored Admin Post List Settings", "colored-admin-post-list") ?></h2>
    1413    <form method="post" action="options.php">
    15         <?php settings_fields(CAPL_Constants::SETTINGS_PAGE_DEFAULT); ?>
    16         <?php do_settings_sections(CAPL_Constants::SETTINGS_PAGE_DEFAULT); ?>
     14        <?php settings_fields(Setting::PAGE_DEFAULT); ?>
     15        <?php do_settings_sections(Setting::PAGE_DEFAULT); ?>
    1716        <?php submit_button(); ?>
    1817    </form>
    19 
    20     <form method="post" action="<?php echo $_SERVER["PHP_SELF"] ?>?page=capl_admin_options" id="capl-form-reset-to-defaults">
    21         <?php submit_button(__("Reset Settings", "colored-admin-post-list"), "delete", "capl-submit-reset", true, array("id" => "capl-button-reset-to-defaults", "data-message" => __("Are you sure?", "colored-admin-post-list"))); ?>
    22 
    23     </form>
    24 
    25 
    2618</div>
Note: See TracChangeset for help on using the changeset viewer.