*/ /** * Plugin class for the Test2pdf plugin. */ class Test2pdfPlugin extends Plugin { public $isCoursePlugin = true; protected function __construct() { parent::__construct( '1.0', 'Jose Angel Ruiz - NoSoloRed (original author)', [ 'enable_plugin' => 'boolean', ] ); } /** * @return StaticPlugin */ public static function create() { static $result = null; return $result ? $result : $result = new self(); } /** * This method creates the tables required to this plugin. */ public function install() { //Installing course settings $this->install_course_fields_in_all_courses(); require_once api_get_path(SYS_PLUGIN_PATH).'test2pdf/database.php'; } /** * This method drops the plugin tables. */ public function uninstall() { //Deleting course settings $this->uninstall_course_fields_in_all_courses($this->course_settings); $tablesToBeDeleted = [ TABLE_TEST2PDF, ]; foreach ($tablesToBeDeleted as $tableToBeDeleted) { $table = Database::get_main_table($tableToBeDeleted); $sql = "DROP TABLE IF EXISTS $tableToBeDeleted"; Database::query($sql); } $this->manageTab(false); } }