Beispiel #1
0
 /**
  * Load css and yui file
  * @return null
  * @param $js Array[optional]
  * @param $css Array[optional]
  */
 public static function load($module_list = false, $noprint = false)
 {
     $module_list = 'base,autocomplete,charts,tabview,table,treeview,colorpicker';
     if (strpos($module_list, 'base') !== false) {
         $module_list = 'base,' . $module_list;
     }
     $list = explode(',', $module_list);
     $js_load = array();
     $css_load = array();
     foreach ($list as $k => $module) {
         if (isset(self::$_css_map[$module])) {
             $css_load = array_unique(array_merge($css_load, self::$_css_map[$module]));
         }
         if (isset(self::$_js_map[$module])) {
             $js_load = array_unique(array_merge($js_load, self::$_js_map[$module]));
         }
     }
     // remove js alredy loaded
     $css_load = array_diff($css_load, self::$_css_loaded);
     $js_load = array_diff($js_load, self::$_js_loaded);
     if (empty($css_load) && empty($js_load)) {
         return '';
     }
     // load new css
     $to_load = '';
     if (!empty($css_load)) {
         $to_load .= '<!-- yui css -->';
         foreach ($css_load as $k => $filename) {
             $to_load .= Util::get_css(Get::tmpl_path('base') . 'yui-skin/' . $filename, true);
         }
     }
     // load new js
     if (!empty($js_load)) {
         $to_load .= '<!-- yui js -->';
         foreach ($js_load as $k => $filename) {
             $to_load .= Util::get_js('/addons/yui/' . $filename);
             if ($filename == 'utilities/utilities.js') {
                 $to_load .= "\n" . '<script type="text/javascript"> YAHOO.util.Connect.initHeader(\'X-Signature\',\'' . Util::getSignature() . '\'); YAHOO.util.Connect.startEvent.subscribe(function() { YAHOO.util.Connect.initHeader(\'X-Signature\',\'' . Util::getSignature() . '\'); });</script>';
             }
             if ($filename == 'charts/charts-min.js') {
                 $to_load .= "\n" . '<script type="text/javascript"> YAHOO.widget.Chart.SWFURL = "' . Get::rel_path('base') . '/addons/yui/charts/assets/charts.swf"; </script>';
             }
         }
         if (Lang::direction() == 'rtl') {
             $to_load .= Util::get_js('/addons/yui/yui-rtl.js');
         }
     }
     // add loaded file to the cache
     if (!empty($css_load)) {
         self::$_css_loaded = array_merge(self::$_css_loaded, $css_load);
     }
     if (!empty($js_load)) {
         self::$_js_loaded = array_merge(self::$_js_loaded, $js_load);
     }
     if (function_exists('cout') && !$noprint) {
         cout($to_load, 'page_head');
     } else {
         return $to_load;
     }
 }
 public function __construct($id, $initFromSession = false)
 {
     parent::__construct($id);
     $this->jsClassName = 'CourseFolderTree';
     $this->serverUrl = 'ajax.adm_server.php?plf=lms&file=category_tree&sf=folder_tree';
     Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
     require_once _base_ . '/lib/lib.dialog.php';
     initDialogs();
     $initialShowedNodes = array();
     if ($initFromSession) {
         if (isset($_SESSION['course_category']['tree_status'])) {
             $tree_status =& $_SESSION['course_category']['tree_status'];
             //if (isset($tree_status['showed_nodes'])) {}
         }
         if (isset($_SESSION['course_category']['filter_status'])) {
             $filter_status =& $_SESSION['course_category']['filter_status'];
             if (isset($filter_status['c_category'])) {
                 $this->setOption('initialSelectedNode', $filter_status['c_category']);
             }
         }
     }
     $lang =& DoceboLanguage::CreateInstance('course', 'lms');
     //$this->setOption('langs', array('_ROOT'=>def('_CATEGORY', 'course', 'lms')));
     $this->addLangKey('_ROOT', $lang->def('_CATEGORY'));
     $this->addLangKey('_YES', $lang->def('_CONFIRM'));
     $this->addLangKey('_NO', $lang->def('_UNDO'));
     $this->addLangKey('_NEW_FOLDER_NAME', $lang->def('_NEW_CATEGORY'));
     $this->addLangKey('_MOD', $lang->def('_MOD'));
     $this->addLangKey('_AREYOUSURE', $lang->def('_AREYOUSURE'));
     $this->addLangKey('_NAME', $lang->def('_NAME'));
     $this->addLangKey('_MOD', $lang->def('_MOD'));
     $this->addLangKey('_DEL', $lang->def('_DEL'));
     //$this->addLangKey('_', $lang->def(''));
     //$selected_node = (isset($_SESSION['course_category']['filter_status']) ? $_SESSION['course_category']['filter_status']['c_category'] : 0); //0 = root node
     $tree_status = $this->_getCourseTreeStatus();
     //0 = root node
     $this->setOption('iconPath', Get::tmpl_path() . 'images/');
     $this->setOption('dragdrop', true);
     //$this->setOption('initNodes', $initialShowedNodes);
     $this->setOption('useCheckboxes', false);
     $this->setOption('addFolderButton', 'add_folder_button');
     //$this->setOption('initialTreeStatus', $tree_status);
     //$this->setOption('options', '');
     //$this->setOption('options', '');
 }
Beispiel #3
0
 public function run()
 {
     if (!$this->id) {
         return false;
     }
     $params = array('id' => $this->id, 'treeClass' => $this->treeClass, 'rel_action' => $this->rel_action);
     if ($this->ajaxUrl && is_string($this->ajaxUrl)) {
         $params['ajaxUrl'] = $this->ajaxUrl;
     }
     if (is_array($this->languages) && count($this->languages) > 0) {
         $params['languages'] = $this->json->encode($this->languages);
     } else {
         $params['languages'] = '{}';
     }
     //other options
     $this->setOption('initialSelectedNode', $this->initialSelectedNode);
     $this->setOption('iconPath', Get::tmpl_path() . 'images/');
     $this->setOption('dragdrop', (bool) $this->dragDrop);
     $this->setOption('useCheckboxes', $this->useCheckboxes);
     $this->setOption('initialSelectorData', $this->initialSelectorData);
     $this->setOption('hiddenSelection', $this->hiddenSelection);
     $this->setOption('canSelectRoot', (bool) $this->canSelectRoot);
     $this->setOption('setSelectedNodeOnServer', (bool) $this->setSelectedNodeOnServer);
     $this->setOption('addFolderButton', $this->id . '_add_folder_button');
     if ($this->rootNodeId !== false) {
         $this->setOption('rootNodeId', $this->rootNodeId);
     }
     if (!empty($this->rootActions) && is_array($this->rootActions)) {
         $this->setOption('rootActions', $this->rootActions);
     }
     $params['options'] = $this->getJsOptions();
     switch ($this->show) {
         case 'explorer':
             $view = "explorer";
             break;
         default:
             $view = "tree";
     }
     $params['runtime'] = (bool) $this->runtime;
     $this->render($view, $params);
 }
Beispiel #4
0
 public static function path()
 {
     return Get::tmpl_path('base');
 }
