Esempio n. 1
0
$objFieldset->contents = "<table><tr><td align=\"right\">" . $catLabel->show() . ": </td><td>" . $objCat->show() . "</td></tr>" . "<tr><td align=\"right\">" . $titLabel->show() . ": </td><td>" . $objTit->show() . "</td></tr></table>";
//Add the fieldset to the form
$objForm->addToForm($objFieldset->show());
// Create an instance of the button object
$this->loadClass('button', 'htmlelements');
// Create a submit button
$objElement = new button('submit');
$objElement->setIconClass("save");
// Set the button type to submit
$objElement->setToSubmit();
// Use the language object to add the word save
$objElement->setValue(' ' . $this->objLanguage->languageText("word_save") . ' ');
// Create cancel button
$objCancel = new button('cancel');
$objCancel->setIconClass("cancel");
$objCancel->setOnClick("window.location='" . $this->uri(NULL) . "';");
$objCancel->setValue(' ' . $this->objLanguage->languageText("mod_storycategoryadmin_cancel", "storycategoryadmin") . ' ');
// Add the button to the form
$objForm->addToForm('<br/>' . $objElement->show() . "&nbsp;" . $objCancel->show());
//Add the heading to the layer
$this->objH = $this->getObject('htmlheading', 'htmlelements');
$this->objH->type = 1;
//Heading <h1>
$this->objH->str = $objLanguage->code2txt("mod_storycategoryadmin_title", "storycategoryadmin");
$rightSideColumn = $this->objH->show();
$rightSideColumn .= $objForm->show();
// Add Left column
$cssLayout->setLeftColumnContent($leftSideColumn);
// Add Right Column
$cssLayout->setMiddleColumnContent($rightSideColumn);
//Output the content to the page
Esempio n. 2
0
    $button->setToSubmit();
    // Set Ability to create symlinks to nothing - default no ability
    $symlink = '';
    // Check ability to create symlinks
    if ($this->contextCode != '' && $this->getParam('context') != 'no' && substr($folder['folderpath'], 0, 7) != 'context') {
        $folderPermission = $this->objFolders->checkPermissionUploadFolder('context', $this->contextCode);
        if ($folderPermission) {
            $symlinkButton = new button('symlinkcontext', $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]'));
            $symlinkButton->setToSubmit();
            $symlink = '&nbsp;' . $symlinkButton->show();
        }
    }
    $selectallbutton = new button('selectall', $this->objLanguage->languageText('phrase_selectall', 'system', 'Select All'));
    $selectallbutton->setOnClick("javascript:SetAllCheckBoxes('movedeletefiles', 'files[]', true);");
    $deselectallbutton = new button('deselectall', $this->objLanguage->languageText('phrase_deselectall', 'system', 'Deselect all'));
    $deselectallbutton->setOnClick("javascript:SetAllCheckBoxes('movedeletefiles', 'files[]', false);");
    $form->addToForm($move . $button->show() . $symlink . '&nbsp;' . $selectallbutton->show() . '&nbsp;' . $deselectallbutton->show());
    $folderInput = new hiddeninput('folder', $folderId);
    $form->addToForm($folderInput->show());
    $folderContent .= $form->show();
} else {
    $folderContent .= $table;
}
if ($folderPermission2) {
    $folderContent .= '<h3>' . $this->objLanguage->languageText('phrase_uploadfiles', 'system', 'Upload Files') . '</h3>';
    if ($quota['quotausage'] >= $quota['quota']) {
        $folderContent .= '<p class="warning">' . $this->objLanguage->languageText('mod_filemanager_quotaexceeded', 'filemanager', 'Allocated Quota Exceeded. First delete some files and then try to upload again.') . '</p>';
    } else {
        $folderContent .= $this->objUpload->show($folderId, $quota['quota'] - $quota['quotausage']);
    }
}
Esempio n. 3
0
//Add the $pname element to the form
$objForm->addToForm($pnameLabel->show() . ": " . $txtToShow . "<br />");
//Create label for the input of ptag
$ptagLabel = new label($this->objLanguage->languageText("mod_userparamsadmin_pvalue", 'userparamsadmin'), "input_ptag");
//Create an element for the input of ptag
$objElement = new textinput("ptag");
//Set the value of the element to $ptag
if (isset($ptag)) {
    $objElement->setValue($ptag);
}
//Add the $ptag element to the form
$objForm->addToForm($ptagLabel->show() . ": " . $objElement->show() . "<br />");
$commaWarn = "<div class='warning'>" . $this->objLanguage->languageText("mod_userparams_nocommas", 'userparamsadmin') . "</div>";
$objForm->addToForm($commaWarn);
// Create an instance of the button object
$this->loadClass('button', 'htmlelements');
// Create a submit button
$objElement = new button('submit');
$objElement->setIconClass("save");
// Set the button type to submit
$objElement->setToSubmit();
// Use the language object to add the word save
$objElement->setValue(' ' . $this->objLanguage->languageText("word_save") . ' ');
//Create cancel button
$objCancel = new button('cancel');
$objCancel->setIconClass("cancel");
$objCancel->setOnClick("window.location='" . $this->uri(array()) . "';");
$objCancel->setValue(' ' . $this->objLanguage->languageText("mod_userparamsadmin_cancel", 'userparamsadmin') . ' ');
// Add the buttons to the form
$objForm->addToForm('<br/>&nbsp;' . $objElement->show() . "&nbsp;" . $objCancel->show());
echo $str . "<div class='standard_form'>" . $objForm->show() . "</div>";
Esempio n. 4
0
$conGroups = array();
$conGroups[0] = array('id' => 'Lecturers', 'name' => $authorLabel);
$conGroups[1] = array('id' => 'Students', 'name' => $readonlyLabel);
$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();
Esempio n. 5
0
        data: "module=contextadmin&action=removeimage&contextcode=' . $contextCode . '", 
        success: function(msg){
            if (msg == "ok") {
                jQuery("#contextexistingimage").remove();
            } else {
                alert("' . $this->objLanguage->languageText('mod_contextadmin_couldnotremoveimage', 'contextadmin', 'Could not remove image') . '");
            }
        }
    });
}
</script>
    ';
    $leftCol .= '<div id="contextexistingimage"><p>' . $this->objLanguage->code2Txt('mod_contextadmin_existingcontextimage', 'contextadmin', NULL, 'Existing [-context-] Image') . ':</p>';
    $leftCol .= '<img src="' . $hasContextImage . '" width="100" height="100"><br />';
    $removeButton = new button('removeimage', $this->objLanguage->languageText('mod_contextadmin_removeimage', 'contextadmin', 'Remove Image'));
    $removeButton->setOnClick('removeContextImage();');
    $leftCol .= $removeButton->show();
    $leftCol .= '<br />&nbsp;';
    $leftCol .= '</div>';
}
$leftCol .= '<p>' . $this->objLanguage->code2Txt('mod_contextadmin_selectcontextimage', 'contextadmin', NULL, 'Select a [-context-] image') . ':</p>';
$leftCol .= $objSelectImage->show();
$table->addCell($leftCol, 200);
$table->addCell('<p>' . $this->objLanguage->code2Txt('mod_contextadmin_enterdescriptioncontext', 'contextadmin', NULL, 'Enter a description of the [-context-]') . ':</p>' . $htmlEditor->show());
$table->endRow();
$button = new button('savecontext', $formButton);
$button->setToSubmit();
$form = new form('createcontext', $this->uri(array('action' => $formAction)));
$backUri = $this->uri(array('action' => 'edit', 'contextcode' => $contextCode), 'contextadmin');
$backButton = new button('back', $this->objLanguage->languageText('word_back'), "document.location='{$backUri}'");
$form->addToForm($table->show());
Esempio n. 6
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @return void
  * @access public
  */
 function showForms()
 {
     //Text Input
     $objForm = new form('testform');
     $url = $this->uri(array('action' => 'add'), 'htmlelements');
     $objForm->setAction($this->uri(array('action' => 'save'), 'htmlelements'));
     $objForm->setDisplayType(2);
     $objElement = new textinput('textbox');
     $objElement->setValue('Some text');
     $objElement->label = 'Textbox\'s label';
     $text = $objElement->show() . '<br />';
     $objForm->addToForm('<span class="warning">Start of Form</span><br />');
     $objForm->addToForm($objElement);
     //Calendar
     /*$objElement = new calendar('cal');
       $today = getdate();
       $objElement->setDate($today['mon'],$today['mday'],$today['year']);
       $calendar = $objElement->show().'<br />';*/
     //Radion button Group
     $objElement = new radio('sex_radio');
     $objElement->addOption('m', 'Male');
     $objElement->addOption('f', 'Female');
     $objElement->addOption('n', 'Seaweed');
     $objElement->setSelected('f');
     $radio = $objElement->show() . '<br />';
     //Check boxes
     $objElement = new checkbox('m', 'Male', true);
     $check = $objElement->show();
     $objElement = new checkbox('f', 'Female');
     $check .= $objElement->show();
     $objElement = new checkbox('n', 'Seawood');
     $check .= $objElement->show() . '<br />';
     //Dropdown
     $objElement = new dropdown('sex_dropdown');
     $objElement->addOption('', '');
     //adding a blank option
     $objElement->addOption('m', 'Male');
     $objElement->addOption('f', 'Female');
     $objElement->addOption('n', 'Seaweed');
     $objElement->setSelected('f');
     $dropdown = $objElement->show() . "<br />";
     //Dropdown created from array
     $objElement = new dropdown('user_dropdown');
     $objElement->addFromDB($this->objDBUser->getAll(), 'username', 'userid', $this->objDBUser->userName());
     $objElement->label = 'User list';
     $dropdown .= $objElement->show() . "<br />";
     //Textarea
     $objElement = new textarea('text_area');
     $objElement->setRows(3);
     $objElement->setColumns('45');
     $objElement->setContent('This is some content for the textarea');
     $ta = $objElement->show() . '<br />';
     //Button
     $objElement = new button('mybutton');
     $objElement->setValue('Normal Button');
     $objElement->setOnClick('alert(\'An onclick Event\')');
     $button = $objElement->show() . '<br />';
     //Submit Button
     $objElement = new button('mybutton');
     $objElement->setToSubmit();
     $objElement->label = 'Buttons Label';
     $objElement->setValue('Submit Button');
     $submit = $objElement->show() . '<br />';
     //add submit button to the form;
     $objForm->addToForm($objElement);
     $mouseoverpopup = new mouseoverpopup('this is some text');
     $mouseoverpopup = $mouseoverpopup->show();
     //Add all the above to a tabbedbox
     $objElement = new tabbedbox();
     $objElement->addTabLabel('Tabbed box 1');
     $objElement->addBoxContent($mouseoverpopup . $text . $dropdown . $button . $submit);
     $tab = '<br />' . $objElement->show() . '<br />';
     //add the tab to the form
     $objForm->addToForm($objElement);
     $objForm->addToForm('<span class="warning">End of Form</span>');
     $form = $objForm->show() . '<br />';
     //create a multitabbedbox
     $objElement = new multitabbedbox('100px', '500px');
     $objElement->addTab(array('name' => 'First', 'url' => 'http://localhost', 'content' => $form, 'default' => true));
     $objElement->addTab(array('name' => 'Second', 'url' => 'http://localhost', 'content' => $check . $radio));
     $objElement->addTab(array('name' => 'Third', 'url' => 'http://localhost', 'content' => $tab, 'height' => '300px', 'width' => '600px'));
     //$objElement->addTab(array('name'=>'Test Validation','url'=>'http://localhost','content' => $this->valFormShow(),'height' => '300','width' => '700'));
     //set layers
     $left = $tab;
     $content = 'This is an example using most of the classes in the htmlelements module<br />';
     $content .= '<br />' . $objElement->show();
     //this to make the centre layer strech downwards
     for ($i = 0; $i < 10; $i++) {
         $content .= '<br />';
     }
     $right = $tab;
     $bottom = $ta;
     $this->setVar('left', $left);
     $this->setVar('right', $right);
     $this->setVar('content', $content);
     $this->setVar('bottom', $bottom);
     //return $str;
 }
 /**
  * Method to show the multi file selector input
  * @return string File Selector
  */
 public function show()
 {
     $this->appendArrayVar('headerParams', $this->showJavaScript());
     $defaultValue = '';
     $defaultDisplay = '';
     if ($this->defaultFiles != '') {
         // Explode into array
         $scripts = explode(',', $this->defaultFiles);
         // Loop through array
         foreach ($scripts as $script) {
             // Check if valid
             if (trim($script) != '') {
                 // Get Path
                 $fileInfo = $this->objFile->getFile($script);
                 // If Valid
                 if ($fileInfo != FALSE) {
                     $defaultValue .= $fileInfo['id'] . ',';
                     $defaultDisplay .= '<span class="multiitem_' . $fileInfo['id'] . '">' . $fileInfo['filename'] . ' <a href="javascript:removeMultiFile(\'' . $fileInfo['id'] . '\');">' . $this->deleteIcon . '</a><br /></span>';
                 }
             }
         }
     }
     $input = new textinput($this->name, $this->defaultFiles);
     // change back to hidden
     $input->cssId = 'hidden_headerscripts';
     $input->extra = ' size="60"';
     $input->value = $defaultValue;
     $input->fldType = 'hidden';
     $selectFile = $this->newObject('selectfile', 'filemanager');
     $selectFile->name = 'temp_multiselect';
     $selectFile->restrictFileList = $this->restrictFileList;
     $selectFile->context = $this->context;
     $selectFile->workgroup = $this->workgroup;
     $addButtonText = '<span class=\'add\'>' . $this->objLanguage->languageText('mod_filemanager_addtolist', 'filemanager', "Add to list") . '</span>';
     $addButton = new button('addtolist', $addButtonText);
     $addButton->setOnClick('addToMultiList();');
     $str = '<div id="multifiles">';
     $str .= '<div id="multifileslist">' . $defaultDisplay . '</div>';
     $str .= $input->show() . $selectFile->show() . $addButton->show() . '</em>';
     $str .= '</div>';
     return $str;
 }
