Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2926/head
Angel Fernando Quiroz Campos 7 years ago
commit a327f6ccc7
  1. 15
      app/Resources/public/assets/pretty-checkbox/.bower.json
  2. 32
      app/Resources/public/assets/pretty-checkbox/.gitignore
  3. 4
      app/Resources/public/assets/pretty-checkbox/.stylelintrc
  4. 22
      app/Resources/public/assets/pretty-checkbox/.travis.yml
  5. 111
      app/Resources/public/assets/pretty-checkbox/Gulpfile.js
  6. 9
      app/Resources/public/assets/pretty-checkbox/LICENSE
  7. 299
      app/Resources/public/assets/pretty-checkbox/README.md
  8. 1
      app/Resources/public/assets/pretty-checkbox/dist/maps/pretty-checkbox.css.map
  9. 959
      app/Resources/public/assets/pretty-checkbox/dist/pretty-checkbox.css
  10. 12
      app/Resources/public/assets/pretty-checkbox/dist/pretty-checkbox.min.css
  11. BIN
      app/Resources/public/assets/pretty-checkbox/logo.png
  12. 65
      app/Resources/public/assets/pretty-checkbox/package.json
  13. BIN
      app/Resources/public/assets/pretty-checkbox/preview.gif
  14. 27
      app/Resources/public/assets/pretty-checkbox/src/pretty-checkbox.scss
  15. 85
      app/Resources/public/assets/pretty-checkbox/src/scss/_core.scss
  16. 39
      app/Resources/public/assets/pretty-checkbox/src/scss/_variables.scss
  17. 7
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/default/_fill.scss
  18. 13
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/default/_outline.scss
  19. 12
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/default/_thick.scss
  20. 39
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/font-icon/_general.scss
  21. 21
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/image/_general.scss
  22. 33
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/svg/_general.scss
  23. 15
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/switch/_fill.scss
  24. 54
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/switch/_general.scss
  25. 16
      app/Resources/public/assets/pretty-checkbox/src/scss/elements/switch/_slim.scss
  26. 1
      app/Resources/public/assets/pretty-checkbox/src/scss/essentials/_functions.scss
  27. 102
      app/Resources/public/assets/pretty-checkbox/src/scss/essentials/_keyframes.scss
  28. 1
      app/Resources/public/assets/pretty-checkbox/src/scss/essentials/_mixins.scss
  29. 89
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_animation.scss
  30. 14
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_bigger.scss
  31. 53
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_colors.scss
  32. 8
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_curve.scss
  33. 12
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_disabled.scss
  34. 6
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_locked.scss
  35. 12
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_plain.scss
  36. 13
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_print.scss
  37. 17
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_round.scss
  38. 32
      app/Resources/public/assets/pretty-checkbox/src/scss/extras/_toggle.scss
  39. 7
      app/Resources/public/assets/pretty-checkbox/src/scss/states/_focus.scss
  40. 13
      app/Resources/public/assets/pretty-checkbox/src/scss/states/_hover.scss
  41. 14
      app/Resources/public/assets/pretty-checkbox/src/scss/states/_indeterminate.scss
  42. 1459
      app/Resources/public/assets/pretty-checkbox/src/test.css
  43. 28
      main/admin/access_url_edit.php
  44. 3
      main/admin/user_import.php
  45. 54
      main/exercise/exercise_reminder.php
  46. 22
      main/exercise/exercise_submit.php
  47. 30
      main/gradebook/lib/GradebookUtils.php
  48. 36
      main/gradebook/lib/be/category.class.php
  49. 26
      main/inc/lib/tracking.lib.php
  50. 100
      main/mySpace/lp_tracking.php
  51. 16
      plugin/buycourses/src/index.buycourses.php

@ -0,0 +1,15 @@
{
"name": "pretty-checkbox",
"homepage": "https://github.com/lokesh-coder/pretty-checkbox",
"version": "3.0.3",
"_release": "3.0.3",
"_resolution": {
"type": "version",
"tag": "v3.0.3",
"commit": "c225070a9bbc1ff416d624fd94858ae9c67656a1"
},
"_source": "https://github.com/lokesh-coder/pretty-checkbox.git",
"_target": "^3.0.3",
"_originalSource": "pretty-checkbox",
"_direct": true
}

@ -0,0 +1,32 @@
# Node
node_modules
npm-debug.log
package-lock.json
.npmrc
# Yarn
yarn-error.log
yarn.lock
# JetBrains
.idea/
# VS Code
.vscode/
.history
# Windows
Thumbs.db
Desktop.ini
# Mac
.DS_Store
# Temporary files
coverage/
docs
tmp
test
# Logs
.log

@ -0,0 +1,4 @@
{
"extends": "stylelint-config-recommended-scss",
"rules":{}
}

@ -0,0 +1,22 @@
sudo: required
dist: trusty
language: node_js
node_js:
- node
cache:
yarn: true
notifications:
email: false
before_install:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
after_success:
- 'if [ ${TRAVIS_PULL_REQUEST} = "false" ]; then
npm run ci;
npm run release;
npm publish --access=public;
npm run log;
fi'
branches:
only:
- staging
- /^greenkeeper/.*$/