function coursecatalogue($id_block, $title, $option = array())
{
    YuiLib::load(array('animation' => 'my_animation', 'container' => 'container-min', 'container' => 'container_core-min'));
    cout(Util::get_js(Get::rel_path('cms') . '/modules/catalog/catalog.js', true), 'page_head');
    if (!isset($_SESSION['chart'])) {
        $_SESSION['chart'] = array();
    }
    $id_course = Get::req('id_course', DOTY_INT, 0);
    $action = Get::req('action', DOTY_STRING, '');
    if ($id_course !== 0 && $action === '') {
        $_SESSION['chart'][$id_course]['idCourse'] = $id_course;
    } else {
        require_once _lms_ . '/lib/lib.subscribe.php';
        $man_subscribe = new CourseSubscribe_Management();
        $man_subscribe->subscribeToCourse(getLogUserId(), $id_course);
    }
    require_once _cms_ . '/lib/lib.catalog.php';
    require_once _base_ . '/lib/lib.navbar.php';
    cout('<link href="./modules/catalog/catalog.css" type="text/css" rel="stylesheet"/>', 'page_head');
    $css_path = Get::tmpl_path('base') . 'yui-skin';
    cout(Util::get_css($css_path . '/tabview.css', true), 'page_head');
    $lang =& DoceboLanguage::CreateInstance('catalogue', 'cms');
    $man_cat = new Man_Catalog();
    $array_id_block = explode('_', $id_block);
    $page = Get::req('page', DOTY_INT, 0);
    if ($page == 0) {
        $page = $this->getBlockPage($array_id_block[0]);
    }
    cout(getTitleArea($title) . '<div class="std_block">');
    $catalogue = $man_cat->getCatalogueForBlock($array_id_block[0]);
    $all_course = false;
    if (array_search(0, $catalogue) !== false) {
        unset($catalogue[array_search(0, $catalogue)]);
        $all_course = true;
    }
    $id_catalogue = Get::req('id_catalogue', DOTY_INT, -2);
    if ($id_catalogue == -2) {
        if (count($catalogue)) {
            if (isset($catalogue[0])) {
                $id_catalogue = $catalogue[0]['id_catalogue'];
            } else {
                $id_catalogue = $catalogue[1]['id_catalogue'];
            }
        } else {
            $id_catalogue = 0;
        }
    }
    $id_category = Get::req('id_cat', DOTY_INT, 0);
    $number_courses = $man_cat->getCourseNumberForBlock($array_id_block[0], $id_catalogue, $id_category, $all_course);
    $nav_bar = new NavBar('ini', Get::sett('visuItem'), $number_courses);
    $nav_bar->setLink('index.php?pag=' . $page . '&amp;id_catalogue=' . $id_catalogue . ($id_category != 0 ? '&amp;id_cat=' . $id_category : ''));
    $ini = $nav_bar->getSelectedPage();
    $limit = ($ini - 1) * Get::sett('visuItem');
    cout($nav_bar->getNavBar() . '<div id="demo" class="yui-navset">' . '<ul class="yui-nav">');
    foreach ($catalogue as $catalogue_info) {
        cout('<li ' . ($catalogue_info['id_catalogue'] == $id_catalogue ? ' class="selected"' : '') . '><a href="index.php?pag=' . $page . '&amp;id_catalogue=' . $catalogue_info['id_catalogue'] . '"><em>' . $catalogue_info['name'] . '</em></a></li>');
    }
    cout('<li ' . ($id_catalogue == 0 ? ' class="selected"' : '') . '><a href="index.php?pag=' . $page . '&amp;id_catalogue=0"><em>' . $lang->def('_ALL_COURSES') . '</em></a></li>' . '<li ' . ($id_catalogue == -1 ? ' class="selected"' : '') . '><a href="index.php?pag=' . $page . '&amp;id_catalogue=-1"><em>' . $lang->def('_CATEGORY') . '</em></a></li>');
    reset($catalogue);
    cout('</ul>');
    cout('<div class="yui-content">');
    if ($number_courses == 0 && $id_catalogue != -1) {
        cout('<p>' . $lang->def('_NO_COURSE_FOR_CATALOG') . '</p>');
    } elseif ($id_catalogue == -1) {
        //Category Visualization
        if ($id_category == 0) {
            $query = "SELECT ca.idCategory, ca.path, ca.lev, ca.iLeft, ca.iRight, COUNT(co.idCourse)" . " FROM " . $GLOBALS['prefix_lms'] . "_category AS ca" . " LEFT JOIN " . $GLOBALS['prefix_lms'] . "_course AS co ON co.idCategory = ca.idCategory" . " WHERE ca.lev = 1" . " GROUP BY ca.idCategory" . " ORDER BY ca.lev, ca.path";
        } else {
            $query = "SELECT iLeft, iRight" . " FROM " . $GLOBALS['prefix_lms'] . "_category" . " WHERE idCategory = " . $id_category;
            list($ileft, $iright) = sql_fetch_row(sql_query($query));
            $query = "SELECT ca.idCategory, ca.path, ca.lev, ca.iLeft, ca.iRight, COUNT(co.idCourse)" . " FROM " . $GLOBALS['prefix_lms'] . "_category AS ca" . " LEFT JOIN " . $GLOBALS['prefix_lms'] . "_course AS co ON co.idCategory = ca.idCategory" . " WHERE ca.iLeft >= " . $ileft . " AND ca.iRight <= " . $iright . " GROUP BY ca.idCategory" . " ORDER BY ca.lev, ca.path";
        }
        $result = sql_query($query);
        $first = true;
        $num_folder = sql_num_rows($result);
        cout('<div class="cat_nav">');
        while (list($id_cat, $path, $lev, $ileft, $iright, $courses) = sql_fetch_row($result)) {
            $cat_name = end(explode('/', $path));
            if ($id_category == $id_cat) {
                cout('<div class="cat_position">' . '<a href="index.php?pag=' . $page . '&id_catalogue=-1">' . $lang->def('_CATEGORY') . '</a>');
                if ($lev > 1) {
                    $query_parent = "SELECT idCategory, path" . " FROM " . $GLOBALS['prefix_lms'] . "_category" . " WHERE iLeft < " . $ileft . " AND iRight > " . $iright . " ORDER BY lev ASC";
                    $result_parent = sql_query($query_parent);
                    while (list($id_cat_pa, $path_pa) = sql_fetch_row($result_parent)) {
                        $pa_name = end(explode('/', $path_pa));
                        cout(' - <a href="index.php?pag=' . $page . '&id_catalogue=-1&amp;id_cat=' . $id_cat_pa . '">' . $pa_name . '</a>');
                    }
                }
                cout(' - ' . $cat_name . '</div>');
            }
            if ($first && $num_folder > 0) {
                $first = false;
                cout('<ul class="cat_nav_list">');
            }
            if ($id_category != $id_cat) {
                $sub_folder = ($iright - $ileft - 1) / 2;
                cout('<li>' . '<a href="index.php?pag=' . $page . '&id_catalogue=-1&amp;id_cat=' . $id_cat . '">' . $cat_name . '<br />' . ($sub_folder > 0 ? '<span class="cat_item_info">' . $lang->def("_CATEGORIES") . ' (' . $sub_folder . ')<br />' : '') . ($courses > 0 ? '<span class="cat_item_info">' . $lang->def("_COURSES") . ' (' . $courses . ')' : '') . '</a>' . '</li>');
            }
        }
        if ($num_folder > 0) {
            cout('</ul>');
        }
        cout('</div>');
        //Course visualization
        cout('<div class="course_list">');
        if ($number_courses == 0) {
            cout('<p>' . $lang->def('_NO_COURSE_FOR_CATEGORY') . '</p>');
        } else {
            $courses = $man_cat->getCourseForBlock($array_id_block[0], $limit, $id_catalogue, $id_category, $all_course);
            foreach ($courses as $course_info) {
                $action = $this->controlCourse($course_info, $page, $id_catalogue, $id_category, $ini);
                cout('<div class="course">' . '<div class="course_info">' . '<h3 class="course_title"><img src="' . getPathImage() . '/language/' . strtolower($course_info['lang_code']) . '.png" alt="" title="" /> ' . $course_info['name'] . '</h3>' . '<p class="course_description">' . $course_info['description'] . '</p>' . '</div>' . '<div class="course_action">' . $action . '</div>' . '</div>');
            }
        }
        cout('</div>');
    } else {
        //Course in catalogue visualization
        $courses = $man_cat->getCourseForBlock($array_id_block[0], $limit, $id_catalogue, $id_category, $all_course);
        foreach ($courses as $course_info) {
            $action = $this->controlCourse($course_info, $page, $id_catalogue, $id_category, $ini);
            cout('<div class="course">' . '<div class="course_info">' . '<h3 class="course_title"><img src="' . getPathImage() . '/language/' . strtolower($course_info['lang_code']) . '.png" alt="" title="" /> ' . $course_info['name'] . '</h3>' . '<p class="course_description">' . $course_info['description'] . '</p>' . '</div>' . '<div class="course_action">' . $action . '</div>' . '</div>');
        }
    }
    cout('</div>' . '</div>' . $nav_bar->getNavBar() . '</div>');
}
 public function __construct($id)
 {
     parent::__construct($id);
     $lang =& DoceboLanguage::CreateInstance('course', 'lms');
     if (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN) {
         $this->serverUrl = Get::rel_path('lms') . '/ajax.server.php?plf=lms&file=coursetableview&sf=table_view';
         $this->addFormatter("man_subscr", 'courseFormatters.p_man_subscr');
     } else {
         $this->serverUrl = Get::rel_path('lms') . '/ajax.adm_server.php?plf=lms&file=coursetableview&sf=table_view';
         $this->addFormatter("man_subscr", 'courseFormatters.man_subscr');
     }
     $this->addFormatter("classroom", 'courseFormatters.classroom');
     $this->addFormatter("certificate", 'courseFormatters.certificate');
     $this->addFormatter("competence", 'courseFormatters.competence');
     $this->addFormatter("menu", 'courseFormatters.menu');
     $this->addFormatter("mod", 'courseFormatters.mod');
     $array_columns = array();
     if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "code", "label" => $lang->def("_CODE"), "sortable" => true, "className" => 'min-cell', 'editor' => 'new YAHOO.widget.TextboxCellEditor({asyncSubmitter: saveData})');
         $array_columns[] = array("key" => "name", "label" => $lang->def("_COURSE_NAME"), "sortable" => true, 'editor' => 'new YAHOO.widget.TextboxCellEditor({asyncSubmitter: saveData})');
     } else {
         $array_columns[] = array("key" => "code", "label" => $lang->def("_CODE"), "sortable" => true, "className" => 'min-cell');
         $array_columns[] = array("key" => "name", "label" => $lang->def("_COURSE_NAME"), "sortable" => true);
     }
     //if(checkPerm('moderate', true, 'course', 'lms') || checkPerm('moderate', true, 'public_course_admin', 'lms'))
     $array_columns[] = array("key" => "waiting", "label" => $lang->def("_WAITING_USERS"), "className" => 'img-cell');
     if (checkPerm('subscribe', true, 'course', 'lms') || checkPerm('subscribe', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "subscriptions", "label" => Get::img('course/subscribe.png', $lang->def('_SUBSCRIBE')), "sortable" => true, "className" => 'img-cell', "formatter" => $this->getCellFormatter("man_subscr"));
     }
     if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "classroom", "label" => Get::img('course/classroom-cal.png', $lang->def('_CLASSROOM')), "className" => 'img-cell');
         $array_columns[] = array("key" => "certificate", "label" => Get::img('course/certificate.png', Lang::t('_CERTIFICATE', 'certificate', 'lms')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("certificate"));
         $array_columns[] = array("key" => "competence", "label" => Get::img('course/competences.png', Lang::t('_COMPETENCES', 'competences', 'lms')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("competence"));
         $array_columns[] = array("key" => "menu", "label" => Get::img('course/menu.png', $lang->def('_ASSIGN_MENU')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("menu"));
     }
     if (checkPerm('add', true, 'course', 'lms') || checkPerm('add', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "dup", "label" => Get::img('standard/dup.png', $lang->def('_MAKE_A_COPY')), "className" => 'img-cell');
     }
     if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "mod", "label" => Get::img('standard/edit.png', $lang->def('_MOD')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("mod"));
     }
     if (checkPerm('del', true, 'course', 'lms') || checkPerm('del', true, 'public_course_admin', 'lms')) {
         $array_columns[] = array("key" => "del", "label" => Get::img('standard/delete.png', $lang->def('_DEL')), "className" => 'img-cell', "formatter" => $this->getCellFormatter('delete'));
     }
     $this->columns = $array_columns;
     $this->fields = array("idCourse", "code", "name", "status", "waiting", "subscriptions", "classroom", "certificate", "competence", "menu", "dup", "mod", "del");
     $this->addOption('langs', array('_START' => $lang->def('_START'), '_PREV' => $lang->def('_PREV'), '_NEXT' => $lang->def('_NEXT'), '_END' => $lang->def('_END'), '_OF' => $lang->def('_OF'), 'MSG_EMPTY' => $lang->def('_EMPTY'), 'MSG_ERROR' => $lang->def('_SERVER_CONNECTION_ERROR'), 'MSG_LOADING' => $lang->def('_LOADING'), '_YES' => $lang->def('_CONFIRM'), '_NO' => $lang->def('_UNDO'), '_AREYOUSURE' => $lang->def('_AREYOUSURE'), '_DEL' => $lang->def('_DEL'), '_SERVER_CONNECTION_ERROR' => $lang->def('_SERVER_CONNECTION_ERROR')));
     if (!isset($_SESSION['course_category']['filter_status'])) {
         $_SESSION['course_category']['filter_status'] = array('c_category' => 0, 'c_filter' => '', 'c_flatview' => true, 'c_waiting' => false);
     } else {
         $filter =& $_SESSION['course_category']['filter_status'];
         if (!isset($filter['c_category'])) {
             $_SESSION['course_category']['filter_status']['c_category'] = 0;
         }
         if (!isset($filter['c_filter'])) {
             $_SESSION['course_category']['filter_status']['c_filter'] = '';
         }
         if (!isset($filter['c_flatview'])) {
             $_SESSION['course_category']['filter_status']['c_flatview'] = true;
         }
         if (!isset($filter['c_waiting'])) {
             $_SESSION['course_category']['filter_status']['c_waiting'] = '';
         }
     }
     $filter =& $_SESSION['course_category']['filter_status'];
     $this->addOption('baseUrl', 'index.php');
     $this->addOption('imageUrl', Get::tmpl_path('base') . 'images/');
     $this->addOption('initialFilter', array('c_category' => array('operator' => '', 'value' => $filter['c_category']), 'c_filter' => array('operator' => '', 'value' => $filter['c_filter']), 'c_flatview' => array('operator' => '', 'value' => $filter['c_flatview']), 'c_waiting' => array('operator' => '', 'value' => $filter['c_waiting'])));
     $this->addOption('deleteDialog', array('id' => 'idCourse', 'name' => 'name'));
 }
