public function show()
 {
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     $rmodel = new AdminrulesAdm();
     switch (Get::req('res', DOTY_ALPHANUM, "")) {
         case 'ok_ins':
             UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard'));
             break;
         case 'err_ins':
             UIFeedback::error(Lang::t('_OPERATION_FAILURE', 'standard'));
             break;
         default:
             if ($rmodel->totalGroup() <= 0) {
                 UIFeedback::notice(Lang::t('_NO_PROFILE_SET', 'adminrules'));
             }
             break;
     }
     $rules_list_js = "";
     if ($this->permissions['assign_profile']) {
         $rules = $rmodel->getGroupForDropdown();
         $rules_list_js .= '[';
         $first = true;
         foreach ($rules as $idst => $label) {
             $rules_list_js .= ($first ? '' : ',') . '{"label":"' . $label . '","value":' . $idst . '}';
             if ($first) {
                 $first = false;
             }
         }
         $rules_list_js .= ']';
     }
     $this->render('show', array('filter_text' => $this->_getSessionValue('filter', ""), 'permissions' => $this->permissions, 'rules_list_js' => $rules_list_js));
 }
Exemplo n.º 2
0
 function init()
 {
     YuiLib::load(array('json' => 'json-min.js', 'container' => 'container_core-min.js', 'menu' => 'menu-min.js', 'button' => 'button-min.js', 'treeview' => 'treeview-min.js'), array('assets/skins/sam' => 'skin.css'));
     cout(Util::get_css('base-folder-tree.css'), 'page_head');
     cout(Util::get_js('appLms/lib/category/lib.categorytree.js'), 'page_head');
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
 }
Exemplo n.º 3
0
    function setupJs($tags_id, $private_tags = '')
    {
        if (!$this->_use_tag) {
            return '';
        }
        $lang =& DoceboLanguage::createInstance('tags', 'framework');
        $this->tags_id = $tags_id;
        YuiLib::load(array('autocomplete' => 'autocomplete-min.js', 'selector' => 'selector-beta-min.js'), array('assets/skins/sam' => 'autocomplete.css'));
        Util::get_js(Get::rel_path('adm') . '/lib/lib.tags.js', true, true);
        // setup some thing that we need in the tag editor
        $GLOBALS['page']->add('<script type="text/javascript">' . "\n" . 'var tag_params ={
			resource_type: "' . $this->resource_type . '", 
			addr: "' . $GLOBALS['where_framework_relative'] . '/ajax.adm_server.php",
			query_append: "file=tags",
			query:"' . $tags_id . '",
			private_query:"' . $private_tags . '",
			popular_tags: "' . addslashes(implode(', ', $this->getPopularTag())) . '",
			user_tags: "' . addslashes(implode(', ', $this->getUserPopularTag(getLogUserId()))) . '", 
			lang: { tags: "' . addslashes($lang->def("_TAGS")) . '",
				tips: "' . addslashes($lang->def("_TAGS_TIPS")) . '",
				popular_tags: "' . addslashes($lang->def("_POPULAR")) . '",
				user_tags: "' . addslashes($lang->def("_YOURS")) . '",
				save: "' . addslashes($lang->def("_SAVE")) . '",
				undo: "' . addslashes($lang->def("_UNDO")) . '",
				add_tags: "' . addslashes($lang->def("_ADD_TAGS")) . '",
				update_tags: "' . addslashes($lang->def("_MOD")) . '"
			}
		};' . "\n" . '</script>', 'scripts');
    }
Exemplo n.º 4
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;
     }
 }
Exemplo n.º 5
0
    public function getAddEditForm($form_url, $data)
    {
        $this->loadJs();
        $res = '';
        $e = false;
        if ($data['rule_id'] > 0) {
            $e = true;
        }
        $res .= Form::openForm('main_form', $form_url);
        $res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield">
					<a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_competence"></div>
					</div>
				</div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield">
					<a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_course"></div>
					</div>
				</div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace();
        $res .= Form::closeForm();
        $res .= '<script type="text/javascript">
			var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '";
			var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '";
			var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"};
			var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . ';
			var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . ';
			</script>';
        return $res;
    }
