--- /dev/null
+<?php
+
+namespace App\Fields;
+
+use Cubist\Backpack\Magic\Fields\SelectFromArray;
+
+class SCORMVersion extends SelectFromArray
+{
+
+ protected $_default = '1.2';
+
+
+ public function getOptions()
+ {
+ return [
+ '1.2' => __('SCORM 1.2'),
+ '2004.3' => __('SCORM 2004 3rd edition'),
+ 2004 => __('SCORM 2004 4th edition'),
+ ];
+ }
+
+ public function getDefaultAttributes()
+ {
+ return array_merge(parent::getDefaultAttributes(), ['column_label' => 'SCORM',
+ 'column_type' => 'model_function',
+ 'column_view_namespace' => 'crud::columns',
+ 'column_function_name' => 'getSCORMVersion']);
+ }
+}
use App\Fields\User;
use App\Models\Base\ToolboxModel;
use App\Models\Traits\PublicationSettings;
+use App\Models\Traits\SCORMVersionTrait;
use Cubist\Backpack\Magic\Fields\Datetime;
use Cubist\Backpack\Magic\Fields\FormBigSection;
use Cubist\Backpack\Magic\Fields\FormSuperSection;
protected static $_permissionBase = 'fluidbook-publication';
use PublicationSettings;
+ use SCORMVersionTrait;
public function setFields()
{
return '/data1/extranet/www/fluidbook/books/working/' . $this->id;
}
- public function getSCORMVersion()
- {
- if (!$this->scorm_enable) {
- return '-';
- }
- $map = ['1.2' => '1.2', '2004' => '2004', '2004.3' => '2004 <sup>3rd ed.</sup>'];
- return $map[$this->scorm_version];
- }
+
}
namespace App\Models;
+use App\Fields\SCORMVersion;
use App\Http\Controllers\Admin\Base\QuizController;
use App\Models\Base\ToolboxModel;
+use App\Models\Traits\SCORMVersionTrait;
use Cubist\Util\Files\Files;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Image\Manipulations;
public $registerMediaConversionsUsingModelInstance = false;
+ use SCORMVersionTrait;
+
protected static function _getColors()
{
return [
$this->addColumnDateFields(__('Projet'));
$this->addOwnerField(__('Projet'));
+ $this->addField(['name' => 'scorm_version',
+ 'label' => __('Version SCORM'),
+ 'column' => true,
+ 'type' => SCORMVersion::class,
+ 'tab' => __('Projet')]
+ );
+
$this->addField(['name' => 'title',
'label' => __('Titre du quiz'),
'type' => 'Text',
use App\Fields\FluidbookDevelopmentVersion;
use App\Fields\FluidbookSignature;
+use App\Fields\SCORMVersion;
use Cubist\Backpack\Magic\Fields\Checkbox;
use Cubist\Backpack\Magic\Fields\FilesOrURL;
use Cubist\Backpack\Magic\Fields\FormSection;
'store_in' => 'settings',
'translatable' => false,
]);
- $this->addField('scorm_version', SelectFromArray::class, $this->__('Version du standard SCORM'), [
+ $this->addField('scorm_version', SCORMVersion::class, $this->__('Version du standard SCORM'), [
'v2' => '{"type":"combo","default":"1.2","editable":true,"label":"\\u00a7!\\u00a7Version du standard SCORM!\\u00a7!","grade":5,"datas":{"\\u00a7!\\u00a7SCORM 1.2!\\u00a7!":"1.2","\\u00a7!\\u00a7SCORM 2004 3rd edition!\\u00a7!":"2004.3","\\u00a7!\\u00a7SCORM 2004 4th edition!\\u00a7!":"2004"}}',
- 'options' => [
- '1.2' => $this->__('SCORM 1.2'),
- '2004.3' => $this->__('SCORM 2004 3rd edition'),
- 2004 => $this->__('SCORM 2004 4th edition'),
- ],
- 'default' => '1.2',
'fake' => true,
'store_in' => 'settings',
'translatable' => false,
--- /dev/null
+<?php
+
+namespace App\Models\Traits;
+
+trait SCORMVersionTrait
+{
+ public function getSCORMVersion()
+ {
+ if ((property_exists($this, 'scorm_enable') && !$this->scorm_enable) || !$this->scorm_version) {
+ return '-';
+ }
+ $map = ['1.2' => '1.2', '2004' => '2004', '2004.3' => '2004 <sup>3rd ed.</sup>'];
+ return $map[$this->scorm_version];
+ }
+}
score BAYES_30 -1.0
score BAYES_40 0.001
score BAYES_50 1.0
-score BAYES_60 3.1
-score BAYES_80 4.1
-score BAYES_95 5.1
-score BAYES_99 5.5
-score BAYES_999 7.5
+score BAYES_60 2.1
+score BAYES_80 3.1
+score BAYES_95 4.1
+score BAYES_99 4.5
+score BAYES_999 9.5
# TXRep
ifplugin Mail::SpamAssassin::Plugin::TextCat
ok_locales en
ok_languages en es fr de sv it pt
-score UNWANTED_LANGUAGE_BODY 1.25
-score CHARSET_FARAWAY 1.25
+score UNWANTED_LANGUAGE_BODY 3.0
+score CHARSET_FARAWAY 3.0
endif
$spam_whitelist
endif
meta HDR_CYR __HDR_FROM_CYR || __HDR_TO_CYR || __HDR_SUBJECT_CYR || __MIME_CONTENT_CYR
-score HDR_CYR 1.25
+score HDR_CYR 3.0
header __HDR_FROM_CYR_UTF8_CHARSET_DEFINITION From:raw =~ /=\?utf-8\?/i
header __HDR_TO_CYR_UTF8_CHARSET_DEFINITION To:raw =~ /=\?utf-8\?/i
meta __HDR_FROM_CYR_UTF8 __HDR_FROM_CYR_UTF8_CHARSET_DEFINITION && __HDR_FROM_CYR_UTF8_CONTENT
meta __HDR_TO_CYR_UTF8 __HDR_TO_CYR_UTF8_CHARSET_DEFINITION && __HDR_TO_CYR_UTF8_CONTENT
meta HDR_ADDR_CYR_UTF8 __HDR_FROM_CYR_UTF8 || __HDR_TO_CYR_UTF8
-score HDR_ADDR_CYR_UTF8 1.25
+score HDR_ADDR_CYR_UTF8 3.0
header __HRD_SENDER_RU From:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i
header __HRD_RECIPIENT_RU From:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i
header __HDR_ENVFROM_RU EnvelopeFrom:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i
header __HDR_RCVD_RU Received:raw =~ /from([[:blank:]]+((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)[[:blank:]])/i
meta HDR_CCTLD_RU __HRD_SENDER_RU || __HRD_RECIPIENT_RU || __HDR_ENVFROM_RU || __HDR_RCVD_RU
-score HDR_CCTLD_RU 1.25
+score HDR_CCTLD_RU 3.0
uri URI_IN_RU /^(http(s?)\:\/\/)((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)($|\/)/i
-score URI_IN_RU 1.25
+score URI_IN_RU 3.0
ifplugin Mail::SpamAssassin::Plugin::MIMEHeader
mimeheader __MIMEPART_NAME_RU Content-Type:raw =~ /name=\"=\?((((cs)?)koi8(-?)r)|(windows-1251))/ims
mimeheader __MIME_FILENAME_RU Content-Disposition:raw =~ /filename=\"=\?((((cs)?)koi8(-?)r)|(windows-1251))/ims
meta MIMEPART_NAME_RU __MIMEPART_NAME_RU || __MIME_FILENAME_RU
-score MIMEPART_NAME_RU 1.25
+score MIMEPART_NAME_RU 3.0
endif
# Note, that when examining body of a message, SA adds header to it as the
meta __CONTENT_CYR_UTF8_CHARSET_DEFINITION __HDR_SUBJ_CYR_UTF8_CHARSET_DEFINITION || __HDR_CONTENTTYPE_CYR_UTF8_CHARSET_DEFINITION
body __CONTENT_CYR_UTF8 /(((\xD0[\x81\x90-\xBF])|(\xD1[\x80-\x8F\x91]))([A-Za-z[:digit:][:blank:][:punct:]])?){3}/
meta CONTENT_CYR_UTF8 __CONTENT_CYR_UTF8_CHARSET_DEFINITION && __CONTENT_CYR_UTF8
-score CONTENT_CYR_UTF8 1.25
+score CONTENT_CYR_UTF8 3.0