/** * This function generates the help page. * * @return void * @since 4.4.0 */ function mlw_generate_help_page() { if (!current_user_can('moderate_comments')) { return; } wp_enqueue_style('qmn_admin_style', plugins_url('../css/qmn_admin.css', __FILE__)); ///Creates the widgets add_meta_box("wpss_mrts", __('Need Help?', 'quiz-master-next'), "qmn_documentation_meta_box_content", "meta_box_help"); add_meta_box("wpss_mrts", __('Support', 'quiz-master-next'), "qmn_support_meta_box_content", "meta_box_support"); add_meta_box("wpss_mrts", __('System Info', 'quiz-master-next'), "qmn_system_meta_box_content", "meta_box_sys_info"); ?> <div class="wrap"> <h2><?php _e('Help Page', 'quiz-master-next'); ?> </h2> <?php echo mlw_qmn_show_adverts(); ?> <!--Display Widget Boxes--> <div style="float:left; width:50%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_help', 'advanced', ''); ?> </div> <div style="float:left; width:50%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_support', 'advanced', ''); ?> </div> <div style="float:left; width:100%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_sys_info', 'advanced', ''); ?> </div> </div> <?php }
/** * Generates the HTML for the Stats page * * Retrieves the HTML for the tab of Stats page from the plugin helper * * @since 4.3.0 * @return void */ function qmn_generate_stats_page() { if (!current_user_can('moderate_comments')) { return; } global $mlwQuizMasterNext; $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'quiz-taken-stats'; $tab_array = $mlwQuizMasterNext->pluginHelper->get_stats_tabs(); ?> <div class="wrap"> <h2><?php _e('Quiz Statistics', 'quiz-master-next'); ?> </h2> <?php echo mlw_qmn_show_adverts(); ?> <h2 class="nav-tab-wrapper"> <?php foreach ($tab_array as $tab) { $active_class = ''; if ($active_tab == $tab['slug']) { $active_class = 'nav-tab-active'; } echo "<a href=\"?page=qmn_stats&tab=" . $tab['slug'] . "\" class=\"nav-tab {$active_class}\">" . $tab['title'] . "</a>"; } ?> </h2> <div> <?php foreach ($tab_array as $tab) { if ($active_tab == $tab['slug']) { call_user_func($tab['function']); } } ?> </div> </div> <?php }
/** * This function generates the help page. * * @return void * @since 4.4.0 */ function mlw_generate_help_page() { ///Creates the widgets add_meta_box("wpss_mrts", __('Need Help?', 'quiz-master-next'), "qmn_documentation_meta_box_content", "meta_box_help"); add_meta_box("wpss_mrts", __('Support', 'quiz-master-next'), "qmn_support_meta_box_content", "meta_box_support"); add_meta_box("wpss_mrts", __('System Info', 'quiz-master-next'), "qmn_system_meta_box_content", "meta_box_sys_info"); ?> <div class="wrap"> <h2><?php _e('Help Page', 'quiz-master-next'); ?> </h2> <?php echo mlw_qmn_show_adverts(); ?> <!--Display Widget Boxes--> <div style="float:left; width:50%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_help', 'advanced', ''); ?> </div> <div style="float:left; width:50%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_support', 'advanced', ''); ?> </div> <div style="float:left; width:100%;" class="inner-sidebar1"> <?php do_meta_boxes('meta_box_sys_info', 'advanced', ''); ?> </div> </div> <?php }
/** * Generates all of the quiz tools that are used * * Long Description * * @param type description * @return type description * @since 4.4.0 */ function mlw_generate_quiz_tools() { if (!current_user_can('moderate_comments')) { return; } add_meta_box("qmn_restore_box", 'Restore Quiz', "qmn_restore_function", "quiz_wpss"); add_meta_box("qmn_audit_box", 'Audit Trail', "mlw_tools_box", "quiz_wpss"); ?> <!-- css --> <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" /> <!-- jquery scripts --> <?php wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-dialog'); wp_enqueue_script('jquery-ui-button'); wp_enqueue_script('jquery-ui-accordion'); wp_enqueue_script('jquery-ui-tooltip'); wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-effects-blind'); wp_enqueue_script('jquery-effects-explode'); ?> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>--> <script type="text/javascript"> var $j = jQuery.noConflict(); // increase the default animation speed to exaggerate the effect $j.fx.speeds._default = 1000; $j(function() { $j("button, #prev_page, #next_page").button(); }); </script> <style type="text/css"> textarea{ border-color:#000000; color:#3300CC; cursor:hand; } p em { padding-left: 1em; color: #555; font-weight: bold; } </style> <div class="wrap"> <h2><?php _e('Tools', 'quiz-master-next'); ?> </h2> <div style="float:left; width:100%;" class="inner-sidebar1"> <?php do_meta_boxes('quiz_wpss', 'advanced', null); ?> </div> <div style="clear:both"></div> <?php echo mlw_qmn_show_adverts(); ?> </div> <?php }
/** * This function allows for the editing of quiz options. * * @param type description * @return void * @since 4.4.0 */ function mlw_generate_quiz_options() { if (!current_user_can('moderate_comments')) { return; } global $wpdb; global $mlwQuizMasterNext; $tab_array = $mlwQuizMasterNext->pluginHelper->get_settings_tabs(); $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'questions'; $quiz_id = intval($_GET["quiz_id"]); if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$table_name} WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } ?> <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <!-- css --> <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" /> <!-- jquery scripts --> <?php wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-dialog'); wp_enqueue_script('jquery-ui-button'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-effects-blind'); wp_enqueue_script('jquery-effects-explode'); ?> <style> .mlw_tab_content { padding: 20px 20px 20px 20px; margin: 20px 20px 20px 20px; } </style> <div class="wrap"> <div class='mlw_quiz_options'> <h2><?php /* translators: The %s corresponds to the name of the quiz */ echo sprintf(__('Quiz Settings For %s', 'quiz-master-next'), $mlw_quiz_options->quiz_name); ?> </h2> <?php ob_start(); if ($quiz_id != "") { ?> <h2 class="nav-tab-wrapper"> <?php foreach ($tab_array as $tab) { $active_class = ''; if ($active_tab == $tab['slug']) { $active_class = 'nav-tab-active'; } echo "<a href=\"?page=mlw_quiz_options&quiz_id={$quiz_id}&tab=" . $tab['slug'] . "\" class=\"nav-tab {$active_class}\">" . $tab['title'] . "</a>"; } ?> </h2> <div> <br /> <br /> <?php foreach ($tab_array as $tab) { if ($active_tab == $tab['slug']) { call_user_func($tab['function']); } } ?> </div> <?php } else { ?> <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"> <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> <strong><?php _e('Error!', 'quiz-master-next'); ?> </strong> <?php _e('Please go to the quizzes page and click on the Edit link from the quiz you wish to edit.', 'quiz-master-next'); ?> </p> </div> <?php } $mlw_output = ob_get_contents(); ob_end_clean(); $mlwQuizMasterNext->alertManager->showAlerts(); echo mlw_qmn_show_adverts(); echo $mlw_output; ?> </div> </div> <?php }