/** * Method to display the list of modules and their usage * * @access public * @return string html */ public function statsByUser() { $data = $this->logShow->showStatsByModule(); $hdModules = $this->objLanguage->languageText('mod_logger_statisticsbymodule', 'logger'); $lbModule = $this->objLanguage->languageText('phrase_modulename'); $lbHits = $this->objLanguage->languageText('word_hits'); $lbUsers = $this->objLanguage->languageText('phrase_numberofusers'); $lnDescription = $this->objLanguage->languageText('phrase_viewmoduledescription'); $objHead = new htmlheading(); $objHead->str = ucwords($hdModules); $objHead->type = 1; $str = $objHead->show(); if (!empty($data)) { $headerParams = $this->getJavascriptFile('new_sorttable.js', 'htmlelements'); $this->appendArrayVar('headerParams', $headerParams); $objTable = new htmltable(); $objTable->cellpadding = '5'; $objTable->id = 'newtable'; $objTable->css_class = 'sorttable'; $objTable->row_attributes = 'name="row_' . $objTable->id . '"'; $objTable->startRow(); $objTable->addCell($lbModule, '60%', '', '', 'heading'); $objTable->addCell($lbHits, '10%', '', '', 'heading'); $objTable->addCell($lbUsers, '10%', '', '', 'heading'); $objTable->addCell('', '20%', '', '', 'heading'); $objTable->endRow(); foreach ($data as $item) { $module = $item['module']; $objPop = new windowpop(); $objPop->set('location', $this->uri(array('action' => 'showmoduleinfo', 'mod' => $module))); $objPop->set('linktext', $lnDescription); $objPop->set('width', '250'); $objPop->set('height', '300'); $objPop->set('left', '300'); $objPop->set('top', '400'); $objPop->set('resizable', 'yes'); $link = $objPop->show(); $row = array(); $row[] = $module; $row[] = $item['calls']; $row[] = $item['users']; $row[] = $link; $objTable->row_attributes = "name='row_" . $objTable->id . "' onmouseover=\"this.className='tbl_ruler';\" onmouseout=\"this.className=''; \""; $objTable->addRow($row); } $str .= $objTable->show(); } return $str . '<br />'; }
/** * Method to show the file selector input * @return string File Selector */ public function show() { $this->appendArrayVar('headerParams', $this->showClearInputJavaScript()); if ($this->defaultFile == '') { $defaultId = ''; $defaultName = ''; } else { $file = $this->objFile->getFile($this->defaultFile); if ($file == FALSE) { $defaultId = ''; $defaultName = ''; } else { $defaultId = $file['id']; $defaultName = $file['filename']; } } $input = new hiddeninput($this->name, $defaultId); $input->extra = ' id="hidden_' . $this->name . '"'; if (count($this->restrictFileList) == 0) { $ext = ''; } else { $ext = ''; $divider = ''; foreach ($this->restrictFileList as $type) { $ext .= $divider . $type; $divider = '____'; } } $forceRestrictions = $this->forceRestrictions ? 'yes' : 'no'; $objPop = new windowpop(); if ($this->context) { $context = 'yes'; } else { $context = 'no'; } if ($this->workgroup) { $workgroup = 'yes'; } else { $workgroup = 'no'; } $location = $this->uri(array('mode' => 'selectfilewindow', 'restriction' => $ext, 'forcerestrictions' => $forceRestrictions, 'name' => $this->name, 'context' => $context, 'workgroup' => $workgroup), 'filemanager'); // Couldnt do this via uri function due to embedded JS $location .= '&value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&'; $objPop->set('location', $location); $this->objIcon->setIcon('find_file'); $this->objIcon->alt = 'Select File'; $this->objIcon->title = 'Select File'; $objPop->set('linktext', $this->objIcon->show()); $objPop->set('linktext', 'Browse'); $objPop->set('linkType', 'button'); $objPop->set('width', '750'); $objPop->set('height', '500'); $objPop->set('resizable', 'yes'); $objPop->set('scrollbars', 'yes'); $objPop->set('left', '50'); $objPop->set('top', '100'); $objPop->set('status', 'yes'); //leave the rest at default values $objPop->putJs(); $textinput = new textinput('selectfile_' . $this->name, $defaultName); $textinput->setId('input_selectfile_' . $this->name); $textinput->extra = ' readonly="true" style="width:' . $this->widthOfInput . '" '; $button = new button('clear', 'Clear', 'clearFileInputJS(\'' . $this->name . '\');'); return $input->show() . $textinput->show() . ' ' . $objPop->show() . ' ' . $button->show(); }
/** * Method to show the file selector input * @return string File Selector */ public function show($context = "no") { $this->appendArrayVar('headerParams', $this->showClearInputJavaScript()); if ($this->defaultFile == '') { $defaultId = ''; $defaultName = ''; $defaultPath = NULL; } else { $file = $this->objFile->getFile($this->defaultFile); if ($file == FALSE) { $defaultId = ''; $defaultName = ''; $defaultPath = NULL; } else { $defaultId = $file['id']; $defaultName = $file['filename']; $defaultPath = $file['path']; } } $input = new hiddeninput($this->name, $defaultId); $input->extra = ' id="hidden_' . $this->name . '"'; $objPop = new windowpop(); if ($this->context == '') { $context = 'no'; } else { $context = 'yes'; } if ($this->workgroup) { $workgroup = 'yes'; } else { $workgroup = 'no'; } $location = $this->uri(array('mode' => 'selectimagewindow', 'restriction' => 'jpg____gif____png____jpeg', 'name' => $this->name, 'context' => $context, 'workgroup' => $workgroup), 'filemanager'); // Couldnt do this via uri function due to embedded JS $location .= '&value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&'; $objPop->set('location', $location); $this->objIcon->setIcon('find_file'); $this->objIcon->alt = 'Select File'; $this->objIcon->title = 'Select File'; $objPop->set('linkType', 'button'); $objPop->set('linktext', 'Select File'); //$objPop->set('linktext', $this->objIcon->show()); $objPop->set('width', '750'); $objPop->set('height', '500'); $objPop->set('resizable', 'yes'); $objPop->set('scrollbars', 'yes'); $objPop->set('left', '50'); $objPop->set('top', '100'); $objPop->set('status', 'yes'); //leave the rest at default values $objPop->putJs(); if ($defaultId == '') { $this->objIcon->setIcon('imagepreview'); $this->objIcon->alt = 'Image Preview'; $this->objIcon->title = 'Image Preview'; $this->objIcon->extra = ' id="imagepreview_' . $this->name . '" class="ImagePreview"'; $previewImg = $this->objIcon->show(); } else { $img = $this->objThumbnails->getThumbnail($defaultId, $file['filename'], $defaultPath); $previewImg = '<img src="' . $img . '" id="imagepreview_' . $this->name . '" class="ImagePreview"/>'; } $textinput = new textinput('selectfile_' . $this->name, $defaultName); $textinput->setId('selectfile_' . $this->name); $textinput->extra = ' readonly="true" style="width:' . $this->widthOfInput . '";height="50" '; $button = new button('clear', 'Reset', 'clearFileInputJS(\'' . $this->name . '\');'); // Option for showing via submodal window // $objSubModalWindow = $this->getObject('submodalwindow', 'htmlelements'); // $subModal = $objSubModalWindow->show('Select', $location, 'button'); // return $input->show().$textinput->show().' '.$subModal.$button->show(); return $input->show() . '<div class="ImagePreviewArea">' . $previewImg . '</div><br /><div>' . $objPop->show() . ' ' . $button->show() . '</div>'; //$textinput->show() }