public function searchForm()
 {
     $this->loadClass('form', 'htmlelements');
     $this->loadClass('textinput', 'htmlelements');
     $this->loadClass('button', 'htmlelements');
     $form = new form('searchfile', $this->uri(array('action' => 'search')));
     $textinput = new textinput('filesearch');
     $button = new button('submitsearch', 'Search');
     $button->setToSubmit();
     $form->addToForm($textinput->show() . ' ' . $button->show());
     return $form->show();
 }
Esempio n. 2
0
 /**
  * Short description for function
  * 
  * Long description (if any) ...
  * 
  * @return object Return description (if any) ...
  * @access public
  */
 function show()
 {
     $show = parent::show();
     $objForm = new form('form1');
     $objForm->action = $this->uri(array('action' => 'edit_main'));
     $objForm->displayType = 3;
     $objForm->addToForm($show);
     $objForm->addToForm("<input type='hidden' name='button' value=''>");
     $objForm->addToForm("<input type='hidden' name='class' value=''>");
     $objForm->addToForm("<input type='hidden' name='id' value=''>");
     return $objForm->show();
 }
Esempio n. 3
0
if ($mode == "edit") {
    $rep = array('category' => $category);
    $fieldsetLabel = $this->objLanguage->code2txt('mod_storycategory_editlabel', "storycategoryadmin", $rep);
} else {
    $fieldsetLabel = $this->objLanguage->code2txt("mod_storycategory_addlabel", "storycategoryadmin");
}
//Create an element for the hidden text input
$objElement = new textinput("id");
//Set the value to the primary keyid
if (isset($id)) {
    $objElement->setValue($id);
}
//Set the field type to hidden for the primary key
$objElement->fldType = "hidden";
//Add the hidden PK field to the form
$objForm->addToForm($objElement->show());
//Create label for input of category
$catLabel = new label($this->objLanguage->languageText("word_category"), "input_category");
//Create an element for the input of category
$objCat = new textinput("category");
$catMiss = $this->objLanguage->languageText('mod_storycategory_catmiss', "storycategoryadmin");
$objForm->addRule('category', $catMiss, 'required');
//Set the value of the element to $category
if (isset($category)) {
    $objCat->setValue($category);
}
//Create label for the input of title
$titLabel = new label($this->objLanguage->languageText("word_title"), "input_title");
//Create an element for the input of title
$objTit = new textinput("title");
$titMiss = $this->objLanguage->languageText('mod_storycategory_titmiss', "storycategoryadmin");
 /**
  * Method to render an add form to a template
  *
  * @param string $module The module to add the parameter
  */
 function showEditAddForm($pmodule)
 {
     //Create a form
     $formAction = $this->uri(array('action' => 'save'));
     //Load the form class
     $this->loadClass('form', 'htmlelements');
     //Create and instance of the form class
     $objForm = new form('sysconfig');
     //Set the action for the form to the uri with paramArray
     $objForm->setAction($formAction);
     //Set the displayType to 3 for freeform
     $objForm->displayType = 3;
     //Create a heading for the title
     //$objHd = $this->newObject('htmlheading', 'htmlelements');
     //Load the textinput class
     $this->loadClass('textinput', 'htmlelements');
     //Load the label class
     $this->loadClass('label', 'htmlelements');
     //Load the dropdown class
     //Kevin Cyster
     $this->loadClass('dropdown', 'htmlelements');
     //Create an element for the input of module
     $objElement = new textinput("pmodule");
     //Set the value of the element to $module
     if (isset($pmodule)) {
         $objElement->setValue($pmodule);
     }
     //Create label for input of module
     $label = new label($this->objLanguage->languageText("mod_sysconfig_modtxt", 'sysconfig'), "input_pmodule");
     $objForm->addToForm("<p><strong>" . $this->objLanguage->languageText("mod_sysconfig_modtxt", 'sysconfig') . "</strong>: " . $pmodule . "</p>");
     //Get the pk value
     $id = $this->getParam('id');
     //Get the records for editing
     $ar = $this->objDbSysconfig->getRow('id', $id, 'tbl_sysconfig_properties');
     //Get the two values needed
     if (isset($ar)) {
         $pname = $ar['pname'];
         $pvalue = $ar['pvalue'];
     } else {
         $pname = $this->getParam('id', NULL);
         $pvalue = $this->getParam('value', NULL);
     }
     #if
     //Create an element for the input of id
     $objElement = new textinput("id");
     $objElement->fldType = "hidden";
     $objElement->setValue($id);
     $objForm->addToForm($objElement->show());
     //Create an element for the input of id
     $objElement = new textinput("pmodule");
     $objElement->fldType = "hidden";
     $objElement->setValue($pmodule);
     $objForm->addToForm($objElement->show());
     //Add the $name element to the form
     $objForm->addToForm('<p><b>' . $this->objLanguage->languageText("mod_sysconfig_paramname", 'sysconfig') . '</b>: ' . $pname . '</p>');
     // Check in Config folder if module is gives as _site_
     if ($pmodule == '_site_') {
         $moduleToCheck = 'config';
     } else {
         $moduleToCheck = $pmodule;
     }
     // Load object that checks if class exists
     $checkobject = $this->getObject('checkobject', 'utilities');
     // Check if class 'sysconfig_{pname}' exists in module.
     if ($checkobject->objectFileExists('sysconfig_' . str_replace('/', '_', str_replace('-', '_', $pname)), $moduleToCheck)) {
         // If yes, instantiate the object
         $objParamValue = $this->getObject(strtolower('sysconfig_' . str_replace('/', '_', str_replace('-', '_', $pname))), $moduleToCheck);
         // send it the current default value
         $objParamValue->setDefaultValue($pvalue);
     } else {
         $valueLabel = new label($this->objLanguage->languageText("mod_sysconfig_paramvalue", 'sysconfig'), "input_pvalue");
         //Add the $value element to the form
         $objForm->addToForm("<b>" . $valueLabel->show() . "</b>: ");
         //Create an element for the input of value
         $objParamValue = new textinput("pvalue");
         $objParamValue->size = "50";
         //Set the value of the element to $value
         if (isset($pvalue)) {
             $objParamValue->setValue($pvalue);
         }
         #if
     }
     //Create text add link
     $objForm->addToForm($objParamValue->show() . "<br /><br />");
     // Create an instance of the button object and add a save button to the form
     $this->loadClass('button', 'htmlelements');
     // Create a submit button
     $objElement = new button('submit');
     // Set the button type to submit
     $objElement->setToSubmit();
     // Use the language object to add the word save
     $objElement->setValue(' ' . $this->objLanguage->languageText("word_save") . ' ');
     // Add the button to the form
     $objForm->addToForm('<br/>' . $objElement->show());
     //Add the form
     return $objForm->show();
 }
