コード例 #1
0
ファイル: listfaculte.php プロジェクト: kostastzo/openeclass
 *                  Panepistimiopolis Ilissia, 15784, Athens, Greece
 *                  e-mail: info@openeclass.org
 * ======================================================================== */
require_once '../../include/baseTheme.php';
require_once 'include/lib/hierarchy.class.php';
$redirectUrl = "modules/auth/opencourses.php?fc=";
$countCallback = null;
if (defined('LISTING_MODE') && LISTING_MODE === 'COURSE_METADATA') {
    require_once 'modules/course_metadata/CourseXML.php';
    $redirectUrl = "modules/course_metadata/opencourses.php?fc=";
    $countCallback = CourseXMLElement::getCountCallback();
    // exit if feature disabled
    if (!get_config('opencourses_enable')) {
        header("Location: {$urlServer}");
        exit;
    }
}
$tree = new Hierarchy();
$pageName = $langSelectFac;
$roots = $tree->buildRootsArray();
if (count($roots) <= 0) {
    die("ERROR: no root nodes");
} else {
    if (count($roots) == 1) {
        header("Location:" . $urlServer . $redirectUrl . intval($roots[0]));
        exit;
    } else {
        $tool_content = $tree->buildNodesNavigationHtml($roots, 'opencourses', $countCallback);
    }
}
draw($tool_content, (isset($uid) and $uid) ? 1 : 0);
コード例 #2
0
ファイル: listfaculte.php プロジェクト: nikosv/openeclass
if (count($roots) <= 0) {
    die("ERROR: no root nodes");
} else if (count($roots) == 1) {
    header("Location:" . $urlServer . $redirectUrl . intval($roots[0]->id));
    exit();
} else {
    $tool_content = action_bar(array(
                                array('title' => $langBack,
                                      'url' => $urlServer,
                                      'icon' => 'fa-reply',
                                      'level' => 'primary-label',
                                      'button-class' => 'btn-default')
                            ),false);
    
    $tool_content .= "
    <div class='row'>
        <div class='col-xs-12'>
            <div class='list-group'>
                <a href='#' class='list-group-item list-header'><b>$langFaculty</b></a>
            ";
    $tool_content .= $tree->buildNodesNavigationHtml($roots, 'opencourses', $countCallback, $showEmpty, $subtrees);
    $tool_content .= "
            </div>
        </div>
    </div>
            ";
}


draw($tool_content, (isset($uid) and $uid) ? 1 : 0);
コード例 #3
0
ファイル: courses.php プロジェクト: kostastzo/openeclass
    }
    $tool_content .= "<div><a href='../../index.php'>{$langHome}</a></div>";
} else {
    $fac = getfacfromfc($fc);
    if (!$fac) {
        // if user does not belong to department
        $tool_content .= "<p align='justify'>{$langAddHereSomeCourses}";
        $roots = $tree->buildRootsArray();
        if (count($roots) <= 0) {
            die("ERROR: no root nodes");
        } else {
            if (count($roots) == 1) {
                header("Location:" . $urlServer . "modules/auth/courses.php?fc=" . intval($roots[0]));
                exit;
            } else {
                $tool_content .= $tree->buildNodesNavigationHtml($tree->buildRootsArray(), 'opencourses');
            }
        }
    } else {
        // department exists
        $numofcourses = getdepnumcourses($fc);
        if (count($tree->buildRootsArray()) > 1) {
            $tool_content .= $tree->buildRootsSelectForm($fc);
        }
        $tool_content .= "<form action='{$_SERVER['SCRIPT_NAME']}' method='post'>";
        $tool_content .= "<table class='table-default'>\n                                  <tr><th><a name='top'></a>{$langFaculty}: " . $tree->getFullPath($fc, false, $_SERVER['SCRIPT_NAME'] . '?fc=') . "\n                                  </th></tr></table><br />";
        if ($numofcourses > 0) {
            $tool_content .= expanded_faculte($fc, $uid);
            $tool_content .= "<br /><div align='right'><input class='btn btn-primary' type='submit' name='submit' value='{$langRegistration}' />&nbsp;&nbsp;</div>";
        } else {
            $tool_content .= $tree->buildDepartmentChildrenNavigationHtml($fc, 'courses');
コード例 #4
0
ファイル: courses.php プロジェクト: nikosv/openeclass
    }
    $tool_content .= "<div><a href='../../index.php'>$langHome</a></div>";
} else {
    $fac = getfacfromfc($fc);
    list($roots, $rootSubtrees) = $tree->buildRootsWithSubTreesArray();
    if (!$fac) { // if user does not belong to department
        $tool_content .= $langAddHereSomeCourses;

        if (count($roots) <= 0) {
            die("ERROR: no root nodes");
        } else if (count($roots) == 1) {
            header("Location:" . $urlServer . "modules/auth/courses.php?fc=" . intval($roots[0]->id));
            exit();
        } else {
            $tool_content .= '<ul>' .
                $tree->buildNodesNavigationHtml($roots, 'courses', null, true, $rootSubtrees) .
                '</ul>';
        }
    } else {
        // department exists
        $numofcourses = getdepnumcourses($fc);
        $tool_content .= action_bar(array(
                                array('title' => $langBack,
                                      'url' => $urlServer,
                                      'icon' => 'fa-reply',
                                      'level' => 'primary-label',
                                      'button-class' => 'btn-default')
                            ),false);
        if (count($roots) > 1) {
            $tool_content .= $tree->buildRootsSelectForm($fc);
        }