Ejemplo n.º 1
0
 public function show()
 {
     $textinput = new textinput($this->name, $this->defaultValue);
     $textinput->cssId = 'ajaxtags_' . $this->name;
     $this->loadJavaScript('ajaxtags_' . $this->name);
     return $textinput->show();
 }
Ejemplo n.º 2
0
 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();
 }
 /**
  *
  * 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 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();
 }
Ejemplo n.º 5
0
echo $header->show();
$table = $this->newObject('htmltable', 'htmlelements');
$table->cellpadding = 5;
$table->startRow();
$searchLabel = new label($this->objLanguage->languageText('mod_contextgroups_searchby', 'contextgroups') . ': ', 'input_field');
$searchdropdown = new dropdown('field');
$searchdropdown->addOption('firstName', $this->objLanguage->languageText('phrase_firstName'));
$searchdropdown->addOption('surname', $this->objLanguage->languageText('word_surname'));
$searchdropdown->addOption('userId', $this->objLanguage->languageText('word_userid'));
$searchdropdown->setSelected($field);
//$table->addCell();
$label = new label($this->objLanguage->languageText('mod_contextgroups_startswith', 'contextgroups') . ': ', 'input_search');
$input = new textinput('search');
$input->value = htmlentities(stripslashes($searchfor));
$input->size = 20;
$table->addCell($searchLabel->show() . $searchdropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $input->show());
$table->endRow();
$table->startRow();
//Ehb-added-begin
$label = new label($this->objLanguage->languageText('mod_contextgroups_choosecourse', 'contextgroups'), 'input_course');
$courseDropdown = new dropdown('course');
$courseDropdown->addOption('all', $this->objLanguage->languageText('mod_contextgroups_allcourses', 'contextgroups'));
for ($i = 0; $i < count($data); $i++) {
    $courseDropdown->addOption($data[$i]['contextcode'], $data[$i]['title']);
}
$courseDropdown->setSelected($course);
$label2 = new label($this->objLanguage->languageText('mod_contextgroups_choosegroup', 'contextgroups'), 'input_group');
$groupDropdown = new dropdown('group');
$groupDropdown->addOption('all', 'All groups');
$groups = array("Lecturers", "Students", "Guest");
for ($i = 0; $i < count($groups); $i++) {
Ejemplo n.º 6
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();
Ejemplo n.º 7
0
 /**
  * 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;
 }
Ejemplo n.º 8
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();
Ejemplo n.º 9
0
$table->endRow();
// surname
$table->startRow();
$friendsurname = new textinput('friend_surname');
$friendsurnameLabel = new label($this->objLanguage->languageText('friendsurname', 'userregistration') . '&nbsp;', 'input_friendsurname');
$table->addCell($friendsurnameLabel->show(), 150, NULL, 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($friendsurname->show());
$table->endRow();
// email
$table->startRow();
$friendemail = new textinput('friend_email');
$friendemailLabel = new label($this->objLanguage->languageText('friendemail', 'userregistration') . '&nbsp;', 'input_friendemail');
$table->addCell($friendemailLabel->show(), 150, NULL, 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($friendemail->show() . $required);
$table->endRow();
// message to include to mate
$defmsg = $this->objLanguage->languageText("mod_userregistration_wordhi", "userregistration") . ", <br /><br /> " . $this->objUser->username() . " " . $this->objLanguage->languageText("mod_userregistration_hasinvited", "userregistration") . " " . $this->objConfig->getSiteName() . "! <br /><br /> " . $this->objLanguage->languageText("mod_userregistration_pleaseclick", "userregistration") . "<br />";
$table->startRow();
$friendmsg = $this->newObject('htmlarea', 'htmlelements');
$friendmsg->name = 'friend_msg';
$friendmsg->value = $defmsg;
$friendmsg->width = '50%';
$friendmsgLabel = new label($this->objLanguage->languageText('friendmessage', 'userregistration') . '&nbsp;', 'input_friendmsg');
$table->addCell($friendmsgLabel->show(), 150, NULL, 'right');
$table->addCell('&nbsp;', 5);
$friendmsg->toolbarSet = 'simple';
$table->addCell($friendmsg->show());
$table->endRow();
$fieldset = $this->newObject('fieldset', 'htmlelements');
Ejemplo n.º 10
0
if (isset($cache['ip'])) {
    $ip->setValue(htmlentities($cache['ip'], ENT_QUOTES));
}
$cadd->addCell($ciplabel->show());
$cadd->addCell($ip->show());
$cadd->endRow();
//Port
$cadd->startRow();
$plabel = new label($this->objLanguage->languageText('mod_cache_port', 'cache') . ':', 'input_port');
$port = new textinput('port');
$port->extra = ' style="width:50%;" ';
if (isset($cache['port'])) {
    $port->setValue($cache['port']);
}
$cadd->addCell($plabel->show());
$cadd->addCell($port->show());
$cadd->endRow();
//end off the form and add the buttons
$this->objCButton = new button($this->objLanguage->languageText('word_save', 'system'));
$this->objCButton->setValue($this->objLanguage->languageText('word_save', 'system'));
$this->objCButton->setToSubmit();
$cfieldset->addContent($cadd->show());
$cform->addToForm($cfieldset->show());
$cform->addToForm($this->objCButton->show());
$cform = $cform->show();
$this->objIcon = $this->getObject('geticon', 'htmlelements');
if (class_exists('Memcache')) {
    $memcache = new Memcache();
} else {
    $arrRep = array('MCLINK' => '<br/> <a href="http://php.net/memcache">http://php.net/memcache</a><br />');
    echo $this->objLanguage->code2Txt('mod_cache_error', 'cache', $arrRep) . '<br/><a href="javascript:javascript:history.go(-1)">' . $this->objLanguage->languageText('mod_cache_back', 'cache') . '</a>';
 /**
  * Standard block show method. It uses the renderform
  * class to render the login box
  */
 public function show()
 {
     $this->loadClass('label', 'htmlelements');
     $this->loadClass('textinput', 'htmlelements');
     $this->loadClass('button', 'htmlelements');
     $this->loadClass('form', 'htmlelements');
     $this->loadClass('htmlheading', 'htmlelements');
     $this->loadClass('link', 'htmlelements');
     $form = new form('elearnlogin', $this->uri(array('action' => 'login'), 'security'));
     $label = new label($this->objLanguage->languageText('word_username', 'system', 'Username') . ':', 'username');
     $form->addToForm($label->show());
     $username = new textinput('username');
     $form->addToForm('<br />' . $username->show());
     $label = new label($this->objLanguage->languageText('word_password', 'system', 'Password') . ':', 'username');
     $form->addToForm('<br />' . $label->show());
     $password = new textinput('password');
     $password->fldType = 'password';
     $form->addToForm('<br />' . $password->show());
     $button = new button('login', $this->objLanguage->languageText('word_login', 'system', 'Login'));
     $button->setToSubmit();
     $form->addToForm('<br />' . $button->show());
     $str = $form->show();
     $str .= '<hr />';
     if ($this->objSysConfig->getValue('elearnlogin_forgotpassword', 'security', 'true') === 'true') {
         // JOC [[ Forgot your password OK
         $header = new htmlheading();
         $header->type = 5;
         $header->str = $this->objLanguage->languageText('mod_security_forgotyourpassword', 'security', 'Forgot your password') . '?';
         $str .= $header->show();
         // JOC [[ Yes, help me login OK
         $link = new link($this->uri(array('action' => 'needpassword')), 'security');
         $link->link = $this->objLanguage->languageText('mod_security_helpmelogin', 'security', 'Yes, help me login');
         $str .= '<p>' . $link->show() . '</p>';
     }
     return $str;
 }
