/**
  * Method to display the sysconfig interface
  */
 public function show()
 {
     // Load the Radio button class
     $this->loadClass('radio', 'htmlelements');
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     $objElement->addOption('postlogin', $this->objLanguage->languageText('mod_postlogin_defaultpostlogin', 'postlogin', 'Default Postlogin Menu'));
     $objElement->addOption('elearnpostlogin', $this->objLanguage->languageText('mod_postlogin_elearnpostlogin', 'postlogin', 'Elearn Postlogin Menu'));
     // Set Default Selected
     $objElement->setSelected($this->defaultValue);
     // Set radio buttons to be one per line
     $objElement->setBreakSpace('<br />');
     // return finished radio button
     return $objElement->show();
 }
 /**
  * Method to display the sysconfig interface
  */
 public function show()
 {
     // Load the Radio button class
     $this->loadClass('radio', 'htmlelements');
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     $objElement->addOption('dropdown', $this->objLanguage->languageText('mod_toolbar_dynamicdropdown', 'toolbar', 'Dynamic Dropdown'));
     $objElement->addOption('flat', $this->objLanguage->languageText('mod_toolbar_flatbuttons', 'toolbar', 'Flat Buttons'));
     $objElement->addOption('elearning', $this->objLanguage->languageText('mod_toolbar_elearningtoolbar', 'toolbar', 'Elearning Toolbar'));
     // Set Default Selected
     $objElement->setSelected($this->defaultValue);
     // Set radio buttons to be one per line
     $objElement->setBreakSpace('<br />');
     // return finished radio button
     return $objElement->show();
 }
 /**
  * Method to display the sysconfig interface
  *
  */
 public function show()
 {
     // Load the Radio button class
     $this->loadClass('radio', 'htmlelements');
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     $objElement->addOption('TRUE', $this->objLanguage->languageText('word_true', 'system', 'True'));
     $objElement->addOption('FALSE', $this->objLanguage->languageText('word_false', 'system', 'False'));
     // Set Default Selected
     $objElement->setSelected($this->defaultVaule);
     // Set radio buttons to be inline
     $objElement->setBreakSpace(' &nbsp;');
     $str = '<p>' . $this->objLanguage->languageText('mod_config_enableapcinfo', 'config', 'This parameter enables APC caching to improve the site speed. However it requires APC to be installed by the server owner - pecl install apc') . '</p>';
     // return finished radio button
     return $str . $objElement->show();
 }
 /**
  * Method to return a customized input to the SysConfig form
  */
 function show()
 {
     // Load the Radio button class
     $this->loadClass('radio', 'htmlelements');
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     $objElement->addOption('Y', $this->objLanguage->languageText('word_yes'));
     $objElement->addOption('N', $this->objLanguage->languageText('word_no'));
     // Set Default Selected
     $objElement->setSelected($this->defaultValue);
     // Set radio buttons to be one per line
     $objElement->setBreakSpace(' &nbsp; ');
     $string = '<p>' . $this->objLanguage->languageText('mod_creativecommons_enableby', 'creativecommons') . '</p>';
     // return finished radio button
     return $string . $objElement->show();
 }
 /**
  * Method to return a customized input to the SysConfig form
  */
 public function show()
 {
     // Load the Radio Button Class
     $this->loadClass('radio', 'htmlelements');
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     $systemTypeList = $this->objAbstract->listSystemTypes();
     foreach ($systemTypeList as $systemType) {
         $objElement->addOption($systemType['systemtype'], $systemType['systemtype']);
     }
     // Set Default Selected
     $objElement->setSelected($this->defaultValue);
     $objElement->setBreakSpace('<br />');
     $string = '<p>Please select the type of system text should be abstracted to:</p>';
     // Return String
     return $string . $objElement->show();
 }
 /**
  * Method to display the sysconfig interface
  *
  */
 public function show()
 {
     // Load the Radio button class
     $this->loadClass('radio', 'htmlelements');
     // Load the Skin Object
     $objSkin = $this->getObject('skinchooser', 'skin');
     $skinsList = $objSkin->getAllSkins();
     // Input MUST be called 'pvalue'
     $objElement = new radio('pvalue');
     foreach ($skinsList as $element => $value) {
         $objElement->addOption($element, $value);
     }
     // Set Default Selected
     $objElement->setSelected($this->defaultVaule);
     // Set radio buttons to be one per line
     $objElement->setBreakSpace('<br />');
     // return finished radio button
     return $objElement->show();
 }
 /**
  * Method to display the list
  *
  * @return string Rendered Input
  */
 public function show()
 {
     $objModules = $this->getObject('modules', 'modulecatalogue');
     if (!$objModules->checkIfRegistered('creativecommons')) {
         return '';
     } else {
         // Get All Licenses
         $licenses = $this->objCC->getAll();
         // Create Radio Button
         $radio = new radio($this->inputName);
         // Set Breakspace
         $radio->setBreakSpace('<br />');
         $iconsFolder = 'icons/creativecommons_v3';
         // Generate Blank Icon
         $this->objIcon->setIcon('blank', NULL, $iconsFolder);
         $blankIcon = $this->objIcon->show();
         // Loop through Licenses
         foreach ($licenses as $license) {
             // Check if License is Enabled
             if ($this->objSysConfig->getValue($license['code'], 'creativecommons') == 'Y') {
                 if ($this->icontype == 'big') {
                     $filename = $license['code'] . '_big';
                 } else {
                     $filename = $license['code'];
                 }
                 $filename = str_replace('/', '_', $filename);
                 $this->objIcon->setIcon($filename, NULL, $iconsFolder);
                 $iconList = $this->objIcon->show();
                 $title = $license['title'];
                 if ($title == 'Attribution Non-commercial Share') {
                     $title = 'Attribution Non-commercial Share Alike';
                 }
                 if ($license['url'] == '') {
                     $url = $title;
                 } else {
                     $url = new link($license['url']);
                     $url->link = $title;
                     $url = $url->show();
                 }
                 $title = $url;
                 // Add to Radio Group
                 $radio->addOption($license['code'], $iconList . ' ' . $title);
             }
         }
         // Set Default Selected Value
         if ($this->defaultValue) {
             $radio->setSelected($this->defaultValue);
         } else {
             $radio->setSelected($this->objSysConfig->getValue('default', 'creativecommons'));
         }
         // Return Radio Button
         return $radio->show();
     }
 }
 /**
  * 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;
 }
 /**
  * Generate the (X)HTML to display the customised form.
  *
  * @return string The generated (X)HTML.
  */
 function show()
 {
     // Get the parameter description.
     $description = '<p>' . $this->objLanguage->languageText('mod_creativecommons_default', 'creativecommons') . '</p>';
     // Load the radio button class form the htmlelements module.
     $this->loadClass('radio', 'htmlelements');
     // The name of the input field must be "pvalue".
     $objElement = new radio('pvalue');
     // Add the licenses as options.
     foreach ($this->objCC->getAll() as $license) {
         $objElement->addOption($license['code'], $license['title']);
     }
     // Have the current value selected by default.
     $objElement->setSelected($this->defaultValue);
     // Display the radio buttons on separate lines.
     $objElement->setBreakSpace('<br />');
     // Return the output.
     return $description . $objElement->show();
 }
