예제 #1
0
$table = $this->newObject('htmltable', 'htmlelements');
$table->startRow();
$table->addCell($usernameLabel->show(), 100);
$table->addCell($username->show());
$table->endRow();
$table->startRow();
$table->addCell($emailLabel->show());
$table->addCell($email->show());
$table->endRow();
$table->startRow();
$table->addCell(' ');
$table->addCell(' ');
$table->endRow();
$table->startRow();
$redrawButton = new button('redraw', 'Redraw', 'redraw();');
$table->addCell($captchaLabel->show());
$table->addCell(stripslashes($this->objLanguage->languageText('mod_security_explaincaptcha', 'security', 'To prevent abuse, please enter the code as shown below. If you are unable to view the code, click on "Redraw" for a new one.')) . '<br /><div id="captchaDiv">' . $objCaptcha->show() . '</div>' . $captcha->show() . ' <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>');
$table->endRow();
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->languageText('mod_security_sendmenewpassword', 'security', 'Send me a new password'));
$button->setToSubmit();
$form->addToForm('<p><br />' . $button->show() . '</p>');
$form->addRule('request_username', 'Please enter your username', 'required');
//$form->addRule('request_email', 'Not a valid Email', 'email');
$form->addRule('request_email', 'Please enter your emailaddress', 'required');
$form->addRule('request_captcha', 'Please enter the code in the image', 'required');
echo $form->show();
//$this->setLayoutTemplate(NULL);
//$this->setVar('pageSuppressXML', TRUE);
//echo '<div id="captchaDiv">'.$objCaptcha->show().'</div>'.$redrawButton->show();
echo '<p>' . $this->objLanguage->languageText('word_note', 'security', 'Note') . ': ';
예제 #2
0
$objModAdmin = $this->getObject('modules', 'modulecatalogue');
$modules = $objModAdmin->getAll('ORDER BY module_id');
$ddbModules = new dropdown('module_name');
$ddbModules->extra = ' onchange="document.frmMod.submit();"';
foreach ($modules as $aModule) {
    $ddbModules->addOption($aModule['module_id'], $aModule['module_id']);
}
$ddbModules->setSelected($this->getSession('module_name'));
// Select a module:
$lblSelectModule = $this->objLanguage->languageText("mod_contextpermissions_lblSelectModule", 'contextpermissions', "[Select a module: ]");
$objLabel = new label($lblSelectModule, 'input_module_name');
$frmMod = new form();
$frmMod->action = $this->uri(array('action' => 'show_main'));
$frmMod->name = 'frmMod';
$frmMod->addToForm('<H1>' . $title . ' </H1>');
$frmMod->addToForm('<P>' . $objLabel->show() . '&nbsp;' . $ddbModules->show() . '</P>');
echo $frmMod->show();
// Initialize links
$lnkCreateAction = $this->lnkText($lblCreateAction, 'create_action', NULL);
$lnkCreateRule = $this->lnkText($lblCreateRule, 'create_rule', NULL);
$lnkCreateCondition = $this->lnkText($lblCreateCondition, 'create_condition', NULL);
$lnkGenerateConfig = $this->lnkText($lblGenerateConfig, 'generate_config', NULL);
$lnkUpdatePermissions = $this->lnkText($lblUpdatePerms, 'update_perms', NULL);
$lnkGetControllerActions = $this->lnkText($lblControllerActions, 'controller_actions', NULL);
$properties = array();
$properties['lblAction'] = $lblAction;
$properties['lblRule'] = $lblRule;
$properties['lblCondition'] = $lblCondition;
$properties['colWidth'] = '10%';
$objViewGrid = $this->getObject('editGrid', 'contextpermissions');
$objViewGrid->connect($this->objDecisionTable, $properties);
예제 #3
0
    $ddbType->addOption($option['name'], $option['name']);
}
$ddbType->setSelected($condition->_function);
$ddbType->extra = 'onChange="javascript:document.frmCond[\'button\'].value=\'save\';document.frmCond.submit();"';
$lnkSave = $this->newObject('link', 'htmlelements');
$lnkSave->href = "#";
$lnkSave->extra = 'onclick="javascript:document.frmCond[\'button\'].value=\'save\';document.frmCond.submit();"';
$lnkSave->link = $this->objLanguage->languageText("word_save");
$lnkBack = $this->newObject('link', 'htmlelements');
$lnkBack->href = '#';
$lnkBack->extra = 'onclick="javascript:document.frmCond[\'button\'].value=\'cancel\';document.frmCond.submit();"';
$lnkBack->link = $this->objLanguage->languageText("word_back");
$arrControls = array($lnkSave->show(), $lnkBack->show());
$lblConditionType = $this->objLanguage->code2Txt('mod_contextpermissions_lblConditionType', 'contextpermissions');
$objLabel = new label($lblConditionType, 'input_type');
$lblType = $objLabel->show();
$frmCond = $this->newObject('form', 'htmlelements');
$frmCond->name = 'frmCond';
$frmCond->displayType = '3';
$frmCond->action = $this->uri(array('action' => 'condition_form'));
$frmCond->addToForm("<input type=hidden name=button value=''>\n");
$frmCond->addToForm("<input type=hidden name=id value={$id}>\n");
$frmCond->addToForm("<DIV id=blog-content>\n");
$frmCond->addToForm("    <DIV id=formline>\n");
$frmCond->addToForm("        <DIV id=formlabel>{$lblType}</DIV>\n");
$frmCond->addToForm("        <DIV id=formelement>" . $ddbType->show() . "</DIV>\n");
$frmCond->addToForm("    </DIV>\n");
$frmCond->addToForm("    <DIV id=formline>\n");
$frmCond->addToForm("        <DIV id=formlabel>{$lblName}</DIV>\n");
$frmCond->addToForm("        <DIV id=formelement>{$element}</DIV>\n");
$frmCond->addToForm("    </DIV>\n");
예제 #4
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()) . "';");
 /**
  * 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();
 }
예제 #6
0
}
$table->addCell($label->show());
$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;">';
예제 #7
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();
 /**
  * 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;
 }
    /**
     * Short description for function
     *
     * Long description (if any) ...
     *
     * @param  array  $subFolders Parameter description (if any) ...
     * @param  array  $files      Parameter description (if any) ...
     * @return object Return description (if any) ...
     * @access public
     */
    function previewLongView($subFolders, $files, $symlinks, $restriction, $mode, $name, $forceRestriction = FALSE)
    {
        $objTable = $this->newObject('htmltable', 'htmlelements');
        $objFilePreview = $this->getObject('filepreview');
        $objFileSize = new formatfilesize();
        $objThumbnail = $this->getObject('thumbnails', 'filemanager');
        if ($this->viewType == strtolower('thumbnails')) {
            $objTable->cssId = $this->objLanguage->languageText('mod_filemanager_filemanagertableclass', 'filemanager', 'filemanagerTable');
            $this->objFileIcons->size = 'large';
        }
        $objIcon = $this->newObject('geticon', 'htmlelements');
        if ($this->editPermission) {
            if ($this->viewType != strtolower('thumbnails')) {
                $objTable->startHeaderRow();
                $objTable->addHeaderCell('&nbsp;', '20');
            }
        }
        if ($this->viewType != strtolower('thumbnails')) {
            $objTable->addHeaderCell('&nbsp;', '20');
            $objTable->addHeaderCell($this->objLanguage->languageText('word_name', 'system', 'Name'));
            $objTable->addHeaderCell($this->objLanguage->languageText('word_size', 'system', 'Size'), 60);
            $objTable->addHeaderCell('&nbsp;', '30');
        }
        // Set Restriction as empty if it is none
        if (count($restriction) == 1 && $restriction[0] == '') {
            $restriction = array();
        }
        $objTable->endHeaderRow();
        $hidden = 0;
        if (count($subFolders) == 0 && count($files) == 0 && count($symlinks) == 0) {
            $objTable->startRow();
            $objTable->addCell('<em>' . $this->objLanguage->languageText('mod_filemanager_nofilesorfolders', 'filemanager', 'No files or folders found') . '</em>', NULL, NULL, NULL, 'noRecordsMessage', 'colspan="5"');
            $objTable->endRow();
        } else {
            if (count($subFolders) > 0) {
                $folderIcon = $this->objFileIcons->getExtensionIcon('folder');
                foreach ($subFolders as $folder) {
                    $this->domDoc = new DOMDocument('utf-8');
                    $domElements['viewDiv'] = $this->domDoc->createElement('div');
                    $domElements['viewDiv']->setAttribute('class', 'fm_thumbnails');
                    $domElements['folderLink'] = $this->domDoc->createElement('a');
                    //The DOM icon folder
                    $domElements['folderIcon'] = $this->domDoc->createElement('img');
                    $domElements['folderIcon']->setAttribute('src', $this->objFileIcons->getIconSrc('folder'));
                    $domElements['folderIcon']->setAttribute('class', 'iconThumbnail');
                    $domElements['folderLink']->setAttribute('title', $this->objLanguage->languageText('mod_filemanager_clicktoopen', 'filemanager'));
                    $domElements['folderLink']->setAttribute('href', str_replace('amp;', '', $this->uri(array('action' => 'viewfolder', 'folder' => $folder['id'], 'view' => $this->viewType), $this->targetModule)));
                    $objTable->startRow();
                    if ($this->editPermission) {
                        $checkbox = new checkbox('files[]');
                        $checkbox->value = 'folder__' . $folder['id'];
                        $checkbox->cssId = htmlentities('input_files_' . basename($folder['folderpath']));
                        //The DOM folder checkbox
                        $domElements['folderCheckbox'] = $this->domDoc->createElement('input');
                        $domElements['folderCheckbox']->setAttribute('type', 'checkbox');
                        $domElements['folderCheckbox']->setAttribute('name', 'files[]');
                        $domElements['folderCheckbox']->setAttribute('id', htmlentities('input_files_' . basename($folder['folderpath'])));
                        $domElements['folderCheckbox']->setAttribute('value', 'folder__' . $folder['id']);
                        $domElements['folderCheckbox']->setAttribute('class', 'transparentbgnb');
                        //Delete confirm object
                        $delConfirm = $this->getObject('confirm', 'utilities');
                        //Setting the confirmation message
                        $delConfirm->setConfirm(NULL, str_replace('amp;', '', $this->uri(array('action' => 'deletefolder', 'id' => $folder['id'], 'module' => $this->targetModule))), $this->objLanguage->languageText('mod_filemanager_areyousuredeletefiles', 'filemanager'), NULL);
                        //The DOM delete link
                        $domElements['deleteconfirm'] = $this->domDoc->createElement('a');
                        $domElements['deleteconfirm']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText('word_delete', 'system')));
                        $domElements['deleteconfirm']->setAttribute('class', $this->objLanguage->languageText('mod_filemanager_buttonlinkclass', 'filemanager'));
                        $domElements['deleteconfirm']->setAttribute('href', $delConfirm->href);
                        $domElements['viewDiv']->appendChild($domElements['folderCheckbox']);
                        $domElements['viewDiv']->appendChild($domElements['deleteconfirm']);
                        $domElements['viewDiv']->appendChild($this->domDoc->createElement('br'));
                        if ($this->viewType != strtolower('thumbnails')) {
                            $objTable->addCell($checkbox->show());
                        }
                    }
                    //The value to appear when the mouse is over the link
                    $domElements['folderParagraph'] = $this->domDoc->createElement('p');
                    $domElements['folderParagraph']->setAttribute('class', 'folderdetails');
                    $domElements['folderParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("phrase_foldername", "system") . ": " . substr(basename($folder['folderpath']), 0, 12)));
                    $domElements['folderParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['folderParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("word_files", "system") . ": " . count($this->objFiles->getFolderFiles($folder['folderpath']))));
                    $domElements['folderParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['folderParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("word_folders", "system") . ": " . count($this->objFolder->getSubFolders($folder['id']))));
                    //creating space between the link at the top and the string below
                    $domElements['viewDiv']->appendChild($this->domDoc->createElement('p'));
                    $domElements['folderLink']->appendChild($domElements['folderIcon']);
                    $domElements['folderLink']->appendChild($domElements['folderParagraph']);
                    $domElements['viewDiv']->appendChild($this->domDoc->createElement('br'));
                    $domElements['viewDiv']->appendChild($domElements['folderLink']);
                    if ($this->viewType != strtolower('thumbnails')) {
                        $objTable->addCell($folderIcon);
                    }
                    $folderLink = new link($this->uri(array('action' => 'viewfolder', 'folder' => $folder['id'], 'view' => $this->viewType), $this->targetModule));
                    $extTitle = '';
                    $accessVal = null;
                    if (key_exists("access", $folder)) {
                        $accessVal = $folder['access'];
                    }
                    if ($accessVal == 'private_all') {
                        $objIcon->setIcon('info');
                        $extTitle = $objIcon->show();
                        $domElements['folderParagraph']->appendChild($this->domDoc->createElement('br'));
                        $domElements['folderParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText('word_access', 'system') . ': '));
                        $domElements['folderParagraph']->appendChild($this->domDoc->createTextNode($folder['access']));
                    }
                    //TODO: make this a reusable function
                    //variables to store informatin partaining folder contants
                    $nmbrOfFiles = count($this->objFiles->getFolderFiles($folder['folderpath']));
                    $nmbrOfFolders = count($this->objFolder->getSubFolders($folder['id']));
                    //Assign the value to be displayed on the link's title depending on it's contents
                    if ($nmbrOfFiles == 0 && $nmbrOfFolders == 0) {
                        $titleString = $this->objLanguage->languageText("mod_filemanager_emptyfolderindicator", "filemanager");
                    } else {
                        $titleString = $this->objLanguage->languageText("mod_filemanager_contentsindicator", "filemanager");
                        $titleString = substr($titleString, 0, 9) . $nmbrOfFolders . substr($titleString, 8, 11) . $nmbrOfFiles . substr($titleString, 18, 12);
                    }
                    //End subfolder and files count
                    $folderLink->title = $titleString;
                    $folderLink->link = substr(basename($folder['folderpath']), 0, 70) . '...' . $extTitle;
                    if ($this->viewType == strtolower('thumbnails')) {
                        $objTable->addCell($this->domDoc->saveHTML($domElements['viewDiv']));
                    } else {
                        $objTable->addCell($folderLink->show());
                        $objTable->addCell('<em>' . $this->objLanguage->languageText('word_folder', 'system', 'Folder') . '</em>');
                        $objTable->endRow();
                    }
                }
            }
            if (is_array($symlinks)) {
                $files = array_merge($files, $symlinks);
            }
            if (count($files) > 0) {
                //var_dump($files);
                $fileSize = new formatfilesize();
                foreach ($files as $file) {
                    $this->domDoc = new DOMDocument('utf-8');
                    $domElements['viewDiv'] = $this->domDoc->createElement('div');
                    $domElements['viewDiv']->setAttribute('class', 'fm_thumbnails');
                    $visibility = null;
                    if (key_exists("visibility", $file)) {
                        $visibility = $file['visibility'];
                    } else {
                        $file['visibility'] = 'visible';
                    }
                    $showFile = true;
                    if ($visibility == 'hidden') {
                        if ($file['creatorid'] == $this->objUser->userid()) {
                            $showFile = true;
                        } else {
                            $showFile = false;
                        }
                    }
                    if (!$showFile) {
                        continue;
                    }
                    if (count($restriction) > 0) {
                        if (!in_array(strtolower($file['datatype']), $restriction)) {
                            $objTable->startRow('hidefile');
                            $hidden++;
                        } else {
                            $objTable->startRow();
                        }
                    } else {
                        $objTable->startRow();
                    }
                    if ($this->editPermission) {
                        $checkbox = new checkbox('files[]');
                        //DOM checkbox
                        $domElements['checkbox'] = $this->domDoc->createElement('input');
                        $domElements['checkbox']->setAttribute('type', 'checkbox');
                        $domElements['checkbox']->setAttribute('name', 'files[]');
                        //DOM link
                        $domElements['editLink'] = $this->domDoc->createElement('a');
                        $domElements['editLink']->setAttribute('title', $this->objLanguage->languageText('mod_filemanager_clicktoedit', 'filemanager'));
                        $domElements['editLink']->setAttribute('href', str_replace('amp;', '', $this->uri(array('action' => 'editfiledetails', 'id' => $file['id']), $this->targetModule)));
                        if (isset($file['symlinkid'])) {
                            $domElements['checkbox']->setAttribute('value', 'symlink_' . $file['symlinkid']);
                            $checkbox->value = 'symlink__' . $file['symlinkid'];
                        } else {
                            $checkbox->value = $file['id'];
                            $domElements['checkbox']->setAttribute('value', $file['id']);
                        }
                        $checkbox->cssId = htmlentities('input_files_' . $file['filename']);
                        if ($this->viewType != strtolower('thumbnails')) {
                            $objTable->addCell($checkbox->show());
                        } else {
                            $domElements['checkbox']->setAttribute('id', htmlentities('input_files_' . $file['filename']));
                            $domElements['viewDiv']->appendChild($domElements['checkbox']);
                            $domElements['editLink']->setAttribute('class', $this->objLanguage->languageText("mod_filemanager_buttonlinkclass", "filemanager"));
                            $domElements['editLink']->appendChild($this->domDoc->createTextNode(substr($this->objLanguage->languageText("word_edit", "system"), 0, 4)));
                            $domElements['viewDiv']->appendChild($domElements['editLink']);
                            //Add the line separator
                            $domElements['viewDiv']->appendChild($this->domDoc->createTextNode(' | '));
                        }
                    }
                    $label = new label($this->objFileIcons->getFileIcon($file['filename']), htmlentities('input_files_' . $file['filename']));
                    if ($this->viewType != strtolower('thumbnails')) {
                        $objTable->addCell($label->show());
                    }
                    if (isset($file['symlinkid'])) {
                        $fileLink = new link($this->uri(array('action' => 'symlink', 'id' => $file['symlinkid'])));
                        //The DOM file link
                        $domElements['fileLink'] = $this->domDoc->createElement('a');
                        $domElements['fileLink']->setAttribute('href', str_replace('amp;', '', $this->uri(array('action' => 'symlink', 'id' => $file['symlinkid']))));
                    } else {
                        $fileLink = new link($this->uri(array('action' => 'fileinfo', 'id' => $file['id']), $this->targetModule));
                        //The DOM file link
                        $domElements['fileLink'] = $this->domDoc->createElement('a');
                        $domElements['fileLink']->setAttribute('class', 'fileLink');
                        $domElements['fileLink']->setAttribute('href', str_replace('amp;', '', $this->uri(array('action' => 'fileinfo', 'id' => $file['id']), $this->targetModule)));
                    }
                    //The DOM image paragraph (to display image file information)
                    $domElements['imgParagraph'] = $this->domDoc->createElement('p');
                    $domElements['imgParagraph']->setAttribute('class', 'filedetails');
                    $linkTitle = '';
                    $access = null;
                    if (key_exists("access", $file)) {
                        $access = $file['access'];
                    } else {
                        $file['access'] = 'public';
                    }
                    $domElements['fileLink']->setAttribute('title', $this->objLanguage->languageText('mod_filemanager_clicktoviewinfo', 'filemanager'));
                    //The DOM download link
                    $domElements['downloadLink'] = $this->domDoc->createElement('a');
                    $domElements['downloadLink']->setAttribute('title', $this->objLanguage->languageText('mod_filemanager_clicktodownload', 'filemanager'));
                    $domElements['downloadLink']->setAttribute('href', $this->objCleanUrl->cleanUpUrl($this->objAltConfig->getcontentPath() . $file['path']));
                    $domElements['downloadLink']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("word_download", "system")));
                    $domElements['downloadLink']->setAttribute('class', $this->objLanguage->languageText("mod_filemanager_buttonlinkclass", "filemanager"));
                    $domElements['viewDiv']->appendChild($domElements['downloadLink']);
                    //creating space between the links at the top and the string below
                    $domElements['viewDiv']->appendChild($this->domDoc->createElement('br'));
                    $filepath = $this->objAltConfig->getSiteRoot() . '/usrfiles/' . $file['path'];
                    $fileType = $this->getObject("fileparts", "files");
                    $domElements['detailsDiv'] = $this->domDoc->createElement('div');
                    $domElements['imgDiv'] = $this->domDoc->createElement('div');
                    $domElements['imgDiv']->setAttribute('class', 'imageDiv');
                    $domElements['imgParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['imgParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("word_filename", "system") . ": " . substr($file['filename'], 0, 10)));
                    //new line
                    $domElements['imgParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['imgParagraph']->appendChild($this->domDoc->createtextNode($this->objLanguage->languageText("phrase_filesize", "system") . ": " . $objFileSize->formatsize($file['filesize'])));
                    //new line
                    $domElements['imgParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['imgParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("phrase_filetype") . ": " . $fileType->getExtension($file['filename'])));
                    //new line
                    $domElements['imgParagraph']->appendChild($this->domDoc->createElement('br'));
                    $domElements['imgParagraph']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText("phrase_dateuploaded", "system") . ": " . $file['datecreated']));
                    if ($access == 'private_all') {
                        $domElements['imgParagraph']->appendChild($this->domDoc->createElement('br'));
                        $domElements['imgParagraph']->appendChild($this->domDoc->createTextNode(ucfirst($this->objLanguage->languageText('word_access', 'system')) . ': '));
                        $domElements['imgParagraph']->appendChild($this->domDoc->createTextNode($folder['access']));
                        $domElements['viewDiv']->setAttribute('id', $file['access']);
                        $objIcon->setIcon('info');
                        $linkTitle = basename($file['filename']) . $objIcon->show();
                    } else {
                        $linkTitle = basename($file['filename']);
                    }
                    // get image thumbnails
                    //The DOM image
                    $domElements['image'] = $this->domDoc->createElement('img');
                    if (ereg("image", $file['mimetype']) || ereg("video", $file['mimetype'])) {
                        $domElements['image']->setAttribute('src', str_replace('amp;', '', $objThumbnail->getThumbnail($file['id'], $file['filename'], $this->objCleanUrl->cleanUpUrl($this->objAltConfig->getcontentPath() . $file['path']), 'large')));
                        $domElements['image']->setAttribute('class', 'imgThumbnail');
                        $domElements['imgDiv']->appendChild($domElements['image']);
                        $domElements['detailsDiv']->appendChild($domElements['imgParagraph']);
                    }
                    //create audio/video player object
                    $objPlayer = "";
                    if (ereg("audio", $file['mimetype'])) {
                        $objPlayer = $objFilePreview->previewFile($file['id']);
                        $domElements['viewDiv']->appendChild($domElements['fileLink']);
                        $domElements['imgParagraph']->removeAttribute('class');
                        $domElements['detailsDiv']->appendChild($domElements['imgParagraph']);
                    }
                    //other formats
                    if (!ereg("audio", $file['mimetype']) && !ereg("image", $file['mimetype']) && !ereg("video", $file['mimetype'])) {
                        $domElements['image']->setAttribute('src', $this->objFileIcons->getIconSrc($file['datatype']));
                        $domElements['image']->setAttribute('class', 'iconThumbnail');
                        $domElements['image']->normalize();
                        $domElements['imgDiv']->appendChild($domElements['image']);
                        $domElements['detailsDiv']->appendChild($domElements['imgParagraph']);
                    }
                    $domElements['fileLink']->appendChild($domElements['detailsDiv']);
                    $domElements['fileLink']->appendChild($domElements['imgDiv']);
                    $domElements['viewDiv']->appendChild($domElements['fileLink']);
                    $fileLink->link = $linkTitle;
                    $folderAccessObj = $this->getObject("folderaccess");
                    $filepath = $this->objAltConfig->getSiteRoot() . '/usrfiles/' . $file['path'];
                    //// $filePreviewObj->previewFile($file['id']);
                    //$this->uri(array("action" => "downloadsecurefile", "path" => $file['path'], "filename" => $file['filename']));
                    // echo "rssult == ". $folderAccessObj->isFileAccessPrivate($file);
                    // die();
                    if ($folderAccessObj->isFileAccessPrivate($file)) {
                        $filepath = $this->objAltConfig->getSiteRoot() . "index.php?module=filemanager&action=file&id=" . $file['id'] . '&filename=' . $file['filename'];
                    }
                    $selectStr = '<a href=\'javascript:selectFile("' . $filepath . '");\'>' . basename($file['filename']) . '</a>';
                    $selectFileStr = '<a href=\'javascript:selectFileWindow("' . $name . '","' . $file['filename'] . '","' . $file['id'] . '");\'>' . basename($file['filename']) . '</a>';
                    $selectImageStr = '<a href=\'javascript:selectImageWindow("' . $name . '", "' . $filepath . '","' . $file['filename'] . '","' . $file['id'] . '");\'>' . basename($file['filename']) . '</a>';
                    if ($mode == 'fckimage' || $mode == 'fckflash' || $mode == 'fcklink') {
                        if ($this->viewType != strtolower('thumbnails')) {
                            $objTable->addCell($selectStr);
                        } else {
                            //Disable file preview
                            $domElements['fileLink']->removeAttribute('href');
                            //remove the title string as the option will not be possible
                            $domElements['fileLink']->removeAttribute('title');
                            //The DOM select string
                            $domElements['selectStr'] = $this->domDoc->createElement('a');
                            $domElements['selectStr']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText('word_select', 'system')));
                            $domElements['selectStr']->setAttribute('href', 'javascript:selectFile("' . $filepath . '");');
                            $domElements['selectStr']->setAttribute('class', $this->objLanguage->languageText('mod_filemanager_buttonlinkclass', 'filemanager'));
                            $domElements['viewDiv']->appendChild($domElements['selectStr']);
                            $objTable->addCell($this->domDoc->saveHTML($domElements['viewDiv']) . $objPlayer);
                        }
                    } else {
                        if ($mode == 'selectfilewindow') {
                            if ($this->viewType != strtolower('thumbnails')) {
                                $objTable->addCell($selectFileStr);
                            } else {
                                $domElements['fileLink']->removeAttribute('href');
                                //remove the title string as the option will not be possible
                                $domElements['fileLink']->removeAttribute('title');
                                //The DOM select file string
                                $domElements['selectFileStr'] = $this->domDoc->createElement('a');
                                $domElements['selectFileStr']->setAttribute('href', 'javascript:selectFileWindow("' . $name . '","' . $file['filename'] . '","' . $file['id'] . '");');
                                $domElements['selectFileStr']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText('word_select', 'system')));
                                $domElements['selectFileStr']->setAttribute('class', $this->objLanguage->languageText('mod_filemanager_buttonlinkclass', 'filemanager'));
                                $domElements['viewDiv']->appendChild($domElements['selectFileStr']);
                                $objTable->addCell($this->domDoc->saveHTML($domElements['viewDiv']) . $objPlayer);
                            }
                        } else {
                            if ($mode == 'selectimagewindow') {
                                if ($this->viewType != strtolower('thumbnails')) {
                                    $objTable->addCell($selectImageStr);
                                } else {
                                    $domElements['fileLink']->removeAttribute('href');
                                    //remove the title string as the option will not be possible
                                    $domElements['fileLink']->removeAttribute('title');
                                    //The DOM image select link
                                    $domElements['imageSelect'] = $this->domDoc->createElement('a');
                                    $domElements['imageSelect']->setAttribute('href', 'javascript:selectImageWindow("' . $name . '","' . $filepath . '","' . $file['filename'] . '","' . $file['id'] . '");');
                                    $domElements['imageSelect']->appendChild($this->domDoc->createTextNode($this->objLanguage->languageText('word_select', 'system')));
                                    $domElements['imageSelect']->setAttribute('class', $this->objLanguage->languageText('mod_filemanager_buttonlinkclass', 'filemanager'));
                                    $domElements['viewDiv']->appendChild($domElements['imageSelect']);
                                    $objTable->addCell($this->domDoc->saveHTML($domElements['viewDiv']) . $objPlayer);
                                }
                            } else {
                                if ($this->viewType == strtolower('thumbnails')) {
                                    //return the document with all available objects and elements
                                    $objTable->addCell($this->domDoc->saveHTML($domElements['viewDiv']) . $objPlayer);
                                } else {
                                    $objTable->addCell($fileLink->show());
                                }
                            }
                        }
                    }
                    if ($this->viewType != strtolower('thumbnails')) {
                        $objTable->addCell($fileSize->formatsize($file['filesize']));
                    } else {
                        $objTable->endRow();
                    }
                }
            }
        }
        if ($hidden > 0 && count($restriction) > 0) {
            $str = '';
            if ($this->viewType == strtolower('thumbnails')) {
                $str .= '<style type="text/css">
#filemanagerTable tr.hidefile {display:none;}
</style>';
            } else {
                $str .= '<style type="text/css">
 tr.hidefile {display:none;}
</style>';
            }
            $str .= $this->objLanguage->languageText('mod_filemanager_browsingfor', 'filemanager', 'Browsing for') . ': ';
            $comma = '';
            foreach ($restriction as $restrict) {
                $str .= $comma . $restrict;
                $comma = ', ';
            }
            if (!$forceRestriction) {
                if ($this->viewType == strtolower('thumbnails')) {
                    $str .= '<script type="text/javascript">
var onOrOff = "off";
function turnOnFiles(value)
{
    if (onOrOff == \'off\') {
        jQuery(\'#filemanagerTable tr.hidefile\').each(function (i) {
            this.style.display = \'inline-block\';
        });
        adjustLayout();
        onOrOff = "on";
    } else {
        jQuery(\'#filemanagerTable tr.hidefile\').each(function (i) {
            this.style.display = \'none\';
        });
        adjustLayout();
        onOrOff = "off";
    }
}
</script>';
                } else {
                    $str .= '<script type="text/javascript">
var onOrOff = "off";
function turnOnFiles(value)
{
    if (onOrOff == \'off\') {
        jQuery(\'tr.hidefile\').each(function (i) {
            this.style.display = \'table-row\';
        });
        adjustLayout();
        onOrOff = "on";
    } else {
        jQuery(\'tr.hidefile\').each(function (i) {
            this.style.display = \'none\';
        });
        adjustLayout();
        onOrOff = "off";
    }
}
</script>';
                }
                $str .= ' &nbsp; - ';
                $this->loadClass('checkbox', 'htmlelements');
                $this->loadClass('label', 'htmlelements');
                $checkbox = new checkbox('showall');
                $checkbox->extra = ' onclick="turnOnFiles();"';
                $label = new label($this->objLanguage->languageText('mod_filemanager_showallfiles', 'filemanager', 'Show All Files'), $checkbox->cssId);
                $str .= $checkbox->show() . $label->show();
            }
        } else {
            $str = '';
        }
        return $str . $objTable->show() . $this->getJavascriptFile('thumbnails.js', 'filemanager');
    }