Esempio n. 5
0
$this->loadClass('checkbox', 'htmlelements');
$this->loadClass('label', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
// echo '<pre>';
// print_r($_POST);
// echo '</pre>';
if ($this->getParam('files') == NULL || !is_array($this->getParam('files')) || count($this->getParam('files')) == 0) {
    echo '<div class="noRecordsMessage">' . $this->objLanguage->languageText('mod_filemanager_nofileswereselected', 'filemanager', 'No Files Were Selected') . '</div>';
    echo '<p><a href="javascript:history.back()">' . $this->objLanguage->languageText('mod_filemanager_backtopreviouspage', 'filemanager', 'Back to Previous Page') . '</a> / ';
    echo '<a href="' . $this->uri(NULL) . '">' . $this->objLanguage->languageText('mod_filemanager_returntofilemanager', 'filemanager', 'Return to File Manager') . '</a></p>';
} else {
    $files = $this->getParam('files');
    $form = new form('confirmsymlink', $this->uri(array('action' => 'symlinkconfirm')));
    $folderIcon = $this->objFileIcons->getExtensionIcon('folder');
    $form->addToForm('<ul>');
    $counter = 0;
    $folderCounter = 0;
    foreach ($files as $file) {
        if (substr($file, 0, 8) == 'folder__') {
            $folderCounter++;
        } else {
            $fileDetails = $this->objFiles->getFile($file);
            if ($fileDetails != FALSE) {
                $counter++;
                $checkbox = new checkbox('files[]', htmlentities($fileDetails['filename']), TRUE);
                $checkbox->value = $file;
                $form->addToForm('<li>' . $checkbox->show() . ' ' . htmlentities($fileDetails['filename']) . '</li>');
            }
        }
    }
Esempio n. 6
0
    $pname = $this->getParam('key', '');
}
if ($ptag == '') {
    // Get it from the querystring
    $ptag = $this->getParam('value', '');
}
//Create an element for the hidden text input
$objElement = new textinput("id");
//Set the value to the primary keyid
if (isset($id)) {
    $objElement->setValue($id);
}
//Set the field type to hidden for the primary key
$objElement->fldType = "hidden";
//Add the hidden PK field to the form
$objForm->addToForm($objElement->show());
//Create a label for the input of pname
$pnameLabel = new label($this->objLanguage->languageText("mod_userparamsadmin_pname", 'userparamsadmin'), "input_pname");
//Create an element for the input of pname
$objElement = new textinput("pname");
//Hide it to avoid breaking the system if its an edit
if ($mode == "edit") {
    $objElement->fldType = "hidden";
    //Set the value of the element to $pname
    if (isset($pname)) {
        $objElement->setValue($pname);
    }
    $txtToShow = $objElement->show() . $pname;
} else {
    // We are adding.
    if (isset($pname)) {
Esempio n. 7
0
            $radio->setSelected('guest');
        }
        // Check if Student
        if (in_array($result['userid'], $students)) {
            $radio->setSelected('student');
        }
        // Check if Lecturer
        if (in_array($result['userid'], $lecturers)) {
            $radio->setSelected('lecturer');
        }
        $table->addCell($radio->show());
        $table->endRow();
    }
    $addUsersForm = new form('addusers', $this->uri(array('action' => 'addusers')));
    $button = new button('submitform', $this->objLanguage->languageText('mod_contextgroups_updateuserroles', 'contextgroups'));
    $button->setToSubmit();
    $button->extra = 'style="margin-right: 50px;"';
    $hiddenInput = new hiddeninput('context', $contextCode);
    $addUsersForm->addToForm($hiddenInput->show());
    $hiddenInput = new hiddeninput('changedItems', '');
    // $hiddenInput->cssId = 'changedItems';
    $hiddenInput->extra = 'id="changedItems"';
    $addUsersForm->addToForm($hiddenInput->show());
    $addUsersForm->addToForm($table->show());
    $addUsersForm->addToForm('<p align="right">' . $button->show() . '</p>');
    echo $addUsersForm->show();
    echo '<p>' . $this->objLanguage->languageText('mod_contextgroups_browseresults', 'contextgroups', 'Browse Results') . ': ' . $paging . '</p>';
}
$returnLink = new link($this->uri(NULL));
$returnLink->link = ucwords($this->objLanguage->code2Txt('phrase_returntocontextgroups', 'contextgroups'));
echo '<p align="center">' . $returnLink->show() . '</p>';
 /**
  * Method to generate an edit context settings form
  * @param array $context Current Context Settings
  * @return str
  */
 public function editContextForm($context)
 {
     $header = new htmlheading();
     $header->type = 1;
     $header->str = $this->objLanguage->languageText('word_edit', 'system', 'Edit') . ': ' . $context['title'];
     $str = $header->show();
     $title = new textinput('title');
     $title->size = 50;
     if ($context != NULL) {
         $title->value = htmlentities($context['title']);
     }
     $titleLabel = new label($this->objLanguage->languageText('word_title', 'system', 'Title'), 'input_title');
     $status = new dropdown('status');
     //$status->setBreakSpace('<br />');
     $status->addOption('Published', $this->objLanguage->languageText('word_published', 'system', 'Published'));
     $status->addOption('Unpublished', $this->objLanguage->languageText('word_unpublished', 'system', 'Unpublished'));
     if ($context != NULL) {
         $status->setSelected($context['status']);
     }
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'true') {
         if (is_null($context)) {
             $access_ = 'Private';
         } else {
             $access_ = $context['access'];
         }
         $access = new hiddeninput('access', $access_);
     } else {
         $access = new radio('access');
         $access->setBreakSpace('<br />');
         $access->addOption('Public', '<strong>' . $this->objLanguage->languageText('word_public', 'system', 'Public') . '</strong> - <span class="caption">' . ucfirst($this->objLanguage->code2Txt('mod_context_publiccontextdescription', 'context', NULL, '[-context-] can be accessed by all users, including anonymous users')) . '</span>');
         $access->addOption('Open', '<strong>' . $this->objLanguage->languageText('word_open', 'system', 'Open') . '</strong> - <span class="caption">' . ucfirst($this->objLanguage->code2Txt('mod_context_opencontextdescription', 'context', NULL, '[-context-] can be accessed by all users that are logged in')) . '</span>');
         $access->addOption('Private', '<strong>' . $this->objLanguage->languageText('word_private', 'system', 'Private') . '</strong> - <span class="caption">' . $this->objLanguage->code2Txt('mod_context_privatecontextdescription', 'context', NULL, 'Only [-context-] members can enter the [-context-]') . '<span class="caption">');
         if ($context != NULL) {
             $access->setSelected($context['access']);
         } else {
             $access->setSelected('Public');
         }
     }
     $table = $this->newObject('htmltable', 'htmlelements');
     if ($context != NULL) {
         $table->startRow();
         $table->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')) . ':', 100);
         $table->addCell('<strong>' . $context['contextcode'] . '</strong>');
         $table->endRow();
     } else {
         $code = new textinput('contextcode');
         $codeLabel = new label(ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')), 'input_contextcode');
         $table->startRow();
         $table->addCell($codeLabel->show(), 100);
         $table->addCell($code->show() . ' <span id="contextcodemessage"></span>');
         $table->endRow();
     }
     $table->startRow();
     $table->addCell($titleLabel->show() . ':');
     $table->addCell($title->show());
     $table->endRow();
     $table->startRow();
     $table->addCell('&nbsp;');
     $table->addCell('&nbsp;');
     $table->endRow();
     $table->startRow();
     $table->addCell($this->objLanguage->languageText('word_status', 'system', 'Status') . ':');
     $table->addCell($status->show());
     $table->endRow();
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'false') {
         $table->startRow();
         $table->addCell($this->objLanguage->languageText('word_access', 'system', 'Access') . ':');
         $table->addCell($access->show());
         $table->endRow();
     }
     $alerts = explode("|", $context['alerts']);
     $emailAlert = new checkbox('emailalertopt', $this->objLanguage->languageText('mod_contextadmin_emailalert', 'contextadmin', 'Email alerts'), $alerts[0] == 'e' || $alerts[0] == '1');
     // this will checked
     //$alerts=array();
     //$emailchecked=;
     //$emailAlert->setChecked(FALSE);
     //if($emailchecked) {
     //    $emailAlert->setChecked($emailchecked);
     //}
     $table->startRow();
     $table->addCell($this->objLanguage->languageText('mod_contextadmin_emailalert', 'contextadmin', 'Alerts'));
     $table->addCell($emailAlert->show());
     $table->endRow();
     $objSelectImage = $this->getObject('selectimage', 'filemanager');
     $objSelectImage->context = TRUE;
     $table2 = $this->newObject('htmltable', 'htmlelements');
     $table2->startRow();
     $table2->addCell($table->show(), 600, NULL, NULL, NULL, 'colspan="2"');
     $table2->addCell($objSelectImage->show());
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell(ucwords($this->objLanguage->code2Txt('mod_context_aboutcontext', 'context', NULL, 'About [-context-]')) . ':', 100);
     $htmlEditor = $this->newObject('htmlarea', 'htmlelements');
     $htmlEditor->name = 'about';
     $htmlEditor->toolbarSet = 'advanced';
     if ($context != NULL) {
         $htmlEditor->value = $context['about'];
     }
     $table2->addCell($htmlEditor->show(), NULL, NULL, NULL, NULL, 'colspan="2"');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->addCell('&nbsp;');
     $table2->endRow();
     $table2->startRow();
     $table2->addCell('&nbsp;', 100);
     if ($context == NULL) {
         $button = new button('savecontext', $formButton);
     } else {
         $button = new button('savecontext', ucwords($this->objLanguage->code2Txt('mod_context_updatecontext', 'context', NULL, 'Update [-context-]')));
     }
     $button->setToSubmit();
     $table2->addCell($button->show(), NULL, NULL, NULL, NULL, 'colspan="2"');
     $table2->endRow();
     $form = new form('createcontext', $this->uri(array('action' => $this->formAction), $this->formModule));
     $form->addToForm($table2->show());
     if ($this->objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'true') {
         $form->addToForm($access->show());
     }
     if ($context != NULL) {
         $hiddenInput = new hiddeninput('contextcode', $context['contextcode']);
         $form->addToForm($hiddenInput->show());
     }
     $form->addRule('title', $this->objLanguage->code2Txt('mod_context_entertitleofcontext', 'context', NULL, 'Please enter the title of your [-context-]'), 'required');
     $str .= $form->show();
     return $str;
 }
}
$course1Dropdown = new dropdown('context1');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course1Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$course2Dropdown = new dropdown('context2');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course2Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$objTable = $this->newObject('htmltable', 'htmlelements');
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextfrom', 'context', null, '[-context-] from')) . ":");
$objTable->endRow();
$objTable->startRow();
$objTable->addCell($course1Dropdown->show());
$objTable->endRow();
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextto', 'context', null, '[-context-] to')) . ":");
$objTable->endRow();
$objTable->startRow();
$objTable->addCell($course2Dropdown->show());
$objTable->endRow();
$objButton = new button('save', $this->objLanguage->languageText('word_save'));
$objButton->extra = 'onclick="javascript:if(confirm(\'' . $this->objLanguage->code2Txt('mod_contextgroups_confirmtransfer', 'context', NULL, 'Are you sure you want to transfer these [-readonlys-]') . '?\')){document.confirmtransfercontextusers.submit();;}else{return false;}"';
$buttons = $objButton->show();
$objForm = new form('confirmtransfercontextusers', $this->uri(array('action' => 'savetransfercontextusers')));
$objForm->addToForm($objTable->show());
$objForm->addToForm($buttons);
echo $objForm->show();
Esempio n. 10
0
        break;
}
switch ($this->getParam('error')) {
    default:
        break;
    case 'nofoldernameprovided':
        echo '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatednoname', 'filemanager', 'Folder was not created. No name provided') . '</span>';
        break;
    case 'illegalcharacters':
        echo '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatedillegalchars', 'filemanager', 'Folder was not created. Folders cannot contain any of the following characters') . ': \\ / : * ? &quot; &lt; &gt; |</span>';
        break;
}
echo '<h1>' . $folderpath . ' ' . $icon . '</h1>';
if ((count($files) > 0 || count($subfolders) > 0) && $folderPermission) {
    $form = new form('deletefiles', $this->uri(array('action' => 'multidelete')));
    $form->addToForm($table);
    $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_deleteselecteditems', 'filemanager', 'Delete Selected Items'));
    $button->setToSubmit();
    $selectallbutton = new button('selectall', $this->objLanguage->languageText('phrase_selectall', 'system', 'Select All'));
    $selectallbutton->setOnClick("javascript:SetAllCheckBoxes('deletefiles', 'files[]', true);");
    $deselectallbutton = new button('deselectall', $this->objLanguage->languageText('phrase_deselectall', 'system', 'Deselect all'));
    $deselectallbutton->setOnClick("javascript:SetAllCheckBoxes('deletefiles', 'files[]', false);");
    $form->addToForm($button->show() . ' &nbsp; &nbsp; ' . $selectallbutton->show() . ' ' . $deselectallbutton->show());
    $folderInput = new hiddeninput('folder', $folderId);
    $form->addToForm($folderInput->show());
    echo $form->show();
} else {
    echo $table;
}
if ($folderPermission) {
    echo '<h3>' . $this->objLanguage->languageText('phrase_uploadfiles', 'system', 'Upload Files') . '</h3>';
Esempio n. 11
0
        $groupDropdown->addOption($groups[$i], $groups[$i]);
    }
    $groupDropdown->setSelected($group);
    $table->addCell($label2->show() . $groupDropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $courseDropdown->show());
    $table->endRow();
    //Ehb-added-End
    $table->startRow();
    $orderLabel = new label($this->objLanguage->languageText('mod_contextgroups_orderresultsby', 'contextgroups') . ': ', 'input_order');
    $searchdropdown->name = 'order';
    $searchdropdown->cssId = 'input_order';
    //$table->addCell($orderLabel->show().$searchdropdown->show());
    $label = new label($this->objLanguage->languageText('mod_contextgroups_noofresults', 'contextgroups') . ': ', 'input_results');
    $dropdown = new dropdown('results');
    $dropdown->addOption('20', '20');
    $dropdown->addOption('30', '30');
    $dropdown->addOption('50', '50');
    $dropdown->addOption('75', '75');
    $dropdown->addOption('100', '100');
    //$dropdown->addOption('all', 'All Results');
    $table->addCell($orderLabel->show() . $searchdropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $dropdown->show());
    $table->endRow();
    $button = new button('searchbutton');
    $button->value = $this->objLanguage->languageText('word_search');
    $button->setToSubmit();
    $table->addCell($button->show());
    $table->addCell('&nbsp;');
    $table->endRow();
    $form = new form('searchforusers', $this->uri(array('action' => 'searchforusers')));
    $form->addToForm($table->show());
    echo $form->show();
}
Esempio n. 12
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  unknown $folderId Parameter description (if any) ...
  * @return object  Return description (if any) ...
  * @access public
  */
 function showCreateFolderForm($folderId)
 {
     $folderPath = $this->getFolderPath($folderId);
     if ($folderPath == FALSE) {
         return '';
     }
     $folderParts = explode('/', $folderPath);
     $form = new form('createfolder', $this->uri(array('action' => 'createfolder')));
     $label = new label('Create a subfolder in: ', 'input_parentfolder');
     $form->addToForm($label->show() . '<br/>' . $this->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId));
     $textinput = new textinput('foldername');
     $label = new label('Name of Folder: ', 'input_foldername');
     $form->addToForm('<br/>' . $label->show() . '<br/>' . $textinput->show() . '&nbsp;');
     $button = new button('create', 'Create Folder');
     $button->setToSubmit();
     $form->addToForm('<br/>' . $button->show());
     return $form->show();
 }