Exemplo n.º 6
0
/**
 * create a istance of a specified class of a module
 * automaticaly include the file that contains the class of the module
 *
 * @param string	$module_name 	the name og the module to istance
 * @param string 	$class_name 	the name of the class relative to the module, if not passed is 
 *									extracted from the $module_name
 * 
 * @return mixed 	the class istance
 */
function createModule($module_name, $class_name = NULL)
{
    $module_name = preg_replace('/[^a-zA-Z0-9\\-\\_]+/', '', $module_name);
    if (file_exists(_base_ . '/customscripts/' . _folder_lms_ . '/class.module/class.' . $module_name . '.php') && Get::cfg('enable_customscripts', false) == true) {
        include_once _base_ . '/customscripts/' . _folder_lms_ . '/class.module/class.' . $module_name . '.php';
        if ($class_name === NULL) {
            $class_name = 'Module_' . ucfirst($module_name);
        }
    } else {
        if (file_exists(dirname(__FILE__) . '/../class.module/class.' . $module_name . '.php')) {
            include_once dirname(__FILE__) . '/../class.module/class.' . $module_name . '.php';
            if ($class_name === NULL) {
                $class_name = 'Module_' . ucfirst($module_name);
            }
        } else {
            include_once dirname(__FILE__) . '/../class.module/class.definition.php';
            $class_name = 'LmsModule';
        }
    }
    if (Get::cfg('enable_plugins', false)) {
        if (checkIfPlugin($module_name) == "plugin") {
            include_once Get::rel_path('plugins') . '/' . $module_name . '/class/class.' . $module_name . '.php';
            $class_name = 'Module_' . ucfirst($module_name);
        }
    }
    $module_cfg = new $class_name();
    return $module_cfg;
}
Exemplo n.º 7
0
function drawCalendar()
{
    checkPerm('view');
    $size = importVar('size', false, 'max');
    $width = "90%";
    if ($size == "min") {
        $width = "200px";
    }
    addCss('calendar_' . $size);
    YuiLib::load('base,dragdrop');
    Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true);
    Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true);
    //permissions = permissions granted to the logged user according to his/her level and role
    //	2 => can create/delete/modify all events
    //	1 => can create/delete/modify only own events
    //	0 => can view only
    $permissions = 0;
    if (checkPerm('mod', true)) {
        $permissions = 2;
    } elseif (checkPerm('personal', true)) {
        $permissions = 1;
    }
    //mode="edit" => events can be added and edited according to given permissions
    //mode="view" => events can only be viewed regardless the permissions
    $GLOBALS['page']->add('<script type="text/javascript">' . '	setup_cal(	null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head');
    $GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content');
}
 public function show()
 {
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     Util::get_js(Get::rel_path('adm') . '/views/groupmanagement/groupmanagement.js', true, true);
     Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
     $this->render('show', array('permissions' => $this->permissions, 'result_message' => "", 'filter_text' => ''));
 }
 public function init()
 {
     YuiLib::load('container,menu,button');
     Util::get_js(Get::rel_path('adm') . '/lib/user_selector/lib.common.js', true, true);
     Util::get_js(Get::rel_path('adm') . '/lib/user_selector/lib.dynamicuserfilter.js', true, true);
     if ($this->_use_other_fields) {
         Util::get_js(Get::rel_path('adm') . '/lib/user_selector/lib.otherfieldtypes.js', true, true);
     }
 }
Exemplo n.º 10
0
 public function init()
 {
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     //$js_path = Get::rel_path('base').'/widget/competenceselector/';
     //Util::get_js($js_path.'competenceselector.js', true, true);
 }
Exemplo n.º 11
0
 /**
  * Return the link for the admin section
  * @return <type>
  */
 public static function admin()
 {
     $res = '';
     $level = Docebo::user()->getUserLevelId();
     if ($level == ADMIN_GROUP_GODADMIN || $level == ADMIN_GROUP_ADMIN) {
         $res .= '<a href="' . Get::rel_path('adm') . '">' . Get::img('standard/goto_admin.gif', Lang::t('_GOTO_ADMIN')) . Lang::t('_GOTO_ADMIN') . '</a>';
     }
     return $res;
 }