Beispiel #7
0
 /**
  * Construct the table drawer class
  * @param <type> $max_rows the maximum number of rows per page
  * @param <type> $caption the table caption
  * @param <type> $summary the tabel summary
  */
 public function __construct($max_rows = 10, $caption = '', $summary = '')
 {
     if (!$max_rows) {
         $max_rows = Get::sett('visuItem');
     }
     $this->table_style = 'table-view';
     $this->cols = 0;
     $this->max_rows = $max_rows;
     $this->cols_class = array();
     $this->table_caption = $caption;
     $this->table_summary = $summary;
     $this->table_head = array();
     $this->table_body = array();
     $this->table_foot = array();
     $this->add_action = array();
     $this->hide_over = false;
     $this->nav_bar = NULL;
     /*i need this for the transiction from old to new*/
     $this->rows = 0;
     $this->maxRowsAtTime = $max_rows;
     Util::get_css(Get::tmpl_path('base') . 'yui-skin/datatable.css', true, true);
 }
Beispiel #8
0
<div class="yui-t6">
	<div class="yui-b">
		<?php 
$this->widget('lms_block', array('zone' => 'right', 'link' => 'elearning/show', 'block_list' => $block_list));
?>
	</div>
	<div id="yui-main">
		<div class="yui-b">

			<div style="margin:1em;">
				<?php 