Esempio n. 13
0
$conGroups[2] = array('id' => 'Guest', 'name' => $guestLabel);
$objSelectBox->insertLeftOptions($conGroups, 'id', 'name');
$objSelectBox->insertRightOptions(array());
// Insert the selectbox into the form object.
$objHead->str = $conGroupLabel;
$objHead->type = 3;
$objForm->addToForm('<p>' . $objHead->show() . '</p><p>' . $objSelectBox->show() . '</p>');
/* *********** Save and close buttons ************* */
$objButton = new button('save', $saveLabel);
$objButton->setOnClick('submitPerms()');
$btns = '<p><br/>' . $objButton->show();
$objButton = new button('save', $closeLabel);
$objButton->setOnClick('window.close()');
$btns .= '&nbsp;&nbsp;' . $objButton->show() . '</p>';
$objForm->addToForm($btns);
/* ************ Show the form ************* */
$str .= $objForm->show();
/* ************ Restore default permissions ************ */
$objInput = new textinput('modulename', $moduleName);
$objInput->fldType = 'hidden';
$objLink = new link('javascript:void(0)');
$objLink->extra = "onclick=\"restoreDefaults()\"";
$objLink->link = $restoreLabel;
$objForm = new form('restore', $this->uri(array('action' => 'restoreperms')));
$objForm->addToForm($objInput->show());
$objForm->addToForm($objLink->show());
$str .= '<p><br/>' . $objForm->show() . '</p>';
$objLayer = new layer();
$objLayer->str = $str;
$objLayer->align = 'center';
echo $objLayer->show() . '<p>&nbsp;</p>';
Esempio n. 14
0
    $searchField = $this->getParam('searchField_context', 'name');
    $orderBy = $this->getParam('orderBy_context', 'quotausage_desc');
    $userDisplay = 'none';
    $contextDisplay = 'block';
} else {
    $searchType = 'users';
    // Just to make it explicit!
    $searchField = $this->getParam('searchField_user', 'firstname');
    $orderBy = $this->getParam('orderBy_user', 'quotausage_desc');
    $userDisplay = 'block';
    $contextDisplay = 'none';
}
$form = new form('quotasearch', $this->uri(array('action' => 'quotamanager')));
$form->method = 'GET';
$hiddenInput = new hiddeninput('module', 'filemanager');
$form->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('action', 'quotamanager');
$form->addToForm($hiddenInput->show());
$table = $this->newObject('htmltable', 'htmlelements');
$table->startRow();
$type = new dropdown('searchType');
$type->addOption('users', $this->objLanguage->languageText('mod_filemanager_users', 'filemanager', 'Users'));
$type->addOption('context', ucwords($this->objLanguage->code2Txt('word_courses', 'security', NULL, '[-contexts-]')));
$type->setSelected($searchType);
$type->extra = 'onchange="swapUsers(this.value);"';
$table->addCell($this->objLanguage->languageText('word_type', 'system', 'Type'));
$table->addCell($type->show());
$search1 = new dropdown('searchField_user');
$search1->addOption('firstname', $this->objLanguage->languageText('phrase_firstname', 'system', 'First Name'));
$search1->addOption('surname', $this->objLanguage->languageText('word_surname', 'system', 'Surname'));
$search1->setSelected($this->getParam('searchField_user'));
Esempio n. 15
0
$confirmPassword->fldType = 'password';
$confirmPassword->extra = 'maxlength=255';
$confirmPasswordLabel = new label($this->objLanguage->languageText('phrase_confirmpassword', 'userregistration', 'Confirm Password'), 'input_register_confirmpassword');
$table->addCell($passwordLabel->show(), 150, 'top', 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($password->show() . $required);
$table->endRow();
$table->startRow();
$table->addCell($confirmPasswordLabel->show(), 150, 'top', 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($confirmPassword->show() . $required);
$table->endRow();
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = $this->objLanguage->languageText('phrase_accountdetails', 'userregistration', 'Account Details');
$fieldset->contents = $table->show();
$form->addToForm($fieldset->show());
$form->addToForm('<br />');
$table = $this->newObject('htmltable', 'htmlelements');
$titlesDropdown = new dropdown('register_title');
$titlesLabel = new label($this->objLanguage->languageText('word_title', 'system') . '&nbsp;', 'input_register_title');
$titles = array("title_mr", "title_miss", "title_mrs", "title_ms", "title_dr", "title_prof", "title_rev", "title_assocprof");
foreach ($titles as $title) {
    $_title = trim($this->objLanguage->languageText($title));
    $titlesDropdown->addOption($_title, $_title);
}
if ($mode == 'addfixup') {
    $titlesDropdown->setSelected($this->getParam('register_title'));
}
$table->startRow();
$table->addCell($titlesLabel->show(), 150, NULL, 'right');
$table->addCell($titlesDropdown->show());
Esempio n. 16
0
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->languageText('mod_useradmin_updatedetails', 'useradmin', 'Update Details'));
$button->setToSubmit();
// $button->setOnClick('validateForm()');
$form->addToForm('<p>' . $button->show() . '</p>');
$form->addRule('useradmin_firstname', $this->objLanguage->languageText('mod_userdetails_enterfirstname', 'userdetails'), 'required');
$form->addRule('useradmin_surname', $this->objLanguage->languageText('mod_userdetails_entersurname', 'userdetails'), 'required');
$form->addRule('useradmin_email', $this->objLanguage->languageText('mod_userdetails_enteremailaddress', 'userdetails'), 'required');
$form->addRule('useradmin_email', $this->objLanguage->languageText('mod_userdetails_entervalidemailaddress', 'userdetails'), 'email');
echo $form->show();
echo '</div>';
echo '<div><div style="width:25%;  float: left; padding: 5px;">';
echo '<h3>' . $this->objLanguage->languageText('phrase_userimage', 'userdetails') . ':</h3>';
$objModule = $this->getObject('modules', 'modulecatalogue');
$changeimageform = new form('changeimage', $this->uri(array('action' => 'changeimage')));
$changeimageform->addToForm($useridinput->show());
if ($objModule->checkIfRegistered('filemanager')) {
    $objSelectFile = $this->getObject('selectimage', 'filemanager');
    $objSelectFile->name = 'imageselect';
    $objSelectFile->restrictFileList = array('jpg', 'gif', 'png', 'jpeg', 'bmp');
    $changeimageform->addToForm($objSelectFile->show());
    $button = new button('changeimage', $this->objLanguage->languageText('phrase_updateimage', 'userdetails'));
    $button->setToSubmit();
    $changeimageform->addToForm('<br />' . $button->show());
}
echo $changeimageform->show();
echo '</div>';
echo '</div>';
$returnlink = new link($this->uri(NULL));
$returnlink->link = 'Return to User Administration';
echo '<br clear="left" />' . $returnlink->show();
Esempio n. 17
0
 /**
  * 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;
 }
<?php

$this->loadClass('link', 'htmlelements');
$this->loadClass('form', 'htmlelements');
$this->loadClass('textinput', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$this->loadClass('htmlheading', 'htmlelements');
$searchForm = new form('filesearch', $this->uri(array('action' => 'search')));
$searchForm->method = 'GET';
$hiddenInput = new hiddeninput('module', 'filemanager');
$searchForm->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('action', 'search');
$searchForm->addToForm($hiddenInput->show());
$textinput = new textinput('filequery', $this->getParam('filequery'));
$searchForm->addToForm($textinput->show());
$button = new button('search', $this->objLanguage->languageText('word_search', 'system', 'Search'));
$button->setToSubmit();
$searchForm->addToForm($button->show());
// Create an Instance of the CSS Layout
$cssLayout = $this->newObject('csslayout', 'htmlelements');
$objFolders = $this->getObject('dbfolder');
$objQuotas = $this->getObject('dbquotas');
$header = new htmlheading();
$header->type = 2;
$header->str = $this->objLanguage->languageText('mod_filemanager_name', 'filemanager', 'File Manager');
$leftColumn = $header->show();
$tagCloudLink = new link($this->uri(array('action' => 'tagcloud')));
$tagCloudLink->link = 'Tag Cloud';
$leftColumn .= $searchForm->show() . '<ul><li>' . $tagCloudLink->show() . '</li>';
if ($objUser->isAdmin()) {
Esempio n. 19
0
<?php

$display = '<h1>' . $this->objLanguage->languageText('mod_blog_searchresults', 'blog', 'Search Results') . '</h1>';
$this->loadClass('textinput', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$this->loadClass('form', 'htmlelements');
$this->loadClass('label', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$form = new form('search', $this->uri(NULL));
$form->method = 'GET';
$formModule = new hiddeninput('module', 'search');
$search = new textinput('search', $this->getParam('search'));
$module = new textinput('searchmodule', $this->getParam('searchmodule'));
$searchLabel = new label($this->objLanguage->languageText('word_search', 'system', 'Search') . ': ', 'input_search');
$moduleLabel = new label($this->objLanguage->languageText('word_module', 'system', 'Module') . ': ', 'input_module');
$form->addToForm($formModule->show() . $searchLabel->show() . $search->show());
$form->addToForm(' &nbsp; &nbsp; ');
$form->addToForm($moduleLabel->show() . $module->show());
$button = new button('go', $this->objLanguage->languageText('word_go', 'system', 'Go'));
$button->setToSubmit();
$form->addToForm(' &nbsp; ' . $button->show());
$display .= $form->show();
$objSearchResults = $this->getObject('searchresults');
$searchKey = $this->getParam('search', $this->getParam('query'));
$display .= $objSearchResults->displaySearchResults($searchKey, $this->getParam('searchmodule'));
$this->setVar('middleContent', $display);
$cssLayout = $this->newObject('csslayout', 'htmlelements');
$cssLayout->setNumColumns(1);
$middleColumn = $display;
$cssLayout->setMiddleColumnContent($middleColumn);
echo $cssLayout->show();
Esempio n. 20
0
<?php

/*
* Template for uploading themes.
* 
*/
// set up html elements
$this->loadClass('htmlheading', 'htmlelements');
$this->loadclass('htmltable', 'htmlelements');
$this->loadclass('textinput', 'htmlelements');
$objConfirm = $this->newObject('timeoutmessage', 'htmlelements');
$objSelectFile = $this->newObject('selectfile', 'filemanager');
// set up language items
$btnupload = $this->objLanguage->languageText('mod_contextadmin_upload', 'contextadmin', 'Upload Theme');
$uploadhead = $btnupload;
$head = $uploadhead;
$btnexit = $this->objLanguage->languageText('word_exit');
$wordstudent = ucwords($this->objLanguage->languageText('mod_context_readonly'));
/************************* set up table ******************************/
$header = new htmlHeading();
$header->str = $this->objLanguage->languageText('mod_filemanager_uploadnewfile', 'filemanager', 'Upload new file');
$header->type = 4;
echo $header->show();
$form = new form('addpodcastbyupload', $this->uri(array('action' => 'saveuploadedtheme', 'id' => $id)));
$form->extra = 'enctype="multipart/form-data"';
$objUpload = $this->newObject('uploadinput', 'filemanager');
$objUpload->showTargetDir = FALSE;
$button = new button('submitform', $btnupload);
$button->setToSubmit();
$form->addToForm($objUpload->show() . '<br />' . $button->show());
echo $form->show();
Esempio n. 21
0
$loHiddenLOCount = $this->newObject('textinput', 'htmlelements');
$loHiddenLOCount->textinput("outcount", $value = $outcomesCount, $type = 'hidden', $size = "10");
//Hidden textinput to store the count of new LO's
$loHiddenLODrops = $this->newObject('textinput', 'htmlelements');
$table->startRow();
$table->addCell('<div id="textBoxes"></div>');
$table->endRow();
//Spacer
$table->startRow();
$table->addCell(Null);
$table->endRow();
//Spacer
$table->startRow();
$table->addCell('<div id="countDiv">' . $loHiddenLOCount->show() . '</div>');
$table->endRow();
$button = new button('savecontext', $formButton);
$button->setToSubmit();
$delButton = new button('deleteoutcomes', $deleteLOButton);
$delButton->setToSubmit();
$form = new form('createcontext', $this->uri(array('action' => $formAction)));
// Fixed Ticket #3128 J C O'Connor
//$backUri = $this->uri(array('action' => 'step2', 'mode' => 'edit', 'contextcode' => $contextCode), 'contextadmin');
$backButton = new button('back', $this->objLanguage->languageText('word_back'));
$backButton->setToSubmit();
$form->addToForm($table->show());
$form->addToForm($backButton->show() . " " . $delButton->show() . " " . $button->show());
$hiddenInput = new hiddeninput('mode', $mode);
$form->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('contextCode', $contextCode);
$form->addToForm($hiddenInput->show());
echo $form->show();
$table->addCell($usernameLabel->show(), 100);
$table->addCell($username->show());
$table->endRow();
$table->startRow();
$table->addCell($emailLabel->show());
$table->addCell($email->show());
$table->endRow();
$table->startRow();
$table->addCell('&nbsp;');
$table->addCell('&nbsp;');
$table->endRow();
$table->startRow();
$redrawButton = new button('redraw', 'Redraw', 'redraw();');
$table->addCell($captchaLabel->show());
$table->addCell(stripslashes($this->objLanguage->languageText('mod_security_explaincaptcha', 'security', 'To prevent abuse, please enter the code as shown below. If you are unable to view the code, click on "Redraw" for a new one.')) . '<br /><div id="captchaDiv">' . $objCaptcha->show() . '</div>' . $captcha->show() . ' <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>');
$table->endRow();
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->languageText('mod_security_sendmenewpassword', 'security', 'Send me a new password'));
$button->setToSubmit();
$form->addToForm('<p><br />' . $button->show() . '</p>');
$form->addRule('request_username', 'Please enter your username', 'required');
//$form->addRule('request_email', 'Not a valid Email', 'email');
$form->addRule('request_email', 'Please enter your emailaddress', 'required');
$form->addRule('request_captcha', 'Please enter the code in the image', 'required');
echo $form->show();
//$this->setLayoutTemplate(NULL);
//$this->setVar('pageSuppressXML', TRUE);
//echo '<div id="captchaDiv">'.$objCaptcha->show().'</div>'.$redrawButton->show();
echo '<p>' . $this->objLanguage->languageText('word_note', 'security', 'Note') . ': ';
echo $this->objLanguage->languageText('mod_security_passworddoesntworkldap', 'security', 'This does not work for accounts that use Network Identification. For assistance in this regard, please contact your System Administrator');
echo ' (' . $this->objConfig->getsiteEmail() . ')</p>';
Esempio n. 23
0
$objTable->startRow();
$objTable->addCell($objLabel->show());
$objTable->addCell($closeField);
$objTable->endRow();
/*
  $objElement = new checkbox('studentsonly', '', true);  // this will checked
  $check = $objElement->show();
  $objTable->addRow(array(
  $userOptLabel,
  $check
  )); */
