예제 #1
0
 function __construct($id, $url = false, $preload = false, $cols_type = "")
 {
     //$this->id = $id;
     parent::__construct($id);
     $this->ajax_url = $url ? $url : $GLOBALS['where_lms_relative'] . '/ajax.adm_server.php?plf=lms&file=categorytree&sf=category';
     $this->preload_tree = $preload;
     $this->sel_columns = $cols_type;
 }
예제 #2
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', '');
 }