예제 #10
0
 /**
  * Method to show the option group for a table
  */
 public function showTable()
 {
     $table = new htmltable();
     $table->startRow();
     $table->cellpadding = 1;
     $counter = 0;
     $equalColumns = (100 - 100 % $this->tableColumns) / $this->tableColumns;
     foreach ($this->options as $opt => $lbl) {
         $counter++;
         $str = '<input type="radio" name="' . $this->name . '"';
         $str .= ' value="' . $opt . '"';
         if ($this->cssClass) {
             $str .= ' class="' . $this->cssClass . '"';
         }
         // If no CSS Id is given, it takes the default value of input_$opt for accessibility
         // If CSS Id is given, it takes the default value of input_$opt for accessibility, as well as CSS one
         if ($this->cssId) {
             $cssId = 'input_' . $this->name . $opt . ' ' . $this->cssId;
         } else {
             $cssId = 'input_' . $this->name . $opt;
         }
         // Cleanup to the CSS Id to make it W3C Compliant
         // At the moment, it checks for \ and /
         $cssId = preg_replace('/(\\/|\\\\)/', '_', $cssId);
         $str .= ' id="' . $cssId . '"';
         if ($this->selected == $opt) {
             $str .= ' checked="checked" ';
         }
         if ($this->extra) {
             $str .= ' ' . $this->extra;
         }
         $str .= ' />';
         $label = new label($lbl, $cssId);
         $str .= $label->show();
         $table->addCell($str, $equalColumns . '%');
         if ($counter % $this->tableColumns == 0) {
             $table->endRow();
             $table->startRow();
         }
     }
     if ($counter % $this->tableColumns == 0) {
         $table->endRow();
     } else {
         for ($i = 1; $i < $counter % $this->tableColumns; $i++) {
             $table->addCell('&nbsp;', $equalColumns . '%');
         }
         $table->endRow();
     }
     return $table->show();
 }
