Moves functions into a class.

1.10.x
Julio Montoya 10 years ago
parent 1e6380acec
commit a5fc66dd0b
  1. 2642
      main/inc/lib/link.lib.php
  2. 44
      main/link/link.php
  3. 14
      main/newscorm/learnpath.class.php
  4. 3
      main/newscorm/resourcelinker.php
  5. 1
      plugin/bbb/lib/bbb.lib.php

File diff suppressed because it is too large Load Diff

@ -124,7 +124,7 @@ if (isset($_GET['action'])) {
case 'addlink':
if ($link_submitted) {
// Here we add a link
if (!addlinkcategory("link")) {
if (!Link::addlinkcategory("link")) {
unset($submit_link);
}
}
@ -132,39 +132,39 @@ if (isset($_GET['action'])) {
case 'addcategory':
if ($category_submitted) {
// Here we add a category
if (!addlinkcategory('category')) {
if (!Link::addlinkcategory('category')) {
unset($submit_category);
}
}
break;
case 'importcsv':
if ($_POST['submitImport']) {
import_csvfile();
Link::import_csvfile();
}
break;
case 'deletelink':
// Here we delete a link
deletelinkcategory($_GET['id'], 'link');
Link::deletelinkcategory($_GET['id'], 'link');
break;
case 'deletecategory':
// Here we delete a category
deletelinkcategory($_GET['id'], 'category');
Link::deletelinkcategory($_GET['id'], 'category');
break;
case 'editlink':
// Here we edit a link
editlinkcategory('link');
Link::editlinkcategory('link');
break;
case 'editcategory':
// Here we edit a category
editlinkcategory('category');
Link::editlinkcategory('category');
break;
case 'visible':
// Here we edit a category
change_visibility_link($_GET['id'], $_GET['scope']);
Link::change_visibility_link($_GET['id'], $_GET['scope']);
break;
case 'invisible':
// Here we edit a category
change_visibility_link($_GET['id'], $_GET['scope']);
Link::change_visibility_link($_GET['id'], $_GET['scope']);
break;
}
Security::clear_token();
@ -208,7 +208,7 @@ if (api_is_allowed_to_edit(null, true) && isset($_GET['action'])) {
$lpId = isset($_GET['lp_id']) ? Security::remove_XSS($_GET['lp_id']) : null;
if ($_GET['action'] == 'editlink') {
$clean_link_id = intval($_GET['id']);
$link_info = get_link_info($_GET['id']);
$link_info = Link::get_link_info($_GET['id']);
if ($link_info) {
$urllink = $link_info['url'];
$title = $link_info['title'];
@ -258,7 +258,7 @@ if (api_is_allowed_to_edit(null, true) && isset($_GET['action'])) {
</div>
</div>';
$resultcategories = getLinkCategories($course_id, $session_id);
$resultcategories = Link::getLinkCategories($course_id, $session_id);
if (!empty($resultcategories)) {
echo ' <div class="control-group category">
@ -402,10 +402,10 @@ if (api_is_allowed_to_edit(null, true) && isset($_GET['action'])) {
}
if (!empty($down)) {
movecatlink($down);
Link::movecatlink($down);
}
if (!empty($up)) {
movecatlink($up);
Link::movecatlink($up);
}
if (empty($_GET['action']) ||
@ -426,7 +426,7 @@ if (empty($_GET['action']) ||
}
// Making the show none / show all links. Show none means urlview=0000 (number of zeros depending on the
// number of categories). Show all means urlview=1111 (number of 1 depending on teh number of categories).
$resultcategories = getLinkCategories($course_id, $session_id);
$resultcategories = Link::getLinkCategories($course_id, $session_id);
$aantalcategories = count($resultcategories);
if (!empty($resultcategories)) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&urlview=';
@ -451,7 +451,7 @@ if (empty($_GET['action']) ||
echo '<table class="data_table">';
echo '<tr><th style="font-weight: bold; text-align:left;padding-left: 10px;">'.get_lang('General').'</th></tr>';
echo '</table>';
showlinksofcategory(0);
Link::showlinksofcategory(0);
}
$i = 0;
@ -465,7 +465,7 @@ if (empty($_GET['action']) ||
//if (!isset($urlview)) {
if ($urlview == '') {
// No $view set in the url, thus for each category link it should be all zeros except it's own
makedefaultviewcode($i);
Link::makedefaultviewcode($i);
} else {
$view = $urlview;
$view[$i] = '1';
@ -498,7 +498,7 @@ if (empty($_GET['action']) ||
if ($session_id == $myrow['session_id']) {
echo '<th>';
echo $strVisibility;
showcategoryadmintools($myrow['id']);
Link::showcategoryadmintools($myrow['id']);
echo '</th>';
} else {
echo '<th>'.get_lang('EditionNotAvailableFromSession');
@ -506,7 +506,7 @@ if (empty($_GET['action']) ||
}
echo '</tr>';
echo '</table>';
echo showlinksofcategory($myrow['id']);
echo Link::showlinksofcategory($myrow['id']);
echo '</tr>';
} else {
echo '<tr>';
@ -524,7 +524,7 @@ if (empty($_GET['action']) ||
if ($session_id == $myrow['session_id']) {
echo '<th style="text-align:center;">';
echo $strVisibility;
showcategoryadmintools($myrow['id']);
Link::showcategoryadmintools($myrow['id']);
echo '</th>';
}
}
@ -548,14 +548,14 @@ if (empty($_GET['action']) ||
echo '</th>';
if (api_is_allowed_to_edit(null, true)) {
if ($session_id == $myrow['session_id']) {
echo '<th>'; echo $strVisibility; showcategoryadmintools($myrow['id']); echo '</th>';
echo '<th>'; echo $strVisibility; Link::showcategoryadmintools($myrow['id']); echo '</th>';
} else {
echo '<th>'.get_lang('EditionNotAvailableFromSession');
}
}
echo '</tr>';
echo '</table>';
echo showlinksofcategory($myrow['id']);
echo Link::showlinksofcategory($myrow['id']);
echo '</tr>';
} else {
echo '<tr>';
@ -571,7 +571,7 @@ if (empty($_GET['action']) ||
if ($session_id == $myrow['session_id']) {
echo '<th style="text-align:center;">';
echo $strVisibility;
showcategoryadmintools($myrow['id']);
Link::showcategoryadmintools($myrow['id']);
echo '</th>';
}
}

@ -1427,7 +1427,6 @@ class learnpath
}
if ($row_select['item_type'] == 'link') {
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
$link = new Link();
$linkId = $row_select['path'];
$link->updateLink($linkId, $url);
@ -3373,13 +3372,12 @@ class learnpath
}
if ($lp_item_type == 'link') {
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
if (is_youtube_link($file)) {
$src = get_youtube_video_id($file);
if (Link::is_youtube_link($file)) {
$src = Link::get_youtube_video_id($file);
$file = 'embed.php?type=youtube&src='.$src;
}
if (isVimeoLink($file)) {
$src = getVimeoLinkId($file);
if (Link::isVimeoLink($file)) {
$src = Link::getVimeoLinkId($file);
$file = 'embed.php?type=vimeo&src='.$src;
}
} else {
@ -8485,8 +8483,6 @@ class learnpath
*/
public function get_links()
{
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
$course_id = api_get_course_int_id();
$tbl_link = Database::get_course_table(TABLE_LINK);
@ -8505,7 +8501,7 @@ class learnpath
$return .= '</li>';
$course_info = api_get_course_info();
$linkCategories = getLinkCategories($course_id, $session_id);
$linkCategories = Link::getLinkCategories($course_id, $session_id);
$categoryIdList = array();
if (!empty($linkCategories)) {
foreach ($linkCategories as $categoryInfo) {

@ -796,9 +796,6 @@ if ($content == 'Link') {
// Including the links language file.
include "../lang/$language/link.inc.php";
// Including the links functions file.
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
$tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
if (($learnpath_id != '') and ($content == 'Link')) {
echo "<form name='learnpath_link'><table>";

@ -760,7 +760,6 @@ class bbb
if (empty($id)) {
return false;
}
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
//$records = BigBlueButtonBN::getRecordingsUrl($id);
$meetingData = Database::select('*', $this->table, array('where' => array('id = ?' => array($id))), 'first');

Loading…
Cancel
Save