static function admin_enqueue_scripts()
 {
     /*$q = new LP_Question();
     		$q->admin_script();*/
     LP_Admin_Assets::enqueue_style('select2', RWMB_CSS_URL . 'select2/select2.css');
     LP_Admin_Assets::enqueue_script('select2', RWMB_JS_URL . 'select2/select2.min.js');
     LP_Admin_Assets::enqueue_script('lpr-quiz-question', LearnPress()->plugin_url('inc/admin/meta-boxes/js/quiz-question.js'));
 }
 static function install()
 {
     self::install_options();
     // Update version
     delete_option('learnpress_version');
     add_option('learnpress_version', LearnPress()->version);
     $s = learn_press_admin_settings('emails');
     $s->set('general', array('from_name' => get_option('blogname'), 'from_email' => get_option('admin_email')));
     $s->update();
 }
Example #3
0
 /**
  * Output common js settings in admin
  *
  * @since 0.9.4
  */
 function plugin_js_settings()
 {
     static $did = false;
     if ($did) {
         return;
     }
     $js = array('ajax' => admin_url('admin-ajax.php'), 'plugin_url' => LearnPress()->plugin_url());
     echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode($js) . '</script>';
     $did = true;
 }
 /**
  * Enqueue scripts and styles
  *
  * @return void
  */
 static function admin_enqueue_scripts()
 {
     LPR_Admin_Assets::enqueue_style('select2', RWMB_CSS_URL . 'select2/select2.css');
     LPR_Admin_Assets::enqueue_style('toastr', LPR_CSS_URL . 'toastr.css');
     LPR_Admin_Assets::enqueue_style('thim-course', LearnPress()->plugin_url('inc/admin/meta-boxes/css/course.css'));
     LPR_Admin_Assets::enqueue_script('select2', RWMB_JS_URL . 'select2/select2.min.js');
     LPR_Admin_Assets::enqueue_script('toastr', LPR_JS_URL . 'toastr.js');
     LPR_Admin_Assets::enqueue_script('tojson', LPR_JS_URL . 'toJSON.js');
     LPR_Admin_Assets::enqueue_script('thim-course', LearnPress()->plugin_url('inc/admin/meta-boxes/js/course.js'), array('jquery', 'toastr', 'tojson'));
     LPR_Admin_Assets::add_localize(array('confirm_remove_section_lesson' => __('Do you want to remove this lesson permanently?', 'learn_press'), 'confirm_remove_section_quiz' => __('Do you want to remove this quiz permanently?', 'learn_press'), 'confirm_remove_section' => __('Do you want to remove this section permanently?', 'learn_press'), 'add_new_quiz' => __('New quiz added', 'learn_press'), 'add_new_lesson' => __('New lesson added', 'learn_press'), 'add_new_section' => __('New section added', 'learn_press'), 'remove_section_lesson' => __('The lesson removed', 'learn_press'), 'remove_section_quiz' => __('The quiz removed', 'learn_press'), 'remove_section' => __('The section removed', 'learn_press'), 'section_ordered' => __('The ordering completed', 'learn_press'), 'add_lesson_to_section' => __('Lesson added to section complete!', 'learn_press'), 'add_quiz_to_section' => __('Quiz added to section complete!', 'learn_press'), 'update_lesson_quiz' => __('%s updated', 'learn_press'), 'quick_edit_name' => __('Click to quick edit name', 'learn_press'), 'confirm_remove_section_assignment' => __('Do you want to remove this assignment permanently', 'learn_press'), 'add_new_assignment' => __('New assignment added', 'learn_press'), 'remove_section_assignment' => __('The assignment removed', 'learn_press'), 'add_assignment_to_section' => __('Assignment added to section complete!', 'learn_press')), null, 'thim-course');
 }
Example #5
0
 /**
  * Output common js settings in admin
  *
  * @since 0.9.4
  */
 function plugin_js_settings()
 {
     static $did = false;
     if ($did) {
         return;
     }
     $js = array('ajax' => admin_url('admin-ajax.php'), 'plugin_url' => LearnPress()->plugin_url(), 'siteurl' => home_url());
     echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode($js) . '</script>';
     if (LP_Settings::instance()->get('debug') == 'yes') {
         echo '<script type="text/javascript">var LEARN_PRESS_DEBUG = true;</script>';
     }
     $did = true;
 }
 /**
  * Load assets for admin
  */
 static function load_scripts()
 {
     $screen = get_current_screen();
     $screen_id = $screen->id;
     if (in_array($screen_id, learn_press_get_screens())) {
         self::add_style('learn-press-global', learn_press_plugin_url('assets/css/global-style.css'));
         self::add_style('learn-press-admin', learn_press_plugin_url('assets/css/admin/admin.css'), array('learn-press-global'));
         self::add_style('learn-press-icons', learn_press_plugin_url('assets/css/icons.css'));
         //self::add_script( 'learn-press-ui', learn_press_plugin_url( 'assets/js/ui.js' ) );
         self::add_script('learn-press-admin', learn_press_plugin_url('assets/js/admin/admin.js'));
         self::add_script('modal-search-items', LearnPress()->plugin_url('assets/js/admin/modal-search-items.js'), array('jquery'));
     }
     if (in_array($screen_id, array('lp_order', 'order'))) {
         self::add_style('learn-press-order', learn_press_plugin_url('assets/css/admin/meta-box-order.css'));
         self::add_script('learn-press-order', LP()->plugin_url('assets/js/admin/meta-box-order.js'), array('backbone', 'wp-util'));
     }
 }
Example #7
0
/**
 * Load the main instance of plugin after all plugins have been loaded
 *
 * @author      TuNguyen
 * @date        04 Mar 2015
 * @since       1.0
 */
function load_learn_press()
{
    $GLOBALS['learn_press'] = array();
    $GLOBALS['LearnPress'] = LearnPress();
}
function learn_press_front_scripts()
{
    $js = array('ajax' => admin_url('admin-ajax.php'), 'plugin_url' => LearnPress()->plugin_url(), 'siteurl' => home_url());
    echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode($js) . '</script>';
}