$this->widget('lms_tab', array('active' => 'elearning', 'close' => false));
echo '<div>';
foreach ($label as $id_common_label => $label_info) {
    echo '<div class="label_container">' . '<a class="no_decoration" href="index.php?r=elearning/show&amp;id_common_label=' . $id_common_label . '">' . '<span class="label_image_cont">' . '<img class="label_image" src="' . ($label_info['image'] !== '' ? $GLOBALS['where_files_relative'] . '/appLms/label/' . $label_info['image'] : Get::tmpl_path('base') . 'images/course/label_image.png') . '" />' . '</span>' . '<span class="label_info_con">' . '<span class="label_title">' . $label_info['title'] . '</span>' . ($label_info['description'] !== '' ? '<br /><span id="label_description_' . $id_common_label . '" class="label_description" title="' . html_entity_decode($label_info['description']) . '">' . $label_info['description'] . '</span>' : '') . '</span>' . '</a>' . '</div>';
}
?>
				</div><!-- Needed to close the label conteiner -->
				</div></div></div><!-- Needed to close the content of the widget manually -->
			</div>
		</div>
	</div>
	<div class="nofloat"></div>
	<div id="label_tooltip"></div>
</div>
<script type="text/javascript">
	var label_elements = YAHOO.util.Selector.query("span[id^=label_description_]");
	var label_tooltip = new YAHOO.widget.Tooltip("label_tooltip",{context: label_elements,width:'250px'});
</script>
Beispiel #9
0
?>
';
			smp_menu.style.display = 'none';
			adv_menu.style.display = 'block';
			UserManagement.useAdvancedFilter = true;
		}
	});
});