예제 #11
0
    $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'));
$table->addCell($status->show());
$table->endRow();
$table->startRow();
$table->addCell('&nbsp;');
$table->addCell('&nbsp;');
$table->endRow();
예제 #12
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();
     }
 }
예제 #13
0
$objLabel = new label($dependsLabel, 'input_dependsContext');
$objCheck = new checkbox('dependsContext');
$objCheck->setChecked($depends);
$objTable->addRow(array($objLabel->show(), $objCheck->show()));
// Link Permissions
$objHead->str = $linkPermLabel;
$objHead->type = 3;
$objTable->startRow();
$objTable->addCell($objHead->show(), '', '', '', '', 'colspan="4"');
$objTable->endRow();
// set available to whole site
if (!$page) {
    $objLabel = new label($siteLabel, 'input_site');
    $objCheck = new checkbox('site');
    $objCheck->setChecked($allSite);
    $objTable->addRow(array($objLabel->show(), $objCheck->show()));
}
$objLink = new link('javascript:void(0)');
$objLink->link = $setPermLabel;
$objLink->extra = "onclick = \"javascript:window.open('" . $this->uri(array('action' => 'setperm', 'modulename' => $moduleName), '', '', TRUE) . "', 'setperms', 'width=800, height=600, scrollbars')\"";
$objTable->startRow();
$objTable->addCell($objLink->show(), '', '', '', '', 'colspan="2"');
$objTable->endRow();
$formElements = '';
// hidden elements: id, module, dependsContext, adminOnly
if ($mode == 'edit') {
    $objInput = new textinput('id', $data['id']);
    $objInput->fldType = 'hidden';
    $formElements .= $objInput->show();
}
$objInput = new textinput('moduleName', $moduleName);
 /**
  * Callback method to evaluate the value parameter for permissions.
  *
  * @access  public    
  * @author  Jonathan Abrahams
  * @param   string     Access control list reference name.
  * @return  true|false Returns result of the evaluation.
  * @version V0.1
  */
 function hasContextPermission($aclName = NULL)
 {
     $function = 'hasContextPermission | ';
     $objDropDown = new dropdown('value');
     $lblSelectContextACL = $this->objLanguage->languageText('mod_contextpermissions_lblSelectContextACL', 'contextpermissions', "[-- Select an access control list for the context--]");
     $objDropDown->addOption('hasContextPermission', $lblSelectContextACL);
     $options = array('isAuthor', 'isEditor', 'isReader');
     // Get context permissions
     foreach ($options as $aclName) {
         $objDropDown->addOption($function . $aclName, $aclName);
     }
     $objDropDown->setSelected($function . $aclName);
     $lblACL = $this->objLanguage->languageText('mod_contextpermissions_lblACL', 'contextpermissions', "[Access control list: ]");
     $objLabel = new label($lblACL, 'input_value');
     $lblName = $objLabel->show();
     return array('lblName' => $lblName, 'element' => $objDropDown->show());
 }