Exemplo n.º 12
0
function loginDispatch($op)
{
    switch ($op) {
        case "login":
            Util::jump_to(Get::rel_path('base') . '/index.php?modname=login&amp;op=login');
            //login();
            break;
    }
}
Exemplo n.º 13
0
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new DashboardAdm();
     YuiLib::load('autocomplete,tabview');
     Util::get_js(Get::rel_path('adm') . '/views/dashboard/dashboard.js', true, true);
     $this->permissions = array('view' => checkPerm('view', true, 'dashboard', 'framework'), 'view_user' => checkPerm('view', true, 'usermanagement', 'framework'), 'add_user' => checkPerm('add', true, 'usermanagement', 'framework'), 'mod_user' => checkPerm('mod', true, 'usermanagement', 'framework'), 'del_user' => checkPerm('del', true, 'usermanagement', 'framework'), 'view_course' => checkPerm('view', true, 'course', 'lms'), 'add_course' => checkPerm('add', true, 'course', 'lms'), 'mod_course' => checkPerm('mod', true, 'course', 'lms'), 'del_course' => checkPerm('del', true, 'course', 'lms'), 'view_communications' => checkPerm('view', true, 'communication', 'lms'), 'add_communications' => checkPerm('add', true, 'communication', 'lms'), 'view_games' => checkPerm('view', true, 'games', 'lms'), 'add_games' => checkPerm('add', true, 'games', 'lms'), 'subscribe' => checkPerm('subscribe', true, 'course', 'lms'));
 }
Exemplo n.º 14
0
 public function init()
 {
     YuiLib::load('base,tabview');
     Lang::init('course');
     $this->path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/';
     $this->model = new CartLms();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->acl_man =& Docebo::user()->getAclManager();
     Util::get_css(Get::rel_path(_base_) . '/appLms/views/cart/cart.css', true, true);
 }
Exemplo n.º 15
0
 /**
  * Include the required libraries in order to have all the things ready and working
  */
 public function initLibraries()
 {
     // load yui
     YuiLib::load(array('yahoo-dom-event' => 'yahoo-dom-event.js', 'connection' => 'connection-min.js', 'dragdrop' => 'dragdrop-min.js', 'element' => 'element-beta-min.js', 'animation' => 'animation-min.js', 'json' => 'json-min.js', 'container' => 'container_core-min.js', 'menu' => 'menu-min.js', 'button' => 'button-min.js', 'container' => 'container-min.js', 'button' => 'button-min.js', 'treeview' => 'treeview-min.js', 'resize' => 'resize-beta-min.js', 'selector' => 'selector-beta-min.js'), array('assets/skins/sam' => 'skin.css'));
     // Selector class
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
     // Commodities functions
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     // The tableview main file
     Util::get_js(Get::rel_path('base') . '/lib/table_view/tableview.js', true, true);
     // Datatable css
     Util::get_css('../yui-skin/datatable.css', false, true);
 }
 public function showTask()
 {
     if (!$this->permissions['view']) {
         echo 'You can\'t access.';
         return;
     }
     //tabview widget, used in role and group editing
     Yuilib::load('tabview');
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     Util::get_js(Get::rel_path('adm') . '/views/functionalroles/functionalroles.js', true, true);
     Util::get_css('base-folder-tree.css', false, true);
     //render view
     $this->render('show', array('permissions' => $this->permissions, 'selected_group' => 0, 'filter_text' => ""));
 }