UserManagement.init({
	baseUrl: "<?php 
echo $this->link;
?>
",
	templatePath: "<?php 
echo Get::tmpl_path();
?>
",
	selectedOrgBranch: <?php 
echo (int) $selected_orgchart;
?>
,
	showDescendants: <?php 
echo $show_descendants ? 'true' : 'false';
?>
,
	showSuspended: <?php 
echo $show_suspended ? 'true' : 'false';
?>
,
	filterText: "<?php 
Beispiel #10
0
 /**
  * Display a fatal app message
  * @param <string> $msg  the errore message
  */
 public static function fatal($msg)
 {
     // empty output buffer
     @ob_end_clean();
     if (defined("IS_AJAX")) {
         // ajax request, json response
         $value = array('fatal' => $msg);
         require_once _base_ . '/lib/lib.json.php';
         $json = new Services_JSON();
         $msg = $json->encode($value);
     } else {
         // Browser request, html response
         $msg = '<p style="">' . '<p style="margin:4em auto;text-align:center;width:50%;padding: 14px 12px 14px 42px;font-weight: bold;font-size: 100%;background: url(' . Get::tmpl_path() . '/images/standard/error_32.png) no-repeat 8px 50% #FFFFDD;border:4px solid red;">' . $msg . '</p>' . '</p>';
     }
     die($msg);
 }
Beispiel #11
0
 if ($ma->currentCanAccessObj('mo_message')) {
     require_once $GLOBALS['where_framework'] . '/lib/lib.message.php';
     $msg = new Man_Message();
     $unread_num = $msg->getCountUnreaded(getLogUserId(), array(), '', true);
     $menu['all'][] = array('index.php?modname=message&amp;op=message&amp;sop=unregistercourse', Lang::t('_MESSAGES', 'menu_over') . ($unread_num ? ' <b class="num_notify">' . $unread_num . '</b>' : ''), false);
     $menu_i++;
 }
 // Customer help
 if ($ma->currentCanAccessObj('mo_help')) {
     $help_email = trim(Get::sett('customer_help_email', ''));
     $can_send_emails = !empty($help_email) ? true : false;
     $can_admin_settings = checkRole('/framework/admin/setting/view', true);
     if ($can_send_emails) {
         cout(Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true), 'scripts');
         cout(Util::get_js(Get::rel_path('lms') . '/modules/customer_help/customer_help.js', true), 'scripts');
         cout('<script type="text/javascript">' . ' var CUSTOMER_HELP_AJAX_URL = "ajax.server.php?mn=customer_help&plf=lms&op=getdialog"; ' . ' var ICON_LOADING = "' . Get::tmpl_path() . 'images/standard/loadbar.gif"; ' . ' var LANG = new LanguageManager({' . '	_CONFIRM: "' . Lang::t('_CONFIRM') . '",' . '	_UNDO: "' . Lang::t('_UNDO') . '",' . '	_COURSE_NAME: "' . Lang::t('_COURSE_NAME', 'course') . '",' . '	_VAL_COURSE_NAME: "' . (isset($GLOBALS['course_descriptor']) ? $GLOBALS['course_descriptor']->getValue('name') : "") . '",' . '	_DLG_TITLE: "' . Lang::t('_CUSTOMER_HELP', 'customer_help') . '",' . '	_LOADING: "' . Lang::t('_LOADING') . '"' . '}); ' . '</script>', 'scripts');
         $menu['all'][] = array('#', Lang::t('_CUSTOMER_HELP', 'customer_help'), false);
         $customer_help = ++$menu_i;
         $setup_menu .= " oMenuBar.getItem({$customer_help}).subscribe('click', CustomerHelpShowPopUp);";
     } else {
         if ($can_admin_settings) {
             $menu['all'][] = array('../appCore/index.php?r=adm/setting/show', '<i>(' . Lang::t('_CUSTOMER_HELP', 'customer_help') . ': ' . Lang::t('_SET', 'standard') . ')</i>', false);
         }
     }
 }
 // Menu for the public admin
 if ($user_level == ADMIN_GROUP_PUBLICADMIN && !empty($menu['public_admin'])) {
     $menu['all'][] = array('#', Lang::t('_PUBLIC_ADMIN_AREA', 'menu_over'), 'public_admin');
     $menu_i++;
 }
 // Link for the administration
Beispiel #12
0
"
				alt="<?php 
        echo Util::purge($course['name']);
        ?>
" />
		</div>
		<?php 
    }
    ?>
		<?php 
    if ($course['use_logo_in_courselist'] && !$course['img_course']) {
        ?>
		<div class="logo_container">
			<img class="clogo cnologo"
				 src="<?php 
        echo Get::tmpl_path() . 'images/course/course_nologo.png';
        ?>
"
				alt="<?php 
        echo Util::purge($course['name']);
        ?>
" />
		</div>
		<?php 
    }
    ?>

		<div class="info_container">
		<h2>
			<?php 
    if ($course['can_enter']['can']) {
Beispiel #13
0
            $sn = "docebo_core";
            $user_session = 'admin_area';
        }
        break;
}
/* session_name($sn);
session_start();

// load regional setting

// load current user from session
require_once(_base_.'/lib/lib.user.php');
$GLOBALS['current_user'] =& DoceboUser::createDoceboUserFromSession($user_session); */
// Utils and so on
//require_once($GLOBALS['where_framework'].'/lib/lib.php');
// load standard language module and put it global
$glang =& DoceboLanguage::createInstance('standard', 'framework');
$glang->setGlobal();
/*require_once(_base_.'/lib/lib.platform.php');*/
// create instance of StdPageWriter
StdPageWriter::createInstance();
//require_once($GLOBALS['where_framework'].'/lib/lib.preoperation.php');
$GLOBALS["template_path"] = Get::tmpl_path() . 'style/';
$GLOBALS["img_path"] = Get::tmpl_path() . 'images/chat/';
$GLOBALS['page']->add('<link href="' . $GLOBALS["template_path"] . 'chat.css" rel="stylesheet" type="text/css" />' . "\n", 'page_head');
$out =& $GLOBALS["page"];
$out->setWorkingZone("content");
$lang =& DoceboLanguage::createInstance('htmlframechat', 'scs');
require_once $GLOBALS["where_scs"] . '/lib/lib.html_chat_common.php';
require_once dirname(__FILE__) . '/functions.php';
$GLOBALS["chat_emo"] = new HtmlChatEmoticons_FrameChat();
Beispiel #14
0
function initDialogs()
{
    require_once _base_ . '/lib/lib.json.php';
    Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
    $json = new Services_JSON();
    $script = 'YAHOO.dialogConstants.setProperties({' . 'CONFIRM: ' . $json->encode(Lang::t('_CONFIRM', 'standard')) . ', ' . 'UNDO: ' . $json->encode(Lang::t('_UNDO', 'standard')) . ', ' . 'CLOSE: ' . $json->encode(Lang::t('_CLOSE', 'standard')) . ', ' . 'LOADING: ' . $json->encode(Lang::t('_LOADING', 'standard')) . ', ' . 'ERROR: ' . $json->encode(Lang::t('_OPERATION_FAILURE', 'standard')) . ', ' . 'SERVER_ERROR: ' . $json->encode(Lang::t('_CONNECTION_ERROR', 'standard')) . ', ' . 'loadingIcon: ' . $json->encode(Get::tmpl_path() . 'images/standard/loadbar.gif') . ', ' . 'smallLoadingIcon: ' . $json->encode(Get::tmpl_path() . 'images/standard/loading_circle.gif') . ', ' . 'authentication: "' . Util::getSignature() . '" ' . '});' . "\n";
    cout('<script type="text/javascript">' . $script . '</script>', 'scripts');
}
Beispiel #15
0
             $keepalivetmo = $gc_maxlifetime - 60;
         } else {
             $keepalivetmo = $gc_maxlifetime - 15;
             // second
         }
     }
 }
 header("Content-Type: text/html; charset=utf-8");
 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN"' . "\n";
 echo '    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
 echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
 echo '<head>';
 echo '	<title>' . $lo_title . '</title>';
 echo '	<link href="' . Get::tmpl_path() . '/style/lms-scormplayer.css" rel="stylesheet" type="text/css" />';
 if (trim($playertemplate) != '') {
     echo '	<link href="' . Get::tmpl_path() . '/player_scorm/' . $playertemplate . '/def_style.css" rel="stylesheet" type="text/css" />';
 }
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/prototype.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/ScormTypes.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/ScormCache.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/ScormApi.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/player.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" src="' . Get::rel_path('lms') . '/modules/scorm/StdPlayer.js"></SCRIPT>' . "\n";
 echo '<SCRIPT type="text/javascript" >' . "\n";
 echo '<!--' . "\n";
 echo "var playerConfig = {\n";
 echo " autoplay: '{$autoplay}',\n";
 echo " backurl: '{$back_url}',\n";
 echo " xmlTreeUrl: '{$xmlTreeUrl}',\n";
 echo " host: '{$_SERVER['HTTP_HOST']}',\n";
 echo " lms_url: '{$lms_url}',\n";