$objContextModules = $this->getObject('dbcontextmodules', 'context');
$objModules = $this->getObject('modules', 'modulecatalogue');
$contextModules = $objContextModules->getContextModules($contextCode);
$plugins = $objModules->getListContextPlugins();
$dropDown = new dropdown('moduleid');
//$dropDown->addOption('all','All');
foreach ($plugins as $plugin) {
    $dropDown->addOption($plugin['module_id'], $plugin['title']);
}
if ($action == 'showuseractivitybymodule') {
    $objTable->addRow(array('<b>' . $selectModuleLabel . '</b>', $dropDown->show()));
}
$saveLabel = "View";
$objButton = new button('save', $saveLabel);
$objButton->setToSubmit();
$btnSave = $objButton->show();
$objForm = new form('showuseractivity', $this->uri(array('action' => $action)));
$objForm->addToForm($objTable->show());
$objForm->addToForm($btnSave);
echo $objForm->show();
 /**
  * Standard block show method. 
  */
 public function show()
 {
     try {
         $objContext = $this->getObject('dbcontext', 'context');
         $courses = $objContext->getListOfPublicContext();
         if (count($courses) == 0) {
             $msg = $this->objLanguage->code2Txt('mod_context_nocontexts', 'context');
             return "<span class='noRecordsMessage'>{$msg}</span>";
         } else {
             $form = new form('joincontext', $this->uri(array('action' => 'joincontext'), 'context'));
             $dropdown = new dropdown('contextcode');
             foreach ($courses as $course) {
                 $dropdown->addOption($course['contextcode'], $course['menutext']);
             }
             $dropdown->setSelected($objContext->getContextCode());
             $button = new button('submitform', ucwords($this->objLanguage->code2Txt('mod_context_entercourse', 'context', NULL, 'Enter [-context-]')));
             $button->setToSubmit();
             $form->addToForm($dropdown->show() . '<br />' . $button->show());
             return $form->show();
         }
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
Esempio n. 25
0
    $tabContent->addTab(array('name' => $this->objLanguage->languageText('mod_filemanager_embedcode', 'filemanager', 'Embed Code'), 'content' => $embedCode));
}
$fileInfo = $this->objLanguage->languageText('mod_filemanager_fileinfo', 'filemanager', 'File Information');
$fileInfoContent = '<h2>' . $fileInfo . '</h2>' . $this->objFiles->getFileInfoTable($file['id']);
if (array_key_exists('width', $file)) {
    $mediaInfo = $this->objLanguage->languageText('mod_filemanager_mediainfo', 'filemanager', 'Media Information');
    $fileInfoContent .= '<br /><h2>' . $mediaInfo . '</h2>' . $this->objFiles->getFileMediaInfoTable($file['id']);
}
$tabContent->addTab(array('name' => $fileInfo, 'content' => $fileInfoContent));
if ($folderPermission) {
    $fileAccess = $this->getObject("folderaccess", "filemanager");
    $tabContent->addTab(array('name' => $this->objLanguage->languageText('mod_filemanager_access', 'filemanager', 'Access'), 'content' => $fileAccess->createFileAccessControlForm($file['id']) . '<br/>' . $fileAccess->createFileVisibilityForm($file['id'])));
}
echo $tabContent->show();
if ($file['category'] == 'archives' && $file['datatype'] == 'zip') {
    $folderParts = explode('/', $file['filefolder']);
    //getTree($folderType='users', $id, $treeType='dhtml', $selected='')
    //get the archive file id
    $archiveId = $this->getParam('id');
    $form = new form('extractarchive', $this->uri(array('action' => 'extractarchive', 'id' => $archiveId)));
    $form->addToForm($this->objLanguage->languageText('mod_filemanager_extractarchiveto', 'filemanager', 'Extract Archive to') . ': ' . $this->objFolders->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId));
    $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_extractfiles', 'filemanager', 'Extract Files'));
    $button->setToSubmit();
    $form->addToForm($button->show());
    $hiddeninput = new hiddeninput('file', $file['id']);
    $form->addToForm($hiddeninput->show());
    echo $form->show();
}
// echo '<h3>'.$this->objLanguage->languageText('mod_filemanager_filehistory', 'filemanager', 'File History').'</h3>';
// echo $this->objFiles->getFileHistory($file['id']);
echo '<p><br />' . $link->show() . ' ' . $link2->show() . '</p>';
Esempio n. 26
0
    //$folderId
    $fieldset->addContent($form->show());
    $folderActions .= '<span id="renamefolder" style="display: xnone;">' . $fieldset->show() . '<br /></span>';
    $objAccess = $this->getObject("folderaccess", "filemanager");
    $accessContent = $objAccess->createAccessControlForm($folder['id']);
    $folderActions .= '<span id="accessfolder" >' . $accessContent . '<br /></span>';
    $alertContent = $objAccess->createAlertsForm($folder['id']);
    $folderActions .= '<span id="alertsfolder" >' . $alertContent . '<br /></span>';
    $fieldset = new fieldset();
    $fieldset->setLegend($this->objLanguage->languageText('mod_filemanager_deletefolder', 'filemanager', 'Delete Folder'));
    $fieldset->addContent('<br/><div class="warning">' . $this->objLanguage->languageText('mod_filemanager_deletewarning', 'filemanager') . '</div><br/>' . $icon);
    $folderActions .= $fieldset->show();
}
if ((count($files) > 0 || count($subfolders) > 0 || count($symlinks) > 0) && $folderPermission) {
    $form = new form('movedeletefiles', $this->uri(array('action' => 'multimovedelete')));
    $form->addToForm($table);
    $folderPath_ = $this->objFolders->getFolderPath($folderId);
    if ($folderPath_ !== FALSE) {
        $folderParts = explode('/', $folderPath_);
        $folderTree = $this->objFolders->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId);
        $objButtonMove = new button('movefiles', $this->objLanguage->languageText('mod_filemanager_moveselecteditems', 'filemanager'));
        $objButtonMove->setToSubmit();
        $move = $this->objLanguage->languageText('mod_filemanager_moveto', 'filemanager') . ':&nbsp;' . $folderTree . '&nbsp;' . $objButtonMove->show() . '&nbsp;';
    } else {
        $move = '';
    }
    $button = new button('submitform', $this->objLanguage->languageText('mod_filemanager_deleteselecteditems', 'filemanager', 'Delete Selected Items'));
    $button->setToSubmit();
    // Set Ability to create symlinks to nothing - default no ability
    $symlink = '';
    // Check ability to create symlinks