Ejemplo n.º 12
0
if ($mode == 'edit') {
    $table->startRow();
    $table->addCell($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code'), 100);
    $table->addCell('<strong title="' . $this->objLanguage->code2Txt('mod_contextadmin_contextcodecannotbechanged', 'contextadmin', NULL, '[-context-] code can not be changed') . '">' . strtoupper($context['contextcode']) . '</strong>');
    $table->endRow();
    $hiddenInput = new hiddeninput('editcontextcode', $context['contextcode']);
    $form->addToForm($hiddenInput->show());
} else {
    $table->startRow();
    $table->addCell($codeLabel->show(), 100);
    $table->addCell($code->show() . ' <span id="contextcodemessage">' . $contextCodeMessage . '</span>');
    $table->endRow();
}
$table->startRow();
$table->addCell($titleLabel->show());
$table->addCell($title->show());
$table->endRow();
$uploadlink = new link($this->uri(array("action" => "uploadtheme")));
$uploadlink->link = '<strong>' . $this->objLanguage->languageText('mod_contextadmin_upload', 'contextadmin', 'Upload') . '</strong>';
if ($mode == 'edit') {
    $table->startRow();
    $table->addCell($canvasLabel->show());
    $table->addCell($canvas->show() . $uploadlink->show());
}
$table->endRow();
$table->startRow();
$table->addCell('&nbsp;');
$table->addCell('&nbsp;');
$table->endRow();
$table->startRow();
$table->addCell($this->objLanguage->languageText('word_status', 'system', 'Status'));
Ejemplo n.º 13
0
        $act = 1;
    }
}
$objRadioElement = new radio('isActive');
$objRadioElement->addOption('1', $objLanguage->languageText("word_yes"));
$objRadioElement->addOption('0', $objLanguage->languageText("word_no"));
$objRadioElement->setSelected($act);
$objFmTable2->addCell($objRadioElement->show(), NULL, "top", "center");
$objFmTable2->addCell($this->formatDate($dateCreated), NULL, "top", "center");
//Correct the date format for expirationDate for the popup cal
if (strlen($expirationDate) == 19) {
    $expirationDate = substr($expirationDate, 0, 16);
    #this is a dirty hack
}
$objTextInput = new textinput('expirationDate', $expirationDate);
$cell = $objTextInput->show();
$objIcon = $this->newObject('geticon', 'htmlelements');
$objIcon->setIcon('modules/calendar');
$objIcon->alt = $this->objLanguage->code2Txt('mod_' . $textModule . '_dpick');
$objLink = $this->newObject('link', 'htmlelements');
$objLink->link("javascript:show_calendar('document.storyinput.expirationDate', document.storyinput.expirationDate.value);");
$objLink->link = $objIcon->show();
$cell .= $objLink->show();
$objFmTable2->addCell($cell . NULL, "top", "center");
$objFmTable2->endRow();
//Add the output
$objFmTable->startRow();
$objFmTable->addCell($objFmTable2->show(), NULL, "top", "left", NULL, "colspan=\"2\"");
$objFmTable->endRow();
//Add the WYSWYG editor label
$storyLabel = ucfirst($objLanguage->code2Txt("mod_" . $textModule . "_story", "stories"));
Ejemplo n.º 14
0
 /**
  * Method to generate a context search form
  */
 public function searchForm()
 {
     $this->loadClass('form', 'htmlelements');
     $this->loadClass('textinput', 'htmlelements');
     $this->loadClass('button', 'htmlelements');
     $this->loadClass('hiddeninput', 'htmlelements');
     $form = new form('contextsearch', $this->uri(array('action' => 'search'), 'context'));
     $form->method = 'GET';
     $module = new hiddeninput('module', 'context');
     $action = new hiddeninput('action', 'search');
     $form->addToForm($module->show() . $action->show());
     $textinput = new textinput('search', $this->getParam('search'));
     $button = new button('searchButton', ucwords($this->objLanguage->code2Txt('mod_context_searchcontext', 'context', NULL, 'Search [-context-]')));
     $button->setIconClass("search");
     $button->setToSubmit();
     $form->addToForm('<p align="center">' . $textinput->show() . '<br />' . $button->show() . '</p>');
     return $form->show();
 }
