示例#1
0
$objButton->extra = 'onclick="javascript:SetAllCheckBoxes(\'removeguests\', \'guestId[]\', true)"';
$buttons = $objButton->show();
$objButton = new button('unselect', $this->objLanguage->languageText('mod_contextgroups_unselectall', 'contextgroups', 'Unselect All'));
$objButton->extra = 'onclick="javascript:SetAllCheckBoxes(\'removeguests\', \'guestId[]\', false)"';
$buttons .= '    ' . $objButton->show();
$objButton = new button('delete', $this->objLanguage->languageText('mod_contextgroups_deleteselected', 'contextgroups', 'Delete Selected'));
$objButton->extra = 'onclick="javascript:if(confirm(\'' . $this->objLanguage->languageText('mod_contextgroups_confirmguest', 'contextgroups', 'Are you sure you want to delete these guests?') . ' \'+getSelectCount(\'removeguests\', \'guestId[]\')+\' ' . $this->objLanguage->languageText('mod_contextgroups_membersselected', 'contextgroups') . '.\')){document.removeguests.submit();}else{return false;}"';
$buttons .= '    ' . $objButton->show();
$objForm = new form('removeguests', $this->uri(array('action' => 'removeallusers', 'mode' => 'guest')));
$objForm->addToForm($objTable->show());
if (count($guestDetails) > 0) {
    $objForm->addToForm($buttons);
}
//echo $objForm->show();
$objTabbedbox = new tabbedbox();
$objTabbedbox->addTabLabel("<b>" . ucfirst(strtolower($this->objLanguage->languageText('mod_contextadmin_guests', 'contextadmin', 'Guests'))) . "</b>");
if ($this->isValid('removeallusers')) {
    $objTabbedbox->addBoxContent($objForm->show());
} else {
    $objTabbedbox->addBoxContent($objTable->show());
}
echo $objTabbedbox->show();
// echo '<pre>';
// print_r($studentDetails);
// echo '<pre>';
if ($this->isValid('addusers')) {
    $header = new htmlheading();
    $header->type = 3;
    $header->str = $this->objLanguage->code2Txt('phrase_searchforuserstoadd', 'contextgroups');
    echo $header->show();
    $table = $this->getObject('htmltable', 'htmlelements');
示例#2
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @return void
  * @access public
  */
 function showForms()
 {
     //Text Input
     $objForm = new form('testform');
     $url = $this->uri(array('action' => 'add'), 'htmlelements');
     $objForm->setAction($this->uri(array('action' => 'save'), 'htmlelements'));
     $objForm->setDisplayType(2);
     $objElement = new textinput('textbox');
     $objElement->setValue('Some text');
     $objElement->label = 'Textbox\'s label';
     $text = $objElement->show() . '<br />';
     $objForm->addToForm('<span class="warning">Start of Form</span><br />');
     $objForm->addToForm($objElement);
     //Calendar
     /*$objElement = new calendar('cal');
       $today = getdate();
       $objElement->setDate($today['mon'],$today['mday'],$today['year']);
       $calendar = $objElement->show().'<br />';*/
     //Radion button Group
     $objElement = new radio('sex_radio');
     $objElement->addOption('m', 'Male');
     $objElement->addOption('f', 'Female');
     $objElement->addOption('n', 'Seaweed');
     $objElement->setSelected('f');
     $radio = $objElement->show() . '<br />';
     //Check boxes
     $objElement = new checkbox('m', 'Male', true);
     $check = $objElement->show();
     $objElement = new checkbox('f', 'Female');
     $check .= $objElement->show();
     $objElement = new checkbox('n', 'Seawood');
     $check .= $objElement->show() . '<br />';
     //Dropdown
     $objElement = new dropdown('sex_dropdown');
     $objElement->addOption('', '');
     //adding a blank option
     $objElement->addOption('m', 'Male');
     $objElement->addOption('f', 'Female');
     $objElement->addOption('n', 'Seaweed');
     $objElement->setSelected('f');
     $dropdown = $objElement->show() . "<br />";
     //Dropdown created from array
     $objElement = new dropdown('user_dropdown');
     $objElement->addFromDB($this->objDBUser->getAll(), 'username', 'userid', $this->objDBUser->userName());
     $objElement->label = 'User list';
     $dropdown .= $objElement->show() . "<br />";
     //Textarea
     $objElement = new textarea('text_area');
     $objElement->setRows(3);
     $objElement->setColumns('45');
     $objElement->setContent('This is some content for the textarea');
     $ta = $objElement->show() . '<br />';
     //Button
     $objElement = new button('mybutton');
     $objElement->setValue('Normal Button');
     $objElement->setOnClick('alert(\'An onclick Event\')');
     $button = $objElement->show() . '<br />';
     //Submit Button
     $objElement = new button('mybutton');
     $objElement->setToSubmit();
     $objElement->label = 'Buttons Label';
     $objElement->setValue('Submit Button');
     $submit = $objElement->show() . '<br />';
     //add submit button to the form;
     $objForm->addToForm($objElement);
     $mouseoverpopup = new mouseoverpopup('this is some text');
     $mouseoverpopup = $mouseoverpopup->show();
     //Add all the above to a tabbedbox
     $objElement = new tabbedbox();
     $objElement->addTabLabel('Tabbed box 1');
     $objElement->addBoxContent($mouseoverpopup . $text . $dropdown . $button . $submit);
     $tab = '<br />' . $objElement->show() . '<br />';
     //add the tab to the form
     $objForm->addToForm($objElement);
     $objForm->addToForm('<span class="warning">End of Form</span>');
     $form = $objForm->show() . '<br />';
     //create a multitabbedbox
     $objElement = new multitabbedbox('100px', '500px');
     $objElement->addTab(array('name' => 'First', 'url' => 'http://localhost', 'content' => $form, 'default' => true));
     $objElement->addTab(array('name' => 'Second', 'url' => 'http://localhost', 'content' => $check . $radio));
     $objElement->addTab(array('name' => 'Third', 'url' => 'http://localhost', 'content' => $tab, 'height' => '300px', 'width' => '600px'));
     //$objElement->addTab(array('name'=>'Test Validation','url'=>'http://localhost','content' => $this->valFormShow(),'height' => '300','width' => '700'));
     //set layers
     $left = $tab;
     $content = 'This is an example using most of the classes in the htmlelements module<br />';
     $content .= '<br />' . $objElement->show();
     //this to make the centre layer strech downwards
     for ($i = 0; $i < 10; $i++) {
         $content .= '<br />';
     }
     $right = $tab;
     $bottom = $ta;
     $this->setVar('left', $left);
     $this->setVar('right', $right);
     $this->setVar('content', $content);
     $this->setVar('bottom', $bottom);
     //return $str;
 }