示例#1
0
 /**
  * Method to add table header.
  *
  * <PRE>
  * LEFT TITLE     RULE1   RULE2   RULE3
  * </PRE>
  * @access public 
  * @author Jonathan Abrahams
  * @return nothing
  */
 function addHeader($titleLeft, $titleTop, $actionTop)
 {
     extract($this->_properties);
     $arrTop = $this->_arrRules;
     // The header for the Rules
     $this->objGrid->startRow();
     $this->objGrid->addCell('');
     $this->objGrid->addCell($titleTop, $colWidth, NULL, NULL, 'heading', "colspan={$colCount} align=center");
     $this->objGrid->endRow();
     $this->objGrid->startRow();
     // Insert the Action or Condition title.
     $this->objGrid->addCell($titleLeft, $colWidth, NULL, NULL, 'heading');
     // Insert the rule column headings.
     $ordered = array_keys($arrTop);
     sort($ordered);
     foreach ($ordered as $idTop) {
         $objTop = $arrTop[$idTop];
         $this->objGrid->addCell($this->lnkText($objTop, $actionTop, $idTop), $colWidth, NULL, NULL, 'heading');
     }
     $this->objGrid->endRow();
 }
 /**
  * Method to Display the Business Card
  * @return string
  */
 public function show()
 {
     switch ($this->userArray['sex']) {
         case 'M':
             $gender = 'Male';
             break;
         case 'F':
             $gender = 'Female';
             break;
         default:
             $gender = 'Unknown';
             break;
     }
     $emailLabel = $this->objLanguage->languageText('phrase_emailaddress');
     $genderLabel = $this->objLanguage->languageText('word_gender');
     $mobileLabel = $this->objLanguage->languageText('phrase_mobilenumber');
     $countryLabel = $this->objLanguage->languageText('word_country');
     $image = $this->objUser->getUserImage($this->userArray['userid'], TRUE);
     if ($this->showResetImage) {
         if ($this->objUser->hasCustomImage($this->userArray['userid'])) {
             $resetimageform = new form('updateimage', $this->uri(array('action' => $this->resetAction), $this->resetModule));
             $id = new hiddeninput('id', $this->userArray['id']);
             $resetimageform->addToForm($id->show());
             $userid = new hiddeninput('userid', $this->userArray['userid']);
             $resetimageform->addToForm($userid->show());
             $button = new button('resetimage', 'Reset Image');
             $button->setToSubmit();
             $resetimageform->addToForm(' ' . $button->show());
             $image .= $resetimageform->show();
         }
     }
     $objHeading = new htmlheading();
     $objHeading->str = $this->userArray['title'] . ' ' . $this->userArray['firstname'] . ' ' . $this->userArray['surname'];
     $objHeading->type = 1;
     $heading = $objHeading->show();
     $objTable = new htmltable();
     $objTable->width = '100%';
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell($image, '25%', 'center', 'center', 'userbizcardleft', 'rowspan="6"');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . ucfirst(strtolower($emailLabel)) . ':</strong>', '30%', '', '', 'heading', '');
     $objTable->addCell($this->userArray['emailaddress'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $mobileLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->userArray['cellnumber'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $countryLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->objCountries->getCountryName($this->userArray['country']) . ' ' . $this->objCountries->getCountryFlag($this->userArray['country']), '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $genderLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($gender, '', '', '', 'heading', '');
     $objTable->endRow();
     $string = $objTable->show();
     $objFieldset = new fieldset();
     $objFieldset->legend = $heading;
     $objFieldset->contents = $string;
     $objFieldset->width = '500px';
     $fieldset = $objFieldset->show();
     return $fieldset;
 }
 /**
  * Method to display the context users
  *
  * @access public
  * @return string html
  */
 public function getContextUsers($userId = Null, $contextCode = Null)
 {
     $hdCoursePages = $this->objLanguage->languageText('mod_logger_visitedpageshistory', 'logger');
     $hdStatsUser = $this->objLanguage->languageText('mod_logger_statisticsbyuser', 'logger');
     $objHead = new htmlheading();
     $objHead->str = ucwords($hdCoursePages . " " . $this->objUser->fullname($userId));
     $objHead->type = 1;
     //        $str = $objHead->show();
     $str = " ";
     $contextTitle = $this->objContext->getField('title', $contextCode);
     $objTable = new htmltable();
     $objTable->width = '100%';
     $objTable->border = '0';
     $objTable->cellspacing = '0';
     $objTable->cellpadding = '10';
     $objTable->startRow();
     $objTable->addHeaderCell("<b>" . $contextTitle . " " . $hdStatsUser . "</b>", '100%', 'top', 'left', Null, 'colspan=2');
     $objTable->endRow();
     if ($userId == NULL) {
         $userId = $this->objUser->userId();
     }
     $objContextGroups = $this->getObject('managegroups', 'contextgroups');
     $studRole = $objContextGroups->contextUsers($role = "Students", $contextCode, $fields = NULL);
     $key = 1;
     $class = 'odd';
     foreach ($studRole as $myStudRole) {
         $studentNames = $this->objUser->fullname($myStudRole['userid']);
         $objLink =& $this->getObject("link", "htmlelements");
         $objLink->link($this->uri(array('module' => 'logger', 'action' => 'userstatsbycontext', 'userId' => $myStudRole['userid'], 'contextcode' => $contextCode)));
         $objLink->link = $studentNames;
         $objTable->startRow();
         $objTable->addCell($key, '5%', 'top', 'left', $class);
         $objTable->addCell($objLink->show(), '95%', 'top', 'left', $class);
         $objTable->endRow();
         $key = $key + 1;
         if ($class == 'odd') {
             $class = 'even';
         } else {
             $class = 'odd';
         }
     }
     $str .= $objTable->show() . "<br />";
     return $str . "<br />";
 }
 /**
  *
  * Method to show the user selectable grades
  * 
  * @acces public
  * @return VOID 
  */
 public function showGrades()
 {
     $selectGradeLabel = $this->objLanguage->code2Txt('mod_grades_grade', 'grades', NULL, 'ERROR: mod_grades_grade');
     $selectLabel = $this->objLanguage->languageText('word_select', 'system', 'ERROR: word_select');
     $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success');
     $successLabel = $this->objLanguage->code2Txt('mod_userdetails_gradesuccess', 'userdetails', NULL, 'ERROR: mod_userdetails_gradesuccess');
     $errorTitleLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error');
     $errorLabel = $this->objLanguage->code2Txt('mod_userdetails_gradeerror', 'userdetails', NULL, 'ERROR: mod_userdetails_gradeerror');
     $grades = $this->objDBgrades->getAll();
     $userGroups = $this->objGroups->getUserGroups($this->objUser->userId());
     $name = NULL;
     if (!empty($userGroups)) {
         foreach ($userGroups as $group) {
             foreach ($grades as $grade) {
                 if ($group['group_define_name'] == $grade['name']) {
                     $name = $grade['name'];
                     break;
                     break;
                 }
             }
         }
     }
     $objDrop = new dropdown('new_name');
     $objDrop->addFromDB($grades, 'name', 'name');
     $objDrop->setSelected($name);
     $gradeDrop = $objDrop->show();
     $objInput = new textinput('old_name', $name, 'hidden', '50');
     $nameInput = $objInput->show();
     $objButton = new button('select', $selectLabel);
     $objButton->setId('grade_select');
     $selectButton = $objButton->show();
     $objTable = new htmltable();
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell('<b>' . ucfirst(strtolower($selectGradeLabel)) . ': </b>', '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($nameInput . $gradeDrop, '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($selectButton, '', '', '', '', '', '');
     $objTable->endRow();
     $gradeTable = $objTable->show();
     $objForm = new form('user', $this->uri(array('action' => 'change_grade')));
     $objForm->extra = ' enctype="multipart/form-data"';
     $objForm->addToForm($gradeTable);
     $gradeForm = $objForm->show();
     $string = $gradeForm;
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_success');
     $this->objDialog->setTitle(ucwords($successTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="success">' . $successLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog = $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_error');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     return $string . $dialog;
 }
示例#5
0
$objDrop = new dropdown('modulename');
$objDrop->extra = 'onchange="document.forms[\'modselect\'].submit()"';
foreach ($moduleList as $item) {
    $modName = $objLanguage->code2Txt('mod_' . $item['module_id'] . '_name', $item['module_id']);
    $objDrop->addOption($item['module_id'], $modName);
}
$objDrop->setSelected($moduleName);
$objForm = new form('modselect', $this->uri(array('action' => 'editlinks')));
$objForm->addToForm('<b>' . $objLabel->show() . ':</b>&nbsp;&nbsp;&nbsp;' . $objDrop->show());
$str .= '<p>' . $objForm->show() . '</p>';
// Toolbar links
$addTool = $objIcon->getAddIcon($this->uri(array('action' => 'addtool', 'modulename' => $moduleName)));
$objHead->str = $toolbarLabel . '&nbsp;&nbsp;' . $addTool;
$objHead->type = 3;
$str .= $objHead->show();
$objTable = new htmltable();
$objTable->width = '99%';
$objTable->cellspacing = 2;
$objTable->cellpadding = 5;
$tableHd = array();
$tableHd[] = $categoryLabel;
$tableHd[] = '';
$objTable->addHeader($tableHd, 'heading', "align='left'");
if (!empty($toolBar)) {
    $i = 0;
    foreach ($toolBar as $item) {
        $class = $i % 2 == 0 ? 'odd' : 'even';
        $icons = $objIcon->getEditIcon($this->uri(array('action' => 'edittool', 'id' => $item['id'])));
        $icons .= $objIcon->getDeleteIconWithConfirm('', array('action' => 'delete', 'id' => $item['id'], 'modulename' => $moduleName), 'toolbar');
        $objTable->addRow(array($item['category'], $icons), $class, "align='left'");
    }
示例#6
0
 /**
  * Method to show the option group for a table
  */
 public function showTable()
 {
     $table = new htmltable();
     $table->startRow();
     $table->cellpadding = 1;
     $counter = 0;
     $equalColumns = (100 - 100 % $this->tableColumns) / $this->tableColumns;
     foreach ($this->options as $opt => $lbl) {
         $counter++;
         $str = '<input type="radio" name="' . $this->name . '"';
         $str .= ' value="' . $opt . '"';
         if ($this->cssClass) {
             $str .= ' class="' . $this->cssClass . '"';
         }
         // If no CSS Id is given, it takes the default value of input_$opt for accessibility
         // If CSS Id is given, it takes the default value of input_$opt for accessibility, as well as CSS one
         if ($this->cssId) {
             $cssId = 'input_' . $this->name . $opt . ' ' . $this->cssId;
         } else {
             $cssId = 'input_' . $this->name . $opt;
         }
         // Cleanup to the CSS Id to make it W3C Compliant
         // At the moment, it checks for \ and /
         $cssId = preg_replace('/(\\/|\\\\)/', '_', $cssId);
         $str .= ' id="' . $cssId . '"';
         if ($this->selected == $opt) {
             $str .= ' checked="checked" ';
         }
         if ($this->extra) {
             $str .= ' ' . $this->extra;
         }
         $str .= ' />';
         $label = new label($lbl, $cssId);
         $str .= $label->show();
         $table->addCell($str, $equalColumns . '%');
         if ($counter % $this->tableColumns == 0) {
             $table->endRow();
             $table->startRow();
         }
     }
     if ($counter % $this->tableColumns == 0) {
         $table->endRow();
     } else {
         for ($i = 1; $i < $counter % $this->tableColumns; $i++) {
             $table->addCell('&nbsp;', $equalColumns . '%');
         }
         $table->endRow();
     }
     return $table->show();
 }