예제 #15
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'));
예제 #16
0
}
$objHead->str = $heading;
$objHead->type = 1;
$str = $objHead->show();
$str .= '<p><b>' . $moduleLabel . ':</b>&nbsp;&nbsp;' . $modName . '</p>';
// Drop down to select a different module
$objLabel = new label($selectLabel, 'input_modulename');
$objDrop = new dropdown('modulename');
$objDrop->extra = 'onchange="document.forms[\'modselect\'].submit()"';
foreach ($moduleList as $item) {
    $modName = $objLanguage->code2Txt('mod_' . $item['module_id'] . '_name', $item['module_id']);
    $objDrop->addOption($item['module_id'], $modName);
}
$objDrop->setSelected($moduleName);
$objForm = new form('modselect', $this->uri(array('action' => 'editlinks')));
$objForm->addToForm('<b>' . $objLabel->show() . ':</b>&nbsp;&nbsp;&nbsp;' . $objDrop->show());
$str .= '<p>' . $objForm->show() . '</p>';
// Toolbar links
$addTool = $objIcon->getAddIcon($this->uri(array('action' => 'addtool', 'modulename' => $moduleName)));
$objHead->str = $toolbarLabel . '&nbsp;&nbsp;' . $addTool;
$objHead->type = 3;
$str .= $objHead->show();
$objTable = new htmltable();
$objTable->width = '99%';
$objTable->cellspacing = 2;
$objTable->cellpadding = 5;
$tableHd = array();
$tableHd[] = $categoryLabel;
$tableHd[] = '';
$objTable->addHeader($tableHd, 'heading', "align='left'");
if (!empty($toolBar)) {
예제 #17
0
    $counter++;
    $checkbox = new checkbox('plugins[]');
    $checkbox->setValue($plugin['module_id']);
    $checkbox->setId('module_' . $plugin['module_id']);
    if (in_array($plugin['module_id'], $contextModules)) {
        $checkbox->setChecked(TRUE);
    }
    $objIcon->setModuleIcon($plugin['module_id']);
    if ($counter % 2 == 1) {
        $table->startRow();
    }
    $table->addCell($checkbox->show(), 20);
    $label = new label($objIcon->show(), 'module_' . $plugin['module_id']);
    $table->addCell($label->show(), 30);
    $label = new label('<strong>' . $plugin['title'] . '</strong><br />' . $plugin['description'], 'module_' . $plugin['module_id']);
    $table->addCell($label->show() . '<br /><br />');
    if ($counter % 2 == 2) {
        $table->endRow();
    }
}
if ($counter % 2 == 1) {
    $table->addCell('&nbsp;');
    $table->addCell('&nbsp;');
    $table->addCell('&nbsp;');
    $table->endRow();
}
$form->addToForm($table->show());
$button = new button('submitform', $this->objLanguage->code2Txt('mod_context_savepluginsabs', 'context', array('plugins' => 'plugins'), 'Save [-plugins-]'));
$button->setToSubmit();
$backUri = $this->uri(array('action' => 'step3', 'mode' => 'edit', 'contextCode' => $contextCode), 'contextadmin');
$backButton = new button('back', $this->objLanguage->languageText('word_back'), "document.location='{$backUri}'");
예제 #18
0
$ip->extra = ' style="width:50%;" ';
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 />');
예제 #19
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;
 }