Esempio n. 27
0
$this->loadClass('form', 'htmlelements');
//$this->loadClass('textinput','htmlelements');
//$this->loadClass('dropdown','htmlelements');
$this->loadClass('button', 'htmlelements');
//
$form = new form('language', $this->uri(array('action' => 'downloadpo')));
//$textinput = new textinput('langname','');
$dropdown = $this->newObject('dropdown', 'htmlelements');
$dropdown->name = 'langname';
$langs = $this->objLanguage->languagelist();
//echo '<pre>';
//var_dump($langs);
//var_dump($objLanguageCode->iso_639_2_tags->codes);
//echo '</pre>';
foreach ($langs as $lang) {
    $langName = $lang['languagename'];
    //$_langName = strtolower($langName);
    $langCode = 'unknown';
    foreach ($this->objLanguageCode->iso_639_2_tags->codes as $ISO => $language) {
        if ($langName == $language) {
            $langCode = $ISO;
            break;
        }
    }
    $dropdown->addOption($langCode, $langName);
}
$submit = new button('submit', $this->objLanguage->languageText('word_submit'));
$submit->setToSubmit();
$form->addToForm($this->objLanguage->languageText('mod_modulecatalogue_language', 'modulecatalogue') . ' : ' . $dropdown->show());
$form->addToForm('&nbsp;' . $submit->show());
echo $form->show();
Esempio n. 28
0
 /**
  *
  * Render the dropdown skin chooser so that it is processed
  * by the skinselect module, for use with Ajax
  *
  * @return string Form with dropdown
  * @access public
  *
  */
 public function show()
 {
     $script = $this->uri(array('action' => 'save'), 'skinselect');
     $objNewForm = new form('selectskin', $script);
     $objDropdown = new dropdown('skinlocation');
     $objDropdown->extra = "onchange =\"document.forms['selectskin'].submit();\"";
     $skins = array();
     $curPage = $this->curPageURL();
     $objSelf = new textinput('returnUri', $curPage);
     $objSelf->fldType = "hidden";
     // Get all the skins as an array
     $dirList = $this->getAllSkins();
     // Sort the array of skins alphabetically
     asort($dirList);
     // Loop and add them to the dropdown
     foreach ($dirList as $element => $value) {
         $objDropdown->addOption($element, $value);
     }
     $objNewForm->addToForm($this->objLanguage->languageText('phrase_selectskin') . ":<br />\n");
     // Set the current skin as the default selected skin
     $objDropdown->setSelected($this->getSession('skin'));
     $objDropdown->cssClass = 'coursechooser';
     $objNewForm->addToForm($objDropdown->show());
     $objNewForm->addToForm($objSelf->show());
     return $objNewForm->show();
 }
 /**
  *
  * Method to parse the string
  * @param  String $str The string to parse
  * @return The    parsed string
  *                
  */
 public function parse($txt)
 {
     preg_match_all('/\\[LIBRARYSEARCH\\](.*)\\[\\/LIBRARYSEARCH\\]/U', $txt, $results, PREG_PATTERN_ORDER);
     preg_match_all('/\\[LIBRARYSEARCH:(.*?)\\]/', $txt, $results2, PREG_PATTERN_ORDER);
     $counter = 0;
     foreach ($results[1] as $item) {
         $objForm = new form('library_search_form', $this->uri(array('action' => 'search'), 'librarysearch'));
         $searchInput = new textinput('search_key');
         $selectCluster = new dropdown('subject_cluster');
         $selectCluster->addOption('database', 'Database');
         $selectCluster->addOption('books', 'Books');
         $selectCluster->addOption('websites', 'Websites');
         $selectCluster->selected = 'websites';
         // Submit Button
         $button = new button('submit_search', $this->objLanguage->languageText('word_search'));
         $button->setToSubmit();
         $objForm->addToForm($searchInput->show() . ' ');
         $objForm->addToForm($selectCluster->show() . ' ');
         $objForm->addToForm($button->show());
         $replacement = $objForm->show();
         $txt = str_replace($results[0][$counter], $replacement, $txt);
         $counter++;
     }
     return $txt;
 }
