Example #1
0
 foreach ($values['import_url'] as $key => $urlUpload) {
     if ($urlUpload && !in_array(basename($urlUpload), $uploadedFiles)) {
         FileSystemTree::checkFile($urlUpload);
         $urlArray = explode("/", $urlUpload);
         $urlFile = urldecode($urlArray[sizeof($urlArray) - 1]);
         if (!copy(dirname($urlUpload) . '/' . rawurlencode(basename($urlUpload)), $uploadDir . "/" . $urlFile)) {
             $errors[] = _PROBLEMUPLOADINGFILE . ': ' . $urlUpload;
         } else {
             $uploadedFiles[basename($urlUpload)] = new EfrontFile($uploadDir . "/" . $urlFile);
         }
     }
 }
 //Perform any path uploads
 foreach ($values['import_path'] as $key => $pathUpload) {
     if ($pathUpload && !in_array($pathUpload, $uploadedFiles)) {
         $pathUpload = EfrontDirectory::normalize($pathUpload);
         if (strpos(dirname($pathUpload), rtrim(G_ROOTPATH, "/")) !== false) {
             FileSystemTree::checkFile($pathUpload);
             $pathArray = explode("/", $pathUpload);
             $pathFile = urldecode($pathArray[sizeof($pathArray) - 1]);
             if (!copy($pathUpload, $uploadDir . "/" . $pathFile)) {
                 $errors[] = _PROBLEMUPLOADINGFILE . ': ' . $pathUpload;
             } else {
                 $uploadedFiles[basename($pathUpload)] = new EfrontFile($uploadDir . "/" . $pathFile);
             }
         } else {
             $errors[] = _PROBLEMUPLOADINGFILE . ': ' . $pathUpload;
         }
     }
 }
 if (!empty($errors)) {
Example #2
0
 } elseif ($_GET['mode'] == 'external') {
     $rootDir = new EfrontDirectory(G_EXTERNALPATH);
     $filesBaseUrl = G_EXTERNALURL;
 } elseif ($_GET['mode'] == 'upload') {
     $rootDir = new EfrontDirectory(G_UPLOADPATH . $_SESSION['s_login']);
     $filesBaseUrl = G_UPLOADPATH . $_SESSION['s_login'];
 } else {
     throw new Exception(_ILLEGALMODE);
 }
 //We are inside a directory. Verify that this directory is below the $rootDir, as defined previously
 if (isset($_GET['directory'])) {
     $directory = new EfrontDirectory($_GET['directory']);
     if (strpos($directory['path'], $rootDir['path']) === false) {
         $directory = $rootDir;
     } else {
         if (EfrontDirectory::normalize($directory['path']) == EfrontDirectory::normalize($rootDir['path'])) {
             $smarty->assign("T_PARENT_DIR", '');
         } else {
             $smarty->assign("T_PARENT_DIR", $directory['directory']);
         }
     }
 } else {
     $directory = $rootDir;
 }
 $offset = str_replace($rootDir['path'], '', $directory['path'] . '/');
 //$t_offset = rtrim($filesBaseUrl.$offset, '/').'/';  //possibly the problem with doulbe slash will be fixed by removing / from the above line, but in order to be sure ....
 $t_offset = str_replace('//', '/', $filesBaseUrl . $offset . '/');
 $t_offset = str_replace('//', '/', $t_offset);
 $smarty->assign("T_OFFSET", $t_offset);
 $files = $folders = array();
 //for_type defines which kind of files we need.
    /**
     * Create HTML representation of file system tree
     *
     * This function creates the file manager HTML code. It also handles any AJAX calls,
     * composes and prints upload and create directory forms, as well as makes sure the
     * correct folder contents are displayed.
     * <code>
     * $basedir    = G_LESSONSPATH.'test/';
     * $filesystem = new FileSystemTree($basedir);									//Set the base directory that the file manager displayes
     * $url        = 'administrator.php?ctg=file_manager';			//Set the url where file manager resides
     * echo $filesystem -> toHTML($url); 											//Display file manager
     * </code>
     * The available options are (the default value in parenthesis):
     * - show_type (true)				//Whether to show the "type" column
     * - show_date (true)				//Whether to show the "last modified" column
     * - show_name (true)				//Whether to show the "name" column
     * - show_size (true)				//Whether to show the "size" column
     * - show_tools (true)				//Whether to show the "tools" column
     * - metadata (true)				//Whether to allow for metadata
     * - db_files_only (false) 			//Whether to display only files that have a db representation
     * - delete (true)					//Whether to display delete icon
     * - download (true)				//Whether to display download icon
     * - zip  (true)					//Whether to display zip icon
     * - share (true)					//Whether to display share icon
     * - create_folder (true)			//Whether to display create folder link
     * - upload (true)					//Whether to display upload file link
     * - copy (true)					//Whether to display copy icon
     * - folders (true)					//Whether to display folders in files list
     *
     * The $extraFileTools, $extraHeaderOptions, $extraDirectoryTools paramaters are used to add custom
     * extra tools to various places of the file manager. The format of these parameters is of the form:
     * $extraFileTools = array(array('image' => 'images/16x16/restore.png', 'title' => _RESTORE, 'action' => 'restore'));
     * $extraHeaderOptions = array(array('image' => 'images/16x16/undo.png', 'title' => _BACKUP, 'action' => 'backup'));
     *
     * @param string $url The url where the file manager resides
     * @param string $currentDirectory The directory to use as base directory
     * @param array $ajaxOptions AJAX-specific options: sort, order, limit, offset, filter
     * @param array $options Options for the file manager
     * @param array $extraFileTools Extra tools for files
     * @param array $extraDirectoryTools Extra tools for directories
     * @param array $extraHeaderOptions Extra tools for file manager header
     * @param array $defaultIterator A specific iterator to use for files display
     * @param bool 	$show_tooltip If tooltip is dislayed in name
     * @return string The HTML representation of the file system
     * @since 3.5.0
     * @access public
     */
    public function toHTML($url, $currentDirectory = '', $ajaxOptions = array(), $options, $extraFileTools = array(), $extraDirectoryTools = array(), $extraHeaderOptions = array(), $defaultIterator = false, $show_tooltip = true, $extraColumns = array())
    {
        //Set default options
        !isset($options['show_type']) ? $options['show_type'] = true : null;
        !isset($options['show_date']) ? $options['show_date'] = true : null;
        !isset($options['show_name']) ? $options['show_name'] = true : null;
        !isset($options['show_size']) ? $options['show_size'] = true : null;
        !isset($options['show_tools']) ? $options['show_tools'] = true : null;
        !isset($options['delete']) ? $options['delete'] = true : null;
        !isset($options['download']) ? $options['download'] = true : null;
        !isset($options['zip']) ? $options['zip'] = true : null;
        !isset($options['share']) ? $options['share'] = true : null;
        !isset($options['edit']) ? $options['edit'] = true : null;
        !isset($options['copy']) ? $options['copy'] = true : null;
        !isset($options['create_folder']) ? $options['create_folder'] = true : null;
        !isset($options['upload']) ? $options['upload'] = true : null;
        !isset($options['folders']) ? $options['folders'] = true : null;
        !isset($options['db_files_only']) ? $options['db_files_only'] = false : null;
        !isset($options['table_id']) ? $tableId = 'filesTable' : ($tableId = $options['table_id']);
        //Make sure that current directory is a path
        //$currentDirectory = new EfrontDirectory($currentDirectory);
        if ($currentDirectory instanceof EfrontDirectory) {
            $currentDirectory = $currentDirectory['path'];
        }
        if (isset($_POST['upload_current_directory']) && strpos(EfrontDirectory::normalize($_POST['upload_current_directory']), rtrim(G_ROOTPATH, "/")) !== false) {
            $currentDirectory = $_POST['upload_current_directory'];
        }
        if (isset($_POST['current_directory']) && strpos(EfrontDirectory::normalize($_POST['current_directory']), rtrim(G_ROOTPATH, "/")) !== false) {
            $currentDirectory = $_POST['current_directory'];
        }
        if (isset($_POST['copy_current_directory']) && strpos(EfrontDirectory::normalize($_POST['copy_current_directory']), rtrim(G_ROOTPATH, "/")) !== false) {
            $currentDirectory = $_POST['copy_current_directory'];
        }
        if ($currentDirectory && $currentDirectory != $this->dir['path']) {
            //Check that the current directory actually exists
            $currentDir = new EfrontDirectory($currentDirectory);
            //Get its parent directory
            $parentDir = new EfrontDirectory($currentDir['directory']);
            //Build a new (shallow) file system tree on the current directory
            $innerFileSystem = new FileSystemTree($currentDir, false);
            //Assign each node as a child to the currentDir, thus creating a new tree with currentDir as parent
            foreach ($innerFileSystem->tree as $key => $value) {
                $currentDir[$key] = $value;
            }
            //$currentDir = $this -> seekNode($currentDirectory);
            //$parentDir  = new EfrontDirectory($currentDir['directory']);
        } else {
            $currentDirectory = $this->dir['path'];
            $currentDir = $this->tree;
        }
        try {
            $uploadForm = new HTML_QuickForm("upload_file_form_{$tableId}", "post", $url, "", "target = 'POPUP_FRAME'", true);
            $uploadFormString = $this->getUploadForm($uploadForm);
            if ($uploadForm->isSubmitted() && $uploadForm->validate()) {
                $uploadedFile = $this->handleUploadForm($uploadForm);
                $uploadFormString .= '
                	  <script>if (window.name == "POPUP_FRAME") {(parent.eF_js_showDivPopup());parent.eF_js_rebuildTable(parent.$(\'filename_' . $tableId . '\').down().getAttribute(\'tableIndex\'), 0, \'\', \'desc\', \'' . urlencode($currentDirectory) . '\');parent.$(\'uploading_image\').hide()}</script>';
            }
            $createFolderForm = new HTML_QuickForm("create_folder_form", "post", $url, "", "target = 'POPUP_FRAME'", true);
            $createFolderString = $this->getCreateDirectoryForm($createFolderForm);
            if ($createFolderForm->isSubmitted() && $createFolderForm->validate()) {
                $this->handleCreateDirectoryForm($createFolderForm);
                $createFolderString .= '
                	  <script>if (window.name == "POPUP_FRAME") {(parent.eF_js_showDivPopup());parent.eF_js_rebuildTable(parent.$(\'filename_' . $tableId . '\').down().getAttribute(\'tableIndex\'), 0, \'\', \'desc\', \'' . urlencode($currentDirectory) . '\');}</script>';
            }
            /*
            $copyForm       = new HTML_QuickForm("copy_file_form", "post", $url, "", "", true);
            
            foreach ($iterator = new EfrontDirectoryOnlyFilterIterator(new EfrontNodeFilterIterator($currentDir)) as $key => $value) {
            $directories[$key] = str_replace($this -> dir['path'].'/', '', EfrontFile :: decode($value['path']));
            }
            $copyForm -> addElement('select', 'destination', null, $directories, 'class = "inputText"');
            $copyFormString = $this -> getCopyForm($copyForm);
            
            if ($copyForm -> isSubmitted() && $copyForm -> validate()) {
            $copiedFile = $this -> handleCopyForm($copyForm);
            }
            */
            //pr($currentDirectory);
            if (isset($_POST['copy_files']) && sizeof($_POST['copy_files']) > 0) {
                $copyFiles = explode(",", $_POST["copy_files"]);
                foreach ($copyFiles as $file) {
                    $file = new EfrontFile($file);
                    //pr('copying to '.$currentDirectory.'/'.basename($file['path']));
                    $file->copy($currentDirectory . '/' . basename($file['path']));
                }
            }
        } catch (Exception $e) {
            echo "<script>if (top && top.mainframe) {w=top.mainframe} else {w=parent;}w.document.getElementById('messageError').innerHTML = '" . $e->getMessage() . "';parent.\$('uploading_image').hide();</script>";
            //Don't halt for uploading and create directory errors
            $GLOBALS['smarty']->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
            $GLOBALS['message'] = $e->getMessage() . ' (' . $e->getCode() . ') &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
        }
        $files = array();
        $fileArrays = array();
        $foldersArray = array();
        $filesArray = array();
        if ($options['folders']) {
            $iterator = new EfrontDirectoryOnlyFilterIterator(new ArrayIterator($currentDir));
            //Plain ArrayIterator so that it iterates only on the current's folder files
            if ($options['db_files_only']) {
                //Filter out directories without database representation
                $iterator = new EfrontDBOnlyFilterIterator($iterator);
            }
            foreach ($iterator as $key => $value) {
                //We convert iterator to a complete array of files, so we can apply sorting, filtering etc more easily
                $current = (array) $iterator->current();
                foreach ($current as $k => $v) {
                    //Remove child elements, such files, directories etc from the array, so we can successfully apply operations on to them, such as filtering
                    if ($v instanceof ArrayObject) {
                        unset($current[$k]);
                    }
                }
                $current['size'] = 0;
                $current['extension'] = '';
                $current['shared'] = 10;
                //Add these 3 parameters, so that sorting below works correctly (10 means nothing, since a folder cannot be shared, but it is handy for sorting)
                $foldersArray[] = (array) $current;
                //Array representation of directory objects, on which we can apply sorting, filtering, etc
            }
            $foldersArray = eF_multiSort($foldersArray, 'name', 'asc');
        }
        if ($defaultIterator) {
            $iterator = $defaultIterator;
        } else {
            $iterator = new EfrontFileOnlyFilterIterator(new EfrontNodeFilterIterator(new ArrayIterator($currentDir)));
            //Plain ArrayIterator so that it iterates only on the current folder's files
            if ($options['db_files_only']) {
                //Filter out directories without database representation
                $iterator = new EfrontDBOnlyFilterIterator($iterator);
            }
        }
        foreach ($iterator as $key => $value) {
            //We convert iterator to a complete array of files, so we can apply sorting, filtering etc more easily
            $current = (array) $iterator->current();
            foreach ($current as $k => $v) {
                //Remove child elements, such files, directories etc from the array, so we can successfully apply operations on to them, such as filtering
                if ($v instanceof ArrayObject) {
                    unset($current[$k]);
                }
            }
            $filesArray[] = (array) $current;
            //Array representation of file objects, on which we can apply sorting, filtering, etc
        }
        $filesArray = eF_multiSort($filesArray, 'name', 'asc');
        $fileArrays = array_merge($foldersArray, $filesArray);
        isset($ajaxOptions['order']) && $ajaxOptions['order'] == 'asc' ? $ajaxOptions['order'] = 'asc' : ($ajaxOptions['order'] = 'desc');
        !isset($ajaxOptions['sort']) ? $ajaxOptions['sort'] = 'name' : null;
        !isset($ajaxOptions['limit']) ? $ajaxOptions['limit'] = 20 : null;
        !isset($ajaxOptions['offset']) ? $ajaxOptions['offset'] = 0 : null;
        !isset($ajaxOptions['filter']) ? $ajaxOptions['filter'] = '' : null;
        $size = sizeof($fileArrays);
        if ($size) {
            $fileArrays = eF_multiSort($fileArrays, $ajaxOptions['sort'], $ajaxOptions['order']);
            $ajaxOptions['filter'] ? $fileArrays = eF_filterData($fileArrays, $ajaxOptions['filter']) : null;
            $fileArrays = array_slice($fileArrays, $ajaxOptions['offset'], $ajaxOptions['limit']);
        }
        $extraColumnsString = '';
        foreach ($extraColumns as $value) {
            $extraColumnsString = '<td class = "topTitle centerAlign" name = "' . $value . '">' . $value . '</td>';
        }
        $filesCode = '
                        <table class = "sortedTable" style = "width:100%" size = "' . $size . '" id = "' . $tableId . '" useAjax = "1" rowsPerPage = "20" other = "' . urlencode($currentDirectory) . '" url = "' . $url . '&" nomass = "1" currentDir = "' . (isset($currentDir['path']) ? $currentDir['path'] : '') . '">
                    		<tr>' . ($options['show_type'] ? '<td class = "topTitle centerAlign" name = "extension">' . _TYPE . '</td>' : '') . '
                    			' . ($options['show_name'] ? '<td class = "topTitle" name = "name" id = "filename_' . $tableId . '">' . _NAME . '</td>' : '') . '
                    			' . ($options['show_size'] ? '<td class = "topTitle" name = "size">' . _SIZE . '</td>' : '') . '
                    			' . ($options['show_date'] ? '<td class = "topTitle" name = "timestamp">' . _MODIFIED . '</td>' : '') . '
								' . $extraColumnsString . '
                    			' . ($_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "topTitle centerAlign" name = "shared">' . _SHARE . '</td>' : '') . '
                    			' . ($options['show_tools'] ? '<td class = "topTitle centerAlign noSort">' . _OPERATIONS . '</td>' : '') . '
                    			' . ($options['delete'] || $_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "topTitle centerAlign">' . _SELECT . '</td>' : '') . '
                    		</tr>';
        if (isset($parentDir)) {
            if ($parentDir['path'] == $this->dir['path']) {
                $parentDir['path'] = '';
            }
            $filesCode .= '
            			<tr class = "defaultRowHeight eventRowColor"><td class = "centerAlign" colspan = "100%">' . _CURRENTLYBROWSINGFOLDER . ': ' . EfrontFile::decode(str_replace($this->dir['path'], '', $currentDir['path'])) . '</td></tr>
                    	<tr class = "defaultRowHeight oddRowColor">
                    		<td class = "centerAlign"><span style = "display:none"></span><img src = "images/16x16/folder_up.png" alt = "' . _UPONELEVEL . '" title = "' . _UPONELEVEL . '"/></td>
                    		<td><a class="editLink" href = "javascript:void(0)" onclick = "eF_js_rebuildTable($(\'filename_' . $tableId . '\').down().getAttribute(\'tableIndex\'), 0, \'\', \'desc\', \'' . urlencode($parentDir['path']) . '\');">.. (' . _UPONELEVEL . ')</a></td>
                    		<td colspan = "5"></td></tr>';
        }
        $i = 0;
        if ($_SESSION['supervises_branches'] != "") {
            $currentEmployee = EfrontUserFactory::factory($_SESSION['s_login']);
            $employees = eF_getTableData("users LEFT OUTER JOIN module_hcd_employee_has_job_description ON users.login = module_hcd_employee_has_job_description.users_LOGIN LEFT OUTER JOIN module_hcd_employee_works_at_branch ON users.login = module_hcd_employee_works_at_branch.users_LOGIN", "users.*, count(job_description_ID) as jobs_num", " users.user_type <> 'administrator' AND ((module_hcd_employee_works_at_branch.branch_ID IN (" . $_SESSION['supervises_branches'] . " ) AND module_hcd_employee_works_at_branch.assigned='1') OR EXISTS (SELECT module_hcd_employees.users_login FROM module_hcd_employees LEFT OUTER JOIN module_hcd_employee_works_at_branch ON module_hcd_employee_works_at_branch.users_login = module_hcd_employees.users_login WHERE users.login=module_hcd_employees.users_login AND module_hcd_employee_works_at_branch.branch_ID IS NULL)) GROUP BY login", "login");
            $supervisedLogins = array();
            foreach ($employees as $key2 => $value2) {
                if (!$value2['active'] || $value2['archive'] || !$value2['jobs_num']) {
                    unset($employees[$key2]);
                } else {
                    $supervisedLogins[] = $value2['login'];
                }
            }
        }
        foreach ($fileArrays as $key => $value) {
            $toolsString = '';
            $sharedString = '';
            if (is_file($value['path'])) {
                $value['id'] == -1 ? $identifier = $value['path'] : ($identifier = $value['id']);
                //The file/directory identifier will be the id, if the entity has a database representation, or the file path otherwise
                $value = new EfrontFile($value);
                //Restore file/directory representation, so we can use its methods
                $link = $url . '&view=' . urlencode($identifier);
                foreach ($extraFileTools as $tool) {
                    //$toolsString .= '<a href = "javascript:void(0)"><img src = "'.$tool['image'].'" alt = "'.$tool['title'].'" title = "'.$tool['title'].'" border = "0" onclick = "'.$tool['action'].'(this, \''.urlencode($identifier).'\')"  /></a>&nbsp;';
                    $toolsString .= '<a href = "javascript:void(0)"><img src = "' . $tool['image'] . '" alt = "' . $tool['title'] . '" title = "' . $tool['title'] . '" border = "0" onclick = "' . $tool['action'] . '(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)" /></a>&nbsp;';
                }
                if (($value['extension'] == 'zip' || $value['extension'] == 'gz') && $options['zip']) {
                    $toolsString .= '<a href = "javascript:void(0)"><img src = "images/16x16/uncompress.png" alt = "' . _UNCOMPRESS . '" title = "' . _UNCOMPRESS . '" border = "0" onclick = "uncompressFile(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)"  /></a>&nbsp;';
                }
                if ($options['download']) {
                    $toolsString .= '<a href = "' . $url . '&download=' . urlencode($identifier) . '"><img src = "images/16x16/import.png" alt = "' . _DOWNLOADFILE . '" title = "' . _DOWNLOADFILE . '" border = "0"/></a>&nbsp;';
                }
                if ($_SESSION['s_lessons_ID'] && $options['share']) {
                    $sharedString = '
	                    	<img class = "ajaxHandle" src = "images/16x16/trafficlight_green.png" alt = "' . _UNSHARE . '" title = "' . _UNSHARE . '" onclick = "unshareFile(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)" style = "' . (!$value['shared'] ? 'display:none' : null) . '" />
	                    	<img class = "ajaxHandle" src = "images/16x16/trafficlight_red.png"   alt = "' . _SHARE . '"   title = "' . _SHARE . '"   onclick = "shareFile(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)"   style = "' . ($value['shared'] ? 'display:none' : null) . '" />';
                }
                if ($options['metadata']) {
                    $toolsString .= '<a href = "' . $url . '&popup=1&display_metadata=' . urlencode($identifier) . '" target = "POPUP_FRAME"><img src = "images/16x16/information.png" alt = "' . _METADATA . '" title = "' . _METADATA . '" onclick = "eF_js_showDivPopup(event, \'' . _METADATA . '\', 2)" border = "0"/></a>&nbsp;';
                }
                if ($options['edit'] && ($_SESSION['s_type'] == 'administrator' || ($value['users_LOGIN'] == $_SESSION['s_login'] || in_array($value['users_LOGIN'], $supervisedLogins)) && isset($value['users_LOGIN']) || EfrontUser::isOptionVisible('allow_users_to_delete_supervisor_files'))) {
                    $toolsString .= '<img class = "ajaxHandle edit" src = "images/16x16/edit.png" alt = "' . _EDIT . '" title = "' . _EDIT . '" onclick = "toggleEditBox(this, \'' . urlencode($identifier) . '\')"/>&nbsp;';
                }
                if ($options['delete'] && ($_SESSION['s_type'] == 'administrator' || ($value['users_LOGIN'] == $_SESSION['s_login'] || in_array($value['users_LOGIN'], $supervisedLogins) || $value['users_LOGIN'] == "") || EfrontUser::isOptionVisible('allow_users_to_delete_supervisor_files'))) {
                    $toolsString .= '<img class = "ajaxHandle" src = "images/16x16/error_delete.png" alt = "' . _DELETE . '" title = "' . _DELETE . '" onclick = "if (confirm(\'' . _IRREVERSIBLEACTIONAREYOUSURE . '\')) {deleteFile(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)}"/></a>&nbsp;';
                }
            } else {
                if (is_dir($value['path'])) {
                    $identifier = $value['path'];
                    $value = new EfrontDirectory($value['path']);
                    $link = $url . '&view_dir=' . urlencode($identifier);
                    foreach ($extraDirectoryTools as $tool) {
                        $toolsString .= '<a href = "javascript:void(0)"><img src = "' . $tool['image'] . '" alt = "' . $tool['title'] . '" title = "' . $tool['title'] . '" border = "0" onclick = "' . $tool['action'] . '(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)"  /></a>&nbsp;';
                    }
                    if ($options['edit']) {
                        $toolsString .= '<img class = "ajaxHandle edit" src = "images/16x16/edit.png" alt = "' . _EDIT . '" title = "' . _EDIT . '" onclick = "toggleEditBox(this, \'' . urlencode($identifier) . '\')"/>&nbsp;';
                    }
                    if ($options['delete']) {
                        $toolsString .= '<img class = "ajaxHandle" src = "images/16x16/error_delete.png" alt = "' . _DELETE . '" title = "' . _DELETE . '" onclick = "if (confirm(\'' . _IRREVERSIBLEACTIONAREYOUSURE . '\')) {deleteFolder(this, $(\'span_' . urlencode($identifier) . '\').innerHTML)}" />&nbsp;';
                    }
                }
            }
            $filesCode .= '<tr class = "defaultRowHeight ' . (fmod($i++, 2) ? 'oddRowColor' : 'evenRowColor') . '">';
            if ($options['show_type']) {
                $filesCode .= '<td class = "centerAlign"><span style = "display:none">' . (isset($value['extension']) ? $value['extension'] : '') . '</span>';
                if ($value['type'] == 'file') {
                    if (strpos($value['mime_type'], "image") !== false || strpos($value['mime_type'], "text") !== false || strpos($value['mime_type'], "pdf") !== false || strpos($value['mime_type'], "html") !== false || strpos($value['mime_type'], "video") !== false || strpos($value['mime_type'], "flash") !== false) {
                        $filesCode .= '<a href = "javascript:void(0);" onclick = "eF_js_showDivPopup(event, \'' . _PREVIEW . '\', 2, \'preview_table_' . $tableId . '\');$(\'preview_frame\').src = \'' . $link . '\';" ><img src = "' . $value->getTypeImage() . '" alt = "' . $value['mime_type'] . '" title = "' . $value['mime_type'] . '" border = "0"/></a></td>';
                    } else {
                        $filesCode .= '<a href = "' . $url . '&download=' . urlencode($identifier) . '"><img src = "' . $value->getTypeImage() . '" alt = "' . $value['mime_type'] . '" title = "' . $value['mime_type'] . '" border = "0"/></a>';
                    }
                } else {
                    isset($value['mime_type']) ? $mimeType = $value['mime_type'] : ($mimeType = '');
                    $filesCode .= '<img src = "' . $value->getTypeImage() . '" alt = "' . $mimeType . '" title = "' . $mimeType . '" border = "0"/></td>';
                }
            }
            if ($options['show_name']) {
                $filesCode .= '<td><span id = "span_' . urlencode($identifier) . '" style = "display:none;">' . urlencode($identifier) . '</span>';
                if ($value['type'] == 'file') {
                    if ($show_tooltip) {
                        $filesCode .= $value->toHTMLTooltipLink($link, true, $tableId);
                    } else {
                        if (strpos($value['mime_type'], "image") !== false || strpos($value['mime_type'], "text") !== false || strpos($value['mime_type'], "pdf") !== false || strpos($value['mime_type'], "flash") !== false || strpos($value['mime_type'], "video") !== false) {
                            $filesCode .= '<a href = "' . $link . '" target = "PREVIEW_FRAME" onclick = "eF_js_showDivPopup(event, \'' . _PREVIEW . '\', 2, \'preview_table_' . $tableId . '\');">' . $value['name'] . '</a>';
                        } else {
                            $filesCode .= '<a target = "PREVIEW_FRAME" href = "' . $url . '&download=' . urlencode($identifier) . '">' . $value['name'] . '</a>';
                        }
                    }
                } else {
                    $filesCode .= '<a class="editLink" href = "javascript:void(0)" onclick = "eF_js_rebuildTable($(\'filename_' . $tableId . '\').down().getAttribute(\'tableIndex\'), 0, \'\', \'desc\', \'' . urlencode($identifier) . '\');">' . $value['name'] . '</a>';
                }
                $filesCode .= '<span id = "edit_' . urlencode($identifier) . '" style = "display:none"><input type = "text" value = "' . $value['name'] . '" onkeypress = "if (event.which == 13 || event.keyCode == 13) {Element.extend(this).next().down().onclick(); return false;}"/>&nbsp;<a href = "javascript:void(0)"><img id = "editImage_' . urlencode($identifier) . '"src = "images/16x16/success.png" style = "vertical-align:middle" onclick = "editFile(this, $(\'span_' . urlencode($identifier) . '\').innerHTML, Element.extend(this).up().previous().value, \'' . $value['type'] . '\',\'' . eF_addslashes($value['name']) . '\')" border = "0"></a></span></td>';
            }
            $extraColumnsString = '';
            foreach ($extraColumns as $column) {
                $extraColumnsString = '<td class = "centerAlign">' . $value[$column] . '</td>';
            }
            $filesCode .= '' . ($options['show_size'] ? '<td>' . ($value['type'] == 'file' ? $value['size'] . ' ' . _KB : '') . '</td>' : '') . '
                        		' . ($options['show_date'] ? '<td>' . formatTimestamp($value['timestamp'], 'time_nosec') . '</td>' : '') . '
                        		' . $extraColumnsString . '
                        		' . ($_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "centerAlign">' . $sharedString . '</td>' : '') . '
                        		' . ($options['show_tools'] ? '<td class = "centerAlign">' . $toolsString . '</td>' : '') . '
	                        		' . ($options['delete'] || $_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "centerAlign">' . ($value['type'] == 'file' ? '<input type = "checkbox" id = "' . $identifier . '" value = "' . $identifier . '" />' : '') . '</td>' : '') . '
                        	</tr>';
        }
        $massOperationsCode = '';
        if ($size) {
            $filesCode .= '
        				</table>';
            if ($options['delete'] || $_SESSION['s_lessons_ID'] && $options['share']) {
                $massOperationsCode = '
            			<div class = "horizontalSeparatorAbove">
            				<span style = "vertical-align:middle">' . _WITHSELECTEDFILES . ':</span>
            				' . ($_SESSION['s_lessons_ID'] && $options['share'] ? '<a href = "javascript:void(0)"><img src = "images/16x16/trafficlight_green.png" title = "' . _SHARESELECTED . '" alt = "' . _SHARESELECTED . '" border = "0" style = "vertical-align:middle" onclick = "shareSelected()"></a><a href = "javascript:void(0)"><img src = "images/16x16/trafficlight_red.png" title = "' . _UNSHARESELECTED . '" alt = "' . _UNSHARESELECTED . '" border = "0" style = "vertical-align:middle" onclick = "unshareSelected()"></a>' : '');
                if ($options['copy']) {
                    $massOperationsCode .= '
                			<form name = "copy_files_form" id = "copy_files_form" method = "post" style = "display:none;"><input type = "hidden" name = "copy_current_directory" id = "copy_current_directory"><input type = "hidden" name = "copy_files" id = "copy_files" value = "" /></form>
							<img class = "ajaxHandle" src = "images/16x16/copy.png" title = "' . _COPYSELECTED . '" alt = "' . _COPYSELECTED . '" onclick = "copyFiles(this);">
                            <img style = "display:none" class = "ajaxHandle" src = "images/16x16/paste.png" title = "' . _PASTESELECTED . '" alt = "' . _PASTESELECTED . '" onclick = "pasteFiles(this, \'' . $tableId . '\');">&nbsp;';
                }
                $massOperationsCode .= ($options['delete'] ? '<a href = "javascript:void(0)"><img src = "images/16x16/error_delete.png" title = "' . _DELETESELECTED . '" alt = "' . _DELETESELECTED . '" border = "0" style = "vertical-align:middle" onclick = "if (confirm(\'' . _IRREVERSIBLEACTIONAREYOUSURE . '\')) deleteSelected()"></a>' : '') . '
            			</div>';
            }
        } elseif (!isset($parentDir)) {
            //Don't display 'no data found' if in subdirectory, because it doesn't show up well with the .. (up one level)
            $filesCode .= '
            				<tr class = "oddRowColor defaultRowHeight"><td colspan = "100%" class = "emptyCategory">' . _NODATAFOUND . '</td></tr>
        				</table>';
        }
        $str = '
        	<div class = "headerTools">';
        if ($options['upload']) {
            $str .= '
        		<span>
            		<img src = "images/16x16/add.png" alt = "' . _UPLOADFILE . '" title = "' . _UPLOADFILE . '"/>
        			<a href = "javascript:void(0)" onclick = "$(\'url_upload\').value = \'\';$$(\'input\').each(function(s)  {if (s.type == \'file\') s.value = \'\'});$(\'upload_current_directory\').value = $(\'' . $tableId . '\').getAttribute(\'currentDir\');eF_js_showDivPopup(event, \'' . _UPLOADFILE . '\', 0, \'upload_file_table_' . $tableId . '\')">' . _UPLOADFILE . '</a>&nbsp;
        		</span>';
        }
        if ($options['create_folder']) {
            $str .= '
        		<span>
        			<img src = "images/16x16/folder_add.png" alt = "' . _CREATEFOLDER . '" title = "' . _CREATEFOLDER . '">
        			<a href = "javascript:void(0)" onclick = "$(\'current_directory\').value = $(\'' . $tableId . '\').getAttribute(\'currentDir\');eF_js_showDivPopup(event, \'' . _CREATEFOLDER . '\', 0, \'create_directory_table_' . $tableId . '\')">' . _CREATEFOLDER . '</a>&nbsp;
        		</span>';
        }
        foreach ($extraHeaderOptions as $option) {
            $str .= '
            	<span>
	        		<img src = "' . $option['image'] . '" alt = "' . $option['title'] . '" title = "' . $option['title'] . '">
    	    		<a href = "' . (isset($option['href']) ? $option['href'] : 'javascript:void(0)') . '" onclick = "' . $option['action'] . '">' . $option['title'] . '</a>&nbsp;
    	    	</span>';
        }
        $str .= '
        	</div>

        	<table style = "width:100%">
        		<tr><td>
<!--ajax:' . $tableId . '-->
        				' . $filesCode . '
<!--/ajax:' . $tableId . '-->
						' . $massOperationsCode . '
        			</td></tr>
        	</table>
        	<script>
        	var url = "' . $url . '";
        	var tableId = "' . $tableId . '";
        	</script>
        	<div id = "upload_file_table_' . $tableId . '" 	   style = "display:none;" class = "filemanagerBlock">' . $uploadFormString . '</div>
        	<div id = "create_directory_table_' . $tableId . '" style = "display:none;" class = "filemanagerBlock">' . $createFolderString . '</div>

        	<div id = "preview_table_' . $tableId . '" style = "height:100%;display:none" class = "filemanagerBlock">
                <iframe name = "PREVIEW_FRAME" id = "preview_frame" src = "about:blank" style = "border-width:0px;width:100%;height:400px;padding:0px 0px 0px 0px">Sorry, but your browser needs to support iframes to see this</iframe>
            </div>';
        /*
                $GLOBALS['smarty'] -> assign("T_BLOCK_DATA", $uploadFormString);
                $GLOBALS['smarty'] -> assign("T_DISPLAY_BLOCK", '<div id = "upload_file_table_'.$tableId.'" style = "display:none;">{eF_template_printBlock title="'._UPLOADFILE.'" data=$T_BLOCK_DATA image="32x32/import.png"}</div>');
                $str .= $GLOBALS['smarty'] -> fetch("display_code.tpl");
                $GLOBALS['smarty'] -> assign("T_BLOCK_DATA", $createFolderString);
                $GLOBALS['smarty'] -> assign("T_DISPLAY_BLOCK", '<div id = "create_directory_table_'.$tableId.'" style = "display:none;">{eF_template_printBlock title="'._CREATEFOLDER.'" data=$T_BLOCK_DATA image="32x32/folder.png"}</div>');
                $str .= $GLOBALS['smarty'] -> fetch("display_code.tpl");
                $GLOBALS['smarty'] -> assign("T_DISPLAY_BLOCK", '<div id = "preview_table_'.$tableId.'" style = "display:none">{eF_template_printBlock title="'._PREVIEW.'" data="<iframe name = \"PREVIEW_FRAME\" id = \"preview_frame\" src = \"about:blank\" style = \"border-width:0px;width:100%;height:100%;padding:0px\">Sorry, but your browser needs to support iframes to see this</iframe>" image="32x32/folder.png"}</div>');
                $str .= $GLOBALS['smarty'] -> fetch("display_code.tpl");
        */
        return $str;
    }
 /**
  * Export lesson
  *
  * This function is used to export the current lesson's data to
  * a file, which can then be imported to other systems. Apart from
  * the lesson content, the user may optinally specify additional
  * information to export, using the $exportEntities array. If
  * $exportEntities is 'all', everything that can be exported, is
  * exported
  *
  * <br/>Example:
  * <code>
  * $exportedFile = $lesson -> export('all');
  * </code>
  *
  * @param array $exportEntities The additional data to export
  * @param boolean $rename Whether to rename the exported file with the same name as the lesson
  * @param boolean $exportFiles Whether to export files as well
  * @return EfrontFile The object of the exported data file
  * @since 3.5.0
  * @access public
  */
 public function export($exportEntities, $rename = true, $exportFiles = true)
 {
     if (!$exportEntities) {
         $exportEntities = array('export_surveys' => 1, 'export_announcements' => 1, 'export_glossary' => 1, 'export_calendar' => 1, 'export_comments' => 1, 'export_rules' => 1);
     }
     $data['lessons'] = $this->lesson;
     unset($data['lessons']['share_folder']);
     unset($data['lessons']['instance_source']);
     unset($data['lessons']['originating_course']);
     $content = eF_getTableData("content", "*", "lessons_ID=" . $this->lesson['id']);
     if (sizeof($content) > 0) {
         $contentIds = array();
         for ($i = 0; $i < sizeof($content); $i++) {
             $content[$i]['data'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $content[$i]['data']);
             $content[$i]['data'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $content[$i]['data']);
             $contentIds[] = $content[$i]['id'];
         }
         $content_list = implode(",", array_values($contentIds));
         $data['content'] = $content;
         $questions = eF_getTableData("questions", "*", "lessons_ID=" . $this->lesson['id']);
         if (sizeof($questions) > 0) {
             for ($i = 0; $i < sizeof($questions); $i++) {
                 $questions[$i]['text'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $questions[$i]['text']);
                 $questions[$i]['text'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $questions[$i]['text']);
             }
             $data['questions'] = $questions;
         }
         $tests = eF_getTableData("tests", "*", "lessons_ID=" . $this->lesson['id']);
         if (sizeof($tests)) {
             $testsIds = array();
             foreach ($tests as $key => $value) {
                 $testsIds[] = $value['id'];
             }
             $tests_list = implode(",", array_values($testsIds));
             $tests_to_questions = eF_getTableData("tests_to_questions", "*", "tests_ID IN ({$tests_list})");
             for ($i = 0; $i < sizeof($tests); $i++) {
                 $tests[$i]['description'] = str_replace(G_SERVERNAME, "##SERVERNAME##", $tests[$i]['description']);
                 $tests[$i]['description'] = str_replace("content/lessons/" . ($this->lesson['share_folder'] ? $this->lesson['share_folder'] : $this->lesson['id']), "##LESSONSLINK##", $tests[$i]['description']);
             }
             $data['tests'] = $tests;
             $data['tests_to_questions'] = $tests_to_questions;
         }
         if (isset($exportEntities['export_rules'])) {
             $rules = eF_getTableData("rules", "*", "lessons_ID=" . $this->lesson['id']);
             if (sizeof($rules) > 0) {
                 $data['rules'] = $rules;
             }
         }
         if (isset($exportEntities['export_comments'])) {
             $comments = eF_getTableData("comments", "*", "content_ID IN ({$content_list})");
             if (sizeof($comments) > 0) {
                 $data['comments'] = $comments;
             }
         }
     }
     if (isset($exportEntities['export_calendar'])) {
         $calendar = calendar::getLessonCalendarEvents($this);
         $calendar = array_values($calendar);
         if (sizeof($calendar) > 0) {
             $data['calendar'] = $calendar;
         }
     }
     if (isset($exportEntities['export_glossary'])) {
         $glossary = eF_getTableData("glossary", "*", "lessons_ID = " . $this->lesson['id']);
         if (sizeof($glossary) > 0) {
             $data['glossary'] = $glossary;
         }
     }
     if (isset($exportEntities['export_announcements'])) {
         $news = eF_getTableData("news", "*", "lessons_ID=" . $this->lesson['id']);
         if (sizeof($news) > 0) {
             $data['news'] = $news;
         }
     }
     if (isset($exportEntities['export_surveys'])) {
         $surveys = eF_getTableData("surveys", "*", "lessons_ID=" . $this->lesson['id']);
         //prepei na ginei to   lesson_ID -> lessons_ID sti basi (ayto isos to parampsoyme eykola)
         if (sizeof($surveys) > 0) {
             $data['surveys'] = $surveys;
             $surveys_ = array();
             foreach ($surveys as $key => $value) {
                 $surveys_[$value['id']] = $value;
             }
             $surveys_list = implode(",", array_keys($surveys_));
             $questions_to_surveys = eF_getTableData("questions_to_surveys", "*", "surveys_ID IN ({$surveys_list})");
             // oposipote omos to survey_ID -> surveys_ID sti basi
             if (sizeof($questions_to_surveys) > 0) {
                 $data['questions_to_surveys'] = $questions_to_surveys;
             }
         }
     }
     $lesson_conditions = eF_getTableData("lesson_conditions", "*", "lessons_ID=" . $this->lesson['id']);
     if (sizeof($lesson_conditions) > 0) {
         $data['lesson_conditions'] = $lesson_conditions;
     }
     $projects = eF_getTableData("projects", "*", "lessons_ID=" . $this->lesson['id']);
     if (sizeof($projects) > 0) {
         $data['projects'] = $projects;
     }
     $lesson_files = eF_getTableData("files", "*", "path like '" . str_replace(G_ROOTPATH, '', EfrontDirectory::normalize($this->getDirectory())) . "%'");
     if (sizeof($lesson_files) > 0) {
         $data['files'] = $lesson_files;
     }
     if (G_VERSIONTYPE != 'community') {
         #cpp#ifndef COMMUNITY
         if (G_VERSIONTYPE != 'standard') {
             #cpp#ifndef STANDARD
             //Export scorm tables from here over
             $scormLessonTables = array('scorm_sequencing_adlseq_map_info', 'scorm_sequencing_content_to_organization', 'scorm_sequencing_maps_info', 'scorm_sequencing_organizations');
             foreach ($scormLessonTables as $table) {
                 $scorm_data = eF_getTableData($table, "*", "lessons_ID=" . $this->lesson['id']);
                 if (sizeof($scorm_data) > 0) {
                     $data[$table] = $scorm_data;
                 }
             }
             $scormContentTables = array('scorm_sequencing_completion_threshold', 'scorm_sequencing_constrained_choice', 'scorm_sequencing_control_mode', 'scorm_sequencing_delivery_controls', 'scorm_sequencing_hide_lms_ui', 'scorm_sequencing_limit_conditions', 'scorm_sequencing_maps', 'scorm_sequencing_map_info', 'scorm_sequencing_objectives', 'scorm_sequencing_rollup_considerations', 'scorm_sequencing_rollup_controls', 'scorm_sequencing_rollup_rules', 'scorm_sequencing_rules');
             if ($content_list) {
                 foreach ($scormContentTables as $table) {
                     $scorm_data = eF_getTableData($table, "*", "content_ID IN ({$content_list})");
                     if (sizeof($scorm_data) > 0) {
                         $data[$table] = $scorm_data;
                     }
                     if ($table == 'scorm_sequencing_rollup_rules' && sizeof($scorm_data) > 0) {
                         $ids = array();
                         foreach ($scorm_data as $value) {
                             $ids[] = $value['id'];
                         }
                         $result = eF_getTableData('scorm_sequencing_rollup_rule', "*", "scorm_sequencing_rollup_rules_ID IN (" . implode(",", $ids) . ")");
                         $data['scorm_sequencing_rollup_rule'] = $result;
                     }
                     if ($table == 'scorm_sequencing_rules' && sizeof($scorm_data) > 0) {
                         $ids = array();
                         foreach ($scorm_data as $value) {
                             $ids[] = $value['id'];
                         }
                         $result = eF_getTableData('scorm_sequencing_rule', "*", "scorm_sequencing_rules_ID IN (" . implode(",", $ids) . ")");
                         $data['scorm_sequencing_rule'] = $result;
                     }
                 }
             }
         }
         #cpp#endif
     }
     #cpp#endif
     //'scorm_sequencing_rollup_rule', 'scorm_sequencing_rule',
     // MODULES - Export module data
     // Get all modules (NOT only the ones that have to do with the user type)
     $modules = eF_loadAllModules();
     foreach ($modules as $module) {
         if ($moduleData = $module->onExportLesson($this->lesson['id'])) {
             $data[$module->className] = $moduleData;
         }
     }
     file_put_contents($this->directory . '/' . "data.dat", serialize($data));
     //Create database dump file
     if ($exportFiles) {
         $lessonDirectory = new EfrontDirectory($this->directory);
         $file = $lessonDirectory->compress($this->lesson['id'] . '_exported.zip', false);
         //Compress the lesson files
     } else {
         $dataFile = new EfrontFile($this->directory . '/' . "data.dat");
         $file = $dataFile->compress($this->lesson['id'] . '_exported.zip');
     }
     $newList = FileSystemTree::importFiles($file['path']);
     //Import the file to the database, so we can download it
     $file = new EfrontFile(current($newList));
     if (empty($GLOBALS['currentUser'])) {
         if ($_SESSION['s_login']) {
             $GLOBALS['currentUser'] = EfrontUserFactory::factory($_SESSION['s_login']);
             $userTempDir = $GLOBALS['currentUser']->user['directory'] . '/temp';
         } else {
             $userTempDir = sys_get_temp_dir();
         }
     } else {
         $userTempDir = $GLOBALS['currentUser']->user['directory'] . '/temp';
     }
     if (!is_dir($userTempDir)) {
         //If the user's temp directory does not exist, create it
         $userTempDir = EfrontDirectory::createDirectory($userTempDir, false);
         $userTempDir = $userTempDir['path'];
     }
     try {
         $existingFile = new EfrontFile($userTempDir . '/' . EfrontFile::encode($this->lesson['name']) . '.zip');
         //Delete any previous exported files
         $existingFile->delete();
     } catch (Exception $e) {
     }
     if ($rename) {
         $newName = str_replace(array('"', '>', '<', '*', '?', ':'), array('&quot;', '&gt;', '&lt;', '&#42;', '&#63;', '&#58;'), $this->lesson['name']);
         $file->rename($userTempDir . '/' . EfrontFile::encode($newName) . '.zip', true);
     }
     unlink($this->directory . '/' . "data.dat");
     //Delete database dump file
     return $file;
 }
Example #5
0
define("PASSWORD","' . $defaultConfig['phplivedocx_password'] . '");
define("PHPLIVEDOCXAPI","' . $defaultConfig['phplivedocx_server'] . '");
?>';
                file_put_contents($path . "phplivedocx_config.php", $phplivedocxConfig);
                eF_updateTableData("users", array('email' => $values['admin_email'], 'password' => EfrontUser::createPassword($values['admin_password']), 'last_login' => '0'));
                eF_updateTableData("users", array('login' => $values['admin_name']), "id=1");
                eF_updateTableData("courses", array('created' => time()));
                eF_updateTableData("courses", array('created' => time(), 'creator_LOGIN' => $values['admin_name']));
                eF_updateTableData("lessons", array('created' => time(), 'creator_LOGIN' => $values['admin_name']));
                eF_updateTableData("users_to_courses", array('from_timestamp' => time()));
                eF_updateTableData("users_to_lessons", array('from_timestamp' => time()));
                eF_deleteTableData("logs", "");
                eF_deleteTableData("events", "");
                EfrontConfiguration::setValue("database_version", G_VERSION_NUM);
                EfrontConfiguration::setValue("system_Email", $values['admin_email']);
                $file = new EfrontFile(EfrontDirectory::normalize(getcwd()) . '/lessons.zip');
                $newFile = $file->copy(G_LESSONSPATH, true);
                $newFile->uncompress();
                $newFile->delete();
                if (G_VERSIONTYPE == 'community') {
                    #cpp#ifdef COMMUNITY
                    $modulesToRemove[] = 'content_reports';
                    $modulesToRemove[] = 'course_reports';
                    $modulesToRemove[] = 'fuze_meetings';
                    $modulesToRemove[] = 'training_reports';
                }
                #cpp#endif
                if (G_VERSIONTYPE != 'enterprise') {
                    #cpp#ifndef ENTERPRISE
                    $modulesToRemove[] = 'branch_reports';
                    $modulesToRemove[] = 'jobs_manager';