Exemplo n.º 17
0
 public function initLibraries()
 {
     YuiLib::load(array('yahoo-dom-event' => 'yahoo-dom-event.js', 'connection' => 'connection-min.js', 'dragdrop' => 'dragdrop-min.js', 'element' => 'element-beta-min.js', 'animation' => 'animation-min.js', 'json' => 'json-min.js', 'container' => 'container_core-min.js', 'menu' => 'menu-min.js', 'button' => 'button-min.js', 'container' => 'container-min.js', 'button' => 'button-min.js', 'treeview' => 'treeview-min.js', 'resize' => 'resize-beta-min.js', 'selector' => 'selector-beta-min.js'), array('assets/skins/sam' => 'skin.css'));
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     $js_path = Get::rel_path('base') . '/lib/folder_tree/';
     Util::get_js($js_path . 'ddnode.js', true, true);
     Util::get_js($js_path . 'foldernode.js', true, true);
     Util::get_js($js_path . 'foldertree.js', true, true);
     //addCss('folder_tree', 'framework');
     cout(Util::get_css('base-folder-tree.css'), 'page_head');
     foreach ($this->styleSheets as $sheet) {
         cout(Util::get_css($sheet . '.css'), 'page_head');
     }
 }
Exemplo n.º 18
0
 /**
  * Initialize required libraries
  */
 public function init()
 {
     YuiLib::load('base,treeview,selector');
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     Util::get_css('base-folder-tree.css', false, true);
     $js_path = Get::rel_path('base') . '/widget/tree/';
     if ($this->dragDrop) {
         Util::get_js($js_path . 'ddnode.js', true, true);
     }
     Util::get_js($js_path . 'foldernode.js', true, true);
     Util::get_js($js_path . 'foldertree.js', true, true);
     if ($this->treeClass != "FolderTree" && $this->treeFile) {
         Util::get_js($this->treeFile, true, true);
     }
 }
Exemplo n.º 19
0
 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', '');
 }
Exemplo n.º 20
0
/**
 * Called in loadHeader method of Block class include .js files if required
 *
 * @return string the code to be include(think to directly use PageWriter->append($string, 'head'))
 **/