Esempio n. 8
0
<?php

$this->loadClass('htmlheading', 'htmlelements');
$this->loadClass('form', 'htmlelements');
$this->loadClass('radio', 'htmlelements');
$this->loadClass('hiddeninput', 'htmlelements');
$this->loadClass('button', 'htmlelements');
$header = new htmlheading();
$header->type = 1;
$header->str = ucwords($this->objLanguage->code2Txt('mod_contextadmin_deletecontext', 'contextadmin', NULL, 'Delete [-context-]')) . ':' . $context['title'];
echo $header->show();
$objDisplayContext = $this->getObject('displaycontext', 'context');
echo $objDisplayContext->formatContextDisplayBlock($context);
$form = new form('deletecontext', $this->uri(array('action' => 'deleteconfirm')));
$radio = new radio('deleteconfirm');
$radio->addOption('no', ' ' . $this->objLanguage->languageText('word_no', 'system', 'No') . ' - ' . $this->objLanguage->code2Txt('mod_contextadmin_donotdeletecontext', 'contextadmin', NULL, 'Do not delete the [-context-]'));
$radio->addOption('yes', ' ' . $this->objLanguage->languageText('word_yes', 'system', 'Yes') . ' - ' . $this->objLanguage->code2Txt('mod_contextadmin_dodeletecontext', 'contextadmin', NULL, 'Delete the [-context-]'));
$radio->setSelected('no');
$radio->setBreakSpace(' &nbsp; &nbsp; ');
$form->addToForm('<p>' . $this->objLanguage->languageText('mod_contextadmin_confirmdeletecontext', 'contextadmin', 'Are you sure you want to delete this context?') . '</p>');
$form->addToForm('<p>' . $radio->show() . '</p>');
$button = new button('confirm', $this->objLanguage->languageText('word_confirm', 'system', 'Confirm'));
$button->setToSubmit();
$cancelButton = new button('cancel', $this->objLanguage->languageText('word_cancel', 'system', 'Cancel'));
$cancelButton->setOnClick("javascript: history.go(-1);");
$form->addToForm('<p>' . $button->show() . ' ' . $cancelButton->show() . '</p>');
$hiddenInput = new hiddeninput('contextcode', $context['contextcode']);
$form->addToForm($hiddenInput->show());
echo $form->show();