Esempio n. 30
0
$this->loadClass('button', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$header = new htmlHeading();
$header->type = 1;
$header->str = $this->objLanguage->languageText('mod_filemanager_editquota', 'filemanager', 'Edit Quota') . ': ';
if (substr($quota['path'], 0, 7) == 'context') {
    $header->str .= ucfirst($this->objLanguage->code2Txt('mod_filemanager_contextfilesof', 'filemanager', NULL, '[-context-] Files of')) . ' ' . $this->objContext->getTitle(substr($quota['path'], 8));
    $defaultQuota = $this->objQuotas->getDefaultContextQuota();
} else {
    $header->str .= $this->objLanguage->languageText('mod_filemanager_userfilesof', 'filemanager', 'User files of') . ' ' . $this->objUser->fullName(substr($quota['path'], 6));
    $defaultQuota = $this->objQuotas->getDefaultUserQuota();
}
echo $header->show();
$form = new form('updatequota', $this->uri(array('action' => 'updatequota')));
$hiddeninput = new hiddeninput('id', $quota['id']);
$form->addToForm($hiddeninput->show());
$radio = new radio('quotatype');
$radio->addOption('Y', $this->objLanguage->languageText('mod_filemanager_usedefaultquotaof', 'filemanager', 'Use Default Quota of') . ' ' . $defaultQuota . ' MB');
$radio->addOption('N', $this->objLanguage->languageText('mod_filemanager_usecustomquota', 'filemanager', 'Use Custom Quota'));
$radio->setBreakSpace('<br />');
$radio->setSelected($quota['usedefault']);
$form->addToForm($radio->show());
$customQuota = new textinput('customquota');
$customQuota->size = 5;
if ($quota['usedefault'] == 'Y') {
    $customQuota->value = $defaultQuota;
} else {
    $customQuota->value = $quota['quota'];
}
$form->addToForm(': ' . $customQuota->show() . ' MB');
$button = new button('confirm', $this->objLanguage->languageText('mod_filemanager_updatequota', 'filemanager', 'Update Quota'));