function loadHeaderHTMLEditor()
{
    $res = "";
    if (getAccessibilityStatus() === false) {
        $ht = Get::sett('hteditor');
    } else {
        $ht = 'accesseditor';
    }
    $relative_path = $GLOBALS['where_framework_relative'];
    $relative_path .= substr($GLOBALS['where_framework_relative'], -1) == '/' ? '' : '/';
    switch ($ht) {
        //using tiny_mce
        case 'tinymce':
            Util::get_js(Get::rel_path('base') . '/addons/tiny_mce/tiny_mce_gzip.js', true, true);
            $GLOBALS['page']->add('<script type="text/javascript">
									tinyMCE_GZ.init({
									plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
									themes : "tinymce_simple,tinymce_complex",
									languages : "en",
									disk_cache : true,
									debug : false
									});
								</script>', 'page_head');
            Util::get_js(Get::rel_path('base') . '/addons/tiny_mce/forma.js', true, true);
            break;
        case 'yui':
            $js = array('element' => 'element-beta-min.js', 'container' => 'container_core-min.js', 'menu' => 'menu-min.js', 'button' => 'button-min.js', 'editor' => 'editor-beta-min.js');
            YuiLib::load($js);
            $GLOBALS['page']->add('<link rel="stylesheet" type="text/css" href="' . $GLOBALS['where_framework_relative'] . '/addons/yui/assets/skins/sam/skin.css">', 'page_head');
            break;
            //using normal textarea
        //using normal textarea
        case 'accesseditor':
        default:
            break;
    }
    if (isset($GLOBALS['page'])) {
        $GLOBALS['page']->add($res, 'page_head');
    } else {
        echo $res;
    }
}
Exemplo n.º 21
0
<?php

YuiLib::load(array('animation' => 'my_animation', 'container' => 'container-min', 'container' => 'container_core-min'));
cout(Util::get_js(Get::rel_path('lms') . '/views/catalog/catalog.js', true), 'page_head');
require_once _lms_ . '/lib/lib.middlearea.php';
$ma = new Man_MiddleArea();
?>
<script type="text/javascript">
	YAHOO.util.Event.onDOMReady(function() {
		initialize("<?php 
echo Lang::t('_UNDO', 'standard');
?>
");
	});
</script>
<div id="global_conf" class="yui-navset yui-navset-top">
	<ul class="yui-nav">
		<li class="<?php 
echo $active_tab == 'all' ? 'selected' : '';
?>
 first">
			<a href="index.php?r=catalog/allCourse">
				<em><?php 
echo Lang::t('_ALL_COURSES', 'catalogue');
?>
</em>
			</a>
		</li>
		<li class="<?php 
echo $active_tab == 'new' ? 'selected' : '';
?>
Exemplo n.º 22
0
echo Form::closeForm();
?>
			</div>
		</div>
	</div>
	<div class="panel_left_small">
		<span class="title"><?php 
echo Lang::t('_ALL_CATEGORIES', 'kb');
?>
</span>
		<?php 
/**
 * Tree
 */
$languages = array('_ROOT' => Get::sett('title_kb_tree', Lang::t('_CATEGORY', 'kb')), '_YES' => Lang::t('_CONFIRM', 'organization_chart'), '_NO' => Lang::t('_UNDO', 'organization_chart'), '_LOADING' => Lang::t('_LOADING', 'standard'), '_NEW_FOLDER_NAME' => Lang::t('_ORGCHART_ADDNODE', 'organization_chart'), '_AREYOUSURE' => Lang::t('_AREYOUSURE', 'organization_chart'), '_NAME' => Lang::t('_NAME', 'standard'), '_MOD' => Lang::t('_MOD', 'standard'), '_DEL' => Lang::t('_DEL', 'standard'));
$params = array('id' => 'kbtree', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/kb/gettreedata', 'treeClass' => 'KbFolderTree', 'treeFile' => Get::rel_path('lms') . '/admin/views/kb/kbfoldertree.js', 'languages' => $languages, 'initialSelectedNode' => (int) $selected_node, 'rootActions' => '', 'show' => 'tree', 'dragDrop' => true);
if ($permissions['add']) {
    $params['rel_action'] = '<a class="ico-wt-sprite subs_add" id="add_kb_folder" href="ajax.adm_server.php?r=alms/kb/addfolder_dialog&id=' . (int) $selected_node . '" ' . ' title="' . Lang::t('_ORGCHART_ADDNODE', 'organization_chart') . '">' . '<span>' . Lang::t('_ORGCHART_ADDNODE', 'organization_chart') . '</span>' . '</a>';
    /**
     * Add folder dialog
     */
    $this->widget('dialog', array('id' => 'add_folder_dialog', 'dynamicContent' => true, 'ajaxUrl' => 'function() { return YAHOO.util.Dom.get("add_kb_folder").href; }', 'dynamicAjaxUrl' => true, 'callback' => 'KbManagement.addFolderCallback', 'callEvents' => array(array('caller' => 'add_kb_folder', 'event' => 'click'))));
}
$this->widget('tree', $params);
?>
	</div>
	<div class="panel_right_big">
	<?php 
$columns = array(array('key' => 'r_name', 'label' => Lang::t('_NAME', 'kb'), 'sortable' => true), array('key' => 'r_type', 'label' => Lang::t('_TYPE', 'kb'), 'sortable' => true, 'className' => 'img-cell'), array('key' => 'r_env', 'label' => Lang::t('_ENVIRONMENT', 'kb'), 'sortable' => true), array('key' => 'r_env_parent', 'label' => Lang::t('_CONTAINED_IN', 'kb'), 'sortable' => false), array('key' => 'r_lang', 'label' => Lang::t('_LANGUAGE', 'kb'), 'sortable' => true), array('key' => 'tags', 'label' => Lang::t('_TAGS', 'kb'), 'sortable' => false));
if ($permissions['mod']) {
    $_title_categorize = Lang::t('_MOD', 'kb');
Exemplo n.º 23
0
 /**
  * Build an html for an image encapsulated into a link
  * @param <string> $url the url for the a[href]
  * @param <string> $title the title for the a[title]
  * @param <string> $src the img[src]
  * @param <string> $alt the img[alt]
  * @param <array> $extra the content of the 'link' key is used as extra in the a element if specified, the 'img' key content is used into the img element
  * @return <string> html code (sample: <a ...><img ...></a> )
  */
 public static function link_img($url, $title, $src, $alt, $extra = false)
 {
     // where are we ?
     $src = Get::rel_path(_base_) . '/templates/standard/images/' . $src;
     return '<a href="' . $url . '" title="' . $title . '"' . (!empty($extra['link']) != false ? ' ' . $extra['link'] : '') . '>' . '<img src="' . $src . '" ' . 'alt="' . ($alt ? $alt : substr($src, 0, -4)) . '" ' . 'title="' . $title . '" ' . (!empty($extra['img']) != false ? $extra . ' ' : '') . '/>' . '</a>' . "\n";
 }
Exemplo n.º 24
0
		<?php 
echo Layout::rtl();
?>
		<!-- specific stylesheet -->

		<!-- printer stylesheet-->
		<link rel="stylesheet" type="text/css" href="<?php 
echo Layout::path();
?>
style/print.css" media="print" />
		<?php 
echo Layout::accessibility();
?>
		<!-- Page Head area -->
		<script type="text/javascript" src="<?php 
echo Get::rel_path('base');
?>
/lib/js_utils.js"></script>
		<?php 
echo Layout::zone('page_head');
?>
        <script type="text/javascript" src="<?php 
echo Layout::path();
?>
resources/jquery/jquery.min.js"></script>
        <script src="<?php 
echo Layout::path();
?>
resources/jquery/jquery-ui.js"></script>
        <script>
            $('document').ready(function() {
Exemplo n.º 25
0
                Util::jump_to($linkto);
                break;
        }
    }
}
if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
    $query = "SELECT param_value FROM core_setting\r\n\t\t\tWHERE param_name = 'maintenance'\r\n\t\t\tORDER BY pack, sequence";
    $mode = $db->fetch_row($db->query($query));
    // Se siamo in modalita' manutenzione
    if ($mode[0] == "on") {
        //	if(Get::sett('maintenance') == 'on'){ // non posso farlo cosi perche non ancora settato
        if (!Docebo::user()->isAnonymous() && $GLOBALS['modname'] != 'login' && $GLOBALS['op'] != 'logout') {
            TrackUser::resetUserSession(getLogUserId());
            $_SESSION = array();
            session_destroy();
            Util::jump_to(Get::rel_path('lms') . '/index.php?modname=login&op=logout');
        }
    }
}
/*
if(Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
	if(!Docebo::user()->isAnonymous() && $GLOBALS['modname'] != 'login' && $GLOBALS['op'] != 'logout') {
		$pwd_elapsed = Docebo::user()->isPasswordElapsed();
		if($pwd_elapsed > 0) {
			$GLOBALS['modname'] = '';
			$GLOBALS['op'] 		= '';
			$GLOBALS['req'] = 'lms/profile/renewalpwd';
		}
	}
}
*/
Exemplo n.º 26
0
 /**
  * Include the required libraries in order to have all the things ready and working
  */
 public function init()
 {
     Util::get_js(Get::rel_path('base') . '/addons/yui/logger/logger-min.js', true, true);
     Util::get_css(Get::rel_path('base') . '/templates/standard/yui-skin/logger.css', true, true);
 }
Exemplo n.º 27
0
							</li>
							<?php 
    }
    ?>
						</ul>
						<?php 
    if ($permissions['view_user']) {
        $this->widget('dialog', array('id' => 'status_user_dialog', 'width' => "700px", 'dynamicContent' => true, 'ajaxUrl' => 'this.href', 'dynamicAjaxUrl' => true, 'constrainToViewport' => false, 'callback' => 'Dashboard.userStatusCallback', 'renderEvent' => 'Dashboard.userStatusRenderEvent', 'confirmOnly' => true, 'fixedCenter' => false, 'callEvents' => array(array('caller' => 'quicklinks_users_status', 'event' => 'click'))));
    }
    if ($permissions['mod_user']) {
        $this->widget('dialog', array('id' => 'chgpwd_user_dialog', 'dynamicContent' => true, 'constrainToViewport' => false, 'ajaxUrl' => 'this.href', 'dynamicAjaxUrl' => true, 'fixedCenter' => false, 'callback' => 'Dashboard.changePasswordCallback', 'renderEvent' => 'Dashboard.changePasswordRenderEvent', 'callEvents' => array(array('caller' => 'quicklinks_users_chgpwd', 'event' => 'click'))));
    }
    if ($permissions['add_user']) {
        $this->widget('dialog', array('id' => 'create_user_dialog', 'dynamicContent' => true, 'ajaxUrl' => 'this.href', 'dynamicAjaxUrl' => true, 'fixedCenter' => false, 'constrainToViewport' => false, 'renderEvent' => 'Dashboard.createUserRenderEvent', 'callback' => 'Dashboard.createUserCallback', 'callEvents' => array(array('caller' => 'quicklinks_users_create', 'event' => 'click'))));
        //orgchart tree in the user creation popup, to be activated at runtime
        $this->widget('tree', array('id' => 'createuser_orgchart_tree', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/usermanagement/gettreedata_create', 'treeClass' => 'DialogOrgFolderTree', 'treeFile' => Get::rel_path('adm') . '/views/usermanagement/orgchartfoldertree.js', 'initialSelectedNode' => 0, 'show' => 'tree', 'useCheckboxes' => 'true', 'initialSelectorData' => array(0), 'setSelectedNodeOnServer' => false, 'hiddenSelection' => 'orgchart_hidden_selection', 'runtime' => true, 'languages' => array('_ROOT' => Get::sett('title_organigram_chart', Lang::t('_ORG_CHART', 'organization_chart')), '_LOADING' => Lang::t('_LOADING', 'standard'))));
    }
    ?>
					</div>
					<?php 
}
?>
					<div class="block_spacer">
						<h3><?php 
echo Lang::t('_CERTIFICATE', 'menu');
?>
</h3>
						<ul class="link_list">
							<li>
								<a id="find_certificate" href="ajax.adm_server.php?r=adm/dashboard/certificate"><?php 
echo Lang::t('_MONITOR_PRINT_CERTIFICATE_STATUS', 'dashboard');
Exemplo n.º 28
0
<?php

$languages = array('_ROOT' => Lang::t('_CATEGORY'), '_YES' => Lang::t('_CONFIRM'), '_NO' => Lang::t('_UNDO'), '_NEW_FOLDER_NAME' => Lang::t('_NEW_CATEGORY'), '_MOD' => Lang::t('_MOD'), '_AREYOUSURE' => Lang::t('_AREYOUSURE'), '_NAME' => Lang::t('_NAME'), '_MOD' => Lang::t('_MOD'), '_DEL' => Lang::t('_DEL'));
$arguments = array('id' => 'tree', 'ajaxUrl' => 'ajax.adm_server.php?plf=lms&file=category_tree&sf=folder_tree', 'treeClass' => 'CourseFolderTree', 'treeFile' => Get::rel_path('base') . '/widget/tree/coursefoldertree.js', 'languages' => $languages, 'show' => 'tree');
$this->widget('tree', $arguments);
Exemplo n.º 29
0
echo Form::getInputTextfield("search_t", "filter_text", "filter_text", $filter_text, '', 255, '');
echo Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
?>
		</div>
	</div>
</div>

<div class="panel_left_small">
<span class="title"><?php 
echo Lang::t('_ALL_CATEGORIES', 'competences');
?>
</span>
<?php 
$_languages = array('_ROOT' => Lang::t('_CATEGORY', 'competences'), '_YES' => Lang::t('_CONFIRM', 'organization_chart'), '_NO' => Lang::t('_UNDO', 'organization_chart'), '_LOADING' => Lang::t('_LOADING', 'standard'), '_NEW_FOLDER_NAME' => Lang::t('_ORGCHART_ADDNODE', 'organization_chart'), '_AREYOUSURE' => Lang::t('_AREYOUSURE', 'organization_chart'), '_NAME' => Lang::t('_NAME', 'standard'), '_MOD' => Lang::t('_MOD', 'standard'), '_DEL' => Lang::t('_DEL', 'standard'), '_USERS' => Lang::t('_ASSIGN_USERS', 'standard'));
$params = array('id' => 'competences_tree', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/competences/gettreedata', 'treeClass' => 'CompetencesFolderTree', 'treeFile' => Get::rel_path('adm') . '/views/competences/competences.js', 'languages' => $_languages, 'initialSelectedNode' => (int) $selected_node, 'show' => 'tree', 'dragDrop' => true);
if ($permissions['add']) {
    $_tree_rel_action = '<a class="ico-wt-sprite subs_add" id="add_category" ' . ' href="ajax.adm_server.php?r=adm/competences/add_category&id=' . (int) $selected_node . '" ' . ' title="' . Lang::t('_ADD', 'competences') . '">' . '<span>' . Lang::t('_ADD', 'competences') . '</span>' . '</a>';
    $params['rel_action'] = $_tree_rel_action;
    //Add category dialog
    $this->widget('dialog', array('id' => 'add_category_dialog', 'dynamicContent' => true, 'ajaxUrl' => 'this.href', 'dynamicAjaxUrl' => true, 'callback' => 'Competences.addCategoryCallback', 'renderEvent' => 'Competences.dialogRenderEvent', 'callEvents' => array(array('caller' => 'add_category', 'event' => 'click'))));
}
$this->widget('tree', $params);
?>
</div>

<div class="panel_right_big">
<?php 
$icon_users = '<span class="ico-sprite subs_users"><span>' . Lang::t('_ASSIGN_USERS', 'competences') . '</span></span>';
$icon_mod = '<span class="ico-sprite subs_mod"><span>' . Lang::t('_MOD', 'standard') . '</span></span>';
$icon_del = '<span class="ico-sprite subs_del"><span>' . Lang::t('_DEL', 'standard') . '</span></span>';
Exemplo n.º 30
0
    public function getContent()
    {
        $out = '';
        if (Docebo::user()->getUserLevelId() == ADMIN_GROUP_USER) {
            return $out;
        }
        if (empty($this->_contentOut) && $this->print_if_empty === false) {
            return $out;
        }
        $out .= Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, false) . Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, false) . '<div id="def_lang" class="def_lang">' . "\n" . implode($this->_startOut) . '<div id="link_container">' . implode($this->_contentOut) . '</div>' . '<a id="command" href="#" onclick="YAHOO.Animation.BlindToggle(\'link_container\');" >' . Lang::t('_NOT_TRANSLATED', 'standard', 'framework') . ' (' . count($this->_contentOut) . ')' . '</a>' . '<script type="text/javascript">' . 'YAHOO.util.Dom.get(\'link_container\').style.display = \'none\';' . '</script>' . '<script type="text/javascript">
				var translation = { module: "", key: "" }
				YAHOO.util.Event.onDOMReady(function() {

					var dialogEvent = function(e) {
						var oConfig = {
							modal: true,
							close: true,
							visible: false,
							fixedcenter: true,
							constraintoviewport: true,
							draggable: true,
							hideaftersubmit: false,
							isDynamic: true,
							ajaxUrl: "ajax.adm_server.php?r=adm/lang/translatemask",
							confirmOnly: false,
							directSubmit: false
						};
						oConfig.renderEvent = function() {
							new YAHOO.widget.TabView("translation_tab");
							YAHOO.util.Event.onAvailable(\'lang_module\', function() {
								YAHOO.util.Dom.get(\'lang_module\').value = translation.module;
								YAHOO.util.Dom.get(\'lang_key\').value = translation.key;
							}, this);
						};
						oConfig.callback = function() { this.destroy(); };

						var info = this.id.split("-");
						translation.module = info[1];
						translation.key = info[2];
						CreateDialog("translation_add", oConfig).call(this, e);
					}
					YAHOO.util.Event.addListener(YAHOO.util.Selector.query(\'a[id^=totranslate]\'), "click", dialogEvent);
				});
				</script>' . implode($this->_endOut) . '</div>' . "\n";
        //ob_clean();
        $out = fillSiteBaseUrlTag($out);
        return $out;
    }