File: /var/www/html/wpmuhibbah_err/wp-content/themes/goodwish/framework/admin/skins/edge/skin.php
<?php
//if accessed directly exit
if(!defined('ABSPATH')) exit;
class EdgeSkin extends GoodwishEdgeSkinAbstract {
/**
* Skin constructor. Hooks to goodwish_edge_admin_scripts_init and goodwish_edge_enqueue_admin_styles
*/
public function __construct() {
$this->skinName = 'edge';
//hook to
add_action('goodwish_edge_admin_scripts_init', array($this, 'registerStyles'));
add_action('goodwish_edge_admin_scripts_init', array($this, 'registerScripts'));
add_action('goodwish_edge_enqueue_admin_styles', array($this, 'enqueueStyles'));
add_action('goodwish_edge_enqueue_admin_scripts', array($this, 'enqueueScripts'));
add_action('goodwish_edge_enqueue_meta_box_styles', array($this, 'enqueueStyles'));
add_action('goodwish_edge_enqueue_meta_box_scripts', array($this, 'enqueueScripts'));
add_action( 'admin_enqueue_scripts', array( $this, 'setShortcodeJSParams' ), 5 );
$this->setIcons();
$this->setMenuItemPosition();
}
/**
* Method that registers skin scripts
*/
public function registerScripts() {
$this->scripts['bootstrap.min'] = 'assets/js/bootstrap.min.js';
$this->scripts['jquery.nouislider.min'] = 'assets/js/edgtf-ui/jquery.nouislider.min.js';
$this->scripts['edgtf-ui-admin'] = 'assets/js/edgtf-ui/edgtf-ui.js';
$this->scripts['edgtf-bootstrap-select'] = 'assets/js/edgtf-ui/edgtf-bootstrap-select.min.js';
foreach ($this->scripts as $scriptHandle => $scriptPath) {
goodwish_edge_register_skin_script($scriptHandle, $scriptPath);
}
}
/**
* Method that registers skin styles
*/
public function registerStyles() {
$this->styles['edgtf-bootstrap'] = 'assets/css/edgtf-bootstrap.css';
$this->styles['edgtf-page-admin'] = 'assets/css/edgtf-page.css';
$this->styles['edgtf-options-admin'] = 'assets/css/edgtf-options.css';
$this->styles['edgtf-meta-boxes-admin'] = 'assets/css/edgtf-meta-boxes.css';
$this->styles['edgtf-ui-admin'] = 'assets/css/edgtf-ui/edgtf-ui.css';
$this->styles['edgtf-forms-admin'] = 'assets/css/edgtf-forms.css';
$this->styles['edgtf-import'] = 'assets/css/edgtf-import.css';
$this->styles['font-awesome-admin'] = 'assets/css/font-awesome/css/font-awesome.min.css';
foreach ($this->styles as $styleHandle => $stylePath) {
goodwish_edge_register_skin_style($styleHandle, $stylePath);
}
}
/**
* Method that set menu icons
*/
public function setIcons() {
$this->icons = array(
'slider' => 'dashicons-images-alt2',
'carousel' => 'dashicons-image-flip-horizontal',
'testimonial' => 'dashicons-format-quote',
'portfolio' => 'dashicons-screenoptions',
'event' => 'dashicons-calendar-alt',
'options' => $this->getSkinURI().'/assets/img/admin-logo-icon.png'
);
}
/**
* Method that set menu item position
*/
public function setMenuItemPosition() {
$this->itemPosition = array(
'slider' => 20,
'carousel' => 20,
'testimonial' => 20,
'portfolio' => 5,
'event' => 10,
'options' => 4
);
}
/**
* Method that renders options page
*
* @see SelectSkin::getHeader()
* @see SelectSkin::getPageNav()
* @see SelectSkin::getPageContent()
*/
public function renderOptions() {
global $goodwish_edge_Framework;
$tab = goodwish_edge_get_admin_tab();
$active_page = $goodwish_edge_Framework->edgtOptions->getAdminPageFromSlug($tab);
if ($active_page == null) return;
?>
<div class="edgtf-options-page edgtf-page">
<?php $this->getHeader($active_page); ?>
<div class="edgtf-page-content-wrapper">
<div class="edgtf-page-content">
<div class="edgtf-page-navigation edgtf-tabs-wrapper vertical left clearfix">
<?php $this->getPageNav($tab); ?>
<?php $this->getPageContent($active_page); ?>
</div>
</div>
</div>
</div>
<?php }
/**
* Method that renders header of options page.
* @param bool $show_save_btn whether to show save button. Should be hidden on import page
*
* @see EdgeSkinAbstract::loadTemplatePart()
*/
public function getHeader($activePage = '', $show_save_btn = true) {
$this->loadTemplatePart('header', array('active_page' => $activePage, 'show_save_btn' => $show_save_btn));
}
/**
* Method that loads page navigation
* @param string $tab current tab
* @param bool $is_import_page if is import page highlighted that tab
*
* @see EdgeSkinAbstract::loadTemplatePart()
*/
public function getPageNav($tab, $is_import_page = false) {
$this->loadTemplatePart('navigation', array(
'tab' => $tab,
'is_import_page' => $is_import_page
));
}
/**
* Method that loads current page content
*
*@param GoodwishEdgeAdminPage $page current page to load
*
* @see EdgeSkinAbstract::loadTemplatePart()
*/
public function getPageContent($page) {
$this->loadTemplatePart('content', array('page' => $page));
}
/**
* Method that loads content for import page
*/
public function getImportContent() {
$this->loadTemplatePart('content-import');
}
/**
* Method that loads anchors and save button template part
*
*@param GoodwishEdgeAdminPage $page current page to load
*
* @see EdgeSkinAbstract::loadTemplatePart()
*/
public function getAnchors($page) {
$this->loadTemplatePart('anchors', array('page' => $page));
}
/**
* Method that renders import page
*
* @see SelectSkin::getHeader()
* * @see SelectSkin::getPageNav()
* * @see SelectSkin::getImportContent()
*/
public function renderImport() { ?>
<div class="edgtf-options-page edgtf-page">
<?php $this->getHeader(false); ?>
<div class="edgtf-page-content-wrapper">
<div class="edgtf-page-content">
<div class="edgtf-page-navigation edgtf-tabs-wrapper vertical left clearfix">
<?php $this->getPageNav('tabimport', true); ?>
<?php $this->getImportContent(); ?>
</div>
</div>
</div>
</div>
<?php }
}
?>