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();
 }
Beispiel #2
0
 public function signup()
 {
     $this->exportJS("\$('#docNav').hide();");
     $data = base::subHeader("Create an Account", "Add your Company to the Support System");
     $data .= base::begin();
     $data .= base::pageHeader("Before you Begin", "You are about to create an account. If your company is already in our system, please have your company administrator add your account. You will only be able to add your company once.");
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'user_name', 'text' => 'Full Name:', 'comment' => 'Main contact for account'];
     $elements[] = ['type' => 'input', 'var' => 'user_email', 'text' => 'E-mail Address:', 'comment' => 'Also your login to this system'];
     $elements[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Password:'******'type' => 'input', 'var' => 'user_phone', 'text' => 'Phone Number (and Extension):', 'comment' => 'xxx.xxx.xxxx ext. xxx'];
     $elements[] = ['type' => 'input', 'var' => 'user_title', 'text' => 'Your Title:', 'comment' => 'Leave blank if individual'];
     $span = [];
     $span[] = ['span' => 6, 'elements' => $elements];
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'company_name', 'text' => 'Company Name:', 'comment' => 'If individual leave this blank'];
     $elements[] = ['type' => 'input', 'var' => 'company_address', 'text' => 'Address:', 'comment' => 'Where to mail invoices if required?'];
     $elements[] = ['type' => 'input', 'var' => 'company_address2', 'text' => 'Address Line 2:', 'comment' => 'Suite, etc.'];
     $elements[] = ['type' => 'input', 'var' => 'company_city', 'text' => 'City:'];
     $elements[] = ['type' => 'input', 'var' => 'company_state', 'text' => 'State:'];
     $elements[] = ['type' => 'input', 'var' => 'company_zip', 'text' => 'Zip:'];
     $span[] = ['span' => 6, 'elements' => $elements];
     $form = form::init()->spanElements($span)->id('createAccount')->post('/login/')->render();
     $button = button::init()->formid('createAccount')->text('Create My Account')->addStyle('post')->addStyle('btn-primary')->icon('fire')->message('Creating Account..')->postVar('createAccount')->render();
     $save = "<div class='pull-right'>{$button}</div>";
     $data .= widget::init()->icon('share-alt')->span(12)->header('Account Details')->content($form)->footer($save)->render();
     $this->export($data);
 }
Beispiel #3
0
     echo $button->get_button('Send', "document.forms[0].task.value='send';document.forms[0].submit();");
     break;
 case 'messages':
     echo '<br/>';
     echo '<br/>';
     echo '<table width="100%" cellpadding="0" cellspacing="0">';
     echo '<tr><td class="TableHead2"><input name="dummy" value="dummy" onclick="javascript:invert_selection()" type="checkbox"></td><td class="TableHead2" width="30%">Sender</td><td class="TableHead2" width="100%">Message</td></tr>';
     $db->query("SELECT * FROM messages_messages WHERE user_id='{$GO_SECURITY->user_id}'ORDER BY ctime DESC");
     while ($db->next_record()) {
         $sender = show_profile($db->f('user_id'), '', 'normal', $link_back);
         $message = htmlspecialchars($db->f('text'));
         echo "<tr id=\"" . $db->f('id') . "\"><td><input id=\"C_" . $db->f('id') . "\" type=\"checkbox\" name=\"msgs[]\" value=\"" . $db->f('id') . "\" onclick=\"javascript:item_click(this)\" /></td><td>{$sender}</td><td>{$message}</td></tr>";
         echo '<tr><td colspan="99" height="1"><img src="' . $GO_THEME->images['cccccc'] . '" border="0" height="1" width="100%" /></td></tr>';
     }
     echo '</table>';
     $button = new button();
     echo '<br/>';
     echo $button->get_button('Delete', "document.forms[0].task.value='delete';document.forms[0].submit();");
     break;
 case 'properties':
     if (!$db->query("SELECT * from messages_users WHERE user_id={$GO_SECURITY->user_id}") || !$db->next_record()) {
         $acl_write = $GO_SECURITY->get_new_acl('message write: ' . $GO_SECURITY->user_id);
         if ($acl_write > 0) {
             $db->query("INSERT INTO messages_users (user_id,acl_write) VALUES ('{$GO_SECURITY->user_id}','{$acl_write}')");
         }
         $db->query("SELECT * from messages_users WHERE user_id={$GO_SECURITY->user_id}");
         $db->next_record();
     }
     $tabtable = new tabtable('messages_tab', 'Messages', '100%', '400', '120', '', true);
     $tabtable->add_tab('properties', 'Properties');
     $tabtable->add_tab('permissions', 'Permissions');