예제 #20
0
$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');
$fieldset->legend = '';
// $this->objLanguage->languageText('phrase_invitefriend', 'userregistration');
$fieldset->contents = $table->show();
// add the form to the fieldset
$form->addToForm($fieldset->show());
$button = new button('submitform', $this->objLanguage->languageText("mod_userregistration_completeinvite", "userregistration"));
$button->setToSubmit();
$form->addToForm('<p align="center"><br />' . $button->show() . '</p>');
$middleColumnContent .= $form->show();
$cssLayout = $this->getObject('csslayout', 'htmlelements');
예제 #21
0
$table->startRow();
$orderLabel = new label($this->objLanguage->languageText('mod_contextgroups_orderresultsby', 'contextgroups') . ': ', 'input_order');
$searchdropdown->name = 'order';
$searchdropdown->cssId = 'input_order';
$searchdropdown->setSelected($order);
//$table->addCell($orderLabel->show().$searchdropdown->show());
$label = new label($this->objLanguage->languageText('mod_contextgroups_noofresults', 'contextgroups') . ': ', 'input_results');
$dropdown = new dropdown('results');
$dropdown->addOption('20', '20');
$dropdown->addOption('30', '30');
$dropdown->addOption('50', '50');
$dropdown->addOption('75', '75');
$dropdown->addOption('100', '100');
//$dropdown->addOption('all', 'All Results');
$dropdown->setSelected($numresults);
$table->addCell($orderLabel->show() . $searchdropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $dropdown->show());
$table->endRow();
$button = new button('searchbutton');
$button->value = $this->objLanguage->languageText('word_search');
$button->setToSubmit();
$table->addCell($button->show());
$table->addCell('&nbsp;');
$table->endRow();
$form = new form('searchforusers', $this->uri(array('action' => 'searchforusers')));
$form->addToForm($table->show());
echo $form->show();
// --------------------------------
if (count($results) == 0) {
    echo '<div class="noRecordsMessage">' . $this->objLanguage->languageText('mod_contextgroups_nousersfoundsearchcriteria', 'contextgroups', 'No Users found with search criteria') . '</div>';
} else {
    $start = ($page - 1) * $numresults + 1;
예제 #22
0
$table = $this->newObject('htmltable', 'htmlelements');
$table->startRow();
$email = new textinput('register_email');
$emailLabel = new label($this->objLanguage->languageText('word_email', 'system', 'Email'), 'input_register_email');
$confirmEmail = new textinput('register_confirmemail');
$confirmEmailLabel = new label($this->objLanguage->languageText('phrase_confirmemail', 'system', 'Confirm Email'), 'input_register_confirmemail');
$emailInfoLabel = new label('Please Enter a Valid Email Address', 'input_register_email');
if ($mode == 'addfixup') {
    $email->value = $this->getParam('register_email');
    $confirmEmail->value = $this->getParam('register_confirmemail');
}
if (isset($userstring[2]) && $mode == 'add') {
    $email->value = $userstring[2];
    $confirmEmail->value = $userstring[2];
}
$table->addCell($emailInfoLabel->show(), 150, NULL, 'right');
$table->addCell('&nbsp;', 10);
$table->addCell($emailLabel->show() . $required . '<br />' . $email->show(), '20%');
$table->addCell($confirmEmailLabel->show() . $required . '<br />' . $confirmEmail->show());
$table->endRow();
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = $this->objLanguage->languageText('phrase_emailaddress', 'system', 'Email Address');
$fieldset->contents = $table->show();
$form->addToForm($fieldset->show());
$form->addToForm('<br />');
$objCaptcha = $this->getObject('captcha', 'utilities');
$captcha = new textinput('request_captcha');
$captchaLabel = new label($this->objLanguage->languageText('phrase_verifyrequest', 'security', 'Verify Request'), 'input_request_captcha');
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = 'Verify Image';
$fieldset->contents = 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() . $required . '  <a href="javascript:redraw();">' . $this->objLanguage->languageText('word_redraw', 'security', 'Redraw') . '</a>';
예제 #23
0
$objTable->addCell($startField);
$objTable->endRow();
//$objTable->addRow(array(
//  $objLabel->show(),
// $startField
//));
// Set closing date of test
$closeField = $objPopupcal->show('enddate', 'yes', 'no', strftime('%Y-%m-%d %H:%M:%S', mktime()));
$objLabel = new label($closeLabel . ':', 'input_close');
/*$objTable->addRow(array(
    $objLabel->show(),
    $closeField
));
*/
$objTable->startRow();
$objTable->addCell($objLabel->show());
$objTable->addCell($closeField);
$objTable->endRow();
/*
  $objElement = new checkbox('studentsonly', '', true);  // this will checked
  $check = $objElement->show();
  $objTable->addRow(array(
  $userOptLabel,
  $check
  )); */
$objContextModules = $this->getObject('dbcontextmodules', 'context');
$objModules = $this->getObject('modules', 'modulecatalogue');
$contextModules = $objContextModules->getContextModules($contextCode);
$plugins = $objModules->getListContextPlugins();
$dropDown = new dropdown('moduleid');
//$dropDown->addOption('all','All');
예제 #24
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();
 }
