Example #1
0
 public static function getInstance()
 {
     if (is_null(self::$_tr)) {
         self::$_tr = new SpTranslate();
     }
     return self::$_tr;
 }
Example #2
0
Plugin URI:   https://wordpress.org/plugins/StudyPress
Description:  StudyPress is an elearning authoring tool. With this plugin you can easily create multimedia learning content and publish it as slides in your wordpress pages and posts. It can manage courses, lessons and quizzes. 
Version:      1.1.1
Author:       Mohammed Tadlaoui, Salim Mohamed Saidi, Meryem Bendella, Bensmaine yasser, Bouacha oussama
License:      GPLv2 or later
*/
if (!defined('ABSPATH')) {
    exit;
}
add_action('admin_menu', 'activate_studypress_plugin');
$sp_lecteur = 0;
define('__ROOT_PLUGIN__', trailingslashit(dirname(__FILE__)));
define('__ROOT_PLUGIN__2', plugin_dir_url(__FILE__));
require_once '_AutoloadClass.php';
require_once 'actions-studypress.php';
$tr = SpTranslate::getInstance();
function activate_studypress_plugin()
{
    global $tr;
    $access = new AccessData();
    $table = StudyPressDB::getTableNameCourse();
    if ($access->getVar("SHOW TABLES LIKE '{$table}'") != $table) {
        $sql = "CREATE TABLE {$table} (\r\n                    " . StudyPressDB::COL_ID_COURSE . " BIGINT UNSIGNED AUTO_INCREMENT ,\r\n                    " . StudyPressDB::COL_NAME_COURSE . " VARCHAR(200),\r\n                    " . StudyPressDB::COL_DESCRIPTION_COURSE . " LONGTEXT ,\r\n                    " . StudyPressDB::COL_AVANCEMENT_COURSE . " VARCHAR(255) DEFAULT '0',\r\n                    " . StudyPressDB::COL_PICTURE_COURSE . " VARCHAR(255),\r\n                    " . StudyPressDB::COL_ID_POST_COURSE . " BIGINT DEFAULT NULL,\r\n                     PRIMARY KEY (" . StudyPressDB::COL_ID_COURSE . ")\r\n                     )";
        $access->query($sql);
    }
    $table = StudyPressDB::getTableNameActivity();
    if ($access->getVar("SHOW TABLES LIKE '{$table}'") != $table) {
        $sql = "CREATE TABLE {$table} (\r\n                    " . StudyPressDB::COL_ID_ACTIVITY . " BIGINT UNSIGNED AUTO_INCREMENT ,\r\n                    " . StudyPressDB::COL_ID_COURSE_ACTIVITY . " BIGINT UNSIGNED ,\r\n                    " . StudyPressDB::COL_NAME_ACTIVITY . " VARCHAR(200),\r\n                    " . StudyPressDB::COL_DURATION_ACTIVITY . " INT NOT NULL,\r\n                    " . StudyPressDB::COL_AUTEUR_ACTIVITY . " VARCHAR(200),\r\n                    " . StudyPressDB::COL_DESCRIPTION_ACTIVITY . " longtext ,\r\n                    " . StudyPressDB::COL_TAGS_ACTIVITY . " longtext ,\r\n                    " . StudyPressDB::COL_GLOSSARY_ACTIVITY . " longtext ,\r\n                    " . StudyPressDB::COL_PICTURE_ACTIVITY . " text,\r\n                    " . StudyPressDB::COL_SHORT_CODE_ACTIVITY . " VARCHAR(50),\r\n                    " . StudyPressDB::COL_ID_AUTEUR_ACTIVITY . " BIGINT,\r\n                    " . StudyPressDB::COL_ID_POST_ACTIVITY . " BIGINT DEFAULT NULL,\r\n                    " . StudyPressDB::COL_TYPE_ACTIVITY . " VARCHAR(10),\r\n                    " . StudyPressDB::COL_ORDER_ACTIVITY . " INT NOT NULL,\r\n                     PRIMARY KEY (" . StudyPressDB::COL_ID_ACTIVITY . "),\r\n                     FOREIGN KEY (" . StudyPressDB::COL_ID_COURSE_ACTIVITY . ") REFERENCES " . StudyPressDB::getTableNameCourse() . " (" . StudyPressDB::COL_ID_COURSE . ")\r\n                     )";
        $access->query($sql);
    }
    $table = StudyPressDB::getTableNameSlide();
function studypress_load_plugin_textdomain()
{
    load_plugin_textdomain(SpTranslate::getDomain(), false, SpTranslate::getPath());
}