You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
902 B
41 lines
902 B
|
8 years ago
|
<?php
|
||
|
|
/* For licensing terms, see /license.txt */
|
||
|
|
/**
|
||
|
|
* Config the plugin
|
||
|
|
* @author Enrique Alcaraz Lopez
|
||
|
|
* @package chamilo.plugin.redirection
|
||
|
|
*/
|
||
|
|
|
||
|
|
class PluginRedirection
|
||
|
|
{
|
||
|
|
# Insertamos la redirección
|
||
|
|
public static function insert($user_id, $url)
|
||
|
|
{
|
||
|
|
return Database::insert(
|
||
|
|
'plugin_redirection',
|
||
|
|
[
|
||
|
|
'user_id' => $user_id,
|
||
|
|
'url' => $url
|
||
|
|
]
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
# Borramos al redirección
|
||
|
|
public static function delete($id)
|
||
|
|
{
|
||
|
|
$table = Database::get_main_table('plugin_redirection');
|
||
|
|
Database::delete(
|
||
|
|
$table,
|
||
|
|
array('id = ?' => array($id))
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
# Devolemos las redirecciones
|
||
|
|
public static function get()
|
||
|
|
{
|
||
|
|
$table = Database::get_main_table('plugin_redirection');
|
||
|
|
return Database::select('*', $table);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|