Example #10
0
        $accountStatusRadio->setSelected(0);
    } else {
        $accountStatusRadio->setSelected(1);
    }
}
$table->addCell($accountStatusRadio->show());
$table->endRow();
// Type of Account
if ($this->objConfig->getuseLDAP() == 'TRUE') {
    $table->startRow();
    $table->addCell('Type of Account');
    $table->addCell('&nbsp;');
    $accountTypeRadio = new radio('accounttype');
    $accountTypeRadio->addOption('ldap', ' Network ID Authentication');
    $accountTypeRadio->addOption('useradmin', ' Site / Database Authentication');
    $accountTypeRadio->setBreakSpace('<br />');
    $accountTypeRadio->extra = 'onclick="checkAccountType(this.value);"';
    if ($mode == 'addfixup') {
        $accountTypeRadio->setSelected($this->getParam('accounttype'));
    } else {
        if ($user['howcreated'] == 'LDAP') {
            $accountTypeRadio->setSelected('ldap');
        } else {
            $accountTypeRadio->setSelected('useradmin');
        }
    }
    $table->addCell($accountTypeRadio->show());
    $table->endRow();
} else {
    $accountType = new hiddeninput('accounttype', 'useradmin');
    $form->addToForm($accountType->show());
Example #11
0
$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'));
$button->setToSubmit();
$form->addToForm('<br /><br />' . $button->show());
$form->addRule('customquota', $this->objLanguage->languageText('mod_filemanager_validatenumber', 'filemanager', 'Please enter a number for the custom quota'), 'numeric');
echo $form->show();
$table->addCell($staffnumLabel->show(), 150, NULL, 'right');
$table->addCell($staffnum->show() . ' <em>' . $staffnumguestLabel->show() . '</em>');
$table->endRow();
$cellnum = new textinput('register_cellnum');
$cellnumLabel = new label($this->objLanguage->languageText('phrase_cellnumber', 'userregistration', 'Cell Number') . '&nbsp;', 'input_register_cellnum');
if ($mode == 'addfixup') {
    $cellnum->value = $this->getParam('register_cellnum');
}
$table->startRow();
$table->addCell($cellnumLabel->show(), 150, NULL, 'right');
$table->addCell($cellnum->show());
$table->endRow();
$sexRadio = new radio('register_sex');
$sexRadio->addOption('M', $this->objLanguage->languageText('word_male', 'system'));
$sexRadio->addOption('F', $this->objLanguage->languageText('word_female', 'system'));
$sexRadio->setBreakSpace(' &nbsp; ');
if ($mode == 'addfixup') {
    $sexRadio->setSelected($this->getParam('register_sex'));
} else {
    $sexRadio->setSelected('M');
}
$table->startRow();
$table->addCell($this->objLanguage->languageText('word_gender', 'userregistration', 'Gender') . '&nbsp;', 150, NULL, 'right');
$table->addCell($sexRadio->show());
$table->endRow();
$table->startRow();
$objCountries =& $this->getObject('languagecode', 'language');
$table->addCell($this->objLanguage->languageText('word_country', 'system') . '&nbsp;', 150, NULL, 'right');
if ($mode == 'addfixup') {
    $table->addCell($objCountries->countryAlpha($this->getParam('country')));
} else {
Example #13
0
$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 ($mode == 'add' && is_array($fixup)) {
    $status->setSelected($fixup['status']);
} else {
    if ($mode == 'edit') {
        $status->setSelected($context['status']);
    }
}
//$access = new hiddeninput('access', 'Private');
//} else {
if ($objSysConfig->getValue('context_access_private_only', 'context', 'false') == 'false') {
    $access = new radio('access');
    $access->setBreakSpace('<br />');
    $access->addOption('Public', '<strong>' . $this->objLanguage->languageText('word_public', 'system', 'Public') . '</strong> - <span class="caption">' . $this->objLanguage->code2Txt('mod_context_publichelp', '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">' . $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 ($mode == 'add' && is_array($fixup)) {
        $access->setSelected($fixup['access']);
    } else {
        if ($mode == 'add') {
            $access->setSelected('Public');
        } else {
            if ($mode == 'edit') {
                $access->setSelected($context['access']);
            }
        }
    }
}
 /**
  * Method to show the interface for overwriting files
  */
 public function showUserOverwiteInterface()
 {
     $userId = $this->objUser->userId();
     $tempFiles = $this->objFile->getTemporaryFiles($userId);
     $form = new form('fixtempfiles', $this->uri(array('action' => 'fixtempfiles')));
     $divider = '';
     $splitter = '';
     $listItems = '';
     $submitButton = new button('submitform', 'Update Files');
     $submitButton->setToSubmit();
     $objHighlightLabels = $this->getObject('highlightlabels', 'htmlelements');
     $objHighlightLabels->show();
     $formatsize = new formatfilesize();
     foreach ($tempFiles as $file) {
         //$form->addToForm($divider);
         //$divider = '<hr size="1" width="70%" />';
         $listItems .= $splitter . $file['id'];
         $splitter = '|';
         // Rename Id of the button to keep them unique
         $submitButton->cssId = 'input_button_' . $file['id'];
         $originalFile = $this->objFile->getOriginalFile($file['filename'], $userId);
         $form->addToForm('<h2>' . $file['filename'] . '</h2>');
         $table = $this->newObject('htmltable', 'htmlelements');
         $table->startHeaderRow();
         $table->addHeaderCell('Info', '20%');
         $table->addHeaderCell('Old File', '40%');
         $table->addHeaderCell('New File', '40%');
         $table->endHeaderRow();
         if ($originalFile['category'] == 'images') {
             $oldThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($originalFile['id'], $originalFile['filename']), 'image');
             $newThumbnail = $this->objFileEmbed->embed($this->objThumbnails->getThumbnail($file['id'], $file['filename']), 'image');
             // File Preview
             $table->startRow();
             $table->addCell('File Preview');
             $table->addCell($oldThumbnail);
             $table->addCell($newThumbnail);
             $table->endRow();
         } else {
             $oldThumbnail = 'gdsgsd';
             $newThumbnail = 'gdsgsd';
         }
         // File Size
         $table->startRow();
         $table->addCell('Size of File');
         $table->addCell($formatsize->formatsize($originalFile['filesize']));
         $table->addCell($formatsize->formatsize($file['filesize']));
         $table->endRow();
         // Date Uploaded
         $table->startRow();
         $table->addCell('Date Uploaded');
         $table->addCell($this->objFormatDateTime->formatDateOnly($originalFile['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($originalFile['timecreated']));
         $table->addCell($this->objFormatDateTime->formatDateOnly($file['datecreated']) . ' at ' . $this->objFormatDateTime->formatTime($file['timecreated']));
         $table->endRow();
         $form->addToForm($table->show());
         $form->addToForm('<h4>Options:</h4>');
         $radio = new radio($file['id']);
         $radio->setBreakSpace('<br />');
         $radio->addOption('ignore', 'Ignore this file for the time being');
         $radio->addOption('overwrite', 'Overwrite old file with new one');
         $radio->addOption('deletetemp', 'Delete the Temporary File');
         $extension = $this->objFileParts->getExtension($file['filename']);
         if (strlen($extension) == strlen($file['filename'])) {
             $filename = $file['filename'];
             $extension = '';
         } else {
             $filename = substr($file['filename'], 0, strlen($file['filename']) - strlen($extension) - 1);
             $extension = '.' . $extension;
         }
         $textinput = new textinput('rename__' . $file['id'], $filename);
         $textinput->size = 50;
         $extensioninput = new textinput('extension__' . $file['id'], $extension);
         $extensioninput->size = 5;
         $extensioninput->extra = ' readonly="true"';
         // Fix Up - Highlight Radio Button
         //$textinput->extra = ' onclick="document.getElementById(\'input_gen19Srv1Nme34_247ignore\').focus();"; ';
         //$radio->addOption('rename', 'Rename the temporary file to: ');
         $radio->setSelected('ignore');
         //$form->addToForm($radio->show().$textinput->show().$extensioninput->show());
         $form->addToForm($radio->show());
         $form->addToForm('<p align="center">' . $submitButton->show() . '</p>');
     }
     $hiddenInput = new hiddeninput('listitems', $listItems);
     $form->addToForm($hiddenInput->show());
     return $form->show();
 }
 /**
  * Method to process Error Upload Messages
  * @return string Confirmation message of error uploads
  */
 public function processOverwriteMessages()
 {
     if ($this->getParam('overwrite') == '') {
         $overwriteMessage = '';
     } else {
         $items = explode('__', $this->getParam('overwrite'));
         $overwriteMessage = '';
         $table = $this->newObject('htmltable', 'htmlelements');
         $table->startHeaderRow();
         $table->addHeaderCell('Filename');
         $table->addHeaderCell('File Size of Existing File', NULL, NULL, 'center');
         $table->addHeaderCell('File Size of New File', NULL, NULL, 'center');
         $table->addHeaderCell('Overwrite File?', NULL, NULL, 'center');
         $table->endHeaderRow();
         $actualItems = array();
         $formatsize = new formatfilesize();
         foreach ($items as $item) {
             // Get File Details
             $file = $this->objFiles->getFile($item);
             // Generate Path to File
             $tempFilePath = $this->objConfig->getcontentBasePath() . '/filemanager_tempfiles/' . $item;
             // Create Boolean Variable - does file exist
             if (file_exists($tempFilePath)) {
                 $tempFileExists = TRUE;
             } else {
                 $tempFileExists = FALSE;
             }
             // If no record
             if ($file == FALSE) {
                 // Delete temp file if it exists
                 if ($tempFileExists && is_file($tempFilePath)) {
                     unlink($tempFilePath);
                 }
             } else {
                 if ($file && $tempFileExists) {
                     // If Record and Temp File exists
                     // Add to Form for User to choose option
                     $actualItems[] = $item;
                     $table->startRow();
                     $table->addCell('<strong>' . $file['filename'] . '</strong>');
                     $table->addCell($formatsize->formatsize($file['filesize']), NULL, NULL, 'center');
                     $table->addCell($formatsize->formatsize(filesize($tempFilePath)), NULL, NULL, 'center');
                     $radio = new radio($item);
                     $radio->addOption('delete', ' No');
                     $radio->addOption('overwrite', ' Yes');
                     $radio->setSelected('delete');
                     $radio->setBreakSpace(' &nbsp; ');
                     $table->addCell($radio->show(), NULL, NULL, 'center');
                     $table->endRow();
                 }
             }
         }
         if (count($actualItems) > 0) {
             $form = new form('overwriteoptions', $this->uri(array('action' => 'fixtempfiles')));
             $form->addToForm($table->show());
             $list = '';
             $separator = '';
             foreach ($actualItems as $itemId) {
                 $list .= $separator . $itemId;
                 $separator = '__';
             }
             $hiddenInput = new hiddeninput('listitems', $list);
             $form->addToForm($hiddenInput->show());
             $overMsg = $this->objLanguage->languageText('mod_filemanager_overwriteconfirm', 'filemanager', 'Do you wish to overwrite?');
             $button = new button('submitform', $overMsg);
             $button->setToSubmit();
             $form->addToForm($button->show());
             $overwriteMessage = $form->show();
         }
     }
     return $overwriteMessage;
 }
Example #16
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();