Beispiel #16
0
					}
				},
				failure: function() { setDialogErrorMessage("<?php 
echo Lang::t('_CONNECTION_ERROR', 'standard');
?>
"); },
				scope: addDialog
			};

			addDialog.setHeader("<?php 
echo Lang::t('_LOADING', 'subscribe');
?>
");
			addDialog.setBody('<div id="admin_rules_table_addDialog"></div>'
				+'<div class="align_center"><img src="<?php 
echo Get::tmpl_path() . 'images/standard/loadbar.gif';
?>
" /></div>');
			addDialog.render(document.body);
			addDialog.show();
			var postdata = "";
			YAHOO.util.Connect.asyncRequest("POST", this.href, {
				success: function(o) {
					var res = YAHOO.lang.JSON.parse(o.responseText);
					if (res.success) {
						addDialog.setHeader(res.header);
						addDialog.setBody('<div id="admin_rules_table_addDialog"></div>'+res.body);
						addDialog.center();
						eval(res.script);
					} else {
						setDialogErrorMessage(res.message ? res.message : "<?php 
Beispiel #17
0
 public function getCourseList($type = '', $page = 1)
 {
     require_once _lms_ . '/lib/lib.catalogue.php';
     $cat_man = new Catalogue_Manager();
     $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
     switch ($type) {
         case 'elearning':
             $filter = " AND course_type = '" . $type . "'";
             $base_link = 'index.php?r=catalog/elearningCourse&amp;page=' . $page;
             if (count($user_catalogue) > 0) {
                 $courses = array();
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 $filter .= " AND idCourse IN (" . implode(',', $courses) . ")";
             }
             break;
         case 'classroom':
             $filter = " AND course_type = '" . $type . "'";
             $base_link = 'index.php?r=catalog/classroomCourse&amp;page=' . $page;
             if (count($user_catalogue) > 0) {
                 $courses = array();
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 $filter .= " AND idCourse IN (" . implode(',', $courses) . ")";
             }
             break;
         case 'new':
             $filter = " AND create_date >= '" . date('Y-m-d', mktime(0, 0, 0, date('m'), (int) date('d') - 7, date('Y'))) . "'";
             $base_link = 'index.php?r=catalog/newCourse&amp;page=' . $page;
             if (count($user_catalogue) > 0) {
                 $courses = array();
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 $filter .= " AND idCourse IN (" . implode(',', $courses) . ")";
             }
             break;
         case 'catalogue':
             $id_catalogue = Get::req('id_cata', DOTY_INT, '0');
             $base_link = 'index.php?r=catalog/catalogueCourse&amp;id_cat=' . $id_catalogue . '&amp;page=' . $page;
             $catalogue_course =& $cat_man->getCatalogueCourse($id_catalogue);
             $filter = " AND idCourse IN (" . implode(',', $catalogue_course) . ")";
             break;
         default:
             $filter = '';
             $base_link = 'index.php?r=catalog/allCourse&amp;page=' . $page;
             if (count($user_catalogue) > 0) {
                 $courses = array();
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 $filter .= " AND idCourse IN (" . implode(',', $courses) . ")";
             }
             break;
     }
     if (count($user_catalogue) == 0 && Get::sett('on_catalogue_empty', 'off') == 'off') {
         $filter = " AND 0 ";
         //query won't return any results with this setting
     }
     $limit = ($page - 1) * Get::sett('visuItem');
     $id_cat = Get::req('id_cat', DOTY_INT, 0);
     $query = "SELECT *" . " FROM %lms_course" . " WHERE status NOT IN (" . CST_PREPARATION . ", " . CST_CONCLUDED . ", " . CST_CANCELLED . ")" . " AND course_type <> 'assessment'" . " AND (                       \n\t\t\t\t\t\t(can_subscribe=2 AND (sub_end_date = '0000-00-00' OR sub_end_date >= '" . date('Y-m-d') . "') AND (sub_start_date = '0000-00-00' OR '" . date('Y-m-d') . "' >= sub_start_date)) OR\n                        (can_subscribe=1)\n\t\t\t\t\t) " . $filter . ($id_cat > 0 ? " AND idCategory = " . (int) $id_cat : '') . " ORDER BY name" . " LIMIT " . $limit . ", " . Get::sett('visuItem');
     $result = sql_query($query);
     $html = '';
     $path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/';
     while ($row = sql_fetch_assoc($result)) {
         $action = '';
         if ($row['course_type'] === 'classroom') {
             $additional_info = '';
             $classrooms = $this->classroom_man->getCourseDate($row['idCourse'], false);
             $action = '<div class="catalog_action" id="action_' . $row['idCourse'] . '">';
             if (count($classrooms) == 0) {
                 $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_EDITIONS', 'catalogue') . '</p>';
             } else {
                 //Controllo che l'utente non sia iscritto a tutte le edizioni future
                 $date_id = array();
                 $user_classroom = $this->classroom_man->getUserDates(Docebo::user()->getIdSt());
                 $classroom_full = $this->classroom_man->getFullDateForCourse($row['idCourse']);
                 $classroom_not_confirmed = $this->classroom_man->getNotConfirmetDateForCourse($row['idCourse']);
                 $overbooking_classroom = $this->classroom_man->getOverbookingDateForCourse($row['idCourse']);
                 foreach ($classrooms as $classroom_info) {
                     $date_id[] = $classroom_info['id_date'];
                 }
                 reset($classrooms);
                 // for all the dates we will remove the one in which the user is subscribed and the classroom not confirmed
                 $control = array_diff($date_id, $user_classroom, $classroom_not_confirmed);
                 if (count($control) == 0) {
                     if (!empty($overbooking_classroom)) {
                         $_text = $row['selling'] == 0 ? Lang::t('_SUBSCRIBE', 'catalogue') : Lang::t('_ADD_TO_CART', 'catalogue');
                         $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'' . ($row['selling'] == 0 ? '0' : '1') . '\')" ' . ' title="' . $_text . '"><p class="can_subscribe">' . $_text . '<br />' . '(' . Lang::t('_SUBSCRIBE_WITH_OVERBOOKING', 'catalogue') . ': ' . count($overbooking_classroom) . ')</p>' . '</a>';
                     } else {
                         //$action .= '<p class="cannot_subscribe">'.Lang::t('_NO_EDITIONS', 'catalogue').'</p>';
                         /* FORMA - INSERITO BOTTONE ENTRA
                         							if (count($user_classroom) > 0) {
                         								$action .= '<p class="subscribed">'.Lang::t('_USER_STATUS_SUBS', 'catalogue').'</p>';
                         							} else {
                         								$action .= '<p class="cannot_subscribe">'.Lang::t('_NO_AVAILABLE_EDITIONS', 'catalogue').'</p>';
                         							}
                         */
                         if (count($user_classroom) > 0) {
                             $action .= '<a href="index.php?modname=course&op=aula&idCourse=' . $row['idCourse'] . ' "' . ' title="' . $_text . '"><p class="subscribed">' . Lang::t('_USER_STATUS_ENTER', 'catalogue') . '</p>' . '</a>';
                         } else {
                             $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_AVAILABLE_EDITIONS', 'catalogue') . '</p>';
                         }
                     }
                 } else {
                     if ($row['selling'] == 0) {
                         switch ($row['subscribe_method']) {
                             case 2:
                                 // free
                                 $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>';
                                 break;
                             case 1:
                                 // moderate
                                 $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_COURSE_S_MODERATE', 'catalogue') . '</p></a>';
                                 break;
                             case 0:
                                 // only admin
                                 $action .= '<p class="cannot_subscribe">' . Lang::t('_COURSE_S_GODADMIN', 'catalogue') . '</p>';
                                 break;
                         }
                     } else {
                         $classroom_in_chart = array();
                         if (isset($_SESSION['lms_cart'][$row['idCourse']]['classroom'])) {
                             $classroom_in_chart = $_SESSION['lms_cart'][$row['idCourse']]['classroom'];
                         }
                         $control = array_diff($control, $classroom_in_chart);
                         if (count($control) == 0) {
                             $action .= '<p class="subscribed">' . Lang::t('_ALL_EDITION_BUYED', 'catalogue') . '</p>';
                         } else {
                             $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>';
                         }
                     }
                 }
             }
             $action .= '</div>';
         } elseif ($row['course_edition'] == 1) {
             $additional_info = '';
             $editions = $this->edition_man->getEditionAvailableForCourse(Docebo::user()->getIdSt(), $row['idCourse']);
             $action = '<div class="catalog_action" id="action_' . $row['idCourse'] . '">';
             if (count($editions) == 0) {
                 $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_EDITIONS', 'catalogue') . '</p>';
             } else {
                 if ($row['selling'] == 0) {
                     $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>';
                 } else {
                     $edition_in_chart = array();
                     if (isset($_SESSION['lms_cart'][$row['idCourse']]['editions'])) {
                         $edition_in_chart = $_SESSION['lms_cart'][$row['idCourse']]['editions'];
                     }
                     $editions = array_diff($editions, $edition_in_chart);
                     if (count($editions) == 0) {
                         $action .= '<p class="subscribed">' . Lang::t('_ALL_EDITION_BUYED', 'catalogue') . '</p>';
                     } else {
                         $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>';
                     }
                 }
             }
             $action .= '</div>';
         } else {
             // standard elearning course without editions
             $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = '" . $row['idCourse'] . "'";
             list($enrolled) = sql_fetch_row(sql_query($query));
             $row['enrolled'] = $enrolled;
             $row['create_date'] = Format::date($row['create_date'], 'date');
             $additional_info = '<p class="course_support_info">' . Lang::t('_COURSE_INTRO', 'course', array('[course_type]' => $row['course_type'], '[create_date]' => $row['create_date'], '[enrolled]' => $row['enrolled'], '[course_status]' => Lang::t($this->cstatus[$row['status']], 'course'))) . '</p>';
             $query = "SELECT status, waiting, level" . " FROM %lms_courseuser" . " WHERE idCourse = " . $row['idCourse'] . " AND idUser = "******"catalog_action" id="action_' . $row['idCourse'] . '">';
             if (sql_num_rows($result_control) > 0) {
                 // the user is enrolled in some way
                 list($status, $waiting, $level) = sql_fetch_row($result_control);
                 if ($waiting) {
                     $action .= '<p class="subscribed">' . Lang::t('_WAITING', 'catalogue') . '</p>';
                 } else {
                     // #1995 Grifo multimedia LR
                     $query_lo = "select org.idOrg, org.idCourse, org.objectType from (SELECT o.idOrg, o.idCourse, o.objectType \n          \tFROM %lms_organization AS o WHERE o.objectType != '' AND o.idCourse IN (" . $row['idCourse'] . ") ORDER BY o.path) as org \n          \tGROUP BY org.idCourse";
                     $result_lo = sql_query($query_lo);
                     list($id_org, $id_course, $obj_type) = sql_fetch_row($result_lo);
                     $str_rel = "";
                     if ($obj_type == "scormorg" && $level <= 3 && $row['direct_play'] == 1) {
                         $str_rel = " rel='lightbox'";
                     }
                     $action .= '<a href="index.php?modname=course&op=aula&idCourse=' . $row['idCourse'] . ' "' . ' title="' . $_text . '"   ' . $str_rel . '><p class="subscribed">' . Lang::t('_USER_STATUS_ENTER', 'catalogue') . '</p>' . '</a><br>';
                 }
             } else {
                 // course is not enrolled
                 $course_full = false;
                 if ($row['max_num_subscribe'] != 0) {
                     $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = " . $row['idCourse'];
                     list($control) = sql_fetch_row(sql_query($query));
                     if ($control >= $row['max_num_subscribe']) {
                         // the course have reached the maximum number of subscription
                         $action .= '<p class="cannot_subscribe">' . Lang::t('_MAX_NUM_SUBSCRIBE', 'catalogue') . ' - ' . $row['max_num_subscribe'] . '</p>';
                         $course_full = true;
                     }
                 }
                 if (!$course_full) {
                     if ($row['selling'] == 0) {
                         switch ($row['subscribe_method']) {
                             case 2:
                                 // free
                                 $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>';
                                 break;
                             case 1:
                                 // moderate
                                 $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'0\')" title="' . Lang::t('_COURSE_S_MODERATE', 'course') . '"><p class="can_subscribe">' . Lang::t('_COURSE_S_MODERATE', 'catalogue') . '</p></a>';
                                 break;
                             case 0:
                                 // only admin
                                 $action .= '<p class="cannot_subscribe">' . Lang::t('_COURSE_S_GODADMIN', 'catalogue') . '</p>';
                                 break;
                         }
                     } else {
                         $date_in_chart = array();
                         if (isset($_SESSION['lms_cart'][$row['idCourse']])) {
                             $action .= '<p class="subscribed">' . Lang::t('_COURSE_IN_CART', 'catalogue') . '</p>';
                         } else {
                             $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>';
                         }
                     }
                 }
             }
             $action .= '</div>';
         }
         $html .= '<div class="dash-course">' . ($row['use_logo_in_courselist'] && $row['img_course'] ? '<div class="logo_container"><img class="clogo" src="' . $path_course . $row['img_course'] . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . ($row['use_logo_in_courselist'] && !$row['img_course'] ? '<div class="logo_container"><img class="clogo cnologo" src="' . Get::tmpl_path() . 'images/course/course_nologo.png' . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . '<div class="info_container">' . '<h2>' . ($row['lang_code'] != 'none' ? Get::img('language/' . strtolower($row['lang_code']) . '.png', $row['lang_code']) . ' ' : '') . $row['name'] . '</h2>' . $additional_info . '<p class="course_support_info">' . $row['description'] . '</p>' . '<p class="course_support_info">' . ($row['course_demo'] ? '<a href="index.php?r=catalog/downloadDemoMaterial&amp;course_id=' . $row['idCourse'] . '" class="ico-wt-sprite subs_download"><span>' . Lang::t('_COURSE_DEMO', 'course') . '</span></a>' : '') . '</p>' . '<p class="course_support_info">' . ($row['code'] ? '<i style="font-size:.88em">[' . $row['code'] . ']</i>' : '') . '</p>' . $action . '<div class="nofloat"></div>' . '</div>' . '</div>';
     }
     if (sql_num_rows($result) <= 0) {
         $html = '<p>' . Lang::t('_NO_CONTENT', 'standard') . '</p>';
     }
     return $html;
 }
 function getUserFunctionalRoles(&$fncroles_data)
 {
     $tb = new Table(0, Lang::t('_FUNCTIONAL_ROLE', 'profile'), Lang::t('_FUNCTIONAL_ROLE', 'profile'));
     $tb->addHead(array(Lang::t('_NAME', 'fncroles'), Lang::t('_SCORE', 'fncroles'), '<img src="' . Get::tmpl_path('base') . 'images/blank.png" />'), array('', 'img-cell', 'img-cell'));
     $icon_flag_ok = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MEET', 'fncroles') . '</span></span>';
     $icon_flag_no = '<span class="ico-sprite fd_notice"><span>' . Lang::t('_NOT_SATISFIED', 'fncroles') . '</span></span>';
     if (count($fncroles_data) > 0) {
         foreach ($fncroles_data as $id_fncrole => $value) {
             $obt = (int) $value->competences_obtained;
             $req = (int) $value->competences_required;
             $line = array();
             $line[] = $value->name;
             $line[] = '<b' . ($obt < $req ? ' class="red"' : '') . '>' . $obt . ' / ' . $req . '</b>';
             $line[] = $obt < $req ? $icon_flag_no : $icon_flag_ok;
             $tb->addBody($line);
         }
     } else {
         $line = array(array('colspan' => 3, 'value' => Lang::t('_NO_CONTENT', 'fncroles')));
         $tb->addBody($line);
     }
     return $tb->getTable();
 }
Beispiel #19
0
/**
 * @return string the relative url of templates folder
 */
function getPathTemplate($platform = false)
{
    return Get::tmpl_path($platform);
    //return getRelativeBasePathTemplate($platform).getTemplate().'/';
}
Beispiel #20
0
	}
}



Users.init({
	idFncrole: <?php 
echo (int) $id_fncrole;
?>
,
	filterText: "<?php 
echo isset($filter_text) ? $filter_text : "";
?>
",
	imagesPath: "<?php 
echo Get::tmpl_path('base');
?>
",
	langs: {
		_AREYOUSURE: "<?php 
echo Lang::t('_AREYOUSURE', 'standard');
?>
",
		_DEL: "<?php 
echo Lang::t('_DEL', 'standard');
?>
",
		_GAP_ANALYSIS: "<?php 
echo Lang::t('_GAP_ANALYSIS', 'fncroles');
?>
",
 public function getCourseList($type = '', $page = 1)
 {
     require_once _lms_ . '/lib/lib.catalogue.php';
     $cat_man = new Catalogue_Manager();
     $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
     $filter = '';
     switch ($type) {
         case 'elearning':
             $filter = " AND course_type = '" . $type . "'";
             break;
         case 'classroom':
             $filter = " AND course_type = '" . $type . "'";
             break;
         case 'edition':
             $filter = " AND course_edition = 1";
             break;
         case 'new':
             $filter = " AND create_date >= '" . date('Y-m-d', mktime(0, 0, 0, date('m'), (int) date('d') - 7, date('Y'))) . "'";
             break;
         case 'catalogue':
             $id_catalogue = Get::req('id_cata', DOTY_INT, '0');
             $catalogue_course =& $cat_man->getCatalogueCourse($id_catalogue);
             $filter = " AND idCourse IN (" . implode(',', $catalogue_course) . ")";
             break;
         default:
             break;
     }
     $filter .= " AND show_rules = 0";
     $login_link = '<a href="index.php">' . Lang::t('_LOG_IN', 'login') . '</a>';
     $signin_link = '<a href="index.php?modname=login&op=register">' . Lang::t('_SIGN_IN', 'login') . '</a>';
     require_once _lib_ . '/lib.usermanager.php';
     $option = new UserManagerOption();
     $register_type = $option->getOption('register_type');
     $limit = ($page - 1) * Get::sett('visuItem');
     $id_cat = Get::req('id_cat', DOTY_INT, 0);
     $query = "SELECT *" . " FROM %lms_course" . " WHERE status NOT IN (" . CST_PREPARATION . ", " . CST_CONCLUDED . ", " . CST_CANCELLED . ")" . " AND course_type <> 'assessment'" . " AND (" . " date_end = '0000-00-00'" . " OR date_end > '" . date('Y-m-d') . "'" . " )" . $filter . ($id_cat > 0 ? " AND idCategory = " . (int) $id_cat : '') . " ORDER BY name" . " LIMIT " . $limit . ", " . Get::sett('visuItem');
     $result = sql_query($query);
     $html = '';
     $path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/';
     while ($row = sql_fetch_assoc($result)) {
         $action = '';
         if ($row['course_type'] === 'classroom') {
             $additional_info = '';
             $classrooms = $this->classroom_man->getCourseDate($row['idCourse'], false);
             if (count($classrooms) > 0) {
                 $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '</p></a>' . '</div>';
             }
         } elseif ($row['course_edition'] == 1) {
             $additional_info = '';
             $editions = $this->edition_man->getEditionAvailableForCourse(Docebo::user()->getIdSt(), $row['idCourse']);
             if (count($editions) > 0) {
                 $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '</p></a>' . '</div>';
             }
         } else {
             // standard elearning course without editions
             $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = '" . $row['idCourse'] . "'";
             list($enrolled) = sql_fetch_row(sql_query($query));
             $row['enrolled'] = $enrolled;
             $row['create_date'] = Format::date($row['create_date'], 'date');
             $additional_info = '<p class="course_support_info">' . Lang::t('_COURSE_INTRO', 'course', array('[course_type]' => $row['course_type'], '[create_date]' => $row['create_date'], '[enrolled]' => $row['enrolled'], '[course_status]' => Lang::t($this->cstatus[$row['status']], 'course'))) . '</p>';
             $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<p class="can_subscribe">' . str_replace(array('[login]', '[signin]'), array($login_link, $signin_link), $register_type === 'self' || $register_type === 'self_optin' || $register_type === 'moderate' ? Lang::t('_REGISTER_FOR_COURSE', 'login') : Lang::t('_REGISTER_FOR_COURSE_NO_REG', 'login')) . '</p>' . '</div>';
         }
         $html .= '<div class="dash-course">' . ($row['use_logo_in_courselist'] && $row['img_course'] ? '<div class="logo_container"><img class="clogo" src="' . $path_course . $row['img_course'] . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . ($row['use_logo_in_courselist'] && !$row['img_course'] ? '<div class="logo_container"><img class="clogo cnologo" src="' . Get::tmpl_path() . 'images/course/course_nologo.png' . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . '<div class="info_container">' . '<h2>' . ($row['lang_code'] != 'none' ? Get::img('language/' . strtolower($row['lang_code']) . '.png', $row['lang_code']) : '') . $row['name'] . '</h2>' . $additional_info . '<p class="course_support_info">' . $row['description'] . '</p>' . '<p class="course_support_info">' . ($row['course_demo'] ? '<a href="index.php?r=homecatalogue/downloadDemoMaterial&amp;course_id=' . $row['idCourse'] . '" class="ico-wt-sprite subs_download"><span>' . Lang::t('_COURSE_DEMO', 'course') . '</span></a>' : '') . '</p>' . '<p class="course_support_info">' . ($row['code'] ? '<i style="font-size:.88em">[' . $row['code'] . ']</i>' : '') . '</p>' . $action . '<div class="nofloat"></div>' . '</div>' . '</div>';
     }
     if (sql_num_rows($result) <= 0) {
         $html = '<p>' . Lang::t('_NO_CONTENT', 'standard') . '</p>';
     }
     return $html;
 }
Beispiel #22
0
 /**
  * Return html code and resolved path for an image
  * @param <string> $src the img[src] attribute, the path can be absolute or relative to the images/ folder of the current template
  * @param <string> $alt the img[alt] attribute
  * @param <string> $class_name the img[class] attribute
  * @param <string> $extra some extra code that you need to add into the image
  * @param <bool> $is_abspath if true the src is assumed absolute, if false the relative path is added to the src attr
  * @return <string> the html code (sample <img ... />)
  */
 public static function img($src, $alt = false, $class_name = false, $extra = false, $is_abspath = false)
 {
     // where are we ?
     if (!$is_abspath) {
         $src = Get::tmpl_path('base') . 'images/' . $src;
     }
     return '<img src="' . $src . '" ' . 'alt="' . ($alt ? $alt : substr($src, 0, -4)) . '" ' . 'title="' . ($alt ? $alt : substr($src, 0, -4)) . '" ' . ($class_name != false ? 'class="' . $class_name . '" ' : '') . ($extra != false ? $extra . ' ' : '') . '/>';
 }
Beispiel #23
0
<?php 
//result of the selection
if ($use_form_input && $separate_input) {
    echo '<input type="hidden" id="userselector_input_' . $id . '_user" name="userselector_input[' . $id . '][user]" value="" />';
}
//table configuration's parameters
$dyn_labels = array();
$dyn_filter = array();
for ($i = 0; $i < $num_var_fields; $i++) {
    $label = '<select id="user_dyn_field_selector_' . $id . '_' . $i . '" name="_dyn_field_selector[' . $i . ']">';
    foreach ($fieldlist as $key => $value) {
        $label .= '<option value="' . $key . '"' . ($selected[$i] == $key ? ' selected="selected"' : '') . '>' . $value . '</option>';
    }
    $label .= '</select>';
    $label .= '<a id="user_dyn_field_sort_' . $id . '_' . $i . '" href="javascript:;">';
    $label .= '<img src="' . Get::tmpl_path() . 'images/standard/sort.png" title="' . Lang::t('_SORT', 'standard') . '" alt="' . Lang::t('_SORT', 'standard') . '" />';
    $label .= '</a>';
    $dyn_filter[$i] = $selected[$i];
    $dyn_labels[$i] = $label;
}
//set columns
$columns_arr = array();
$columns_arr[] = array('key' => 'userid', 'label' => Lang::t('_USERNAME'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter');
$columns_arr[] = array('key' => 'lastname', 'label' => Lang::t('_LASTNAME'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter');
$columns_arr[] = array('key' => 'firstname', 'label' => Lang::t('_FIRSTNAME'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter');
for ($i = 0; $i < $num_var_fields; $i++) {
    $columns_arr[] = array('key' => '_dyn_field_' . $i, 'label' => $dyn_labels[$i]);
}
if ($use_suspended) {
    $columns_arr[] = array('key' => 'valid', 'label' => '<span class="ico-sprite subs_unlocked"><span>' . Lang::t('_SUSPEND', 'standard') . '</span></span>', 'formatter' => $_varname . '.suspendFormatter', 'className' => 'img-cell');
}