-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
820 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
// This file is part of the tool_certificate plugin for Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Class represents a customcert element. | ||
* | ||
* @package mod_customcert | ||
* @copyright 2024 Mark Nelson <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace mod_customcert\persistent; | ||
|
||
use core\persistent; | ||
|
||
/** | ||
* Class represents a customcert element. | ||
* | ||
* @package mod_customcert | ||
* @copyright 2024 Mark Nelson <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class element extends persistent { | ||
|
||
/** @var string */ | ||
const TABLE = 'tool_certificate_elements'; | ||
|
||
/** | ||
* Return the definition of the properties of this model. | ||
* | ||
* @return array | ||
*/ | ||
protected static function define_properties() { | ||
return [ | ||
'pageid' => [ | ||
'type' => PARAM_INT, | ||
], | ||
'name' => [ | ||
'type' => PARAM_TEXT, | ||
'default' => '', | ||
], | ||
'element' => [ | ||
'type' => PARAM_ALPHANUMEXT, | ||
], | ||
'data' => [ | ||
'type' => PARAM_RAW, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'font' => [ | ||
'type' => PARAM_NOTAGS, | ||
'null' => NULL_ALLOWED, | ||
'default' => 'freesans', | ||
], | ||
'fontsize' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'colour' => [ | ||
'type' => PARAM_NOTAGS, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'posx' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'posy' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'width' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'refpoint' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
'sequence' => [ | ||
'type' => PARAM_INT, | ||
'null' => NULL_ALLOWED, | ||
'default' => null, | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Class represents a customcert page. | ||
* | ||
* @package mod_customcert | ||
* @copyright 2024 Mark Nelson <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace mod_customcert\persistent; | ||
|
||
use core\persistent; | ||
|
||
/** | ||
* Class represents a customcert page. | ||
* | ||
* @package mod_customcert | ||
* @copyright 2024 Mark Nelson <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class page extends persistent { | ||
|
||
/** @var string The table name. */ | ||
public const TABLE = 'customcert_pages'; | ||
|
||
/** | ||
* Return the definition of the properties of this model. | ||
* | ||
* @return array | ||
*/ | ||
protected static function define_properties() { | ||
return [ | ||
'templateid' => [ | ||
'type' => PARAM_INT | ||
], | ||
'width' => [ | ||
'type' => PARAM_INT, | ||
'default' => 297 | ||
], | ||
'height' => [ | ||
'type' => PARAM_INT, | ||
'default' => 210 | ||
], | ||
'leftmargin' => [ | ||
'type' => PARAM_INT, | ||
'default' => 0 | ||
], | ||
'rightmargin' => [ | ||
'type' => PARAM_INT, | ||
'default' => 0 | ||
], | ||
'sequence' => [ | ||
'type' => PARAM_INT | ||
], | ||
]; | ||
} | ||
|
||
public function after_create() | ||
{ | ||
\mod_customcert\event\page_created::create_from_page($this->get('id'), $this)->trigger(); | ||
} | ||
} |
Oops, something went wrong.