Add upstream plugins

Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
2019-10-25 22:42:20 +02:00
parent 5d3c2ec184
commit 290736650a
1186 changed files with 302577 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<?php
/**
* The abstract class for a admin page.
*
* @author Time.ly Network Inc.
* @since 2.0
*
* @package AI1EC
* @subpackage AI1EC.View
*/
abstract class Ai1ec_View_Admin_Abstract extends Ai1ec_Base {
/**
* @var string
*/
protected $_page_id;
/**
* @var string
*/
protected $_page_suffix;
/**
* @var string
*/
protected $_api_registration;
/**
* Standard constructor
*
* @param Ai1ec_Registry_Object $registry
*/
public function __construct( Ai1ec_Registry_Object $registry ) {
parent::__construct( $registry );
$exploded_class = explode( '_', get_class( $this ) );
$this->_page_suffix = strtolower( end( $exploded_class ) );
$this->_api_registration = $this->_registry->get( 'model.api.api-registration' );
}
/**
* Get the url of the page
*
* @return string
*/
public function get_url() {
return add_query_arg(
array(
'post_type' => AI1EC_POST_TYPE,
'page' => AI1EC_PLUGIN_NAME . '-' . $this->_page_suffix,
),
ai1ec_admin_url( 'edit.php' )
);
}
/**
* Adds the page to the correct menu.
*/
abstract public function add_page();
/**
* Adds the page to the correct menu.
*/
abstract public function add_meta_box();
/**
* Display the page html
*/
abstract public function display_page();
/**
* Handle post, likely to be deprecated to use commands.
*/
abstract public function handle_post();
}