Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Customfields text field plugin
-
 
19
 *
-
 
20
 * @package   customfield_text
-
 
21
 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com>
-
 
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
23
 */
-
 
24
 
16
 
Línea 25... Línea -...
25
namespace customfield_text;
-
 
26
 
-
 
27
defined('MOODLE_INTERNAL') || die;
-
 
28
 
-
 
29
use core_customfield\api;
17
namespace customfield_text;
30
 
18
 
31
/**
19
/**
32
 * Class data
20
 * Class data
33
 *
21
 *
34
 * @package customfield_text
22
 * @package   customfield_text
35
 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com>
23
 * @copyright 2018 Daniel Neis Araujo <daniel@moodle.com>
36
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Línea 103... Línea 91...
103
            return null;
91
            return null;
104
        }
92
        }
Línea 105... Línea 93...
105
 
93
 
106
        $link = $this->get_field()->get_configdata_property('link');
94
        $link = $this->get_field()->get_configdata_property('link');
-
 
95
        if ($link) {
107
        if ($link) {
96
            $url = new \moodle_url(str_replace('$$', $this->get_value(), $link));
108
            $linktarget = $this->get_field()->get_configdata_property('linktarget');
-
 
109
            $url = str_replace('$$', urlencode($this->get_value()), $link);
97
            $linktarget = $this->get_field()->get_configdata_property('linktarget');
110
            $attributes = $linktarget ? ['target' => $linktarget] : [];
98
            $attributes = $linktarget ? ['target' => $linktarget] : [];
111
            $value = \html_writer::link($url, $value, $attributes);
99
            $value = \html_writer::link($url, $value, $attributes);
Línea 112... Línea 100...
112
        }
100
        }