Beispiel #4
0
$objFieldset = $this->getObject('fieldset', 'htmlelements');
$objFieldset->legend = $fieldsetLabel;
$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
 /**
  * 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();
 }
    $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>');
            }
        }
    }
    $form->addToForm('</ul>');
    $form->addToForm($this->objFolders->getTree('context', $this->contextCode, 'htmldropdown'));
    $button = new button('submitform', $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]'));
    $button->setToSubmit();
    $form->addToForm('<br />' . $button->show());
    $folderInput = new hiddeninput('folder', $this->getParam('folder'));
    $this->setVar('folderId', $this->getParam('folder'));
    $form->addToForm($folderInput->show());
    if ($counter > 0) {
        echo '<h1>' . $this->objLanguage->code2Txt('mod_filemanager_attachtocontext', 'filemanager', NULL, 'Attach to [-context-]') . '?</h1>';
        echo '<p>' . $this->objLanguage->languageText('mod_filemanager_selectfolderattachfiles', 'filemanager', 'Please select the folder you would like these files to be placed in') . '</p>';
        echo $form->show();
    } else {
        echo '<h1 class="error">' . $this->objLanguage->languageText('word_error', 'system', 'Error') . ':</h1>';
        echo '<p>xx' . $this->objLanguage->languageText('mod_filemanager_warnfilesnolonger', 'filemanager', 'The files/folders you have attempted to delete no longer exist') . '.</p>';
    }
}
Beispiel #7
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>";
        if (in_array($result['userid'], $guests)) {
            $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'));
 /**
  * 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();
     }
 }
$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>';
Beispiel #11
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();
<div style="max-width: 600px; padding: 45px 10px 10px; border-right: 1px solid rgb(204, 204, 204); margin-top: -45px;">
<h3><i class="uk-icon-edit"></i> Dados da carta</h3>
<div>
	<form class='uk-form' action='#' method='POST' id='form_carta'>
	<div class="uk-grid">
		<div class='uk-button-group uk-navbar-flip' style="">
		<?php 
if (isset($_GET['id'])) {
    $button = new button();
    $button->cancelar_carta($cod_carta, "doacoes_avulsas.php");
    $button = new button();
    $button->renovar_carta($cod_carta);
}
?>
					
		</div>
		<div class="uk-width-1-1">
			<div class="uk-grid">
				<div class="uk-width-1-4">
				<?php 
$campos_inputs->input_form_row($cod_carta, 'cod_carta', 'Carta', 'nova', ' readonly ');
?>
				</div>
			</div>
		</div>
		<div class="uk-width-1-1">
			<div class="uk-grid">
				<div class="uk-width-1-1 uk-width-small-1-1 uk-width-medium-1-3 uk-width-large-1-3">
				<?php 
$campos_select->select_status_carta($status_carta);
?>
$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()) {
    $quotaManager = new link($this->uri(array('action' => 'quotamanager')));
}
$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();
Beispiel #15
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();
}
Beispiel #16
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();
Beispiel #17
0
 public function generateNav()
 {
     $data = null;
     if (!$this->user) {
         return null;
     }
     if ($this->isProvidingCompany()) {
         $data .= "\t<li class='dropdown'><a data-toggle='dropdown'\tclass='dropdown-toggle' href='/clients/'>\n\t\t\t\t\t\t\t\t\tClients <b class='caret'></b></a>\n\t\t\t\t\t\t\t\t\t<ul class='dropdown-menu'>\n\t\t\t\t\t\t\t\t\t\t\t<li class=''><a href='/clients/create/'>Create Client</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li class=''><a href='/clients/'>List Clients</a></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\n\t\t\t\t\t";
     } else {
         $data .= "<li><a href='/billing/'>Billing</a></li>";
     }
     if ($this->isAdmin()) {
         $data .= "<li><a href='/admin/'>aTikit Admin</a></li>";
     }
     $data .= "<li class='dropdown'><a data-toggle='dropdown' class='dropdown-toggle' href='/clients/'>\n\t\t\t\t\tOptions <b class='caret'></b></a>\n\t\t\t\t\t<ul class='dropdown-menu'>\n\t\t\t\t\t\t<li><a data-toggle='modal' href='#me'><i class='icon-user'></i>  My Profile</a></li>\n\t\t\t\t\t\t<li><a href='/logout/'><i class='icon-signout'></i>  Logout</a></li>\n\t\t\t\t\t</ul>\n\t\t\t</li>";
     $save = button::init()->addStyle('mpost')->addStyle('btn-info')->text('Save Profile')->formid('myProfileForm')->postVar('saveProfile')->id('true')->icon('ok')->render();
     $this->exportModal(modal::init()->id('me')->header("My Profile")->content($this->getMyProfile())->footer($save)->render());
     return $data;
 }
Beispiel #18
0
 private function taskUpdateForm(&$subticket)
 {
     $fields = [];
     $fields[] = ['type' => 'textarea', 'span' => 12, 'rows' => 6, 'var' => 'reply_body', 'text' => 'Reply:'];
     $data = form::init()->post('/ticket/')->elements($fields)->id('taskReplyForm')->render();
     $data .= button::init()->addStyle('btn-primary')->text('Update Task')->postVar('updateTask')->id($subticket['id'])->message('Updating Task..')->addStyle('post')->icon('plus-sign')->formid('taskReplyForm')->render();
     $data .= button::init()->addStyle('btn-danger')->text('Close Task')->url("/closetask/{$subticket['id']}/")->message('Closing Task..')->icon('remove')->addStyle('get')->formid('taskReplyForm')->render();
     return $data;
 }
Beispiel #19
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();
Beispiel #20
0
    $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
    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']);
    }
Beispiel #21
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();
Beispiel #22
0
			<script src="./js/jquery.validate.js"></script>
	<!-- Latest compiled and minified JavaScript -->
		<script src="./lib/jquery-2.1.4.min.js"></script>
	<script src="./lib/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="./js/prototype.js"></script>
<script type="text/javascript" src="./js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="./js/lightbox.js"></script>

	<link rel="stylesheet" href="./css/lightbox.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="./css/css.css">
</head>
<body>
	<section class = "container-fluid">
<?php 
include "template.php";
$podz = new button();
$podz->header();
$podz->menu();
?>
		<section class = "row">
					<aside class = "col-md-4">
			<iframe width="560" height="315" src="https://www.youtube.com/embed/ANv53eHfX5M" frameborder="0" allowfullscreen class="kek"></iframe>
			<p> Vecā Sanktpēterburga </p>
		</aside>
		<main class="col-md-4">
<?php 
$podz->butto();
?>
				<center>
<h1 class="zag">Krievijas Imperijas pilsetu fotografijas 1917 g. :</h1>
<article>
Beispiel #23
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>';
Beispiel #24
0
    }
    $objIcon->setModuleIcon($plugin['module_id']);
    if ($counter % 2 == 1) {
        $table->startRow();
    }
    $table->addCell($checkbox->show(), 20);
    $label = new label($objIcon->show(), 'module_' . $plugin['module_id']);
    $table->addCell($label->show(), 30);
    $label = new label('<strong>' . $plugin['title'] . '</strong><br />' . $plugin['description'], 'module_' . $plugin['module_id']);
    $table->addCell($label->show() . '<br /><br />');
    if ($counter % 2 == 2) {
        $table->endRow();
    }
}
if ($counter % 2 == 1) {
    $table->addCell('&nbsp;');
    $table->addCell('&nbsp;');
    $table->addCell('&nbsp;');
    $table->endRow();
}
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->code2Txt('mod_context_savepluginsabs', 'context', array('plugins' => 'plugins'), 'Save [-plugins-]'));
$button->setToSubmit();
$backUri = $this->uri(array('action' => 'step3', 'mode' => 'edit', 'contextCode' => $contextCode), 'contextadmin');
$backButton = new button('back', $this->objLanguage->languageText('word_back'), "document.location='{$backUri}'");
$form->addToForm($backButton->show() . " " . $button->show());
$hiddenInput = new hiddeninput('mode', $mode);
$form->addToForm($hiddenInput->show());
$hiddenInput = new hiddeninput('contextCode', $contextCode);
$form->addToForm($hiddenInput->show());
echo $form->show();
Beispiel #25
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();
Beispiel #26
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();
 /**
  *
  * 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;
 }
 /**
  * Method to Display the Business Card
  * @return string
  */
 public function show()
 {
     switch ($this->userArray['sex']) {
         case 'M':
             $gender = 'Male';
             break;
         case 'F':
             $gender = 'Female';
             break;
         default:
             $gender = 'Unknown';
             break;
     }
     $emailLabel = $this->objLanguage->languageText('phrase_emailaddress');
     $genderLabel = $this->objLanguage->languageText('word_gender');
     $mobileLabel = $this->objLanguage->languageText('phrase_mobilenumber');
     $countryLabel = $this->objLanguage->languageText('word_country');
     $image = $this->objUser->getUserImage($this->userArray['userid'], TRUE);
     if ($this->showResetImage) {
         if ($this->objUser->hasCustomImage($this->userArray['userid'])) {
             $resetimageform = new form('updateimage', $this->uri(array('action' => $this->resetAction), $this->resetModule));
             $id = new hiddeninput('id', $this->userArray['id']);
             $resetimageform->addToForm($id->show());
             $userid = new hiddeninput('userid', $this->userArray['userid']);
             $resetimageform->addToForm($userid->show());
             $button = new button('resetimage', 'Reset Image');
             $button->setToSubmit();
             $resetimageform->addToForm(' ' . $button->show());
             $image .= $resetimageform->show();
         }
     }
     $objHeading = new htmlheading();
     $objHeading->str = $this->userArray['title'] . ' ' . $this->userArray['firstname'] . ' ' . $this->userArray['surname'];
     $objHeading->type = 1;
     $heading = $objHeading->show();
     $objTable = new htmltable();
     $objTable->width = '100%';
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell($image, '25%', 'center', 'center', 'userbizcardleft', 'rowspan="6"');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . ucfirst(strtolower($emailLabel)) . ':</strong>', '30%', '', '', 'heading', '');
     $objTable->addCell($this->userArray['emailaddress'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $mobileLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->userArray['cellnumber'], '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $countryLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($this->objCountries->getCountryName($this->userArray['country']) . ' ' . $this->objCountries->getCountryFlag($this->userArray['country']), '', '', '', 'heading', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell('<strong>' . $genderLabel . ':</strong>', '', '', '', 'heading', '');
     $objTable->addCell($gender, '', '', '', 'heading', '');
     $objTable->endRow();
     $string = $objTable->show();
     $objFieldset = new fieldset();
     $objFieldset->legend = $heading;
     $objFieldset->contents = $string;
     $objFieldset->width = '500px';
     $fieldset = $objFieldset->show();
     return $fieldset;
 }
 /**
  * Method to show the file selector input
  * @return string File Selector
  */
 public function show()
 {
     $this->appendArrayVar('headerParams', $this->showClearInputJavaScript());
     if ($this->defaultFile == '') {
         $defaultId = '';
         $defaultName = '';
     } else {
         $file = $this->objFile->getFile($this->defaultFile);
         if ($file == FALSE) {
             $defaultId = '';
             $defaultName = '';
         } else {
             $defaultId = $file['id'];
             $defaultName = $file['filename'];
         }
     }
     $input = new hiddeninput($this->name, $defaultId);
     $input->extra = ' id="hidden_' . $this->name . '"';
     if (count($this->restrictFileList) == 0) {
         $ext = '';
     } else {
         $ext = '';
         $divider = '';
         foreach ($this->restrictFileList as $type) {
             $ext .= $divider . $type;
             $divider = '____';
         }
     }
     $forceRestrictions = $this->forceRestrictions ? 'yes' : 'no';
     $objPop = new windowpop();
     if ($this->context) {
         $context = 'yes';
     } else {
         $context = 'no';
     }
     if ($this->workgroup) {
         $workgroup = 'yes';
     } else {
         $workgroup = 'no';
     }
     $location = $this->uri(array('mode' => 'selectfilewindow', 'restriction' => $ext, 'forcerestrictions' => $forceRestrictions, 'name' => $this->name, 'context' => $context, 'workgroup' => $workgroup), 'filemanager');
     // Couldnt do this via uri function due to embedded JS
     $location .= '&amp;value=\'+document.getElementById(\'hidden_' . $this->name . '\').value+\'&amp;';
     $objPop->set('location', $location);
     $this->objIcon->setIcon('find_file');
     $this->objIcon->alt = 'Select File';
     $this->objIcon->title = 'Select File';
     $objPop->set('linktext', $this->objIcon->show());
     $objPop->set('linktext', 'Browse');
     $objPop->set('linkType', 'button');
     $objPop->set('width', '750');
     $objPop->set('height', '500');
     $objPop->set('resizable', 'yes');
     $objPop->set('scrollbars', 'yes');
     $objPop->set('left', '50');
     $objPop->set('top', '100');
     $objPop->set('status', 'yes');
     //leave the rest at default values
     $objPop->putJs();
     $textinput = new textinput('selectfile_' . $this->name, $defaultName);
     $textinput->setId('input_selectfile_' . $this->name);
     $textinput->extra = ' readonly="true" style="width:' . $this->widthOfInput . '" ';
     $button = new button('clear', 'Clear', 'clearFileInputJS(\'' . $this->name . '\');');
     return $input->show() . $textinput->show() . ' ' . $objPop->show() . ' ' . $button->show();
 }
 /**
  * Method to 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;
 }