本文整理汇总了PHP中form::show方法的典型用法代码示例。如果您正苦于以下问题:PHP form::show方法的具体用法?PHP form::show怎么用?PHP form::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form
的用法示例。
在下文中一共展示了form::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchForm
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();
}
示例2: renderLoginBox
/**
*
* 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();
}
}
示例3: button
//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() . " " . $objCancel->show());
//Add the heading to the layer
$this->objH = $this->getObject('htmlheading', 'htmlelements');
$this->objH->type = 1;
//Heading <h1>
$this->objH->str = $objLanguage->code2txt("mod_storycategoryadmin_title", "storycategoryadmin");
$rightSideColumn = $this->objH->show();
$rightSideColumn .= $objForm->show();
// Add Left column
$cssLayout->setLeftColumnContent($leftSideColumn);
// Add Right Column
$cssLayout->setMiddleColumnContent($rightSideColumn);
//Output the content to the page
echo $cssLayout->show();
示例4: showEditAddForm
/**
* 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
//.........这里部分代码省略.........
示例5: label
$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/> ' . $objElement->show() . " " . $objCancel->show());
echo $str . "<div class='standard_form'>" . $objForm->show() . "</div>";
示例6: form
<?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(' ');
$form->addToForm($moduleLabel->show() . $module->show());
$button = new button('go', $this->objLanguage->languageText('word_go', 'system', 'Go'));
$button->setToSubmit();
$form->addToForm(' ' . $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();
示例7: editContextForm
/**
* 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(' ');
$table->addCell(' ');
$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(' ');
$table2->addCell(' ');
$table2->addCell(' ');
$table2->endRow();
//.........这里部分代码省略.........
示例8: button
$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();
示例9: putCategoryChooser
/**
*
* Method to put a dropdown list of categories
*
*/
function putCategoryChooser()
{
$objCat = $this->getObject('dbstorycategory', 'storycategoryadmin');
$ar = $objCat->getAll();
//Load the form class that I need
$this->loadClass('form', 'htmlelements');
$this->loadClass('dropdown', 'htmlelements');
//Instantiate the form class
$objForm = new form('chCat');
//Instantiate a dropdown
$objCatDrd = new dropdown('category_selector');
$objCatDrd->extra = " onchange=\"document.location=document.forms['chCat'].category_selector.value;\"";
//Add the categories
$objCatDrd->addOption("", $this->objLanguage->languageText("mod_stories_anothercat", 'stories'));
foreach ($ar as $line) {
$link = $this->uri(array('action' => $this->getParam('action', NULL), 'storycategory' => $line['category']), $this->getParam('module', '_default'));
$objCatDrd->addOption($link, $line['title']);
}
$objForm->addToForm($objCatDrd->show());
return $objForm->show();
}
示例10: show
/**
* Standard block show method.
*/
public function show()
{
// Get all user contents
$contexts = $this->objUserContext->getUserContext($this->objUser->userId());
if (count($contexts) == 0) {
return $this->objLanguage->code2Txt('mod_context_youdonotbelongtocontexts', 'context', NULL, 'You do not belong to any [-contexts-]');
} else {
$form = new form('joincontext', $this->uri(array('action' => 'joincontext'), 'context'));
$dropdown = new dropdown('contextcode');
$contextArray = array();
foreach ($contexts as $contextCode) {
$contextDetails = $this->objContext->getContextDetails($contextCode);
//check if this course is unpublished
if ($contextDetails["status"] == "Unpublished") {
//if so check if this person is lecturer lecturer of the course
$groupId = $this->objGroups->getLeafId(array($contextCode, 'Lecturers'));
$ret = $this->objGroups->isGroupMember($this->objUser->userId(), $groupId);
if ($ret) {
$contextArray[$contextDetails['title']] = $contextCode;
}
} else {
$contextArray[$contextDetails['title']] = $contextCode;
}
}
if (count($contextArray) < 1) {
return $this->objLanguage->code2Txt('mod_context_youdonotbelongtocontexts', 'context', NULL, 'You do not belong to any [-contexts-]');
}
ksort($contextArray);
foreach ($contextArray as $title => $code) {
$dropdown->addOption($code, $title);
}
$dropdown->setSelected($this->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();
}
}
示例11: putlanguageChooser
/**
* Method to render Language Chooser on the
* index page.
* Construct a form and populate it with all available
* language translations for selection
* @access public
* @return form
*/
public function putlanguageChooser()
{
try {
//$ret = $this->languageText("phrase_languagelist",'language') . ":<br />\n";
$script = $_SERVER['PHP_SELF'];
$objNewForm = new form('languageCheck', $script);
$objDropdown = new dropdown('Languages');
$objDropdown->extra = "onchange =\"document.forms['languageCheck'].submit();\"";
$results = $this->languagelist();
foreach ($results as $list) {
foreach ($list as $key) {
$objDropdown->addOption($key, $key);
}
}
$objNewForm->addToForm($this->languageText("phrase_languagelist") . ":<br />\n");
$objNewForm->addToForm($objDropdown->show());
$ret = $objNewForm->show();
return $ret;
} catch (Exception $e) {
$this->errorCallback($this->languageText('word_caught_exception') . $e->getMessage());
exit;
}
}
示例12: createFileVisibilityForm
/**
* this creates the visibility control field
* @param type $id
* @return type
*/
function createFileVisibilityForm($id)
{
$dbFile = $this->getObject("dbfile", "filemanager");
$file = $dbFile->getFile($id);
$form = new form('visibilityform', $this->uri(array('action' => 'setfilevisibility', 'id' => $id)));
$visibleTxt = $this->objLanguage->languageText('mod_filemanager_visible', 'filemanager');
$hiddenTxt = $this->objLanguage->languageText('mod_filemanager_hidden', 'filemanager');
$legend = $this->objLanguage->languageText('mod_filemanager_visibility', 'filemanager');
$objElement = new radio('access_radio');
$objElement->addOption('visible', $visibleTxt . '<br/>');
$objElement->addOption('hidden', $hiddenTxt . '<br/>');
$access = $file['visibility'] == NULL ? 'visible' : $file['visibility'];
$objElement->setSelected($access);
$applyButton = new button('apply', $this->objLanguage->languageText('mod_filemanager_apply', 'filemanager'));
$applyButton->setToSubmit();
$fieldset = new fieldset();
$fieldset->setLegend($legend);
$fieldset->addContent($objElement->show() . '<br/>' . $applyButton->show());
$hiddeninput = new hiddeninput('id', $id);
$form->addToForm($hiddeninput->show());
$form->addToForm($fieldset->show());
$content = $form->show();
$objModule = $this->getObject('modules', 'modulecatalogue');
//See if the simple map module is registered and set a param
$isRegistered = $objModule->checkIfRegistered('digitallibrary');
if ($isRegistered) {
$dlfieldset = new fieldset();
$dlfieldset->setLegend("Link to digital library");
$link = new link($this->uri(array("action" => "linkfromfilemanager", "fileid" => $id), "digitallibrary"));
$link->link = "<strong>Link this file</>";
$dlfieldset->addContent($link->show());
$content .= $dlfieldset->show();
}
return $content;
}
示例13: show
/**
* 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;
}
示例14: joinInterestGroup
/**
* Method to create a dropdown list on interest groups (workgroups).
* @param string $filter Determines if users should be filtered by context or not (alumni users).
* @return the html string.
*/
function joinInterestGroup($filter = 'context')
{
// Check if workgroup is registered and active for the context
$objModule = $this->getObject('modules', 'modulecatalogue');
$objCondition = $this->getObject('contextcondition', 'contextpermissions');
///////////////////+>
$notaMember = $this->objLanguage->code2Txt('mod_toolbar_notingroup', 'toolbar');
///////////////////+>
$leaveGroup = $this->objLanguage->code2Txt('mod_workgroup_leavegroup', 'workgroup');
///////////////////+>
$join = ucwords($this->objLanguage->code2Txt('mod_toolbar_joingroup', 'toolbar'));
////////////////+>
$notInGroup = $this->objLanguage->code2Txt('phrase_notinworkgroup');
$inGroup = $this->objLanguage->code2Txt('mod_workgroup_currentlyinworkgroup', 'workgroup');
$go = $this->objLanguage->languageText('word_go');
$str = '';
if ($objModule->checkIfRegistered('workgroup', 'workgroup')) {
$objDBWorkgroup = $this->getObject('dbworkgroup', 'workgroup');
$this->objHeading = $this->newObject('htmlheading', 'htmlelements');
$this->objHeading->str = $join;
$this->objHeading->type = 4;
$str = $this->objHeading->show();
if ($filter == 'context') {
// Get available workgroups. Lecturers - all in context
if ($objCondition->isContextMember('Lecturers')) {
$workgroups = $objDBWorkgroup->getAll($this->contextcode);
} else {
$workgroups = $objDBWorkgroup->getAllForUser($this->contextcode, $this->objUser->userId());
}
} else {
$workgroups = $objDBWorkgroup->getAllForUser(NULL, $this->objUser->userId());
}
// No workgroups are available.
if (count($workgroups) == 0) {
$str .= $notaMember;
} else {
$workgroupId = $objDBWorkgroup->getWorkgroupId();
if ($workgroupId == NULL) {
$workgroupTitle = '';
//"<strong>".$notInGroup."</strong>";
} else {
$objLink = new link($this->uri(null, 'workgroup'));
$objLink->link = $objDBWorkgroup->getDescription($workgroupId);
$workGroupLink = $objLink->show();
$this->objIcon->setIcon('leavecourse');
$this->objIcon->alt = $leaveGroup;
$this->objIcon->title = $leaveGroup;
$objLink = new link($this->uri(array('action' => 'leaveworkgroup'), 'workgroup'));
$objLink->link = $this->objIcon->show();
$workgroupTitle = $workGroupLink . ' ' . $objLink->show();
$workgroupTitle = str_replace('{workgroup}', '<strong>' . $workgroupTitle . '</strong>', $inGroup);
}
$str .= '<p>' . $workgroupTitle . '</p>';
$objForm = new form('joinworkgroup', $this->uri(array('action' => 'joinworkgroup'), 'workgroup'));
$objForm->setDisplayType(3);
$dropdown = new dropdown('workgroup');
$dropdown->cssClass = 'coursechooser';
$dropdown->addFromDB($workgroups, 'description', 'id', $workgroupId);
$button = new button('save', $go);
$button->setToSubmit();
$objForm->addToForm('<p>' . $dropdown->show() . '</p>');
$objForm->addToForm('<p>' . $button->show() . '</p>');
$str .= $objForm->show();
}
}
return $str;
}
示例15: searchForm
/**
* 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();
}