Ejemplo n.º 15
0
 /**
  *
  * Render a login box
  *
  * @param string $module The module we are in or will go to
  * @param boolean $ajaxLogin Whether or not to do ajax login
  * @return string The login box
  * @access public
  *
  */
 public function renderLoginBox($module = NULL, $ajaxLogin = FALSE)
 {
     try {
         // Determine if we need to use https
         $useHTTPS = $this->objSysConfig->getValue('MOD_SECURITY_HTTPS', 'security');
         // Set the formaction depending on whether it is going to use ajax or not.
         if (!$ajaxLogin) {
             // Set the action for the login form depending on if there is a module or not.
             if ($module != NULL) {
                 $formAction = $this->uri(array('action' => 'login', 'mod' => $module), 'security');
             } else {
                 $formAction = $this->uri(array('action' => 'login'), 'login');
             }
             if ($useHTTPS == '1' || $useHTTPS == 'TRUE') {
                 $formAction = str_replace("http:", "https:", $formAction);
             }
         } else {
             // We want an ajax login.
             $formAction = 'javascript:void(0);';
         }
         // Create a Form object.
         $objForm = new form('loginform', $formAction);
         $objFields = new fieldset();
         $objFields->setLegend(' ');
         //--Create an element for the username
         $objInput = new textinput('username', '', 'text', '15');
         $objInput->extra = 'maxlength="255"';
         $objInput->setCss('required minlength(2)');
         $objLabel = new label($this->objLanguage->languageText('word_username') . ': ', 'input_username');
         //Add the username box to the form
         $objFields->addContent($objLabel->show() . '<br />');
         $objFields->addContent($objInput->show() . '<br />');
         //--- Create an element for the password
         $objInput = new textinput('password', '', 'password', '15');
         $objInput->extra = 'maxlength="255"';
         $objInput->setCss('required');
         $objLabel = new label($this->objLanguage->languageText('word_password') . ': ', 'input_password');
         $objFields->addContent($objLabel->show() . '<br />');
         $objFields->addContent($objInput->show());
         //--- Create an element for the network login radio
         $objElement = new checkbox("useLdap");
         $objElement->setCSS("transparentbgnb");
         $objElement->label = $this->objLanguage->languageText("phrase_networkid") . ' ';
         $ldap = '';
         $objSysConfig = $this->getObject('dbsysconfig', 'sysconfig');
         $showLDAPCheckBox = $objSysConfig->getValue('show_ldap_checkbox', 'security');
         // Get a nonce
         $objNonce = $this->getObject('nonce', 'login');
         $nonce = $objNonce->storeNonce();
         // Create a hidden field for the nonce
         $objNonce = new hiddeninput('nonce', $nonce);
         $objNonce->extra = ' id=\'nonce\'';
         $nonce = $objNonce->show();
         //----------------------------------------------------------------------------------------Checking this is a violation of the principle of chain of responsiblity @todo fix it
         if ($this->objConfig->getuseLDAP() && $showLDAPCheckBox == 'true') {
             $ldap .= $objElement->label . ' ' . $objElement->show();
         }
         //--- Create an element for the remember me checkbox
         $objRElement = new checkbox("remember");
         $objRElement->setCSS("transparentbgnb noborder");
         $objRElement->label = $this->objLanguage->languageText("phrase_rememberme", "security");
         $rem = $objRElement->show() . "<br />";
         //--- Create a submit button
         $objButton = new button('submit', $this->objLanguage->languageText("word_login"));
         // Add the login icon
         $objButton->setIconClass("user");
         // Set the button type to submit
         $objButton->setToSubmit();
         // Give the button an ID for jQuery to grab.
         $objButton->setId('loginButton');
         // Add the button to the form ----------------------------------------------------------- Note LDAP breaks the COR pattern
         $objFields->addContent($ldap . '<br />' . $nonce . $rem . "<div class='loginbuttonwrap'>" . $objButton->show() . '</div>');
         $helpText = strtoupper($this->objLanguage->languageText('word_help', 'system'));
         $helpIcon = $this->objHelp->show('register', 'useradmin', $helpText);
         $resetLink = new Link($this->uri(array('action' => 'needpassword'), 'security'));
         $resetLink->link = $this->objLanguage->languageText('mod_security_forgotpassword');
         // the help link
         $p = '<br/>' . $resetLink->show() . '<br />' . $helpIcon;
         $objFields->addContent($p);
         $objForm->addToForm($objFields->show());
         return '<div id="login_block_wrapper">' . $objForm->show() . '</div>';
     } catch (Exception $e) {
         customException::cleanUp();
     }
 }
