| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: WPSchoolPress |
| 4 |
Plugin URI: http://wpschoolpress.com |
| 5 |
Description: WPSchoolpress is a school management system plugin that makes school activities transparent to parents. For more information please visit our website. |
| 6 |
Version: 2.1.14 |
| 7 |
Author: WPSchoolPress Team |
| 8 |
Author URI: wpschoolpress.com |
| 9 |
Text Domain: WPSchoolPress |
| 10 |
Domain Path: languages |
| 11 |
@package WPSchoolPress |
| 12 |
*/ |
| 13 |
// Exit if accessed directly |
| 14 |
if (!defined('ABSPATH')) exit; |
| 15 |
/** |
| 16 |
* Basic plugin definitions |
| 17 |
* |
| 18 |
* @package WPSchoolPress |
| 19 |
* @since 2.1.14 |
| 20 |
*/ |
| 21 |
if (!defined('WPSP_PLUGIN_URL')) |
| 22 |
{ |
| 23 |
define('WPSP_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 24 |
} |
| 25 |
if (!defined('WPSP_PLUGIN_PATH')) |
| 26 |
{ |
| 27 |
define('WPSP_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
| 28 |
} |
| 29 |
if (!defined('WPSP_PLUGIN_VERSION')) |
| 30 |
{ |
| 31 |
define('WPSP_PLUGIN_VERSION', '2.1.14'); //Plugin version number |
| 32 |
} |
| 33 |
define('WPSP_PERMISSION_MSG', 'You don\'t have enough permission to access this page'); |
| 34 |
// Call the required files when plugin activate |
| 35 |
register_activation_hook(__FILE__, 'wpsp_activation'); |
| 36 |
function wpsp_activation() |
| 37 |
{ |
| 38 |
include_once (WPSP_PLUGIN_PATH . 'lib/wpsp-activation.php'); |
| 39 |
} |
| 40 |
register_deactivation_hook( __FILE__, 'wpsp_deactivation'); |
| 41 |
function wpsp_deactivation() |
| 42 |
{ |
| 43 |
include_once (WPSP_PLUGIN_PATH . 'lib/wpsp-deactivation.php'); |
| 44 |
} |
| 45 |
// add action to load plugin |
| 46 |
add_action('plugins_loaded', 'wpsp_plugins_loaded'); |
| 47 |
|
| 48 |
function wpsp_plugins_loaded() |
| 49 |
{ |
| 50 |
$wpsp_lang_dir = dirname(plugin_basename(__FILE__)) . '/languages/'; |
| 51 |
load_plugin_textdomain('WPSchoolPress', false, $wpsp_lang_dir); |
| 52 |
// initialize settings of plugin Open required files for initialization |
| 53 |
require_once (WPSP_PLUGIN_PATH . 'lib/wpsp-ajaxworks.php'); |
| 54 |
require_once (WPSP_PLUGIN_PATH . 'lib/wpsp-ajaxworks-student.php'); |
| 55 |
require_once (WPSP_PLUGIN_PATH . 'lib/wpsp-ajaxworks-teacher.php'); |
| 56 |
require_once (WPSP_PLUGIN_PATH . 'wpsp-layout.php'); |
| 57 |
require_once (WPSP_PLUGIN_PATH . 'includes/wpsp-misc.php'); |
| 58 |
wpsp_get_setting(); |
| 59 |
|
| 60 |
global $wpsp_settings_data; |
| 61 |
global $wpsp_admin, $wpsp_public, $paytmClass, $paypalClass; |
| 62 |
// admin class handles most of functionalities of plugin |
| 63 |
include_once (WPSP_PLUGIN_PATH . 'wpsp-class-admin.php'); |
| 64 |
$wpsp_admin = new Wpsp_Admin(); |
| 65 |
$wpsp_admin->add_hooks(); |
| 66 |
// public class handles most of functionalities of plugin |
| 67 |
include_once (WPSP_PLUGIN_PATH . 'wpsp-class-public.php'); |
| 68 |
$wpsp_public = new Wpsp_Public(); |
| 69 |
$wpsp_public->add_hooks(); |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
add_action('admin_init', 'ajax_actions'); |
| 75 |
function ajax_actions() |
| 76 |
{ |
| 77 |
add_action('wp_ajax_listdashboardschedule', 'wpsp_listdashboardschedule'); |
| 78 |
add_action('wp_ajax_StudentProfile', 'wpsp_StudentProfile'); |
| 79 |
add_action('wp_ajax_AddStudent', 'wpsp_AddStudent'); |
| 80 |
add_action('wp_ajax_UpdateStudent', 'wpsp_UpdateStudent'); |
| 81 |
add_action('wp_ajax_StudentPublicProfile', 'wpsp_StudentPublicProfile'); |
| 82 |
add_action('wp_ajax_ParentPublicProfile', 'wpsp_ParentPublicProfile'); |
| 83 |
add_action('wp_ajax_TeacherPublicProfile', 'wpsp_TeacherPublicProfile'); |
| 84 |
add_action('wp_ajax_bulkDelete', 'wpsp_BulkDelete'); |
| 85 |
add_action('wp_ajax_undoImport', 'wpsp_UndoImport'); |
| 86 |
add_action('wp_ajax_AddTeacher', 'wpsp_AddTeacher'); |
| 87 |
add_action('wp_ajax_AddParent', 'wpsp_AddParent'); |
| 88 |
add_action('wp_ajax_AddClass', 'wpsp_AddClass'); |
| 89 |
add_action('wp_ajax_UpdateClass', 'wpsp_UpdateClass'); |
| 90 |
add_action('wp_ajax_GetClass', 'wpsp_GetClass'); |
| 91 |
add_action('wp_ajax_DeleteClass', 'wpsp_DeleteClass'); |
| 92 |
add_action('wp_ajax_Updateregisterdeactive', 'wpsp_Updateregisterdeactive'); |
| 93 |
add_action('wp_ajax_Updateregisteractive', 'wpsp_Updateregisteractive'); |
| 94 |
add_action('wp_ajax_bulkaproverequest', 'wpsp_bulkaproverequest'); |
| 95 |
add_action('wp_ajax_bulkdisaproverequest', 'wpsp_bulkdisaproverequest'); |
| 96 |
add_action('wp_ajax_AddExam', 'wpsp_AddExam'); |
| 97 |
add_action('wp_ajax_UpdateExam', 'wpsp_UpdateExam'); |
| 98 |
add_action('wp_ajax_ExamInfo', 'wpsp_ExamInfo'); |
| 99 |
add_action('wp_ajax_DeleteExam', 'wpsp_DeleteExam'); |
| 100 |
add_action('wp_ajax_getStudentsList', 'wpsp_getStudentsList'); |
| 101 |
add_action('wp_ajax_AttendanceEntry', 'wpsp_AttendanceEntry'); |
| 102 |
add_action('wp_ajax_deleteAttendance', 'wpsp_DeleteAttendance'); |
| 103 |
add_action('wp_ajax_getStudentsAttendanceList', 'wpsp_getStudentsAttendanceList'); |
| 104 |
add_action('wp_ajax_getAbsentees', 'wpsp_GetAbsentees'); |
| 105 |
add_action('wp_ajax_getAbsentDates', 'wpsp_GetAbsentDates'); |
| 106 |
add_action('wp_ajax_getAttReport', 'wpsp_GetAttReport'); |
| 107 |
add_action('wp_ajax_AddSubject', 'wpsp_AddSubject'); |
| 108 |
add_action('wp_ajax_SubjectInfo', 'wpsp_SubjectInfo'); |
| 109 |
add_action('wp_ajax_UpdateSubject', 'wpsp_UpdateSubject'); |
| 110 |
add_action('wp_ajax_DeleteSubject', 'wpsp_DeleteSubject'); |
| 111 |
add_action('wp_ajax_subjectList', 'wpsp_SubjectList'); |
| 112 |
add_action('wp_ajax_save_timetable', 'wpsp_SaveTimetable'); |
| 113 |
add_action('wp_ajax_deletsloat', 'wpsp_DeleteTimetablesloat'); |
| 114 |
add_action('wp_ajax_deletTimetable', 'wpsp_DeleteTimetable'); |
| 115 |
add_action('wp_ajax_addMark', 'wpsp_AddMark'); |
| 116 |
add_action('wp_ajax_getMarksubject', 'wpsp_getMarksubject'); |
| 117 |
|
| 118 |
add_action('wp_ajax_GenSetting', 'wpsp_GenSetting'); |
| 119 |
add_action('wp_ajax_GenSettingsms', 'wpsp_GenSettingsms'); |
| 120 |
add_action('wp_ajax_GenSettingsocial', 'wpsp_GenSettingsocial'); |
| 121 |
add_action('wp_ajax_GenSettinglicensing', 'wpsp_GenSettinglicensing'); |
| 122 |
add_action('wp_ajax_addSubField', 'wpsp_AddSubField'); |
| 123 |
add_action('wp_ajax_updateSubField', 'wpsp_UpdateSubField'); |
| 124 |
add_action('wp_ajax_deleteSubField', 'wpsp_DeleteSubField'); |
| 125 |
add_action('wp_ajax_manageGrade', 'wpsp_ManageGrade'); |
| 126 |
add_action('wp_ajax_addEvent', 'wpsp_AddEvent'); |
| 127 |
add_action('wp_ajax_updateEvent', 'wpsp_UpdateEvent'); |
| 128 |
add_action('wp_ajax_deleteEvent', 'wpsp_DeleteEvent'); |
| 129 |
add_action('wp_ajax_listEvent', 'wpsp_ListEvent'); |
| 130 |
add_action('wp_ajax_deleteAllLeaves', 'wpsp_DeleteLeave'); |
| 131 |
add_action('wp_ajax_addLeaveDay', 'wpsp_AddLeaveDay'); |
| 132 |
add_action('wp_ajax_getLeaveDays', 'wpsp_GetLeaveDays'); |
| 133 |
add_action('wp_ajax_getClassYear', 'wpsp_GetClassYear'); |
| 134 |
add_action('wp_ajax_addTransport', 'wpsp_AddTransport'); |
| 135 |
add_action('wp_ajax_updateTransport', 'wpsp_UpdateTransport'); |
| 136 |
add_action('wp_ajax_viewTransport', 'wpsp_ViewTransport'); |
| 137 |
add_action('wp_ajax_deleteTransport', 'wpsp_DeleteTransport'); |
| 138 |
add_action('wp_ajax_sendMessage', 'wpsp_SendMessage'); |
| 139 |
add_action('wp_ajax_sendSubMessage', 'wpsp_sendSubMessage'); |
| 140 |
add_action('wp_ajax_viewMessage', 'wpsp_ViewMessage'); |
| 141 |
add_action('wp_ajax_deleteMessage', 'wpsp_DeleteMessage'); |
| 142 |
add_action('wp_ajax_photoUpload', 'wpsp_UploadPhoto'); |
| 143 |
add_action('wp_ajax_deletePhoto', 'wpsp_DeletePhoto'); |
| 144 |
add_action('wp_ajax_DeleteStudent', 'wpsp_DeleteStudent'); |
| 145 |
add_action('wp_ajax_DeleteTeacher', 'wpsp_DeleteTeacher'); |
| 146 |
// Teacher modules |
| 147 |
add_action('wp_ajax_getTeachersList', 'wpsp_getTeachersList'); |
| 148 |
add_action('wp_ajax_TeacherAttendanceEntry', 'wpsp_TeacherAttendanceEntry'); |
| 149 |
add_action('wp_ajax_TeacherAttendanceDelete', 'wpsp_TeacherAttendanceDelete'); |
| 150 |
add_action('wp_ajax_TeacherAttendanceView', 'wpsp_TeacherAttendanceView'); |
| 151 |
add_action('wp_ajax_UpdateTeacher', 'wpsp_UpdateTeacher'); |
| 152 |
// Notification modules |
| 153 |
add_action('wp_ajax_deleteNotify', 'wpsp_deleteNotify'); |
| 154 |
add_action('wp_ajax_getNotify', 'wpsp_getNotifyInfo'); |
| 155 |
// Change Password |
| 156 |
add_action('wp_ajax_changepassword', 'wpsp_changepassword'); |
| 157 |
// Import Dummy data |
| 158 |
add_action('wp_ajax_ImportContents', 'wpsp_Import_Dummy_contents'); |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
// Get error content and update |
| 164 |
function wpsp_save_error() |
| 165 |
{ |
| 166 |
update_option('plugin_error', ob_get_contents()); |
| 167 |
} |
| 168 |
add_action('activated_plugin', 'wpsp_save_error'); |
| 169 |
//Show Link Plugin Page |
| 170 |
function wpsp_add_plugin_links($links) |
| 171 |
{ |
| 172 |
$plugin_links = array( |
| 173 |
'<a href="'.esc_url('admin.php?page=WPSchoolPress').'"><strong style="color: #11967A; display: inline;">' . __('Settings', 'WPSchoolPress-123') . '</strong></a>' |
| 174 |
); |
| 175 |
return array_merge($plugin_links, $links); |
| 176 |
} |
| 177 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__) , 'wpsp_add_plugin_links', 20); |
| 178 |
// Change login page logo url |
| 179 |
function wp_wp_login_url() { return home_url(); } |
| 180 |
add_filter( 'login_headerurl', 'wp_wp_login_url' ); |
| 181 |
?> |
| 182 |
|