| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Educare |
| 4 |
* @version 1.6.1 |
| 5 |
* @author FixBD <fixbd.org@gmail.com> |
| 6 |
* @copyright GPL-2.0+ |
| 7 |
* @link http://github.com/fixbd/educare |
| 8 |
* @license https://www.gnu.org/licenses/gpl-2.0.html |
| 9 |
* |
| 10 |
* Plugin Name: Educare |
| 11 |
* Plugin URI: http://wordpress.org/plugins/educare/ |
| 12 |
* Description: Educare is a powerful online School/College students & results management system dev by FixBD. This plugin allows you to manage and publish students results. You can easily Add/Edit/Delete Students, Results, Class, Exam, Year Custom field and much more... Also you can import & export unlimited students and results just a click! |
| 13 |
* Version: 1.6.1 |
| 14 |
* Author: FixBD |
| 15 |
* Author URI: http://fixbd.com |
| 16 |
* License: GPL-2.0+ |
| 17 |
* Text Domain: educare |
| 18 |
* |
| 19 |
* Attention please... |
| 20 |
* Educare is a free software; you can redistribute it and/or modify it under the terms of the GNU |
| 21 |
* General Public License as published by the Free Software Foundation. either version 2 of the License, |
| 22 |
* or (at your option) any later version. |
| 23 |
* |
| 24 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
| 25 |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 26 |
* |
| 27 |
* You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>. |
| 28 |
*/ |
| 29 |
|
| 30 |
// Prevent direct access to the file |
| 31 |
if (!defined('ABSPATH')) { |
| 32 |
exit; // Exit if accessed directly |
| 33 |
} |
| 34 |
|
| 35 |
// Make it simple! (Define paths) |
| 36 |
define('EDUCARE_FILE', plugin_basename( __FILE__ )); |
| 37 |
define('EDUCARE_DIR', plugin_dir_path(__FILE__)); |
| 38 |
define('EDUCARE_INC', EDUCARE_DIR.'includes'.'/'); |
| 39 |
define('EDUCARE_ADMIN', EDUCARE_INC.'admin'.'/'); |
| 40 |
define('EDUCARE_TEMP', EDUCARE_DIR.'templates'.'/'); |
| 41 |
define('EDUCARE_FOLDER', basename(dirname(__FILE__))); |
| 42 |
define('EDUCARE_URL', plugin_dir_url(EDUCARE_FOLDER).EDUCARE_FOLDER.'/'); |
| 43 |
define('EDUCARE_VERSION', '1.6.1'); |
| 44 |
define('EDUCARE_SETTINGS_VERSION', '1.0'); |
| 45 |
define('EDUCARE_RESULTS_VERSION', '1.0'); |
| 46 |
|
| 47 |
// Include plugin functions |
| 48 |
require_once(EDUCARE_INC.'functions.php'); |
| 49 |
// Create a database table for plugin settings and student results system |
| 50 |
require_once(EDUCARE_INC.'database/educare-database.php'); |
| 51 |
|
| 52 |
// Activation hook 1: Add database |
| 53 |
register_activation_hook( __FILE__, 'educare_database_table' ); |
| 54 |
// Seactivation hook |
| 55 |
register_deactivation_hook( __FILE__, 'educare_deactivation_hook' ); |
| 56 |
// Uninstall hook |
| 57 |
register_uninstall_hook( __FILE__, 'educare_uninstall_action' ); |
| 58 |
|
| 59 |
/** |
| 60 |
* Adds custom action links to the plugin entry in the WordPress admin dashboard. |
| 61 |
* |
| 62 |
* This function is used to modify the action links displayed for the plugin in the |
| 63 |
* list of installed plugins in the WordPress admin dashboard. The action links provide |
| 64 |
* quick access to specific pages or actions related to the plugin. |
| 65 |
* |
| 66 |
* @param array $links An array of existing action links for the plugin. |
| 67 |
* @param string $file The main file of the current plugin. |
| 68 |
* @return array Modified array of action links. |
| 69 |
*/ |
| 70 |
if (!function_exists('educare_action_links')) { |
| 71 |
|
| 72 |
function educare_action_links( $links, $file ) { |
| 73 |
static $educare; |
| 74 |
|
| 75 |
if (!$educare) { |
| 76 |
$educare = plugin_basename(__FILE__); |
| 77 |
} |
| 78 |
|
| 79 |
$action_links = array ( |
| 80 |
// 'link || lug' => 'titile', |
| 81 |
'settings' => 'Settings', |
| 82 |
'management' => 'Management', |
| 83 |
'all-results' => 'All Results', |
| 84 |
'all-students' => 'All Students' |
| 85 |
); |
| 86 |
|
| 87 |
foreach ($action_links as $url => $title) { |
| 88 |
if ($file == $educare) { |
| 89 |
$url = 'admin.php?page=educare-' . esc_attr($url); |
| 90 |
$in = '<a href="'. esc_url($url) .'">'. esc_html($title) .'</a>'; |
| 91 |
// Add action link |
| 92 |
array_unshift($links, $in); |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
return $links; |
| 97 |
} |
| 98 |
|
| 99 |
// add options after plugin activation |
| 100 |
add_filter( 'plugin_action_links', 'educare_action_links', 10, 2 ); |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
?> |