Exemple #1
0
<?php

/**
 * the class for rendering our kanban board
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// instantiate the plugin
Kanban_Board::init();
class Kanban_Board extends Kanban_Db
{
    // the instance of this object
    private static $instance;
    // the common name for this class
    static $slug = 'board';
    // the table name of this class
    protected static $table_name = 'boards';
    // define db table columns and their validation type
    protected static $table_columns = array('title' => 'text', 'description' => 'text', 'created_dt_gmt' => 'datetime', 'modified_dt_gmt' => 'datetime', 'user_id_author' => 'int', 'is_active' => 'bool');
    // add actions and filters
    static function init()
    {
        // send board data to the board template
        add_filter('template_include', array(__CLASS__, 'send_page_data_to_template'), 100);
        // must be higher than template
    }
    /**
     * load data needed for board's javascript
     * @param  string $template the passed in template path