/** * Inits modules and components, adds edit actions * * @access public * @param array $config * @return void */ public function __construct($config) { //set modules self::$modules = $config['modules']; //set components self::$components = $config['components']; //set options self::$options = $config['options']; //init modules $this->initModules(); //init components $this->initComponents(); //save options action add_action('wp_ajax_themex_save_options', array(__CLASS__, 'saveOptions')); //reset options action add_action('wp_ajax_themex_reset_options', array(__CLASS__, 'resetOptions')); //save post action add_action('save_post', array(__CLASS__, 'savePost')); //filter user relations add_filter('comments_clauses', array($this, 'filterUserRelations')); //activation hook add_action('init', array(__CLASS__, 'activate')); }
$pause = ThemexCore::getOption('slider_pause', '0'); $speed = ThemexCore::getOption('slider_speed', '1000'); $query = new WP_Query(array('post_type' => 'slide', 'showposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC')); if ($query->have_posts()) { if ($type == 'boxed') { ?> <div class="row"> <div class="boxed-slider themex-slider"> <ul> <?php while ($query->have_posts()) { ?> <?php $query->the_post(); $video = ThemexCore::getPostMeta($post->ID, 'slide_video'); $link = ThemexCore::getPostMeta($post->ID, 'slide_link'); ?> <li> <?php if (!empty($video)) { ?> <div class="embedded-video"> <?php echo themex_html($video); ?> </div> <?php } else { ?> <?php if (!empty($link)) {
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer')) { } ?> </div> <?php } ?> </div> </div> <!-- /content --> <div class="footer-wrap"> <footer class="site-footer"> <div class="row"> <div class="copyright left"> <?php echo ThemexCore::getOption('copyright', 'Academy Theme © ' . date('Y')); ?> </div> <nav class="footer-navigation right"> <?php wp_nav_menu(array('theme_location' => 'footer_menu')); ?> </nav> <!-- /navigation --> </div> </footer> </div> <!-- /footer --> </div> <!-- /site wrap --> <?php
</header> <?php if (!ThemexCore::checkOption('course_popularity') || !ThemexCore::checkOption('course_rating')) { ?> <footer class="course-footer clearfix"> <?php if (!ThemexCore::checkOption('course_popularity')) { ?> <div class="course-users left"> <?php echo ThemexCore::getPostMeta($post->ID, 'course_popularity', '0'); ?> </div> <?php } ?> <?php if (!ThemexCore::checkOption('course_rating')) { ?> <?php get_template_part('module', 'rating'); ?> <?php } ?> </footer> <?php } ?> </div> </div>
/** * Gets answer statistics * * @access public * @param int $ID * @param int $user * @return array */ public static function getAnswerStatistics($ID, $user) { $answers = array(); $quiz = ThemexCore::getPostRelations(0, $ID, 'quiz_lesson', true); if (!empty($quiz)) { $relations = explode(' ; ', ThemexCore::getUserRelations($user, $quiz, 'answers', true) . ' '); foreach ($relations as $relation) { $answer = array(); $relation = explode(' , ', $relation); if (count($relation) == 3) { $answer['question'] = themex_value($relation, 0); $answer['answer'] = themex_value($relation, 1); $answer['result'] = themex_value($relation, 2); $answers[] = $answer; } } } return $answers; }
?> <aside class="sidebar column fourcol"> <?php get_sidebar('lesson'); ?> </aside> <div class="column eightcol last"> <?php } else { ?> <div class="column eightcol lesson-content"> <?php } ?> <?php if (ThemexLesson::$data['prerequisite']['progress'] == 0 && ThemexLesson::$data['status'] != 'free' && ThemexCore::checkOption('lesson_hide') && !ThemexCourse::isAuthor()) { printf(__('Complete "%s" lesson before taking this lesson.', 'academy'), '<a href="' . get_permalink(ThemexLesson::$data['prerequisite']['ID']) . '">' . get_the_title(ThemexLesson::$data['prerequisite']['ID']) . '</a>'); } else { the_content(); comments_template('/questions.php'); } ?> </div> <?php if ($layout == 'right') { ?> <aside class="sidebar fourcol column last"> <?php get_sidebar('lesson'); ?> </aside>
_e('Password', 'academy'); ?> " /> </div> </div> <div class="sixcol column last"> <div class="field-wrapper"> <input type="password" name="user_password_repeat" placeholder="<?php _e('Repeat Password', 'academy'); ?> " /> </div> </div> <div class="clear"></div> <?php if (ThemexCore::checkOption('user_captcha')) { ?> <div class="form-captcha"> <img src="<?php echo THEMEX_URI; ?> assets/images/captcha/captcha.php" alt="" /> <input type="text" name="captcha" id="captcha" size="6" value="" /> </div> <div class="clear"></div> <?php } ?> <a href="#" class="element-button submit-button left"><span class="button-icon register"></span><?php _e('Register', 'academy'); ?>
> <head> <title><?php wp_title('|', true, 'right'); ?> </title> <?php wp_head(); ?> </head> <body <?php body_class('single-certificate'); ?> > <?php $ID = ThemexCore::getRewriteRule('certificate'); $certificate = ThemexCourse::getCertificate(themex_decode($ID), themex_decode($ID, true)); if (isset($certificate['user'])) { ?> <div class="certificate-wrap"> <?php if (!empty($certificate['background'])) { ?> <div class="substrate"> <img src="<?php echo $certificate['background']; ?> " class="fullwidth" alt="" /> </div> <?php }
<?php } } ?> </tbody> </table> <div class="profile-description"> <?php ThemexInterface::renderEditor('content', ThemexWoo::$data['product']['content']); ?> </div> <?php if (ThemexWoo::$data['product']['status'] == 'draft') { ?> <?php if (ThemexCore::checkOption('shop_approve')) { ?> <a href="#" class="element-button element-submit primary"><?php _e('Save Changes', 'makery'); ?> </a> <?php } else { ?> <a href="#" class="element-button element-submit primary"><?php _e('Submit for Review', 'makery'); ?> </a> <?php } ?>
<?php if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] == 'publish') { ?> <tr> <th><?php _e('Current Rate', 'makery'); ?> </th> <td><?php echo ThemexShop::filterRate(ThemexShop::$data['ID'], ThemexShop::$data['rate']); ?> %</td> </tr> <?php } $methods = array_flip(ThemexCore::getOption('withdrawal_methods', array('paypal', 'skrill', 'swift'))); $gateways = ThemexWoo::getPaymentMethods(); if (count($gateways) > 1 || !isset($gateways['paypal-adaptive-payments'])) { foreach (ThemexCore::$components['forms']['withdrawal'] as $name => $field) { if (is_array(reset($field))) { if (isset($methods[$name])) { foreach ($field as $key => $child) { ?> <tr class="trigger-method-<?php echo $name; ?> "> <th><?php echo $child['label']; ?> </th>
?> <span class="fa fa-tags"></span> <span><?php echo sprintf(_n('%d Sale', '%d Sales', ThemexShop::$data['sales'], 'makery'), ThemexShop::$data['sales']); ?> </span> <?php } } } ?> </li> </ul> </div> <?php if (!ThemexCore::checkOption('shop_rating')) { ?> <div class="shop-rating" title="<?php echo sprintf(_n('%d Rating', '%d Ratings', ThemexShop::$data['ratings'], 'makery'), ThemexShop::$data['ratings']); ?> "> <div class="element-rating" data-score="<?php echo ThemexShop::$data['rating']; ?> "></div> </div> <?php } ?> </div> </div>
<?php $speed = intval(ThemexCore::getOption('slider_speed', '1000')); $pause = intval(ThemexCore::getOption('slider_pause', '0')); $query = new WP_Query(array('post_type' => 'slide', 'showposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC')); if ($query->have_posts()) { ?> <div class="slider-wrap"> <div class="element-slider header-slider" data-effect="slide" data-pause="<?php echo $pause; ?> " data-speed="<?php echo $speed; ?> "> <ul> <?php while ($query->have_posts()) { $query->the_post(); ?> <li> <div class="container"> <?php the_content(); ?> </div> </li> <?php } ?> </ul>
?> </th> <td> <div class="element-select"> <span></span> <?php echo ThemexInterface::renderOption(array('id' => 'category', 'type' => 'select_category', 'taxonomy' => 'shop_category', 'value' => esc_attr(themex_array('category', $_GET)), 'wrap' => false)); ?> </div> </td> </tr> <?php } ?> <?php if (!ThemexCore::checkOption('profile_location')) { ?> <tr> <th><?php _e('Country', 'makery'); ?> </th> <td> <div class="element-select"> <span></span> <?php echo ThemexInterface::renderOption(array('id' => 'country', 'type' => 'select_country', 'attributes' => array('class' => 'countries-list'), 'value' => esc_attr(themex_array('country', $_GET)), 'wrap' => false)); ?> </div> </td> </tr>
<?php /* @version 3.0.0 */ if (!defined('ABSPATH')) { exit; } $limit = ThemexCore::getOption('products_per_page', 9); $extend = $limit * 2; ?> <div class="items-order right"> <form action="<?php echo themex_url(); ?> " method="GET" class="woocommerce-ordering"> <a href="#limit" class="element-submit <?php if (themex_value('limit', $_GET, $limit) == $limit) { ?> active<?php } ?> " data-value="<?php echo $limit; ?> "><?php echo $limit; ?> </a> <a href="#limit" class="element-submit <?php if (themex_value('limit', $_GET) == $extend) {
} ?> <?php if (!ThemexCore::checkOption('post_date')) { ?> <time class="post-date nomargin" datetime="<?php the_time('Y-m-d'); ?> "><?php the_time(get_option('date_format')); ?> </time> <?php } ?> <?php if (!ThemexCore::checkOption('post_author')) { ?> <div class="post-author"> <?php _e('by', 'academy'); ?> <?php the_author_posts_link(); ?> </div> <?php } ?> </footer> </div> </article>
<?php if (!ThemexCore::checkOption('course_retake')) { ?> <a href="#" class="element-button secondary medium submit-button left"><?php _e('Unsubscribe Now', 'academy'); ?> </a> <input type="hidden" name="course_action" value="remove_user" /> <?php } ?> <?php if (ThemexCourse::hasCertificate()) { ?> <a href="<?php echo ThemexCore::getURL('certificate', themex_encode(ThemexCourse::$data['ID'], ThemexUser::$data['user']['ID'])); ?> " target="_blank" class="element-button medium certificate-button"><?php _e('View Certificate', 'academy'); ?> </a> <?php } ?> <?php } } ?> <input type="hidden" name="course_id" value="<?php echo ThemexCourse::$data['ID']; ?>
</a> </div> </div> <div class="author-details"> <h4 class="author-name"> <a href="<?php echo esc_url($author['links']['profile']['url']); ?> "> <?php echo $author['profile']['full_name']; ?> </a> </h4> <?php if (!empty($author['profile']['location']) && !ThemexCore::checkOption('profile_location')) { ?> <div class="shop-attributes"> <ul> <li> <span class="fa fa-map-marker"></span> <span><?php echo $author['profile']['location']; ?> </span> </li> </ul> </div> <?php } ?>
echo esc_attr(ThemexUser::$data['user']['profile']['signature']); ?> " /> </div> </td> </tr> <?php } ?> <?php ThemexForm::renderData('profile', array('edit' => true, 'placeholder' => false, 'before_title' => '<tr><th>', 'after_title' => '</th>', 'before_content' => '<td>', 'after_content' => '</td></tr>'), ThemexUser::$data['user']['profile']); ?> </tbody> </table> <?php if (!ThemexCore::checkOption('profile_description')) { ?> <?php ThemexInterface::renderEditor('description', ThemexUser::$data['user']['profile']['description']); ?> <?php } ?> <a href="#" class="element-button submit-button"><span class="button-icon save"></span><?php _e('Save Changes', 'academy'); ?> </a> <input type="hidden" name="user_action" value="update_profile" /> <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(THEMEX_PREFIX . 'nonce'); ?>
/** * Updates upsell limit * * @access public * @return void */ public static function updateUpsellLimit() { $columns = 4; $limit = ThemexCore::getOption('product_upsell_number', 4); woocommerce_upsell_display($limit, $columns); }
<a href="#" title="<?php _e('Add to Favorites', 'makery'); ?> " class="element-submit primary" data-title="<?php _e('Remove from Favorites', 'makery'); ?> "><span class="fa fa-heart small"></span></a> <input type="hidden" name="user_action" class="toggle" value="add_relation" data-value="remove_relation" /> <?php } ?> <?php } else { ?> <a href="<?php echo ThemexCore::getURL('register'); ?> " title="<?php _e('Add to Favorites', 'makery'); ?> " class="primary"><span class="fa fa-heart small"></span></a> <?php } ?> <?php } ?> <input type="hidden" name="relation_type" value="product" /> <input type="hidden" name="relation_id" value="<?php echo $product->id; ?>
<?php /* Template Name: Posts */ get_header(); $layout = ThemexCore::getOption('posts_layout', 'right'); if ($layout == 'left') { ?> <aside class="sidebar column fourcol"> <?php get_sidebar(); ?> </aside> <div class="column eightcol last"> <?php } else { if ($layout == 'right') { ?> <div class="column eightcol"> <?php } else { ?> <div class="fullwidth-section"> <?php } } ?> <?php echo category_description(); ?>
?> </td> </tr> <?php } ?> </tbody> </table> <?php } ?> <?php if ($order['status'] == 'processing') { ?> <?php if (!ThemexCore::checkOption('order_note')) { ?> <div class="field-wrap"> <textarea name="order_note" id="order_note" cols="30" rows="5" placeholder="<?php _e('Order Note', 'makery'); ?> "></textarea> </div> <?php } ?> <a href="#" class="element-button element-submit primary"><?php _e('Complete Order', 'makery'); ?> </a> <input type="hidden" name="order_id" value="<?php
/** * Renders footer * * @access public * @return void */ public static function renderFooter() { $out = ThemexCore::getOption('tracking'); echo $out; }
<?php /* @version 3.0.0 */ if (!defined('ABSPATH')) { exit; } $view = ThemexCore::getOption('products_view', 'grid'); ?> <div class="items-view left"> <form action="<?php echo themex_url(); ?> " method="GET" class="woocommerce-ordering"> <?php if ($view == 'grid') { ?> <a href="#view" title="<?php _e('Grid View', 'makery'); ?> " class="element-submit <?php if (themex_value('view', $_GET, 'grid') == 'grid') { ?> active<?php } ?> " data-value="grid"><span class="fa fa-th-large"></span></a> <a href="#view" title="<?php _e('List View', 'makery'); ?>
/** * Refreshes module data * * @access public * @return void */ public static function refresh() { self::$data = (array) ThemexCore::getOption(__CLASS__); }
*/ get_header(); get_sidebar('profile-left'); ?> <div class="column fivecol"> <div class="element-title indented"> <h1><?php _e('My Address', 'makery'); ?> </h1> </div> <?php ThemexInterface::renderTemplateContent('profile-address'); ?> <?php if (!ThemexWoo::isActive() || ThemexCore::checkOption('profile_address')) { ?> <span class="secondary"><?php _e('There are no fields in this form.', 'makery'); ?> </span> <?php } else { ?> <form action="" method="POST" class="site-form"> <div class="message"> <?php ThemexInterface::renderMessages(themex_value('success', $_POST, false)); ?> </div> <table class="profile-fields">
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer')) { } ?> </div> <?php } ?> </section> <!-- /content --> </div> <div class="footer-wrap"> <footer class="site-footer container"> <div class="site-copyright left"> <?php echo ThemexCore::getOption('copyright', 'Makery Theme © ' . date('Y')); ?> </div> <nav class="footer-menu right"> <?php wp_nav_menu(array('theme_location' => 'footer_menu')); ?> </nav> </footer> <!-- /footer --> </div> </div> <?php wp_footer(); ?> </body>
<?php get_header(); ?> <div class="woocommerce"> <?php $woocommerce_loop['single'] = true; $woocommerce_loop['columns'] = 4; $products = array_merge(ThemexShop::$data['products'], array(0)); $limit = intval(themex_value('limit', $_GET, ThemexCore::getOption('products_per_page', 9))); $order = ThemexWoo::getSorting(); query_posts(array('post_type' => 'product', 'post_status' => 'publish', 'paged' => themex_paged(), 'posts_per_page' => $limit, 'post__in' => $products, 'orderby' => $order['orderby'], 'order' => $order['order'], 'meta_key' => $order['meta_key'])); $layout = 'full'; $shop = $post->ID; ThemexWoo::getTemplate('archive-product.php'); ?> </div> <?php get_footer();
<?php /* Template Name: Courses */ get_header(); $layout = ThemexCore::getOption('courses_layout', 'fullwidth'); $view = ThemexCore::getOption('courses_view', 'grid'); $columns = intval(ThemexCore::getOption('courses_columns', '4')); if ($layout == 'left') { ?> <aside class="sidebar fourcol column"> <?php get_sidebar(); ?> </aside> <div class="eightcol column last"> <?php } else { if ($layout == 'right') { ?> <div class="eightcol column"> <?php } else { ?> <div class="fullwidth-section"> <?php } } ?> <?php
/** * Filters lesson columns * * @access public * @param mixed $query * @return mixed */ public static function filterLessonColumns($query) { global $pagenow; if (is_admin() && $pagenow == 'edit.php' && isset($_GET['lesson_course'])) { $lessons = ThemexCore::getPostRelations(0, intval($_GET['lesson_course']), 'lesson_course'); if (!empty($lessons)) { $query->set('post__in', $lessons); } } return $query; }