예제 #25
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) . "';");
예제 #26
0
 /**
  *
  * Method to generate a form for a site-wide search
  *
  * @param boolean $compact whether or not to use the compact search form for small screens.
  * @return str Search Form
  * @access public
  *
  */
 public function show($compact = FALSE)
 {
     //checking if configuration exist-By Emmanuel Natalis
     if (strtoupper($this->objConfig->getenable_searchBox()) == 'TRUE' && $this->objModules->checkIfRegistered('search')) {
         $slabel = new label($this->objLanguage->languageText('phrase_sitesearch', 'search', 'Site Search') . ':', 'input_search');
         $sform = new form('query', $this->uri(NULL, 'search'));
         //$sform->addRule('searchterm', $this->objLanguage->languageText("mod_blog_phrase_searchtermreq", "blog") , 'required');
         $query = new textinput('search');
         $query->size = 15;
         $objSButton = new button($this->objLanguage->languageText('word_go', 'system'));
         // Add the search icon
         $objSButton->setIconClass("search");
         //$this->objSButton->setValue($this->objLanguage->languageText('mod_skin_find', 'skin'));
         $objSButton->setValue('Find');
         $objSButton->setToSubmit();
         if ($compact) {
             $sform->addToForm($slabel->show() . ' ' . $objSButton->show() . '<br /> ' . $query->show());
         } else {
             $sform->addToForm($slabel->show() . ' ' . $query->show() . ' ' . $objSButton->show());
         }
         $sform = '<div id="search">' . $sform->show() . '</div>';
         return $sform;
     } else {
         return NULL;
     }
 }