Ejemplo n.º 16
0
    case 'nofoldernameprovided':
        $folderContent .= '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatednoname', 'filemanager', 'Folder was not created. No name provided') . '</span>';
        break;
    case 'illegalcharacters':
        $folderContent .= '<span class="error">' . $this->objLanguage->languageText('mod_filemanager_folderwasnotcreatedillegalchars', 'filemanager', 'Folder was not created. Folders cannot contain any of the following characters') . ': \\ / : * ? &quot; &lt; &gt; |</span>';
        break;
}
echo '<h1>' . $folderpath . '</h1>';
$folderActions = "";
if ($folder['folderlevel'] != 2 && $folderPermission) {
    $form = new form('formrenamefolder', $this->uri(array('action' => 'renamefolder')));
    $objInputFolder = new hiddeninput('folder', $folderId);
    $form->addToForm($objInputFolder->show());
    $label = new label($this->objLanguage->languageText('mod_filemanager_nameoffolder', 'filemanager') . ': ', 'input_foldername');
    $textinput = new textinput('foldername', $folderpath);
    $form->addToForm($label->show() . $textinput->show());
    $buttonSubmit = new button('renamefoldersubmit', $this->objLanguage->languageText('mod_filemanager_renamefolder', 'filemanager'));
    $buttonSubmit->setToSubmit();
    $form->addToForm('&nbsp;' . $buttonSubmit->show() . '<br/><div class="warning">' . $this->objLanguage->languageText('mod_filemanager_renamewarning', 'filemanager') . '</div>');
    $fieldset = new fieldset();
    $fieldset->setLegend($this->objLanguage->languageText('mod_filemanager_renamefolder', 'filemanager'));
    //$folderId
    $fieldset->addContent($form->show());
    $folderActions .= '<span id="renamefolder" style="display: xnone;">' . $fieldset->show() . '<br /></span>';
    $objAccess = $this->getObject("folderaccess", "filemanager");
    $accessContent = $objAccess->createAccessControlForm($folder['id']);
    $folderActions .= '<span id="accessfolder" >' . $accessContent . '<br /></span>';
    $alertContent = $objAccess->createAlertsForm($folder['id']);
    $folderActions .= '<span id="alertsfolder" >' . $alertContent . '<br /></span>';
    $fieldset = new fieldset();
    $fieldset->setLegend($this->objLanguage->languageText('mod_filemanager_deletefolder', 'filemanager', 'Delete Folder'));
Ejemplo n.º 17
0
 /**
  *
  * Render the dropdown skin chooser so that it is processed
  * by the skinselect module, for use with Ajax
  *
  * @return string Form with dropdown
  * @access public
  *
  */
 public function show()
 {
     $script = $this->uri(array('action' => 'save'), 'skinselect');
     $objNewForm = new form('selectskin', $script);
     $objDropdown = new dropdown('skinlocation');
     $objDropdown->extra = "onchange =\"document.forms['selectskin'].submit();\"";
     $skins = array();
     $curPage = $this->curPageURL();
     $objSelf = new textinput('returnUri', $curPage);
     $objSelf->fldType = "hidden";
     // Get all the skins as an array
     $dirList = $this->getAllSkins();
     // Sort the array of skins alphabetically
     asort($dirList);
     // Loop and add them to the dropdown
     foreach ($dirList as $element => $value) {
         $objDropdown->addOption($element, $value);
     }
     $objNewForm->addToForm($this->objLanguage->languageText('phrase_selectskin') . ":<br />\n");
     // Set the current skin as the default selected skin
     $objDropdown->setSelected($this->getSession('skin'));
     $objDropdown->cssClass = 'coursechooser';
     $objNewForm->addToForm($objDropdown->show());
     $objNewForm->addToForm($objSelf->show());
     return $objNewForm->show();
 }
Ejemplo n.º 18
0
 /**
  *
  * Method to show the user selectable grades
  * 
  * @acces public
  * @return VOID 
  */
 public function showGrades()
 {
     $selectGradeLabel = $this->objLanguage->code2Txt('mod_grades_grade', 'grades', NULL, 'ERROR: mod_grades_grade');
     $selectLabel = $this->objLanguage->languageText('word_select', 'system', 'ERROR: word_select');
     $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success');
     $successLabel = $this->objLanguage->code2Txt('mod_userdetails_gradesuccess', 'userdetails', NULL, 'ERROR: mod_userdetails_gradesuccess');
     $errorTitleLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error');
     $errorLabel = $this->objLanguage->code2Txt('mod_userdetails_gradeerror', 'userdetails', NULL, 'ERROR: mod_userdetails_gradeerror');
     $grades = $this->objDBgrades->getAll();
     $userGroups = $this->objGroups->getUserGroups($this->objUser->userId());
     $name = NULL;
     if (!empty($userGroups)) {
         foreach ($userGroups as $group) {
             foreach ($grades as $grade) {
                 if ($group['group_define_name'] == $grade['name']) {
                     $name = $grade['name'];
                     break;
                     break;
                 }
             }
         }
     }
     $objDrop = new dropdown('new_name');
     $objDrop->addFromDB($grades, 'name', 'name');
     $objDrop->setSelected($name);
     $gradeDrop = $objDrop->show();
     $objInput = new textinput('old_name', $name, 'hidden', '50');
     $nameInput = $objInput->show();
     $objButton = new button('select', $selectLabel);
     $objButton->setId('grade_select');
     $selectButton = $objButton->show();
     $objTable = new htmltable();
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell('<b>' . ucfirst(strtolower($selectGradeLabel)) . ': </b>', '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($nameInput . $gradeDrop, '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($selectButton, '', '', '', '', '', '');
     $objTable->endRow();
     $gradeTable = $objTable->show();
     $objForm = new form('user', $this->uri(array('action' => 'change_grade')));
     $objForm->extra = ' enctype="multipart/form-data"';
     $objForm->addToForm($gradeTable);
     $gradeForm = $objForm->show();
     $string = $gradeForm;
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_success');
     $this->objDialog->setTitle(ucwords($successTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="success">' . $successLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog = $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_error');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     return $string . $dialog;
 }
Ejemplo n.º 19
0
$table->addCell('&nbsp;');
$table->addCell($textinput->show() . ' - ' . $passMsg . $ldapMsg);
$table->endRow();
// Repeat Password
$table->startRow();
$label = new label('Repeat Password', 'input_useradmin_repeatpassword');
$textinput = new textinput('useradmin_repeatpassword');
$textinput->fldType = 'password';
$textinput->size = 15;
$textinput->extra = ' autocomplete="off"';
if ($howcreated == 'LDAP') {
    $textinput->extra .= ' disabled="disabled"';
}
$table->addCell($label->show());
$table->addCell('&nbsp;');
$table->addCell($textinput->show());
$table->endRow();
$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');
Ejemplo n.º 20
0
 /**
  * Method to create a link.
  * @param  string The action, rule, or condition name.
  * @param  string The action to perform.
  * @param  string The reference id for the object.
  * @return string The HTML link element.
  */
 function lnkText($objLink, $action, $id)
 {
     $lnkText = parent::lnkText($objLink, $action, $id);
     if ($id == $this->name && $action == $this->getParam('class')) {
         $bodyParams = "onload=\"document.form1['objName'].focus();document.form1['objName'].select();\"";
         $this->objEngine->setVar('bodyParams', $bodyParams);
         $tinName = new textinput('objName', $objLink->_name);
         $tinName->extra = "onDblClick =\"javascript: document.form1['objName'].value='';\"";
         $tinName->extra .= 'onKeyPress ="javascript: if( event.keyCode==13){ ';
         $tinName->extra .= "document.form1['button'].value='save';";
         $tinName->extra .= "document.form1['class'].value='{$action}';";
         $tinName->extra .= "document.form1['id'].value='{$id}';";
         $tinName->extra .= 'document.form1.submit();}"';
         if (isset($objLink->_params)) {
             $tinName->extra .= " title = '{$objLink->_params}'";
         }
         $lnkText = $tinName->show();
         if (get_class($objLink) == 'condition') {
             $lnkEdit = $this->newObject('link', 'htmlelements');
             $lnkEdit->href = '#';
             $lnkEdit->link = 'Edit';
             $lnkEdit->extra = 'onClick ="javascript:';
             $lnkEdit->extra .= "document.form1['button'].value='edit';";
             $lnkEdit->extra .= "document.form1['class'].value='{$action}';";
             $lnkEdit->extra .= "document.form1['id'].value='{$id}';";
             $lnkEdit->extra .= 'document.form1.submit();"';
         }
         $lnkSave = $this->newObject('link', 'htmlelements');
         $lnkSave->href = '#';
         $lnkSave->link = 'Save';
         $lnkSave->extra = 'onClick ="javascript:';
         $lnkSave->extra .= "document.form1['button'].value='save';";
         $lnkSave->extra .= "document.form1['class'].value='{$action}';";
         $lnkSave->extra .= "document.form1['id'].value='{$id}';";
         $lnkSave->extra .= 'document.form1.submit();"';
         $lnkCancel = $this->newObject('link', 'htmlelements');
         $lnkCancel->href = '#';
         $lnkCancel->link = 'Cancel';
         $lnkCancel->extra = 'onClick ="javascript:';
         $lnkCancel->extra .= 'document.form1.submit();"';
         $lnkDelete = $this->newObject('link', 'htmlelements');
         $lnkDelete->href = '#';
         $lnkDelete->link = 'Delete';
         $lnkDelete->extra = 'onClick ="javascript:';
         $lnkDelete->extra .= "document.form1['button'].value='delete';";
         $lnkDelete->extra .= "document.form1['class'].value='{$action}';";
         $lnkDelete->extra .= "document.form1['id'].value='{$id}';";
         $lnkDelete->extra .= 'document.form1.submit();"';
         $show = '<TABLE width=100%><TR align=center><TD>' . $lnkText . '</TD></TR>';
         $show .= '<TR align=center><TD>';
         $show .= $lnkSave->show() . ' / ' . $lnkCancel->show() . ' / ' . $lnkDelete->show();
         $show .= isset($lnkEdit) ? ' / ' . $lnkEdit->show() : NULL;
         $show .= '</TD></TR></TABLE>';
         return $show;
     } else {
         return $lnkText;
     }
 }
Ejemplo n.º 21
0
$devmsg = nl2br($devmsg);
$usrmsg = nl2br($usrmsg);
$blurb = $this->objLanguage->languagetext("mod_errors_blurb", "errors");
//$midcol .= $blurb;
$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_usrtitle", "errors"), $usrmsg);
//'<div class="featurebox">' . nl2br($usrmsg) . '</div>';
$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_devtitle", "errors"), $devmsg);
//'<div class="featurebox">' . nl2br($devmsg) . '</div>';
//$logfile = htmlentities(file_get_contents('error_log/system_errors.log'));
//$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_logfiletitle", "errors"), $logfile);
// CAPTCHA
$objCaptcha = $this->getObject('captcha', 'utilities');
$captcha = new textinput('request_captcha');
$captchaLabel = NULL;
// new label($this->objLanguage->languageText('phrase_verifyrequest', 'security', 'Verify Request'), 'input_request_captcha');
$cap = 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>';
//create the form
$objForm->displayType = 4;
$objForm->addToFormEx($objLanguage->languageText('mod_errors_submiterrs', 'errors'));
$objForm->addToFormEx($objTextArea->show());
$objForm->addToFormEx($captchaLabel, $cap);
$objForm->addToFormEx($objHiddenInput->show());
$objForm->addToFormEx($objHiddenInput2->show());
$objForm->addRule('request_captcha', $this->objLanguage->languageText("mod_blogcomments_captchaval", 'blogcomments'), 'required');
$this->objButton =& new button($objLanguage->languageText('word_sendtodevs', 'errors'));
$this->objButton->setValue($objLanguage->languageText('word_sendtodevs', 'errors'));
$this->objButton->setToSubmit();
$objForm->addToFormEx($this->objButton->show());
$midcol .= $objFeatureBox->show($this->objLanguage->languagetext("mod_errors_mailadmins", "errors"), $objForm->show());
$cssLayout->setMiddleColumnContent($midcol);
echo $cssLayout->show();
Ejemplo n.º 22
0
$table->addCell($type->show());
$search1 = new dropdown('searchField_user');
$search1->addOption('firstname', $this->objLanguage->languageText('phrase_firstname', 'system', 'First Name'));
$search1->addOption('surname', $this->objLanguage->languageText('word_surname', 'system', 'Surname'));
$search1->setSelected($this->getParam('searchField_user'));
$div1 = '<div class="userform" style="display: ' . $userDisplay . '">' . $search1->show() . '</div>';
$search2 = new dropdown('searchField_context');
$search2->addOption('title', ucwords($this->objLanguage->code2Txt('mod_context_contexttitle', 'context', NULL, '[-context-] Title')));
$search2->addOption('contextcode', ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')));
$search2->setSelected($this->getParam('searchField_context'));
$div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $search2->show() . '</div>';
$table->addCell($this->objLanguage->languageText('mod_filemanager_searchfield', 'filemanager', 'Search Field'));
$table->addCell($div1 . $div2);
$searchFor = new textinput('searchfor', $this->getParam('searchfor'));
$table->addCell($this->objLanguage->languageText('mod_forum_searchfor', 'system', 'Search for'));
$table->addCell($searchFor->show());
$orderBy1 = new dropdown('orderBy_user');
$orderBy1->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage'));
$orderBy1->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage'));
$orderBy1->addOption('firstname', $this->objLanguage->languageText('phrase_firstname', 'system', 'First Name'));
$orderBy1->addOption('surname', $this->objLanguage->languageText('word_surname', 'system', 'Surname'));
$orderBy1->setSelected($this->getParam('orderBy_user'));
$div1 = '<div class="userform" style="display: ' . $userDisplay . '">' . $orderBy1->show() . '</div>';
$orderBy2 = new dropdown('orderBy_context');
$orderBy2->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage'));
$orderBy2->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage'));
$orderBy2->addOption('title', ucwords($this->objLanguage->code2Txt('mod_context_contexttitle', 'context', NULL, '[-context-] Title')));
$orderBy2->addOption('contextcode', ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')));
$orderBy2->setSelected($this->getParam('orderBy_context'));
$div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $orderBy2->show() . '</div>';
$table->addCell($this->objLanguage->languageText('mod_filemanager_orderby', 'filemanager', 'Order By'));
Ejemplo n.º 23
0
    /**
     * Method to render the color picker as HTML code
     *
     * @return string The HTML code of the rendered textinput and colorpicker
     * @access public
     */
    public function show()
    {
        $this->appendArrayVar('headerParams', $this->getJavaScriptFile('ColorPicker2.js'));
        //'<script type="text/javascript" SRC="modules/htmlelements/resources/ColorPicker2.js"></SCRIPT>');
        $this->appendArrayVar('headerParams', '<script type="text/javascript">
var colorpicker = new ColorPicker(); // DIV style
</script>');
        $this->setVar('pageSuppressXML', TRUE);
        $input = new textinput($this->name, $this->defaultColor);
        $id = $input->cssId;
        return $input->show() . ' <a href="javascript:;" onclick="colorpicker.select(document.getElementById(\'' . $id . '\'),\'colorpick_' . $id . '\');return false;" NAME="colorpick_' . $id . '" id="colorpick_' . $id . '">' . $this->objIcon->show() . '</a><script type="text/javascript">colorpicker.writeDiv();</script>';
    }
Ejemplo n.º 24
0
$conGroups[2] = array('id' => 'Guest', 'name' => $guestLabel);
$objSelectBox->insertLeftOptions($conGroups, 'id', 'name');
$objSelectBox->insertRightOptions(array());
// Insert the selectbox into the form object.
$objHead->str = $conGroupLabel;
$objHead->type = 3;
$objForm->addToForm('<p>' . $objHead->show() . '</p><p>' . $objSelectBox->show() . '</p>');
/* *********** Save and close buttons ************* */
$objButton = new button('save', $saveLabel);
$objButton->setOnClick('submitPerms()');
$btns = '<p><br/>' . $objButton->show();
$objButton = new button('save', $closeLabel);
$objButton->setOnClick('window.close()');
$btns .= '&nbsp;&nbsp;' . $objButton->show() . '</p>';
$objForm->addToForm($btns);
/* ************ Show the form ************* */
$str .= $objForm->show();
/* ************ Restore default permissions ************ */
$objInput = new textinput('modulename', $moduleName);
$objInput->fldType = 'hidden';
$objLink = new link('javascript:void(0)');
$objLink->extra = "onclick=\"restoreDefaults()\"";
$objLink->link = $restoreLabel;
$objForm = new form('restore', $this->uri(array('action' => 'restoreperms')));
$objForm->addToForm($objInput->show());
$objForm->addToForm($objLink->show());
$str .= '<p><br/>' . $objForm->show() . '</p>';
$objLayer = new layer();
$objLayer->str = $str;
$objLayer->align = 'center';
echo $objLayer->show() . '<p>&nbsp;</p>';
Ejemplo n.º 25
0
        $objElement->setValue($pname);
    }
    $txtToShow = $objElement->show();
}
//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()) . "';");
Ejemplo n.º 26
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  unknown $folderId Parameter description (if any) ...
  * @return object  Return description (if any) ...
  * @access public
  */
 function showCreateFolderForm($folderId)
 {
     $folderPath = $this->getFolderPath($folderId);
     if ($folderPath == FALSE) {
         return '';
     }
     $folderParts = explode('/', $folderPath);
     $form = new form('createfolder', $this->uri(array('action' => 'createfolder')));
     $label = new label('Create a subfolder in: ', 'input_parentfolder');
     $form->addToForm($label->show() . '<br/>' . $this->getTree($folderParts[0], $folderParts[1], 'htmldropdown', $folderId));
     $textinput = new textinput('foldername');
     $label = new label('Name of Folder: ', 'input_foldername');
     $form->addToForm('<br/>' . $label->show() . '<br/>' . $textinput->show() . '&nbsp;');
     $button = new button('create', 'Create Folder');
     $button->setToSubmit();
     $form->addToForm('<br/>' . $button->show());
     return $form->show();
 }
Ejemplo n.º 27
0
//Create label for the input of title
$titLabel = new label($this->objLanguage->languageText("word_title"), "input_title");
//Create an element for the input of title
$objTit = new textinput("title");
$titMiss = $this->objLanguage->languageText('mod_storycategory_titmiss', "storycategoryadmin");
$objForm->addRule('title', $titMiss, 'required');
//Set the width
$objTit->size = 70;
//Set the value of the element to $title
if (isset($title)) {
    $objTit->setValue($title);
}
//Create an instance of the fieldset object
$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) . "';");
Ejemplo n.º 28
0
 /**
  * Method to show the file input
  *
  * Remember to add $form->extra = 'enctype="multipart/form-data"'; to the form
  * @return string
  */
 public function show()
 {
     $input = new textinput($this->name);
     $input->fldType = 'file';
     $input->cssClass = '';
     $input->size = '50';
     $objLanguage = $this->getObject('language', 'language');
     $objFolder = $this->getObject('dbfolder');
     $this->objContext = $this->getObject('dbcontext', 'context');
     $this->contextCode = $this->objContext->getContextCode();
     $tree = "";
     $targetDirLabel = "";
     if ($this->showTargetDir) {
         if ($this->targetDirMode == TARGETDIRMODE_USER) {
             $tree = $objFolder->getTree('users', $this->objUser->userId(), 'htmldropdown');
         } else {
             if ($this->targetDirMode == TARGETDIRMODE_CONTEXT && $this->contextCode != '') {
                 $tree = $objFolder->getTree('context', $this->contextCode, 'htmldropdown');
             } else {
                 $tree = '';
             }
         }
         $targetDirLabel = $objLanguage->languageText('mod_filemanager_saveuploadfilein', 'filemanager', 'Save Uploaded File in') . ':';
     }
     $objQuotas = $this->getObject('dbquotas');
     $maxFileSize = new hiddeninput('MAX_FILE_SIZE', $objQuotas->getRemainingSpaceUser($this->objUser->userId()));
     $restrict = '';
     $restrictStr = '';
     if (count($this->restrictFileList) > 0) {
         $divider = '';
         $comma = '';
         foreach ($this->restrictFileList as $restriction) {
             $restrict .= $divider . $restriction;
             $restrictStr .= $comma . $restriction;
             $divider = '___';
             $comma = ', ';
         }
         $restrictInput = new hiddeninput('restrictions__' . $this->name, $restrict);
         $restrict = $restrictInput->show();
         $restrictStr = ' (' . $restrictStr . ')';
     }
     return $maxFileSize->show() . $input->show() . $restrictStr . '<br /> ' . $targetDirLabel . ' ' . $tree . $restrict;
 }
Ejemplo n.º 29
0
 /**
  * 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();
 }
Ejemplo n.º 30
0
<?php

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