@ -0,0 +1,111 @@
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var headerComment = require('gulp-header-comment');
var gulpStylelint = require('gulp-stylelint');
var stylefmt = require('gulp-stylefmt');
let cleanCSS = require('gulp-clean-css');
var gulpSequence = require('gulp-sequence')
var del = require('del');
var reload = browserSync.reload;
module.exports = gulp;
/* BROWSER SYNC */
gulp.task('browser-sync', function () {
browserSync({
port: 3040,
server: {
baseDir: "./",
directory: true
},
https: true
});
});
/* BROWSER SYNC RELOAD */
gulp.task('browser-sync-reload', function () {
browserSync.reload();
});
/* LIST SCSS */
gulp.task('lint:scss', function () {
return gulp
.src('src/**/*.scss')
.pipe(gulpStylelint({
reporters: [{
formatter: 'string',
console: true
}]
}));
});
/* COMPILE SCSS */
gulp.task('compile:scss', function () {
return gulp.src('src/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded'
})
.on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['> 5%', 'last 4 versions'],
cascade: false
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('dist'))
.pipe(browserSync.reload({
stream: true
}));
});
/* FORMAT CSS */
gulp.task('format:css', function () {
return gulp.src('dist/*.css')
.pipe(stylefmt())
.pipe(gulp.dest('dist'));
})
/* CLEAN DIST */
gulp.task('clean:dist', function () {
return del(['dist']);
});
/* MINIFY CSS */
gulp.task('minify:css', () => {
return gulp.src('dist/*.css')
.pipe(cleanCSS({
compatibility: 'ie9'
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'));
});
/* SET HEADER */
gulp.task('set:header', function () {
return gulp.src('dist/*.css')
.pipe(headerComment(`
pretty-checkbox.css
A pure CSS library to beautify checkbox and radio buttons
Source: <%= pkg.repository.link %>
Demo: <%= pkg.homepage %>
Copyright (c) <%= moment().format('YYYY') %> <%= _.capitalize(pkg.author) %>
`))
.pipe(gulp.dest('dist'))
});
gulp.task('build', function (cb) {
gulpSequence('lint:scss', 'clean:dist', 'compile:scss', 'format:css', 'minify:css', 'set:header', cb)
});
gulp.task('default', ['compile:scss', 'browser-sync'], function () {
gulp.watch("src/**/*.scss", ['compile:scss', 'browser-sync-reload']);
});

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2017 Lokesh Rajendran ( lokesh.aero@gmail.com )
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,299 @@
<h1 align="center">
<br>
<a href="https://lokesh-coder.github.io/pretty-checkbox/"><img src="logo.png" alt="Pretty checkbox" width="100"></a>
<br> <br> pretty-checkbox.css <br>
</h1>
<h4 align="center">A pure CSS library to beautify checkbox and radio buttons.</h4>
<p align="center">
<a href="https://github.com/lokesh-coder/pretty-checkbox/releases">
<img src="https://img.shields.io/github/release/lokesh-coder/pretty-checkbox.svg?style=flat-square&colorA=8033b0&colorB=75b7dd" alt="Github Release">
</a>
<a href="LICENSE">
<img src="https://img.shields.io/npm/l/pretty-checkbox.svg?style=flat-square&colorA=8033b0&colorB=75b7dd" alt="Licence">
</a>
<a href="#">
<img src="https://img.shields.io/npm/dm/pretty-checkbox.svg?style=flat-square&colorA=8033b0&colorB=75b7dd" alt="Downloads">
</a>
</p>
<br>
<div class="highlight highlight-source-shell">
<pre>
<div align="center"><strong >Demo and documentation</strong></div>
<div align="center"><a align="center" href="https://lokesh-coder.github.io/pretty-checkbox/">https://lokesh-coder.github.io/pretty-checkbox/</a></div>
</pre>
</div>
<div align="center">
<img src="preview.gif" alt="Pretty checkbox preview"/>
</div>
### Features
* Basic
- **Shapes** - *Square*, *Curve*, *Round*
- **Variants** - *Default*, *Fill*, *Thick*
- **Colors** - *Primary*, *Success*, *Info*, *Warning*, *Danger*
- **Color types** - *Solid*, *Outline*
- **Animations** - *Smooth*, *Tada*, *Jelly*, *Pulse*, *Rotate*
* Switch - iOS style - *Outline*, *Fill*, *Slim*
* Responsive
* No JavaScript
* Custom Font Icons
* SVG Icons
* Image support
* Toggle between icons / SVG's / images
* Lock
* State - *Focus*, *Hover*, *Indeterminate*
* Supports frameworks - *Bootstrap*, *Foundation*, *Sematic UI*, *Bulma*, ...
* SCSS customization
* Supports all modern browsers, including mobile devices
* Print friendly
* and more... ( *I am kidding, that's all!* )
### Installation
- **From CLI**
Install the library from [`npm`](https://www.npmjs.com/package/pretty-checkbox) or [`yarn`](https://yarnpkg.com/en/package/pretty-checkbox) package manager
```sh
> npm install pretty-checkbox // or
> yarn add pretty-checkbox
```
Add `pretty-checkbox.min.css` in your html
<br>
- **From CDN** ( [`jsDelivr`](https://www.jsdelivr.com/package/npm/pretty-checkbox) )
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pretty-checkbox@3.0/dist/pretty-checkbox.min.css"/>
```
<br>
- **Manual download** ( [`Github`](https://github.com/lokesh-coder/pretty-checkbox/archive/master.zip) )
Download the source from Github.
```html
<link rel="stylesheet" href="../<PATH>/pretty-checkbox/dist/pretty-checkbox.min.css"/>
```
`<PATH>` is where the library is downloaded.
<br>
**SCSS**
You can also import `pretty-checkbox.scss` in your main scss file.
```scss
@import '~pretty-checkbox/src/pretty.scss';
```
Please refer the document for SCSS settings.
### Usage
Pretty checkbox comes with many styles,
| Class name | Description |
| :---------- | :----------------------- |
| `p-default` | Basic style |
| `p-switch` | iOS like toggle style |
| `p-icon` | Custom font icons |
| `p-svg` | Custom SVG files, markup |
| `p-image` | Tiny images |
And three shapes `p-round` `p-curve` `p-square` (default)
#### Basic checkbox
```html
<div class="pretty p-default">
<input type="checkbox" />
<div class="state">
<label>Check me</label>
</div>
</div>
```
Basic checkbox has three variants `p-fill` `p-thick` `p-outline` (default)
You can combine them.
```html
<div class="pretty p-default p-curve p-fill">
<input type="checkbox" />
<div class="state">
<label>Fill</label>
</div>
</div>
```
<div align="center"><strong >---</strong></div>
#### Switch checkbox
Switch has three variants `p-outline` `p-fill` `p-slim`
```html
<div class="pretty p-switch p-fill">
<input type="checkbox" />
<div class="state">
<label>On</label>
</div>
</div>
```
<div align="center"><strong >---</strong></div>
#### Custom Font icons
```html
<div class="pretty p-icon">
<input type="checkbox">
<div class="state">
<i class="icon fa fa-check"></i>
<label>Check me</label>
</div>
</div>
```
<blockquote>
<sub>
<strong>Note</strong>: class `icon` should be added along with icon class names
</sub>
</blockquote>
<blockquote>
<sub>
<strong>Note</strong>: For icons to work, you need to add appropriate font icons library. In above example , we used font awesome icon. So, FontAwesome should be included separately.
</sub>
</blockquote>
<div align="right">
<i><sub><a href="https://lokesh-coder.github.io/pretty-checkbox#fonticons">
more details</a></sub></i>
</div>
<div align="center"><strong >---</strong></div>
#### SVG
Supports SVG file in <img/> tag, markup (`<svg> ... </svg>`) and sprites
```html
<div class="pretty p-svg">
<input type="checkbox">
<div class="state">
<img class="svg" src="file.svg" />
<label>Check me</label>
</div>
</div>
```
<blockquote>
<sub>
<strong>Note</strong>: class `svg` to be added in img tag or svg tag.
</sub>
</blockquote>
<div align="right">
<i><sub><a href="https://lokesh-coder.github.io/pretty-checkbox#svg">more details</a></sub></i>
</div>
<div align="center"><strong >---</strong></div>
#### Image
Supports any type of valid image format.
```html
<div class="pretty p-image">
<input type="checkbox" />
<div class="state">
<img class="image" src="/check.png" />
<label>Block</label>
</div>
</div>
```
<blockquote>
<sub>
<strong>Note</strong>: class `image` to be added in img tag.
</sub>
</blockquote>
<div align="right">
<i><sub><a href="https://lokesh-coder.github.io/pretty-checkbox#image">more details</a></sub></i>
</div>
<div align="center"><strong >---</strong></div>
#### Colors
There are five solid colors `p-primary` `p-success` `p-warning` `p-info` `p-danger`
And five outline colors `p-primary-o` `p-success-o` `p-warning-o` `p-info-o` `p-danger-o`
```html
<div class="pretty p-default p-curve p-thick">
<input type="checkbox" />
<div class="state p-warning">
<label>Warning</label>
</div>
</div>
```
<blockquote>
<sub>
<strong>Note</strong>: Color class must be added in state class. Solid colors and Ouline colors have distinct role in font icons and toggle feature.
</sub>
</blockquote>
<div align="right">
<i><sub><a href="https://lokesh-coder.github.io/pretty-checkbox#colors">more details</a></sub></i>
</div>
### More
There are more features like ***Radio buttons*** , ***Toggle*** , ***States*** , ***Animations*** , ***Border less*** , ***Lock*** , ***Scale***, ***SCSS Settings***.
Please refer the [documentation](https://lokesh-coder.github.io/pretty-checkbox/) to know about them.
### Browser support
Works in all modern browsers.
`Chrome >= 26` `Firefox >= 16` `Safari >= 6.1` `Opera >= 15` `IE >= 9`
### Font Icon libraries
* [Font awesome](http://fontawesome.io/icons/)
* [Bootstrap Glyphicons](https://getbootstrap.com/docs/3.3/components/#glyphicons)
* [Material icon ( MDI )](https://materialdesignicons.com/)
* [Material icon ( ZMDI )](http://zavoloklom.github.io/material-design-iconic-font/icons.html)
* [Ion icons](http://ionicons.com/)
* [Typicons](http://www.typicons.com/)
* [Material icon ( Google )](https://material.io/icons)
* Others not tested, but will work ( 99% ).
### SVG
* [UIKit](https://getuikit.com/docs/icon)
* [Feathers](https://feathericons.com/)
* Others
### Inspiration
- [Awesome Bootstrap Checkbox](https://github.com/flatlogic/awesome-bootstrap-checkbox) - Idea
- [Animista](http://animista.net) - Animations
### Contributions
Thanks to all those good people who spend their valuable time and helped to improve this library. Any Contributions are welcome!
### License
This project is licensed under the MIT License
<div align="center"><sub></sub></div>

File diff suppressed because one or more lines are too long

@ -0,0 +1,959 @@
/**
* pretty-checkbox.css
*
* A pure CSS library to beautify checkbox and radio buttons
*
* Source: https://github.com/lokesh-coder/pretty-checkbox
* Demo: https://lokesh-coder.github.io/pretty-checkbox
*
* Copyright (c) 2017 Lokesh rajendran
*/
.pretty * {
box-sizing: border-box;
}
.pretty input:not([type='checkbox']):not([type='radio']) {
display: none;
}
.pretty {
position: relative;
display: inline-block;
margin-right: 1em;
white-space: nowrap;
line-height: 1;
}
.pretty input {
position: absolute;
left: 0;
top: 0;
min-width: 1em;
width: 100%;
height: 100%;
z-index: 2;
opacity: 0;
margin: 0;
padding: 0;
cursor: pointer;
}
.pretty .state label {
position: initial;
display: inline-block;
font-weight: normal;
margin: 0;
text-indent: 1.5em;
min-width: calc(1em + 2px);
}
.pretty .state label:before,
.pretty .state label:after {
content: '';
width: calc(1em + 2px);
height: calc(1em + 2px);
display: block;
box-sizing: border-box;
border-radius: 0;
border: 1px solid transparent;
z-index: 0;
position: absolute;
left: 0;
top: calc((0% - (100% - 1em)) - 8%);
background-color: transparent;
}
.pretty .state label:before {
border-color: #bdc3c7;
}
.pretty .state.p-is-hover,
.pretty .state.p-is-indeterminate {
display: none;
}
@-webkit-keyframes zoom {
0% {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0);
}
}
@keyframes zoom {
0% {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0);
}
}
@-webkit-keyframes tada {
0% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
-webkit-transform: scale(7);
transform: scale(7);
}
38% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
55% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
72% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
81% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.24);
transform: scale(1.24);
}
89% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
95% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.04);
transform: scale(1.04);
}
100% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
}
@keyframes tada {
0% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
-webkit-transform: scale(7);
transform: scale(7);
}
38% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
55% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
72% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
81% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.24);
transform: scale(1.24);
}
89% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
95% {
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
-webkit-transform: scale(1.04);
transform: scale(1.04);
}
100% {
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
-webkit-transform: scale(1);
transform: scale(1);
}
}
@-webkit-keyframes jelly {
0% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
30% {
-webkit-transform: scale3d(0.75, 1.25, 1);
transform: scale3d(0.75, 1.25, 1);
}
40% {
-webkit-transform: scale3d(1.25, 0.75, 1);
transform: scale3d(1.25, 0.75, 1);
}
50% {
-webkit-transform: scale3d(0.85, 1.15, 1);
transform: scale3d(0.85, 1.15, 1);
}
65% {
-webkit-transform: scale3d(1.05, 0.95, 1);
transform: scale3d(1.05, 0.95, 1);
}
75% {
-webkit-transform: scale3d(0.95, 1.05, 1);
transform: scale3d(0.95, 1.05, 1);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes jelly {
0% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
30% {
-webkit-transform: scale3d(0.75, 1.25, 1);
transform: scale3d(0.75, 1.25, 1);
}
40% {
-webkit-transform: scale3d(1.25, 0.75, 1);
transform: scale3d(1.25, 0.75, 1);
}
50% {
-webkit-transform: scale3d(0.85, 1.15, 1);
transform: scale3d(0.85, 1.15, 1);
}
65% {
-webkit-transform: scale3d(1.05, 0.95, 1);
transform: scale3d(1.05, 0.95, 1);
}
75% {
-webkit-transform: scale3d(0.95, 1.05, 1);
transform: scale3d(0.95, 1.05, 1);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes rotate {
0% {
opacity: 0;
-webkit-transform: translateZ(-200px) rotate(-45deg);
transform: translateZ(-200px) rotate(-45deg);
}
100% {
opacity: 1;
-webkit-transform: translateZ(0) rotate(0);
transform: translateZ(0) rotate(0);
}
}
@keyframes rotate {
0% {
opacity: 0;
-webkit-transform: translateZ(-200px) rotate(-45deg);
transform: translateZ(-200px) rotate(-45deg);
}
100% {
opacity: 1;
-webkit-transform: translateZ(0) rotate(0);
transform: translateZ(0) rotate(0);
}
}
@-webkit-keyframes pulse {
0% {
box-shadow: 0px 0px 0px 0px #bdc3c7;
}
100% {
box-shadow: 0px 0px 0px 1.5em rgba(189, 195, 199, 0);
}
}
@keyframes pulse {
0% {
box-shadow: 0px 0px 0px 0px #bdc3c7;
}
100% {
box-shadow: 0px 0px 0px 1.5em rgba(189, 195, 199, 0);
}
}
.pretty.p-default.p-fill .state label:after {
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.pretty.p-default .state label:after {
-webkit-transform: scale(0.6);
-ms-transform: scale(0.6);
transform: scale(0.6);
}
.pretty.p-default input:checked ~ .state label:after {
background-color: #bdc3c7 !important;
}
.pretty.p-default.p-thick .state label:before,
.pretty.p-default.p-thick .state label:after {
border-width: calc(1em / 7);
}
.pretty.p-default.p-thick .state label:after {
-webkit-transform: scale(0.4) !important;
-ms-transform: scale(0.4) !important;
transform: scale(0.4) !important;
}
.pretty.p-icon .state .icon {
position: absolute;
font-size: 1em;
width: calc(1em + 2px);
height: calc(1em + 2px);
left: 0;
z-index: 1;
text-align: center;
line-height: normal;
top: calc((0% - (100% - 1em)) - 8%);
border: 1px solid transparent;
opacity: 0;
}
.pretty.p-icon .state .icon:before {
margin: 0;
width: 100%;
height: 100%;
text-align: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
line-height: 1;
}
.pretty.p-icon input:checked ~ .state .icon {
opacity: 1;
}
.pretty.p-icon input:checked ~ .state label:before {
border-color: #5a656b;
}
.pretty.p-svg .state .svg {
position: absolute;
font-size: 1em;
width: calc(1em + 2px);
height: calc(1em + 2px);
left: 0;
z-index: 1;
text-align: center;
line-height: normal;
top: calc((0% - (100% - 1em)) - 8%);
border: 1px solid transparent;
opacity: 0;
}
.pretty.p-svg .state svg {
margin: 0;
width: 100%;
height: 100%;
text-align: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
line-height: 1;
}
.pretty.p-svg input:checked ~ .state .svg {
opacity: 1;
}
.pretty.p-image .state img {
opacity: 0;
position: absolute;
width: calc(1em + 2px);
height: calc(1em + 2px);
top: 0;
top: calc((0% - (100% - 1em)) - 8%);
left: 0;
z-index: 0;
text-align: center;
line-height: normal;
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
.pretty.p-image input:checked ~ .state img {
opacity: 1;
}
.pretty.p-switch input {
min-width: 2em;
}
.pretty.p-switch .state {
position: relative;
}
.pretty.p-switch .state:before {
content: '';
border: 1px solid #bdc3c7;
border-radius: 60px;
width: 2em;
box-sizing: unset;
height: calc(1em + 2px);
position: absolute;
top: 0;
top: calc((0% - (100% - 1em)) - 16%);
z-index: 0;
transition: all 0.5s ease;
}
.pretty.p-switch .state label {
text-indent: 2.5em;
}
.pretty.p-switch .state label:before,
.pretty.p-switch .state label:after {
transition: all 0.5s ease;
border-radius: 100%;
left: 0;
border-color: transparent;
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
.pretty.p-switch .state label:after {
background-color: #bdc3c7 !important;
}
.pretty.p-switch input:checked ~ .state:before {
border-color: #5a656b;
}
.pretty.p-switch input:checked ~ .state label:before {
opacity: 0;
}
.pretty.p-switch input:checked ~ .state label:after {
background-color: #5a656b !important;
left: 1em;
}
.pretty.p-switch.p-fill input:checked ~ .state:before {
border-color: #5a656b;
background-color: #5a656b !important;
}
.pretty.p-switch.p-fill input:checked ~ .state label:before {
opacity: 0;
}
.pretty.p-switch.p-fill input:checked ~ .state label:after {
background-color: #fff !important;
left: 1em;
}
.pretty.p-switch.p-slim .state:before {
height: 0.1em;
background: #bdc3c7 !important;
top: calc(50% - 0.1em);
}
.pretty.p-switch.p-slim input:checked ~ .state:before {
border-color: #5a656b;
background-color: #5a656b !important;
}
.pretty.p-has-hover input:hover ~ .state:not(.p-is-hover) {
display: none;
}
.pretty.p-has-hover input:hover ~ .state.p-is-hover {
display: block;
}
.pretty.p-has-hover input:hover ~ .state.p-is-hover .icon {
display: block;
}
.pretty.p-has-focus input:focus ~ .state label:before {
box-shadow: 0px 0px 3px 0px #bdc3c7;
}
.pretty.p-has-indeterminate input[type='checkbox']:indeterminate ~ .state:not(.p-is-indeterminate) {
display: none;
}
.pretty.p-has-indeterminate input[type='checkbox']:indeterminate ~ .state.p-is-indeterminate {
display: block;
}
.pretty.p-has-indeterminate input[type='checkbox']:indeterminate ~ .state.p-is-indeterminate .icon {
display: block;
opacity: 1;
}
.pretty.p-toggle .state.p-on {
opacity: 0;
display: none;
}
.pretty.p-toggle .state.p-off,
.pretty.p-toggle .state .icon,
.pretty.p-toggle .state .svg,
.pretty.p-toggle .state img {
opacity: 1;
display: inherit;
}
.pretty.p-toggle .state.p-off .icon {
color: #bdc3c7;
}
.pretty.p-toggle input:checked ~ .state.p-on {
opacity: 1;
display: inherit;
}
.pretty.p-toggle input:checked ~ .state.p-off {
opacity: 0;
display: none;
}
.pretty.p-plain input:checked ~ .state label:before,
.pretty.p-plain.p-toggle .state label:before {
content: none;
}
.pretty.p-plain.p-plain .icon {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.pretty.p-round .state label:before,
.pretty.p-round .state label:after {
border-radius: 100%;
}
.pretty.p-round.p-icon .state .icon {
border-radius: 100%;
overflow: hidden;
}
.pretty.p-round.p-icon .state .icon:before {
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
.pretty.p-curve .state label:before,
.pretty.p-curve .state label:after {
border-radius: 20%;
}
.pretty.p-smooth label:before,
.pretty.p-smooth label:after,
.pretty.p-smooth .icon,
.pretty.p-smooth .svg {
transition: all 0.5s ease;
}
.pretty.p-smooth input:checked + .state label:after {
transition: all 0.3s ease;
}
.pretty.p-smooth input:checked + .state .icon,
.pretty.p-smooth input:checked + .state .svg,
.pretty.p-smooth input:checked + .state img {
-webkit-animation: zoom 0.2s ease;
animation: zoom 0.2s ease;
}
.pretty.p-smooth.p-default input:checked + .state label:after {
-webkit-animation: zoom 0.2s ease;
animation: zoom 0.2s ease;
}
.pretty.p-smooth.p-plain input:checked + .state label:before {
content: '';
-webkit-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
transition: all 0.5s ease;
}
.pretty.p-tada:not(.p-default) input:checked + .state .icon,
.pretty.p-tada:not(.p-default) input:checked + .state .svg,
.pretty.p-tada:not(.p-default) input:checked + .state img,
.pretty.p-tada:not(.p-default) input:checked + .state label:before,
.pretty.p-tada:not(.p-default) input:checked + .state label:after {
-webkit-animation: tada 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1 alternate;
animation: tada 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1 alternate;
opacity: 1;
}
.pretty.p-jelly:not(.p-default) input:checked + .state .icon,
.pretty.p-jelly:not(.p-default) input:checked + .state .svg,
.pretty.p-jelly:not(.p-default) input:checked + .state img,
.pretty.p-jelly:not(.p-default) input:checked + .state label:before,
.pretty.p-jelly:not(.p-default) input:checked + .state label:after {
-webkit-animation: jelly 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
animation: jelly 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
opacity: 1;
}
.pretty.p-jelly:not(.p-default) input:checked + .state label:before {
border-color: transparent;
}
.pretty.p-rotate:not(.p-default) input:checked ~ .state .icon,
.pretty.p-rotate:not(.p-default) input:checked ~ .state .svg,
.pretty.p-rotate:not(.p-default) input:checked ~ .state img,
.pretty.p-rotate:not(.p-default) input:checked ~ .state label:before,
.pretty.p-rotate:not(.p-default) input:checked ~ .state label:after {
-webkit-animation: rotate 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
animation: rotate 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
opacity: 1;
}
.pretty.p-rotate:not(.p-default) input:checked ~ .state label:before {
border-color: transparent;
}
.pretty.p-pulse:not(.p-switch) input:checked ~ .state label:before {
-webkit-animation: pulse 1s;
animation: pulse 1s;
}
.pretty input[disabled] {
cursor: not-allowed;
display: none;
}
.pretty input[disabled] ~ * {
opacity: .5;
}
.pretty.p-locked input {
display: none;
cursor: not-allowed;
}
.pretty input:checked ~ .state.p-primary label:after,
.pretty.p-toggle .state.p-primary label:after {
background-color: #428bca !important;
}
.pretty input:checked ~ .state.p-primary .icon,
.pretty input:checked ~ .state.p-primary .svg,
.pretty.p-toggle .state.p-primary .icon,
.pretty.p-toggle .state.p-primary .svg {
color: #fff;
stroke: #fff;
}
.pretty input:checked ~ .state.p-primary-o label:before,
.pretty.p-toggle .state.p-primary-o label:before {
border-color: #428bca;
}
.pretty input:checked ~ .state.p-primary-o label:after,
.pretty.p-toggle .state.p-primary-o label:after {
background-color: transparent;
}
.pretty input:checked ~ .state.p-primary-o .icon,
.pretty input:checked ~ .state.p-primary-o .svg,
.pretty input:checked ~ .state.p-primary-o svg,
.pretty.p-toggle .state.p-primary-o .icon,
.pretty.p-toggle .state.p-primary-o .svg,
.pretty.p-toggle .state.p-primary-o svg {
color: #428bca;
stroke: #428bca;
}
.pretty.p-default:not(.p-fill) input:checked ~ .state.p-primary-o label:after {
background-color: #428bca !important;
}
.pretty.p-switch input:checked ~ .state.p-primary:before {
border-color: #428bca;
}
.pretty.p-switch.p-fill input:checked ~ .state.p-primary:before {
background-color: #428bca !important;
}
.pretty.p-switch.p-slim input:checked ~ .state.p-primary:before {
border-color: #245682;
background-color: #245682 !important;
}
.pretty input:checked ~ .state.p-info label:after,
.pretty.p-toggle .state.p-info label:after {
background-color: #5bc0de !important;
}
.pretty input:checked ~ .state.p-info .icon,
.pretty input:checked ~ .state.p-info .svg,
.pretty.p-toggle .state.p-info .icon,
.pretty.p-toggle .state.p-info .svg {
color: #fff;
stroke: #fff;
}
.pretty input:checked ~ .state.p-info-o label:before,
.pretty.p-toggle .state.p-info-o label:before {
border-color: #5bc0de;
}
.pretty input:checked ~ .state.p-info-o label:after,
.pretty.p-toggle .state.p-info-o label:after {
background-color: transparent;
}
.pretty input:checked ~ .state.p-info-o .icon,
.pretty input:checked ~ .state.p-info-o .svg,
.pretty input:checked ~ .state.p-info-o svg,
.pretty.p-toggle .state.p-info-o .icon,
.pretty.p-toggle .state.p-info-o .svg,
.pretty.p-toggle .state.p-info-o svg {
color: #5bc0de;
stroke: #5bc0de;
}
.pretty.p-default:not(.p-fill) input:checked ~ .state.p-info-o label:after {
background-color: #5bc0de !important;
}
.pretty.p-switch input:checked ~ .state.p-info:before {
border-color: #5bc0de;
}
.pretty.p-switch.p-fill input:checked ~ .state.p-info:before {
background-color: #5bc0de !important;
}
.pretty.p-switch.p-slim input:checked ~ .state.p-info:before {
border-color: #2390b0;
background-color: #2390b0 !important;
}
.pretty input:checked ~ .state.p-success label:after,
.pretty.p-toggle .state.p-success label:after {
background-color: #5cb85c !important;
}
.pretty input:checked ~ .state.p-success .icon,
.pretty input:checked ~ .state.p-success .svg,
.pretty.p-toggle .state.p-success .icon,
.pretty.p-toggle .state.p-success .svg {
color: #fff;
stroke: #fff;
}
.pretty input:checked ~ .state.p-success-o label:before,
.pretty.p-toggle .state.p-success-o label:before {
border-color: #5cb85c;
}
.pretty input:checked ~ .state.p-success-o label:after,
.pretty.p-toggle .state.p-success-o label:after {
background-color: transparent;
}
.pretty input:checked ~ .state.p-success-o .icon,
.pretty input:checked ~ .state.p-success-o .svg,
.pretty input:checked ~ .state.p-success-o svg,
.pretty.p-toggle .state.p-success-o .icon,
.pretty.p-toggle .state.p-success-o .svg,
.pretty.p-toggle .state.p-success-o svg {
color: #5cb85c;
stroke: #5cb85c;
}
.pretty.p-default:not(.p-fill) input:checked ~ .state.p-success-o label:after {
background-color: #5cb85c !important;
}
.pretty.p-switch input:checked ~ .state.p-success:before {
border-color: #5cb85c;
}
.pretty.p-switch.p-fill input:checked ~ .state.p-success:before {
background-color: #5cb85c !important;
}
.pretty.p-switch.p-slim input:checked ~ .state.p-success:before {
border-color: #357935;
background-color: #357935 !important;
}
.pretty input:checked ~ .state.p-warning label:after,
.pretty.p-toggle .state.p-warning label:after {
background-color: #f0ad4e !important;
}
.pretty input:checked ~ .state.p-warning .icon,
.pretty input:checked ~ .state.p-warning .svg,
.pretty.p-toggle .state.p-warning .icon,
.pretty.p-toggle .state.p-warning .svg {
color: #fff;
stroke: #fff;
}
.pretty input:checked ~ .state.p-warning-o label:before,
.pretty.p-toggle .state.p-warning-o label:before {
border-color: #f0ad4e;
}
.pretty input:checked ~ .state.p-warning-o label:after,
.pretty.p-toggle .state.p-warning-o label:after {
background-color: transparent;
}
.pretty input:checked ~ .state.p-warning-o .icon,
.pretty input:checked ~ .state.p-warning-o .svg,
.pretty input:checked ~ .state.p-warning-o svg,
.pretty.p-toggle .state.p-warning-o .icon,
.pretty.p-toggle .state.p-warning-o .svg,
.pretty.p-toggle .state.p-warning-o svg {
color: #f0ad4e;
stroke: #f0ad4e;
}
.pretty.p-default:not(.p-fill) input:checked ~ .state.p-warning-o label:after {
background-color: #f0ad4e !important;
}
.pretty.p-switch input:checked ~ .state.p-warning:before {
border-color: #f0ad4e;
}
.pretty.p-switch.p-fill input:checked ~ .state.p-warning:before {
background-color: #f0ad4e !important;
}
.pretty.p-switch.p-slim input:checked ~ .state.p-warning:before {
border-color: #c77c11;
background-color: #c77c11 !important;
}
.pretty input:checked ~ .state.p-danger label:after,
.pretty.p-toggle .state.p-danger label:after {
background-color: #d9534f !important;
}
.pretty input:checked ~ .state.p-danger .icon,
.pretty input:checked ~ .state.p-danger .svg,
.pretty.p-toggle .state.p-danger .icon,
.pretty.p-toggle .state.p-danger .svg {
color: #fff;
stroke: #fff;
}
.pretty input:checked ~ .state.p-danger-o label:before,
.pretty.p-toggle .state.p-danger-o label:before {
border-color: #d9534f;
}
.pretty input:checked ~ .state.p-danger-o label:after,
.pretty.p-toggle .state.p-danger-o label:after {
background-color: transparent;
}
.pretty input:checked ~ .state.p-danger-o .icon,
.pretty input:checked ~ .state.p-danger-o .svg,
.pretty input:checked ~ .state.p-danger-o svg,
.pretty.p-toggle .state.p-danger-o .icon,
.pretty.p-toggle .state.p-danger-o .svg,
.pretty.p-toggle .state.p-danger-o svg {
color: #d9534f;
stroke: #d9534f;
}
.pretty.p-default:not(.p-fill) input:checked ~ .state.p-danger-o label:after {
background-color: #d9534f !important;
}
.pretty.p-switch input:checked ~ .state.p-danger:before {
border-color: #d9534f;
}
.pretty.p-switch.p-fill input:checked ~ .state.p-danger:before {
background-color: #d9534f !important;
}
.pretty.p-switch.p-slim input:checked ~ .state.p-danger:before {
border-color: #a02622;
background-color: #a02622 !important;
}
.pretty.p-bigger label:before,
.pretty.p-bigger label:after,
.pretty.p-bigger .icon,
.pretty.p-bigger .svg,
.pretty.p-bigger .img {
font-size: 1.2em !important;
top: calc((0% - (100% - 1em)) - 35%) !important;
}
.pretty.p-bigger label {
text-indent: 1.7em;
}
@media print {
.pretty .state:before,
.pretty .state label:before,
.pretty .state label:after,
.pretty .state .icon {
color-adjust: exact;
/* stylelint-disable */
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

@ -0,0 +1,65 @@
{
"name": "pretty-checkbox",
"version": "3.0.3",
"description": "A pure css library to beautify checkbox and radio buttons.",
"main": "dist/pretty-checkbox.min.css",
"scripts": {
"lint":"gulp lint:scss",
"fix": "stylelint \"src\\**\\*.scss\" --syntax scss --fix",
"format": "gulp css:format",
"build": "gulp build",
"ci": "npm run build && git add dist -f && git commit -m \"build(release): auto build [ci skip]\"",
"release": "corp-semantic-release",
"log": "conventional-github-releaser -p angular -r 0"
},
"dependencies": {},
"devDependencies": {
"browser-sync": "^2.8.2",
"conventional-github-releaser": "^1.1.12",
"corp-semantic-release": "^6.1.0",
"del": "^3.0.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.1",
"gulp-clean-css": "^3.9.0",
"gulp-header-comment": "^0.2.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.1",
"gulp-sequence": "^0.4.6",
"gulp-sourcemaps": "^2.6.1",
"gulp-stylefmt": "^1.1.0",
"gulp-stylelint": "^5.0.0",
"rimraf": "2.6.1",
"stylefmt": "^6.0.0",
"stylelint": "^8.2.0",
"stylelint-config-recommended": "^1.0.0",
"stylelint-config-recommended-scss": "^2.0.0",
"stylelint-scss": "^2.1.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lokesh-coder/pretty-checkbox.git",
"link": "https://github.com/lokesh-coder/pretty-checkbox"
},
"keywords": [
"checkbox",
"radio",
"bootstrap",
"fonticon",
"icon",
"svg",
"switch",
"toggle",
"sass",
"css3",
"animation",
"pretty",
"check",
"colors"
],
"author": "Lokesh Rajendran",
"license": "MIT",
"bugs": {
"url": "https://github.com/lokesh-coder/pretty-checkbox/issues"
},
"homepage": "https://lokesh-coder.github.io/pretty-checkbox"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

@ -0,0 +1,27 @@
@import './scss/variables';
@import './scss/core';
@import './scss/essentials/keyframes';
@import './scss/essentials/functions';
@import './scss/essentials/mixins';
@import './scss/elements/default/fill';
@import './scss/elements/default/outline';
@import './scss/elements/default/thick';
@import './scss/elements/font-icon/general';
@import './scss/elements/svg/general';
@import './scss/elements/image/general';
@import './scss/elements/switch/general';
@import './scss/elements/switch/fill';
@import './scss/elements/switch/slim';
@import './scss/states/hover';
@import './scss/states/focus';
@import './scss/states/indeterminate';
@import './scss/extras/toggle';
@import './scss/extras/plain';
@import './scss/extras/round';
@import './scss/extras/curve';
@import './scss/extras/animation';
@import './scss/extras/disabled';
@import './scss/extras/locked';
@import './scss/extras/colors';
@import './scss/extras/bigger';
@import './scss/extras/print';

@ -0,0 +1,85 @@
@charset 'utf-8';
.#{$pretty--class-name} * {
box-sizing: border-box;
}
//Throw error on invalid input types.
.#{$pretty--class-name} input:not([type='checkbox']):not([type='radio']) {
display: none;
@if $pretty--debug {
+ *:after {
content: $pretty--err-message;
border: 1px solid #dedede;
border-left: 3px solid #d9534f;
padding: 9px;
font-size: 1em;
font-weight: 600;
color: #d9534f;
position: absolute;
z-index: 3;
background: #fbfbfb;
top: 0;
left: 0;
}
}
}
.#{$pretty--class-name} {
position: relative;
display: inline-block;
margin-right: 1em;
white-space: nowrap;
line-height: 1;
input {
position: absolute;
left: 0;
top: 0;
min-width: 1em;
width: 100%;
height: 100%;
z-index: $pretty--z-index-front;
opacity: 0;
margin: 0;
padding: 0;
cursor: pointer;
}
.state {
label {
position: initial;
display: inline-block;
font-weight: normal;
margin: 0;
text-indent: $pretty--label-text-offset;
min-width: $pretty--box-size;
&:before,
&:after {
content: '';
width: $pretty--box-size;
height: $pretty--box-size;
display: block;
box-sizing: border-box;
border-radius: 0;
border: 1px solid transparent;
z-index: $pretty--z-index-back;
position: absolute;
left: 0;
top: $pretty-top-offset;
background-color: transparent;
}
&:before {
border-color: $pretty--color-default;
}
}
&.p-is-hover,
&.p-is-indeterminate {
display: none;
}
}
}

@ -0,0 +1,39 @@
$pretty--class-name: pretty !default;
// colors
$pretty--color-default: #bdc3c7 !default;
$pretty--color-primary: #428bca !default;
$pretty--color-info: #5bc0de !default;
$pretty--color-success: #5cb85c !default;
$pretty--color-warning: #f0ad4e !default;
$pretty--color-danger: #d9534f !default;
$pretty--color-dark: #5a656b !default;
// z-index
$pretty--z-index-back: 0 !default;
$pretty--z-index-between: 1 !default;
$pretty--z-index-front: 2 !default;
// box
$pretty--curve-radius: 20% !default;
$pretty--box-size: calc(1em + 2px) !default;
// text
$pretty--label-text-offset: 1.5em !default;
$pretty--label-text-offset-switch: 2.5em !default;
// scale
$pretty--2x: 1.2em !default;
// color set
$pretty--colors: (primary, $pretty--color-primary), (info, $pretty--color-info), (success, $pretty--color-success), (warning, $pretty--color-warning), (danger, $pretty--color-danger) !default;
// position
$pretty-top: 8;
$pretty-top-switch: ($pretty-top * 2) * 1%;
$pretty-top-offset: calc((0% - (100% - 1em)) - #{$pretty-top * 1%});
$pretty-top-offset-switch: calc((0% - (100% - 1em)) - #{$pretty-top-switch});
// dev
$pretty--debug: false !default;
$pretty--err-message: 'Error: Invalid input type!' !default;

@ -0,0 +1,7 @@
.#{$pretty--class-name}.p-default.p-fill {
.state label {
&:after {
transform: scale(1);
}
}
}

@ -0,0 +1,13 @@
.#{$pretty--class-name}.p-default {
.state label {
&:after {
transform: scale(0.6);
}
}
input:checked ~ .state label {
&:after {
background-color: $pretty--color-default !important;
}
}
}

@ -0,0 +1,12 @@
.#{$pretty--class-name}.p-default.p-thick {
.state label {
&:before,
&:after {
border-width: calc(1em / 7);
}
&:after {
transform: scale(0.4) !important;
}
}
}

@ -0,0 +1,39 @@
.#{$pretty--class-name}.p-icon {
.state {
.icon {
position: absolute;
font-size: 1em;
width: $pretty--box-size;
height: $pretty--box-size;
left: 0;
z-index: $pretty--z-index-between;
text-align: center;
line-height: normal;
top: $pretty-top-offset;
border: 1px solid transparent;
opacity: 0;
}
.icon:before {
margin: 0;
width: 100%;
height: 100%;
text-align: center;
display: flex;
flex: 1;
justify-content: center;
align-items: center;
line-height: 1;
}
}
input:checked ~ .state {
.icon {
opacity: 1;
}
label:before {
border-color: #5a656b;
}
}
}

@ -0,0 +1,21 @@
.#{$pretty--class-name}.p-image {
.state {
img {
opacity: 0;
position: absolute;
width: $pretty--box-size;
height: $pretty--box-size;
top: 0;
top: $pretty-top-offset;
left: 0;
z-index: $pretty--z-index-back;
text-align: center;
line-height: normal;
transform: scale(0.8);
}
}
input:checked ~ .state img {
opacity: 1;
}
}

@ -0,0 +1,33 @@
.#{$pretty--class-name}.p-svg {
.state {
.svg {
position: absolute;
font-size: 1em;
width: $pretty--box-size;
height: $pretty--box-size;
left: 0;
z-index: $pretty--z-index-between;
text-align: center;
line-height: normal;
top: $pretty-top-offset;
border: 1px solid transparent;
opacity: 0;
}
svg {
margin: 0;
width: 100%;
height: 100%;
text-align: center;
display: flex;
flex: 1;
justify-content: center;
align-items: center;
line-height: 1;
}
}
input:checked ~ .state .svg {
opacity: 1;
}
}

@ -0,0 +1,15 @@
.#{$pretty--class-name}.p-switch.p-fill {
input:checked~.state {
&:before {
border-color: $pretty--color-dark;
background-color: $pretty--color-dark !important;
}
label:before {
opacity: 0;
}
label:after {
background-color: #fff !important;
left: 1em;
}
}
}

@ -0,0 +1,54 @@
.#{$pretty--class-name}.p-switch {
input{
min-width:2em;
}
.state {
position: relative;
&:before {
content: '';
border: 1px solid $pretty--color-default;
border-radius: 60px;
width: 2em;
box-sizing: unset;
height: $pretty--box-size;
position: absolute;
top: 0;
top: $pretty-top-offset-switch;
z-index: $pretty--z-index-back;
transition: all 0.5s ease;
}
label {
text-indent: $pretty--label-text-offset-switch;
&:before,
&:after {
transition: all 0.5s ease;
border-radius: 100%;
left: 0;
border-color: transparent;
transform: scale(0.8);
}
&:after {
background-color: $pretty--color-default !important;
}
}
}
input:checked ~ .state {
&:before {
border-color: $pretty--color-dark;
}
label:before {
opacity: 0;
}
label:after {
background-color: $pretty--color-dark !important;
left: 1em;
}
}
}

@ -0,0 +1,16 @@
.#{$pretty--class-name}.p-switch.p-slim {
.state {
&:before {
height: 0.1em;
background: $pretty--color-default !important;
top: calc(50% - 0.1em);
}
}
input:checked ~ .state {
&:before {
border-color: $pretty--color-dark;
background-color: $pretty--color-dark !important;
}
}
}

@ -0,0 +1,102 @@
@keyframes zoom {
0% {
opacity: 0;
transform: scale(0);
}
}
@keyframes tada {
0% {
animation-timing-function: ease-in;
opacity: 0;
transform: scale(7);
}
38% {
animation-timing-function: ease-out;
opacity: 1;
transform: scale(1);
}
55% {
animation-timing-function: ease-in;
transform: scale(1.5);
}
72% {
animation-timing-function: ease-out;
transform: scale(1);
}
81% {
animation-timing-function: ease-in;
transform: scale(1.24);
}
89% {
animation-timing-function: ease-out;
transform: scale(1);
}
95% {
animation-timing-function: ease-in;
transform: scale(1.04);
}
100% {
animation-timing-function: ease-out;
transform: scale(1);
}
}
@keyframes jelly {
0% {
transform: scale3d(1, 1, 1);
}
30% {
transform: scale3d(.75, 1.25, 1);
}
40% {
transform: scale3d(1.25, .75, 1);
}
50% {
transform: scale3d(.85, 1.15, 1);
}
65% {
transform: scale3d(1.05, .95, 1);
}
75% {
transform: scale3d(.95, 1.05, 1);
}
100% {
transform: scale3d(1, 1, 1);
}
}
@keyframes rotate {
0% {
opacity: 0;
transform: translateZ(-200px) rotate(-45deg);
}
100% {
opacity: 1;
transform: translateZ(0) rotate(0);
}
}
@keyframes pulse {
0% {
box-shadow: 0px 0px 0px 0px transparentize($pretty--color-default, 0);
}
100% {
box-shadow: 0px 0px 0px 1.5em transparentize($pretty--color-default, 1);
}
}

@ -0,0 +1,89 @@
.#{$pretty--class-name}.p-smooth {
label:before,
label:after,
.icon,
.svg {
transition: all 0.5s ease;
}
input:checked + .state {
label:after {
transition: all 0.3s ease;
}
.icon,
.svg,
img {
animation: zoom 0.2s ease;
}
}
&.p-default input:checked + .state {
label:after {
animation: zoom 0.2s ease;
}
}
&.p-plain input:checked + .state {
label:before {
content: '';
transform: scale(0);
transition: all 0.5s ease;
}
}
}
.#{$pretty--class-name}.p-tada:not(.p-default) {
input:checked + .state {
.icon,
.svg,
img,
label:before,
label:after {
animation: tada 0.7s cubic-bezier(0.250, 0.460, 0.450, 0.940) 1 alternate;
opacity: 1;
}
}
}
.#{$pretty--class-name}.p-jelly:not(.p-default) {
input:checked + .state {
.icon,
.svg,
img,
label:before,
label:after {
animation: jelly 0.7s cubic-bezier(0.250, 0.460, 0.450, 0.940);
opacity: 1;
}
label:before {
border-color: transparent;
}
}
}
.#{$pretty--class-name}.p-rotate:not(.p-default) {
input:checked ~ .state {
.icon,
.svg,
img,
label:before,
label:after {
animation: rotate 0.7s cubic-bezier(0.250, 0.460, 0.450, 0.940);
opacity: 1;
}
label:before {
border-color: transparent;
}
}
}
.#{$pretty--class-name}.p-pulse:not(.p-switch) {
input:checked ~ .state {
label:before {
animation: pulse 1s;
}
}
}

@ -0,0 +1,14 @@
.#{$pretty--class-name}.p-bigger {
label:before,
label:after,
.icon,
.svg,
.img {
font-size: $pretty--2x !important;
top: calc((0% - (100% - 1em)) - 35%) !important;
}
label {
text-indent: 1.7em;
}
}

@ -0,0 +1,53 @@
.#{$pretty--class-name} {
@each $name, $color in $pretty--colors {
input:checked ~ .state.p-#{$name},
&.p-toggle .state.p-#{$name} {
label:after {
background-color: $color !important;
}
.icon,
.svg {
color: #fff;
stroke: #fff;
}
}
input:checked ~ .state.p-#{$name}-o,
&.p-toggle .state.p-#{$name}-o {
label:before {
border-color: $color;
}
label:after {
background-color: transparent;
}
.icon,
.svg,
svg {
color: $color;
stroke: $color;
}
}
&.p-default:not(.p-fill) input:checked ~ .state.p-#{$name}-o label {
&:after {
background-color: $color !important;
}
}
&.p-switch input:checked ~ .state.p-#{$name}:before {
border-color: $color;
}
&.p-switch.p-fill input:checked ~ .state.p-#{$name}:before {
background-color: $color !important;
}
&.p-switch.p-slim input:checked ~ .state.p-#{$name}:before {
border-color: darken($color, 20%);
background-color: darken($color, 20%) !important;
}
}
}

@ -0,0 +1,8 @@
.#{$pretty--class-name}.p-curve {
.state label {
&:before,
&:after {
border-radius: $pretty--curve-radius;
}
}
}

@ -0,0 +1,12 @@
.#{$pretty--class-name} {
input {
&[disabled] {
cursor: not-allowed;
display: none;
& ~ * {
opacity: .5;
}
}
}
}

@ -0,0 +1,6 @@
.#{$pretty--class-name}.p-locked {
input {
display: none;
cursor: not-allowed;
}
}

@ -0,0 +1,12 @@
.#{$pretty--class-name}.p-plain {
input:checked ~ .state label,
&.p-toggle .state label {
&:before {
content: none;
}
}
&.p-plain .icon {
transform: scale(1.1);
}
}

@ -0,0 +1,13 @@
@media print {
.#{$pretty--class-name} {
.state:before,
.state label:before,
.state label:after,
.state .icon {
color-adjust: exact;
/* stylelint-disable */
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
}

@ -0,0 +1,17 @@
.#{$pretty--class-name}.p-round {
.state label {
&:before,
&:after {
border-radius: 100%;
}
}
&.p-icon .state .icon {
border-radius: 100%;
overflow: hidden;
&:before {
transform: scale(0.8);
}
}
}

@ -0,0 +1,32 @@
.#{$pretty--class-name}.p-toggle {
.state {
&.p-on {
opacity: 0;
display: none;
}
&.p-off,
.icon,
.svg,
img {
opacity: 1;
display: inherit;
}
&.p-off .icon {
color: $pretty--color-default;
}
}
input:checked ~ .state {
&.p-on {
opacity: 1;
display: inherit;
}
&.p-off {
opacity: 0;
display: none;
}
}
}

@ -0,0 +1,7 @@
.#{$pretty--class-name}.p-has-focus {
input:focus {
~ .state label:before {
box-shadow: 0px 0px 3px 0px rgb(189, 195, 199);
}
}
}

@ -0,0 +1,13 @@
.#{$pretty--class-name}.p-has-hover {
input:hover ~ .state:not(.p-is-hover) {
display: none;
}
input:hover ~ .state.p-is-hover {
display: block;
.icon {
display: block;
}
}
}

@ -0,0 +1,14 @@
.#{$pretty--class-name}.p-has-indeterminate {
input[type='checkbox']:indeterminate ~.state:not(.p-is-indeterminate) {
display: none;
}
input[type='checkbox']:indeterminate ~.state.p-is-indeterminate {
display: block;
.icon {
display: block;
opacity: 1;
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,10 +1,12 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.admin * @package chamilo.admin
* *
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
@ -25,15 +27,16 @@ if ($form->validate()) {
$url_array = $form->getSubmitValues(); $url_array = $form->getSubmitValues();
$url = Security::remove_XSS($url_array['url']); $url = Security::remove_XSS($url_array['url']);
$description = Security::remove_XSS($url_array['description']); $description = Security::remove_XSS($url_array['description']);
$active = isset($url_array['active']) ? intval($url_array['active']) : 0; $active = isset($url_array['active']) ? (int) $url_array['active'] : 0;
$url_id = isset($url_array['id']) ? intval($url_array['id']) : 0; $url_id = isset($url_array['id']) ? (int) $url_array['id'] : 0;
$url_to_go = 'access_urls.php'; $url_to_go = 'access_urls.php';
if (!empty($url_id)) { if (!empty($url_id)) {
//we can't change the status of the url with id=1 //we can't change the status of the url with id=1
if ($url_id == 1) { if ($url_id == 1) {
$active = 1; $active = 1;
} }
//checking url
// Checking url
if (substr($url, strlen($url) - 1, strlen($url)) == '/') { if (substr($url, strlen($url) - 1, strlen($url)) == '/') {
UrlManager::update($url_id, $url, $description, $active); UrlManager::update($url_id, $url, $description, $active);
} else { } else {
@ -41,12 +44,12 @@ if ($form->validate()) {
} }
// URL Images // URL Images
$url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
$image_fields = ["url_image_1", "url_image_2", "url_image_3"]; $image_fields = ['url_image_1', 'url_image_2', 'url_image_3'];
foreach ($image_fields as $image_field) { foreach ($image_fields as $image_field) {
if ($_FILES[$image_field]['error'] == 0) { if ($_FILES[$image_field]['error'] == 0) {
// Hardcoded: only PNG files allowed // Hardcoded: only PNG files allowed
$fileFields = explode('.', $_FILES[$image_field]['name']); $fileFields = explode('.', $_FILES[$image_field]['name']);
if (end($fileFields) == 'png') { if (end($fileFields) === 'png') {
if (file_exists($url_images_dir.$url_id.'_'.$image_field.'.png')) { if (file_exists($url_images_dir.$url_id.'_'.$image_field.'.png')) {
// if the file exists, we have to remove it before move_uploaded_file // if the file exists, we have to remove it before move_uploaded_file
unlink($url_images_dir.$url_id.'_'.$image_field.'.png'); unlink($url_images_dir.$url_id.'_'.$image_field.'.png');
@ -56,9 +59,7 @@ if ($form->validate()) {
$url_images_dir.$url_id.'_'.$image_field.'.png' $url_images_dir.$url_id.'_'.$image_field.'.png'
); );
} }
// else fail silently
} }
// else fail silently
} }
$url_to_go = 'access_urls.php'; $url_to_go = 'access_urls.php';
$message = get_lang('URLEdited'); $message = get_lang('URLEdited');
@ -88,11 +89,12 @@ if ($form->validate()) {
// Hardcoded: only PNG files allowed // Hardcoded: only PNG files allowed
$fileFields = explode('.', $_FILES[$image_field]['name']); $fileFields = explode('.', $_FILES[$image_field]['name']);
if (end($fileFields) == 'png') { if (end($fileFields) == 'png') {
move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png'); move_uploaded_file(
$_FILES[$image_field]['tmp_name'],
$url_images_dir.$url_id.'_'.$image_field.'.png'
);
} }
// else fail silently
} }
// else fail silently
} }
} }
Security::clear_token(); Security::clear_token();
@ -125,7 +127,7 @@ $form->setDefaults($defaults);
$submit_name = get_lang('AddUrl'); $submit_name = get_lang('AddUrl');
if (isset($_GET['url_id'])) { if (isset($_GET['url_id'])) {
$url_id = intval($_GET['url_id']); $url_id = (int) $_GET['url_id'];
$num_url_id = UrlManager::url_id_exist($url_id); $num_url_id = UrlManager::url_id_exist($url_id);
if ($num_url_id != 1) { if ($num_url_id != 1) {
header('Location: access_urls.php'); header('Location: access_urls.php');
@ -143,8 +145,8 @@ if (!api_is_multiple_url_enabled()) {
} }
$tool_name = get_lang('AddUrl'); $tool_name = get_lang('AddUrl');
$interbreadcrumb[] = ["url" => 'index.php', "name" => get_lang('PlatformAdmin')]; $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
$interbreadcrumb[] = ["url" => 'access_urls.php', "name" => get_lang('MultipleAccessURLs')]; $interbreadcrumb[] = ['url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')];
Display :: display_header($tool_name); Display :: display_header($tool_name);

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\ExtraFieldOptions; use Chamilo\CoreBundle\Entity\ExtraFieldOptions;
use Chamilo\CoreBundle\Entity\ExtraFieldValues;
use ChamiloSession as Session; use ChamiloSession as Session;
/** /**
@ -773,4 +772,4 @@ if ($count_fields > 0) {
</pre> </pre>
</blockquote> </blockquote>
<?php <?php
Display :: display_footer(); Display::display_footer();

@ -15,28 +15,26 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
/* ACCESS RIGHTS */
// notice for unauthorized people.
api_protect_course_script(true); api_protect_course_script(true);
$origin = api_get_origin(); $origin = api_get_origin();
if (empty($learnpath_id)) { if (empty($learnpath_id)) {
if (!empty($_REQUEST['learnpath_id'])) { if (!empty($_REQUEST['learnpath_id'])) {
$learnpath_id = intval($_REQUEST['learnpath_id']); $learnpath_id = (int) $_REQUEST['learnpath_id'];
} else { } else {
$learnpath_id = 0; $learnpath_id = 0;
} }
} }
if (empty($learnpath_item_id)) { if (empty($learnpath_item_id)) {
if (!empty($_REQUEST['learnpath_item_id'])) { if (!empty($_REQUEST['learnpath_item_id'])) {
$learnpath_item_id = intval($_REQUEST['learnpath_item_id']); $learnpath_item_id = (int) $_REQUEST['learnpath_item_id'];
} else { } else {
$learnpath_item_id = 0; $learnpath_item_id = 0;
} }
} }
if (empty($learnpath_item_view_id)) { if (empty($learnpath_item_view_id)) {
if (!empty($_REQUEST['learnpath_item_view_id'])) { if (!empty($_REQUEST['learnpath_item_view_id'])) {
$learnpath_item_view_id = intval($_REQUEST['learnpath_item_view_id']); $learnpath_item_view_id = (int) $_REQUEST['learnpath_item_view_id'];
} else { } else {
$learnpath_item_view_id = 0; $learnpath_item_view_id = 0;
} }
@ -44,7 +42,7 @@ if (empty($learnpath_item_view_id)) {
if (empty($exerciseId)) { if (empty($exerciseId)) {
if (!empty($_REQUEST['exerciseId'])) { if (!empty($_REQUEST['exerciseId'])) {
$exerciseId = intval($_REQUEST['exerciseId']); $exerciseId = (int) $_REQUEST['exerciseId'];
} else { } else {
$exerciseId = 0; $exerciseId = 0;
} }
@ -60,9 +58,9 @@ if (empty($objExercise)) {
} }
if (!$objExercise) { if (!$objExercise) {
//Redirect to the exercise overview // Redirect to the exercise overview
//Check if the exe_id exists // Check if the exe_id exists
header("Location: overview.php?exerciseId=".$exerciseId.'&'.api_get_cidreq()); header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$exerciseId.'&'.api_get_cidreq());
exit; exit;
} }
@ -88,6 +86,8 @@ if ($time_control) {
$htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left); $htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left);
} }
$htmlHeadXtra[] = api_get_css_asset('pretty-checkbox/dist/pretty-checkbox.min.css');
$exe_id = 0; $exe_id = 0;
if (isset($_GET['exe_id'])) { if (isset($_GET['exe_id'])) {
$exe_id = (int) $_GET['exe_id']; $exe_id = (int) $_GET['exe_id'];
@ -106,7 +106,7 @@ if (empty($exercise_stat_info) || empty($question_list)) {
} }
$nameTools = get_lang('Exercises'); $nameTools = get_lang('Exercises');
$interbreadcrumb[] = ["url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')]; $interbreadcrumb[] = ['url' => 'exercise.php?'.api_get_cidreq(), 'name' => get_lang('Exercises')];
$hideHeaderAndFooter = in_array($origin, ['learnpath', 'embeddable']); $hideHeaderAndFooter = in_array($origin, ['learnpath', 'embeddable']);
@ -140,7 +140,7 @@ echo '<script>
function final_submit() { function final_submit() {
//Normal inputs //Normal inputs
window.location = "exercise_result.php?'.api_get_cidreq().'&exe_id='.$exe_id.'&" + lp_data; window.location = "'.api_get_path(WEB_CODE_PATH).'exercise/exercise_result.php?'.api_get_cidreq().'&exe_id='.$exe_id.'&" + lp_data;
} }
function changeOptionStatus(status) function changeOptionStatus(status)
@ -217,13 +217,13 @@ foreach ($attempt_list as $question_id => $options) {
} }
} }
} }
echo Display::label(get_lang('QuestionWithNoAnswer'), 'warning'); echo Display::label(get_lang('QuestionWithNoAnswer'), 'danger');
echo '<div class="clear"></div><br />'; echo '<div class="clear"></div><br />';
$table = ''; $table = '';
$counter = 0; $counter = 0;
// Loop over all question to show results for each of them, one by one
// Loop over all question to show results for each of them, one by one
foreach ($question_list as $questionId) { foreach ($question_list as $questionId) {
// destruction of the Question object // destruction of the Question object
unset($objQuestionTmp); unset($objQuestionTmp);
@ -231,24 +231,34 @@ foreach ($question_list as $questionId) {
$objQuestionTmp = Question:: read($questionId); $objQuestionTmp = Question:: read($questionId);
$quesId = $objQuestionTmp->selectId(); $quesId = $objQuestionTmp->selectId();
$check_id = 'remind_list['.$questionId.']'; $check_id = 'remind_list['.$questionId.']';
$attributes = ['id' => $check_id, 'onclick' => "save_remind_item(this, '$questionId');"];
$attributes = ['id' => $check_id, 'onclick' => "save_remind_item(this, '$questionId');"];
if (in_array($questionId, $remind_list)) { if (in_array($questionId, $remind_list)) {
$attributes['checked'] = 1; $attributes['checked'] = 1;
} }
$label_attributes = [];
$label_attributes['for'] = $check_id;
$checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes); $checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes);
$checkbox = '<div class="pretty p-default">
'.$checkbox.'
<div class="state p-primary ">
<label>&nbsp;</label>
</div>
</div>';
$url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1&'.api_get_cidreq(); $url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1&'.api_get_cidreq();
$counter++; $counter++;
$question_title = $counter.'. '.strip_tags($objQuestionTmp->selectTitle()); $questionTitle = $counter.'. '.strip_tags($objQuestionTmp->selectTitle());
//Check if the question doesn't have an answer // Check if the question doesn't have an answer
if (!in_array($questionId, $exercise_result)) { if (!in_array($questionId, $exercise_result)) {
$question_title = Display::label($question_title, 'warning'); $questionTitle = Display::label($questionTitle, 'danger');
} }
$question_title = Display::tag('label', $checkbox.$question_title, $label_attributes);
$table .= Display::div($question_title, ['class' => 'exercise_reminder_item checkbox']); $label_attributes = [];
$label_attributes['for'] = $check_id;
$questionTitle = Display::tag('label', $checkbox.$questionTitle, $label_attributes);
$table .= Display::div($questionTitle, ['class' => 'exercise_reminder_item ']);
} // end foreach() block that loops over all questions } // end foreach() block that loops over all questions
echo Display::div($table, ['class' => 'question-check-test']); echo Display::div($table, ['class' => 'question-check-test']);
@ -256,7 +266,7 @@ echo Display::div($table, ['class' => 'question-check-test']);
$exerciseActions = Display::url( $exerciseActions = Display::url(
get_lang('ReviewQuestions'), get_lang('ReviewQuestions'),
'javascript://', 'javascript://',
['onclick' => 'review_questions();', 'class' => 'btn btn-success'] ['onclick' => 'review_questions();', 'class' => 'btn btn-primary']
); );
$exerciseActions .= '&nbsp;'.Display::url( $exerciseActions .= '&nbsp;'.Display::url(

@ -82,22 +82,22 @@ if (api_get_setting('enable_record_audio') === 'true') {
$template = new Template(); $template = new Template();
// General parameters passed via POST/GET // General parameters passed via POST/GET
$learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : 0; $learnpath_id = isset($_REQUEST['learnpath_id']) ? (int) $_REQUEST['learnpath_id'] : 0;
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : 0; $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? (int) $_REQUEST['learnpath_item_id'] : 0;
$learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : 0; $learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? (int) $_REQUEST['learnpath_item_view_id'] : 0;
$reminder = isset($_REQUEST['reminder']) ? intval($_REQUEST['reminder']) : 0; $reminder = isset($_REQUEST['reminder']) ? (int) $_REQUEST['reminder'] : 0;
$remind_question_id = isset($_REQUEST['remind_question_id']) ? intval($_REQUEST['remind_question_id']) : 0; $remind_question_id = isset($_REQUEST['remind_question_id']) ? (int) $_REQUEST['remind_question_id'] : 0;
$exerciseId = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : 0; $exerciseId = isset($_REQUEST['exerciseId']) ? (int) $_REQUEST['exerciseId'] : 0;
$formSent = isset($_REQUEST['formSent']) ? $_REQUEST['formSent'] : null; $formSent = isset($_REQUEST['formSent']) ? $_REQUEST['formSent'] : null;
$exerciseResult = isset($_REQUEST['exerciseResult']) ? $_REQUEST['exerciseResult'] : null; $exerciseResult = isset($_REQUEST['exerciseResult']) ? $_REQUEST['exerciseResult'] : null;
$exerciseResultCoordinates = isset($_REQUEST['exerciseResultCoordinates']) ? $_REQUEST['exerciseResultCoordinates'] : null; $exerciseResultCoordinates = isset($_REQUEST['exerciseResultCoordinates']) ? $_REQUEST['exerciseResultCoordinates'] : null;
$choice = isset($_REQUEST['choice']) ? $_REQUEST['choice'] : null; $choice = isset($_REQUEST['choice']) ? $_REQUEST['choice'] : null;
$choice = empty($choice) ? isset($_REQUEST['choice2']) ? $_REQUEST['choice2'] : null : null; $choice = empty($choice) ? isset($_REQUEST['choice2']) ? $_REQUEST['choice2'] : null : null;
//From submit modal // From submit modal
$current_question = isset($_REQUEST['num']) ? intval($_REQUEST['num']) : null; $current_question = isset($_REQUEST['num']) ? (int) $_REQUEST['num'] : null;
$currentAnswer = isset($_REQUEST['num_answer']) ? intval($_REQUEST['num_answer']) : null; $currentAnswer = isset($_REQUEST['num_answer']) ? (int) $_REQUEST['num_answer'] : null;
$endExercise = isset($_REQUEST['end_exercise']) && $_REQUEST['end_exercise'] == 1 ? true : false; $endExercise = isset($_REQUEST['end_exercise']) && $_REQUEST['end_exercise'] == 1 ? true : false;
$logInfo = [ $logInfo = [
@ -111,7 +111,6 @@ Event::registerLog($logInfo);
// Error message // Error message
$error = ''; $error = '';
$exercise_attempt_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $exercise_attempt_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
/* Teacher takes an exam and want to see a preview, /* Teacher takes an exam and want to see a preview,
@ -178,7 +177,8 @@ $exercise_sound = $objExercise->selectSound();
// If reminder ends we jump to the exercise_reminder // If reminder ends we jump to the exercise_reminder
if ($objExercise->review_answers) { if ($objExercise->review_answers) {
if ($remind_question_id == -1) { if ($remind_question_id == -1) {
header('Location: exercise_reminder.php?exerciseId='.$exerciseId.'&'.api_get_cidreq()); header('Location: '.api_get_path(WEB_CODE_PATH).
'exercise/exercise_reminder.php?exerciseId='.$exerciseId.'&'.api_get_cidreq());
exit; exit;
} }
} }

@ -83,9 +83,9 @@ class GradebookUtils
$course_code, $course_code,
$weight $weight
) { ) {
$course_code = Database::escape_string($course_code); $link_id = (int) $link_id;
if (!empty($link_id)) { if (!empty($link_id)) {
$link_id = intval($link_id); $course_code = Database::escape_string($course_code);
$sql = 'UPDATE '.Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK).' $sql = 'UPDATE '.Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK).'
SET weight = '."'".api_float_val($weight)."'".' SET weight = '."'".api_float_val($weight)."'".'
WHERE course_code = "'.$course_code.'" AND id = '.$link_id; WHERE course_code = "'.$course_code.'" AND id = '.$link_id;
@ -350,8 +350,8 @@ class GradebookUtils
$courseParams = api_get_cidreq_params($eval->get_course_code(), $eval->getSessionId()); $courseParams = api_get_cidreq_params($eval->get_course_code(), $eval->getSessionId());
if ($message_eval === false && api_is_allowed_to_edit(null, true)) { if ($message_eval === false && api_is_allowed_to_edit(null, true)) {
$visibility_icon = ($eval->is_visible() == 0) ? 'invisible' : 'visible'; $visibility_icon = $eval->is_visible() == 0 ? 'invisible' : 'visible';
$visibility_command = ($eval->is_visible() == 0) ? 'set_visible' : 'set_invisible'; $visibility_command = $eval->is_visible() == 0 ? 'set_visible' : 'set_invisible';
if ($is_locked && !api_is_platform_admin()) { if ($is_locked && !api_is_platform_admin()) {
$modify_icons = Display::return_icon( $modify_icons = Display::return_icon(
'edit_na.png', 'edit_na.png',
@ -447,8 +447,8 @@ class GradebookUtils
); );
if ($message_link === false) { if ($message_link === false) {
$visibility_icon = ($link->is_visible() == 0) ? 'invisible' : 'visible'; $visibility_icon = $link->is_visible() == 0 ? 'invisible' : 'visible';
$visibility_command = ($link->is_visible() == 0) ? 'set_visible' : 'set_invisible'; $visibility_command = $link->is_visible() == 0 ? 'set_visible' : 'set_invisible';
if ($is_locked && !api_is_platform_admin()) { if ($is_locked && !api_is_platform_admin()) {
$modify_icons = Display::return_icon( $modify_icons = Display::return_icon(
@ -585,10 +585,12 @@ class GradebookUtils
{ {
$course_table = Database::get_main_table(TABLE_MAIN_COURSE); $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$id_link = (int) $id_link;
$sql = 'SELECT c.id FROM '.$course_table.' c $sql = 'SELECT c.id FROM '.$course_table.' c
INNER JOIN '.$tbl_grade_links.' l INNER JOIN '.$tbl_grade_links.' l
ON c.code = l.course_code ON c.code = l.course_code
WHERE l.id='.intval($id_link).' OR l.category_id='.intval($id_link); WHERE l.id='.$id_link.' OR l.category_id='.$id_link;
$res = Database::query($sql); $res = Database::query($sql);
$array = Database::fetch_array($res, 'ASSOC'); $array = Database::fetch_array($res, 'ASSOC');
@ -884,11 +886,11 @@ class GradebookUtils
$sql = "SELECT * FROM $t $sql = "SELECT * FROM $t
WHERE course_code = '".Database::escape_string($course_code)."' "; WHERE course_code = '".Database::escape_string($course_code)."' ";
if (!empty($session_id)) { if (!empty($session_id)) {
$sql .= " AND session_id = ".(int) $session_id; $sql .= " AND session_id = ".$session_id;
} else { } else {
$sql .= " AND (session_id IS NULL OR session_id = 0) "; $sql .= ' AND (session_id IS NULL OR session_id = 0) ';
} }
$sql .= " ORDER BY id"; $sql .= ' ORDER BY id ';
$res = Database::query($sql); $res = Database::query($sql);
if (Database::num_rows($res) < 1) { if (Database::num_rows($res) < 1) {
//there is no unique category for this course+session combination, //there is no unique category for this course+session combination,
@ -1319,7 +1321,7 @@ class GradebookUtils
*/ */
public static function updateLinkWeight($linkId, $name, $weight) public static function updateLinkWeight($linkId, $name, $weight)
{ {
$linkId = intval($linkId); $linkId = (int) $linkId;
$weight = api_float_val($weight); $weight = api_float_val($weight);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
@ -1385,7 +1387,7 @@ class GradebookUtils
public static function updateEvaluationWeight($id, $weight) public static function updateEvaluationWeight($id, $weight)
{ {
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$id = intval($id); $id = (int) $id;
$evaluation = new Evaluation(); $evaluation = new Evaluation();
$evaluation->addEvaluationLog($id); $evaluation->addEvaluationLog($id);
$sql = 'UPDATE '.$table_evaluation.' $sql = 'UPDATE '.$table_evaluation.'
@ -1406,7 +1408,7 @@ class GradebookUtils
$userId, $userId,
$includeNonPublicCertificates = true $includeNonPublicCertificates = true
) { ) {
$userId = intval($userId); $userId = (int) $userId;
$courseList = []; $courseList = [];
$courses = CourseManager::get_courses_list_by_user_id($userId); $courses = CourseManager::get_courses_list_by_user_id($userId);
@ -1468,7 +1470,7 @@ class GradebookUtils
*/ */
public static function getUserCertificatesInSessions($userId, $includeNonPublicCertificates = true) public static function getUserCertificatesInSessions($userId, $includeNonPublicCertificates = true)
{ {
$userId = intval($userId); $userId = (int) $userId;
$sessionList = []; $sessionList = [];
$sessions = SessionManager::get_sessions_by_user($userId, true, true); $sessions = SessionManager::get_sessions_by_user($userId, true, true);

@ -2142,28 +2142,11 @@ class Category implements GradebookItem
return false; return false;
} }
// Block certification links depending gradebook configuration (generate certifications)
if (empty($category->getGenerateCertificates())) {
return false;
}
$sessionId = $category->get_session_id(); $sessionId = $category->get_session_id();
$courseCode = $category->get_course_code(); $courseCode = $category->get_course_code();
$courseInfo = api_get_course_info($courseCode); $courseInfo = api_get_course_info($courseCode);
$courseId = $courseInfo['real_id']; $courseId = $courseInfo['real_id'];
$cattotal = self::load($category_id);
$scoretotal = $cattotal[0]->calc_score($user_id);
// Do not remove this the gradebook/lib/fe/gradebooktable.class.php
// file load this variable as a global
$scoredisplay = ScoreDisplay::instance();
$my_score_in_gradebook = $scoredisplay->display_score(
$scoretotal,
SCORE_SIMPLE
);
$userFinishedCourse = self::userFinishedCourse( $userFinishedCourse = self::userFinishedCourse(
$user_id, $user_id,
$category, $category,
@ -2197,7 +2180,7 @@ class Category implements GradebookItem
); );
$userHasSkills = !empty($userSkills); $userHasSkills = !empty($userSkills);
if ($userHasSkills && !$category->getGenerateCertificates()) { if ($userHasSkills) {
return [ return [
'badge_link' => Display::toolbarButton( 'badge_link' => Display::toolbarButton(
get_lang('ExportBadges'), get_lang('ExportBadges'),
@ -2208,6 +2191,23 @@ class Category implements GradebookItem
} }
} }
// Block certification links depending gradebook configuration (generate certifications)
if (empty($category->getGenerateCertificates())) {
return false;
}
$cattotal = self::load($category_id);
$scoretotal = $cattotal[0]->calc_score($user_id);
// Do not remove this the gradebook/lib/fe/gradebooktable.class.php
// file load this variable as a global
$scoredisplay = ScoreDisplay::instance();
$my_score_in_gradebook = $scoredisplay->display_score(
$scoretotal,
SCORE_SIMPLE
);
$my_certificate = GradebookUtils::get_certificate_by_user_id( $my_certificate = GradebookUtils::get_certificate_by_user_id(
$category->get_id(), $category->get_id(),
$user_id $user_id

@ -419,22 +419,28 @@ class Tracking
Display::return_icon('visible.png', get_lang('HideAttemptView')), Display::return_icon('visible.png', get_lang('HideAttemptView')),
api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix
); );
$extend_attempt_link .= '&nbsp;'. if (api_is_allowed_to_edit()) {
Display::url( $extend_attempt_link .= '&nbsp;'.
Display::return_icon('pdf.png', get_lang('ExportToPdf')), Display::url(
api_get_self().'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix Display::return_icon('pdf.png', get_lang('ExportToPdf')),
); api_get_self(
).'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
);
}
} else { // Same case if fold_attempt_id is set, so not implemented explicitly. } else { // Same case if fold_attempt_id is set, so not implemented explicitly.
// The extend button for this attempt has not been clicked. // The extend button for this attempt has not been clicked.
$extend_attempt_link = Display::url( $extend_attempt_link = Display::url(
Display::return_icon('invisible.png', get_lang('ExtendAttemptView')), Display::return_icon('invisible.png', get_lang('ExtendAttemptView')),
api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
); );
$extend_attempt_link .= '&nbsp;'. if (api_is_allowed_to_edit()) {
Display::url( $extend_attempt_link .= '&nbsp;'.
Display::return_icon('pdf.png', get_lang('ExportToPdf')), Display::url(
api_get_self().'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix Display::return_icon('pdf.png', get_lang('ExportToPdf')),
); api_get_self(
).'?action=export_stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
);
}
} }
} }

@ -1,6 +1,9 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CourseBundle\Entity\CLpItemView;
/** /**
* Learning paths reporting. * Learning paths reporting.
* *
@ -27,9 +30,9 @@ $courseCode = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : a
$origin = api_get_origin(); $origin = api_get_origin();
$lp_id = (int) $_GET['lp_id']; $lp_id = (int) $_GET['lp_id'];
$csv_content = []; $csv_content = [];
$course_info = api_get_course_info($courseCode); $courseInfo = api_get_course_info($courseCode);
if (empty($course_info) || empty($lp_id)) { if (empty($courseInfo) || empty($lp_id)) {
api_not_allowed(api_get_origin() !== 'learnpath'); api_not_allowed(api_get_origin() !== 'learnpath');
} }
$userInfo = api_get_user_info($user_id); $userInfo = api_get_user_info($user_id);
@ -48,8 +51,8 @@ if (!api_is_platform_admin(true) &&
if ($origin === 'user_course') { if ($origin === 'user_course') {
$interbreadcrumb[] = [ $interbreadcrumb[] = [
'url' => api_get_path(WEB_COURSE_PATH).$course_info['directory'], 'url' => api_get_path(WEB_COURSE_PATH).$courseInfo['directory'],
'name' => $course_info['name'], 'name' => $courseInfo['name'],
]; ];
$interbreadcrumb[] = [ $interbreadcrumb[] = [
'url' => "../user/user.php?cidReq=$courseCode", 'url' => "../user/user.php?cidReq=$courseCode",
@ -73,7 +76,7 @@ $interbreadcrumb[] = [
]; ];
$nameTools = get_lang('LearningPathDetails'); $nameTools = get_lang('LearningPathDetails');
$sql = 'SELECT name FROM '.Database::get_course_table(TABLE_LP_MAIN).' $sql = 'SELECT name FROM '.Database::get_course_table(TABLE_LP_MAIN).'
WHERE c_id = '.$course_info['real_id'].' AND id='.$lp_id; WHERE c_id = '.$courseInfo['real_id'].' AND id='.$lp_id;
$rs = Database::query($sql); $rs = Database::query($sql);
$lp_title = Database::result($rs, 0, 0); $lp_title = Database::result($rs, 0, 0);
@ -82,12 +85,15 @@ $origin = 'tracking';
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
switch ($action) { switch ($action) {
case 'export_stats': case 'export_stats':
if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
$itemId = isset($_REQUEST['extend_id']) ? $_REQUEST['extend_id'] : 0; $itemId = isset($_REQUEST['extend_id']) ? $_REQUEST['extend_id'] : 0;
$itemViewId = isset($_REQUEST['extend_attempt_id']) ? $_REQUEST['extend_attempt_id'] : 0; $itemViewId = isset($_REQUEST['extend_attempt_id']) ? $_REQUEST['extend_attempt_id'] : 0;
$em = Database::getManager(); $em = Database::getManager();
$repo = $em->getRepository('ChamiloCourseBundle:CLpItemView'); $repo = $em->getRepository('ChamiloCourseBundle:CLpItemView');
/** @var \Chamilo\CourseBundle\Entity\CLpItemView $itemView */ /** @var CLpItemView $itemView */
$itemView = $repo->find($itemViewId); $itemView = $repo->find($itemViewId);
if (!$itemView) { if (!$itemView) {
@ -110,6 +116,7 @@ switch ($action) {
$studentName = ''; $studentName = '';
$questions = []; $questions = [];
$categories = [];
foreach ($list1 as $id => $interaction) { foreach ($list1 as $id => $interaction) {
$counter++; $counter++;
if ($counter === 1) { if ($counter === 1) {
@ -151,24 +158,58 @@ switch ($action) {
$total++; $total++;
$globalTotal++; $globalTotal++;
} }
$table->setCellContents($row, 0, $choiceCounter); $table->setCellContents($row, 0, 'Q'.$choiceCounter);
$table->setCellContents($row, 1, $option['student_response_formatted']); $table->setCellContents($row, 1, $option['student_response_formatted']);
$table->setCellContents($row, 2, $option['result']); $result = Display::return_icon('completed.png');
if ($option['result'] === 'wrong') {
$result = Display::return_icon('delete.png');
}
$table->setCellContents($row, 2, $result);
$choiceCounter++; $choiceCounter++;
$row++; $row++;
} }
// Question total // Question total
$table->setCellContents($row, 0, get_lang('Total')); $table->setCellContents($row, 0, get_lang('Total'));
$table->setCellContents($row, 1, $data['question']); $table->setCellContents($row, 1, $data['question']);
$totalOptions = count($data['options']); $totalOptions = count($data['options']);
$score = $scoreDisplay->display_score([0 => $total, 1 => $totalOptions]); $arrayScore = [0 => $total, 1 => $totalOptions];
$table->setCellContents($row, 2, $score); $scoreToString = $scoreDisplay->display_score($arrayScore);
$globalTotalCount += $totalOptions; $table->setCellContents($row, 2, $scoreToString);
$categories[] = [
'name' => $data['question'],
'score' => $scoreDisplay->display_score($arrayScore, SCORE_DIV),
'score_percentage' => $scoreDisplay->display_score($arrayScore, SCORE_PERCENT),
];
$globalTotalCount += $totalOptions;
$row++; $row++;
} }
$score = $scoreDisplay->display_score([0 => $globalTotal, 1 => $globalTotalCount]); $tableSummary = new HTML_Table(['class' => 'data_table']);
$tableSummary->setCellContents(0, 0, get_lang('CategoryName'));
$tableSummary->setCellContents(0, 1, get_lang('Score'));
$tableSummary->setCellContents(0, 2, get_lang('Percentage'));
$rowSummary = 1;
foreach ($categories as $data) {
$tableSummary->setCellContents($rowSummary, 0, $data['name']);
$tableSummary->setCellContents($rowSummary, 1, $data['score']);
$tableSummary->setCellContents($rowSummary, 2, $data['score_percentage']);
$rowSummary++;
}
$globalScoreTotal = [0 => $globalTotal, 1 => $globalTotalCount];
$score = $scoreDisplay->display_score($globalScoreTotal);
$tableSummary->setCellContents($rowSummary, 0, get_lang('GeneralTotal'));
$tableSummary->setCellContents($rowSummary, 1, $scoreDisplay->display_score($globalScoreTotal, SCORE_DIV));
$tableSummary->setCellContents($rowSummary, 2, $scoreDisplay->display_score($globalScoreTotal, SCORE_PERCENT));
$rowSummary++;
$table->setCellContents($row, 0, get_lang('GlobalTotal')); $table->setCellContents($row, 0, get_lang('GlobalTotal'));
$table->setCellContents($row, 1, ''); $table->setCellContents($row, 1, '');
$table->setCellContents($row, 2, $score); $table->setCellContents($row, 2, $score);
@ -177,7 +218,7 @@ switch ($action) {
$duration = learnpathItem::getScormTimeFromParameter('js', $itemView->getTotalTime()); $duration = learnpathItem::getScormTimeFromParameter('js', $itemView->getTotalTime());
$table = new HTML_Table(['class' => 'table']); $table = new HTML_Table(['class' => 'data_table']);
$data = [ $data = [
get_lang('Name') => $lp->getName(), get_lang('Name') => $lp->getName(),
get_lang('Attempt') => $itemView->getViewCount(), get_lang('Attempt') => $itemView->getViewCount(),
@ -185,8 +226,9 @@ switch ($action) {
get_lang('Duration') => $duration, get_lang('Duration') => $duration,
get_lang('StartTime') => api_get_local_time($itemView->getStartTime()), get_lang('StartTime') => api_get_local_time($itemView->getStartTime()),
get_lang('EndTime') => api_get_local_time($endTime), get_lang('EndTime') => api_get_local_time($endTime),
get_lang('Student') => $studentName, get_lang('Candidate') => $studentName,
]; ];
$row = 0; $row = 0;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$table->setCellContents($row, 0, $key); $table->setCellContents($row, 0, $key);
@ -196,13 +238,37 @@ switch ($action) {
$headerTableToString = $table->toHtml(); $headerTableToString = $table->toHtml();
$content = $headerTableToString.$tableToString; $content = $headerTableToString.'<br /><br />'.$tableSummary->toHtml().'<pagebreak>'.$tableToString;
$pdf = new PDF(); $pdf = new PDF();
$table = new HTML_Table(['class' => 'table']);
$logo = ChamiloApi::getPlatformLogo(
$theme,
[
'title' => '',
'class' => '',
'id' => 'header-logo',
]
);
$table->setCellContents(0, 0, $logo);
$secondLogo = api_get_path(SYS_PATH).'custompages/url-images/'.api_get_current_access_url_id().'_url_image_2.png';
$logo2 = Display::img($secondLogo, null, ['style' => 'height:70px;']);
$table->setCellContents(0, 1, $logo2);
$table->setCellAttributes(0, 1, ['style' => 'display:block;float:right;text-align:right']);
$pdf->set_custom_header($table->toHtml());
$background = api_get_path(SYS_PATH).'custompages/url-images/'.api_get_current_access_url_id().'_pdf_background.png';
$content = '<html><body style="background-image-resize: 5; background-position: top left; background-image: url('.$background.');">'
.$content.'</body></html>';
$pdf->content_to_pdf( $pdf->content_to_pdf(
$content, $content,
null, null,
$courseInfo['code'], $courseInfo['code'].'_'.$lp->getName(),
$courseInfo['code'], $courseInfo['code'],
'D', 'D',
false, false,
@ -238,7 +304,7 @@ echo Display::toolbarAction(
$table_title = $session_id $table_title = $session_id
? Display::return_icon('session.png', get_lang('Session')).PHP_EOL.api_get_session_name($session_id).PHP_EOL ? Display::return_icon('session.png', get_lang('Session')).PHP_EOL.api_get_session_name($session_id).PHP_EOL
: PHP_EOL; : PHP_EOL;
$table_title .= Display::return_icon('course.png', get_lang('Course')).PHP_EOL.$course_info['name'].PHP_EOL $table_title .= Display::return_icon('course.png', get_lang('Course')).PHP_EOL.$courseInfo['name'].PHP_EOL
.Display::return_icon('user.png', get_lang('User')).' '.$name; .Display::return_icon('user.png', get_lang('User')).' '.$name;
echo Display::page_header($table_title); echo Display::page_header($table_title);

@ -9,15 +9,11 @@
$plugin = BuyCoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$guess_enable = $plugin->get('unregistered_users_enable'); $guess_enable = $plugin->get('unregistered_users_enable');
if ($guess_enable == "true" || isset($_SESSION['_user'])) { if ($guess_enable == 'true' || isset($_SESSION['_user'])) {
// If the user is NOT an administrator, redirect it to course/session buy list if (api_is_platform_admin()) {
if (!api_is_platform_admin()) { $tpl = new Template();
header('Location: src/course_panel.php'); $content = $tpl->fetch('buycourses/view/index.tpl');
exit; $tpl->assign('content', $content);
$tpl->display_one_col_template();
} }
$tpl = new Template();
$content = $tpl->fetch('buycourses/view/index.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} }

Loading…
Cancel
Save