/**
  * Display form for agent configuration
  *
  * @param $items_id integer ID 
  * @param $options array
  *
  *@return bool true if form is ok
  *
  **/
 function showForm($items_id, $options = array())
 {
     global $DB, $CFG_GLPI, $LANG;
     if ($items_id == '') {
         if (isset($_POST['id'])) {
             $a_list = $this->find("`users_id`='" . $_POST['id'] . "'", '', 1);
             if (count($a_list)) {
                 $array = current($a_list);
                 $items_id = $array['id'];
             }
         }
     }
     if ($items_id != '') {
         $this->getFromDB($items_id);
     } else {
         $this->getEmpty();
     }
     $this->showFormHeader($options);
     $this->getFromDB($items_id);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['common'][16] . "&nbsp;:</td>";
     echo "<td align='center'>";
     $objectName = autoName($this->fields["name"], "name", false, $this->getType());
     autocompletionTextField($this, 'name', array('value' => $objectName));
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contacttemplate'][1] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo("is_default", $this->fields['is_default']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='2'>" . $LANG['plugin_monitoring']['contact'][3] . "</th>";
     echo "<th colspan='2'>" . $LANG['plugin_monitoring']['contact'][4] . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][5] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notifications_enabled', $this->fields['host_notifications_enabled']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][5] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notifications_enabled', $this->fields['service_notifications_enabled']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][19] . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("PluginMonitoringNotificationcommand", array('name' => 'host_notification_commands', 'value' => $this->fields['host_notification_commands']));
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][19] . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("PluginMonitoringNotificationcommand", array('name' => 'service_notification_commands', 'value' => $this->fields['service_notification_commands']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][6] . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("Calendar", array('name' => 'host_notification_period', 'value' => $this->fields['host_notification_period']));
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][6] . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("Calendar", array('name' => 'service_notification_period', 'value' => $this->fields['service_notification_period']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][7] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_d', $this->fields['host_notification_options_d']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][8] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_w', $this->fields['service_notification_options_w']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][9] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_u', $this->fields['host_notification_options_u']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][10] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_u', $this->fields['service_notification_options_u']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][11] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_r', $this->fields['host_notification_options_r']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][12] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_c', $this->fields['service_notification_options_c']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][13] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_f', $this->fields['host_notification_options_f']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][14] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_r', $this->fields['service_notification_options_r']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][15] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_s', $this->fields['host_notification_options_s']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][16] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_f', $this->fields['service_notification_options_f']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][17] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_n', $this->fields['host_notification_options_n']);
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['contact'][18] . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_n', $this->fields['service_notification_options_n']);
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
<?php

include "../../libraries/start.php";
require $dir_libraries . "form.php";
$form = new form();
require $dir_libraries . "dropdown.php";
$dropdown = new dropdown();
$id = $_GET['id'];
$sql = "SELECT * FROM pegawai WHERE id='{$id}'";
$item = $database->fetch_data($sql);
?>
  

<!DOCTYPE html>
<html lang="en">
    <head>
        <?php 
include $dir_subviews . "bs_meta.php";
?>
        <?php 
include $dir_subviews . "bs_css.php";
?>
    </head>
    
    <body>
        <?php 
include $dir_subviews . "menu.php";
?>
        <?php 
//include $dir_subviews."header.php";
?>
$grid->add_data_col('os', 'OS');
$grid->add_data_col('browser', 'Browser');
$grid->add_template_col('redirect_link', '?page=' . $_GET['page'] . '&tab=cutom&add=1&page404={db_ID}', 'Redirect');
$grid->run();
?>
<div>* Too many 404 errors? <a target="_blank" href="http://www.clogica.com/kb/too-many-404-errors.htm">click here to see why?</a></div>
<br/><br/>
<form method="POST">
<h3>Unknown 404 Links Redirection<hr></h3>	
 
<table class="cform" width="100%">
	<tr>
		<td class="labelxx">Unknown 404 Redirection Status:</td>
		<td>
		<?php 
$drop = new dropdown('p404_status');
$drop->add('Enabled', '1');
$drop->add('Disabled', '2');
$drop->dropdown_print();
$drop->select($options['p404_status']);
?>
		</td>
	</tr>
	<tr>
	<td  class="labelxx">
	Redirect Unknown 404 Pages to:
	</td>
	<td>
	<input type="text" name="redirect_to" id="redirect_to" size="30" value="<?php 
echo $options['p404_redirect_to'];
?>
示例#4
0
$groups = array("Lecturers", "Students", "Guest");
for ($i = 0; $i < count($groups); $i++) {
    $groupDropdown->addOption($groups[$i], $groups[$i]);
}
$groupDropdown->setSelected($group);
$table->addCell($label2->show() . $groupDropdown->show() . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $label->show() . $courseDropdown->show());
$table->endRow();
//Ehb-added-End
$table->startRow();
$orderLabel = new label($this->objLanguage->languageText('mod_contextgroups_orderresultsby', 'contextgroups') . ': ', 'input_order');
$searchdropdown->name = 'order';
$searchdropdown->cssId = 'input_order';
$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();
示例#5
0
$objTable->startRow();
$objTable->addCell($objLabel->show());
$objTable->addCell($closeField);
$objTable->endRow();
/*
  $objElement = new checkbox('studentsonly', '', true);  // this will checked
  $check = $objElement->show();
  $objTable->addRow(array(
  $userOptLabel,
  $check
  )); */
$objContextModules = $this->getObject('dbcontextmodules', 'context');
$objModules = $this->getObject('modules', 'modulecatalogue');
$contextModules = $objContextModules->getContextModules($contextCode);
$plugins = $objModules->getListContextPlugins();
$dropDown = new dropdown('moduleid');
//$dropDown->addOption('all','All');
foreach ($plugins as $plugin) {
    $dropDown->addOption($plugin['module_id'], $plugin['title']);
}
if ($action == 'showuseractivitybymodule') {
    $objTable->addRow(array('<b>' . $selectModuleLabel . '</b>', $dropDown->show()));
}
$saveLabel = "View";
$objButton = new button('save', $saveLabel);
$objButton->setToSubmit();
$btnSave = $objButton->show();
$objForm = new form('showuseractivity', $this->uri(array('action' => $action)));
$objForm->addToForm($objTable->show());
$objForm->addToForm($btnSave);
echo $objForm->show();
 function showForm($items_id, $options = array())
 {
     if ($items_id == '-1') {
         $items_id = '';
     }
     $this->initForm($items_id, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . " :</td>";
     echo "<td>";
     echo "<input type='text' name='name' value='" . $this->fields["name"] . "' size='30'/>";
     echo "</td>";
     echo "<td>" . __('Check definition', 'monitoring') . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::show("PluginMonitoringCheck", array('name' => 'plugin_monitoring_checks_id', 'value' => $this->fields['plugin_monitoring_checks_id']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . _n('Comment', 'Comments', 2) . "&nbsp;: </td>";
     echo "<td>";
     echo "<textarea cols='45' rows='2' name='comment'>" . $this->fields["comment"] . "</textarea>";
     echo "</td>";
     echo "<td>" . __('Check period', 'monitoring') . "&nbsp;:</td>";
     echo "<td>";
     dropdown::show("Calendar", array('name' => 'calendars_id', 'value' => $this->fields['calendars_id']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan='2'></td>";
     echo "<td>" . __('Interval between 2 notifications', 'monitoring') . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::showNumber('notification_interval', array('value' => $this->fields['notification_interval'], 'min' => 0, 'max' => 2880, 'unit' => 'minute(s)'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan='2'></td>";
     echo "<td>" . __('Business priority level', 'monitoring') . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::showNumber('business_priority', array('value' => $this->fields['business_priority'], 'min' => 1, 'max' => 5));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan='2'></td>";
     echo "<td>" . __('Services catalog template ?', 'monitoring') . "&nbsp;:</td>";
     echo "<td>";
     if (PluginMonitoringServicescatalog::canUpdate()) {
         Dropdown::showYesNo('is_generic', $this->fields['is_generic']);
     } else {
         echo Dropdown::getYesNo($this->fields['is_generic']);
     }
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
 /**
  *
  * Method to return a customised input to the sysconfig form
  * 
  * @access public
  * @return string $string The html string to be displayed in sysconfig 
  */
 public function show()
 {
     $string = $this->objLanguage->languageText('mod_jquerycore_selectversion', 'jquerycore', 'ERROR: mod_jquerycore_selectversion');
     $objDrop = new dropdown('pvalue');
     foreach ($this->coreVersions as $version) {
         $objDrop->addOption($version, $version);
     }
     $objDrop->setSelected($this->defaultValue);
     $string .= '&nbsp;' . $objDrop->show();
     return $string;
 }
<?php

require "../../../libraries/start.php";
require $dir_libraries . "dropdown.php";
$dropdown = new dropdown();
require $dir_libraries . "form.php";
$form = new form();
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <?php 
include $dir_subviews . "bs_meta.php";
?>
        <?php 
include $dir_subviews . "bs_css.php";
?>
    </head>
    
    <body>
        <?php 
include $dir_subviews . "menu.php";
?>
       
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <legend>FORM USER&nbsp;
                        <?php 
$form->addBtn();
?>
$header = new htmlheading();
$header->type = 3;
$header->str = ucwords($this->objLanguage->code2Txt('mod_context_importstudentsfromcontext', 'context', NULL, 'Import [-readonly-] from one [-context-] to another'));
echo $header->show();
if ($errormessages) {
    $header2 = new htmlheading();
    $header2->type = 3;
    $header2->str = $errormessages;
    echo $heade2->show();
}
$course1Dropdown = new dropdown('context1');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course1Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$course2Dropdown = new dropdown('context2');
foreach ($data as $contextCode) {
    $row = $this->objContext->getContextDetails($contextCode);
    $course2Dropdown->addOption($row['contextcode'], $row['menutext']);
}
$objTable = $this->newObject('htmltable', 'htmlelements');
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextfrom', 'context', null, '[-context-] from')) . ":");
$objTable->endRow();
$objTable->startRow();
$objTable->addCell($course1Dropdown->show());
$objTable->endRow();
$objTable->startRow();
$objTable->addCell(ucwords($this->objLanguage->code2Txt('mod_context_contextto', 'context', null, '[-context-] to')) . ":");
$objTable->endRow();
$objTable->startRow();
示例#10
0
$search2->addOption('contextcode', ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')));
$search2->setSelected($this->getParam('searchField_context'));
$div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $search2->show() . '</div>';
$table->addCell($this->objLanguage->languageText('mod_filemanager_searchfield', 'filemanager', 'Search Field'));
$table->addCell($div1 . $div2);
$searchFor = new textinput('searchfor', $this->getParam('searchfor'));
$table->addCell($this->objLanguage->languageText('mod_forum_searchfor', 'system', 'Search for'));
$table->addCell($searchFor->show());
$orderBy1 = new dropdown('orderBy_user');
$orderBy1->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage'));
$orderBy1->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage'));
$orderBy1->addOption('firstname', $this->objLanguage->languageText('phrase_firstname', 'system', 'First Name'));
$orderBy1->addOption('surname', $this->objLanguage->languageText('word_surname', 'system', 'Surname'));
$orderBy1->setSelected($this->getParam('orderBy_user'));
$div1 = '<div class="userform" style="display: ' . $userDisplay . '">' . $orderBy1->show() . '</div>';
$orderBy2 = new dropdown('orderBy_context');
$orderBy2->addOption('quotausage_desc', $this->objLanguage->languageText('mod_filemanager_mostusage', 'filemanager', 'Most Usage'));
$orderBy2->addOption('quotausage', $this->objLanguage->languageText('mod_filemanager_leastusage', 'filemanager', 'Least Usage'));
$orderBy2->addOption('title', ucwords($this->objLanguage->code2Txt('mod_context_contexttitle', 'context', NULL, '[-context-] Title')));
$orderBy2->addOption('contextcode', ucwords($this->objLanguage->code2Txt('mod_context_contextcode', 'context', NULL, '[-context-] Code')));
$orderBy2->setSelected($this->getParam('orderBy_context'));
$div2 = '<div class="contextform" style="display: ' . $contextDisplay . '">' . $orderBy2->show() . '</div>';
$table->addCell($this->objLanguage->languageText('mod_filemanager_orderby', 'filemanager', 'Order By'));
$table->addCell($div1 . $div2);
$button = new button('go', $this->objLanguage->languageText('word_go', 'system', 'Go'));
$button->setToSubmit();
$table->addCell($button->show());
$table->endRow();
$form->addToForm($table->show());
echo $form->show();
$objPagination = $this->newObject('pagination', 'navigation');
示例#11
0
<H1><?php 
echo $title . $this->lnkIcnCreate('create_condition');
?>
</H1>
<DIV><?php 
$this->loadClass('label', 'htmlelements');
$this->loadClass('dropdown', 'htmlelements');
$viewCondition = $this->getObject('viewcondition', 'decisiontable');
$viewCondition->connect($condition);
extract($viewCondition->elements());
$ddbType = new dropdown('type');
foreach ($condition->objConditionType->getAll() as $option) {
    $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';
示例#12
0
$table->addCell($passwordLabel->show(), 150, 'top', 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($password->show() . $required);
$table->endRow();
$table->startRow();
$table->addCell($confirmPasswordLabel->show(), 150, 'top', 'right');
$table->addCell('&nbsp;', 5);
$table->addCell($confirmPassword->show() . $required);
$table->endRow();
$fieldset = $this->newObject('fieldset', 'htmlelements');
$fieldset->legend = $this->objLanguage->languageText('phrase_accountdetails', 'userregistration', 'Account Details');
$fieldset->contents = $table->show();
$form->addToForm($fieldset->show());
$form->addToForm('<br />');
$table = $this->newObject('htmltable', 'htmlelements');
$titlesDropdown = new dropdown('register_title');
$titlesLabel = new label($this->objLanguage->languageText('word_title', 'system') . '&nbsp;', 'input_register_title');
$titles = array("title_mr", "title_miss", "title_mrs", "title_ms", "title_dr", "title_prof", "title_rev", "title_assocprof");
foreach ($titles as $title) {
    $_title = trim($this->objLanguage->languageText($title));
    $titlesDropdown->addOption($_title, $_title);
}
if ($mode == 'addfixup') {
    $titlesDropdown->setSelected($this->getParam('register_title'));
}
$table->startRow();
$table->addCell($titlesLabel->show(), 150, NULL, 'right');
$table->addCell($titlesDropdown->show());
$table->endRow();
$firstname = new textinput('register_firstname');
$firstnameLabel = new label($this->objLanguage->languageText('phrase_firstname', 'system', "First name") . '&nbsp;', 'input_register_firstname');
 /**
  *
  * Method to show the user selectable grades
  * 
  * @acces public
  * @return VOID 
  */
 public function showGrades()
 {
     $selectGradeLabel = $this->objLanguage->code2Txt('mod_grades_grade', 'grades', NULL, 'ERROR: mod_grades_grade');
     $selectLabel = $this->objLanguage->languageText('word_select', 'system', 'ERROR: word_select');
     $successTitleLabel = $this->objLanguage->languageText('word_success', 'system', 'ERROR: word_success');
     $successLabel = $this->objLanguage->code2Txt('mod_userdetails_gradesuccess', 'userdetails', NULL, 'ERROR: mod_userdetails_gradesuccess');
     $errorTitleLabel = $this->objLanguage->languageText('word_error', 'system', 'ERROR: word_error');
     $errorLabel = $this->objLanguage->code2Txt('mod_userdetails_gradeerror', 'userdetails', NULL, 'ERROR: mod_userdetails_gradeerror');
     $grades = $this->objDBgrades->getAll();
     $userGroups = $this->objGroups->getUserGroups($this->objUser->userId());
     $name = NULL;
     if (!empty($userGroups)) {
         foreach ($userGroups as $group) {
             foreach ($grades as $grade) {
                 if ($group['group_define_name'] == $grade['name']) {
                     $name = $grade['name'];
                     break;
                     break;
                 }
             }
         }
     }
     $objDrop = new dropdown('new_name');
     $objDrop->addFromDB($grades, 'name', 'name');
     $objDrop->setSelected($name);
     $gradeDrop = $objDrop->show();
     $objInput = new textinput('old_name', $name, 'hidden', '50');
     $nameInput = $objInput->show();
     $objButton = new button('select', $selectLabel);
     $objButton->setId('grade_select');
     $selectButton = $objButton->show();
     $objTable = new htmltable();
     $objTable->cellpadding = '4';
     $objTable->startRow();
     $objTable->addCell('<b>' . ucfirst(strtolower($selectGradeLabel)) . ': </b>', '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($nameInput . $gradeDrop, '', '', '', '', '', '');
     $objTable->endRow();
     $objTable->startRow();
     $objTable->addCell($selectButton, '', '', '', '', '', '');
     $objTable->endRow();
     $gradeTable = $objTable->show();
     $objForm = new form('user', $this->uri(array('action' => 'change_grade')));
     $objForm->extra = ' enctype="multipart/form-data"';
     $objForm->addToForm($gradeTable);
     $gradeForm = $objForm->show();
     $string = $gradeForm;
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_success');
     $this->objDialog->setTitle(ucwords($successTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="success">' . $successLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog = $this->objDialog->show();
     $this->objDialog = $this->newObject('dialog', 'jquerycore');
     $this->objDialog->setCssId('dialog_grade_error');
     $this->objDialog->setTitle(ucwords($errorTitleLabel));
     $this->objDialog->setCloseOnEscape(FALSE);
     $this->objDialog->setContent('<span class="error">' . $errorLabel . '</span>');
     $this->objDialog->setAutoOpen(FALSE);
     $this->objDialog->setOpen("jQuery('.ui-dialog-titlebar-close').hide();");
     $dialog .= $this->objDialog->show();
     return $string . $dialog;
 }
示例#14
0
<?php

require "fs_folders/php_functions/connect.php";
require "fs_folders/php_functions/function.php";
require "fs_folders/php_functions/myclass.php";
require "fs_folders/php_functions/library.php";
require "fs_folders/php_functions/source.php";
require "fs_folders/dropdown/dropdown_php_file/dropdown.php";
$dd = new dropdown();
$mc = new myclass();
$mc->auto_detect_path();
// $mc->get_visitor_info( "" , "info" );
if (!empty($_GET["infp"])) {
    $infp = $_GET["infp"];
    // echo "$infp";
} else {
    $infp = "about_us";
}
$mc->get_visitor_info("", "info tab: {$infp} ", "info");
?>
 

<html>  
	<head>  
		<?php 
$mc->header_attribute(" Info | Fashion Sponge", "Fashion Sponge is the easiest & fastest way to: Show your ootd, see the latest trends, discover fashionable people & blogs, get beauty & style tips & find fashion inspiration.", "OOTD | Trends | Fashion Blogs | Beauty Tips | Fashion Inspiration ");
?>
		 
 
	 	<link rel="stylesheet" type="text/css" href="fs_folders/info/info_style_file/info_style.css"> 
		<!-- new inner script -->
示例#15
0
}
$objBizCard = $this->getObject('userbizcard', 'useradmin');
$objBizCard->setUserArray($user);
$objBizCard->showResetImage = TRUE;
$objBizCard->resetModule = $this->getParam('module');
echo $objBizCard->show();
echo '<div id="formresults"></div>';
$form = new form('updatedetails', $this->uri(array('action' => 'updateuserdetails')));
$form->addToForm($useridinput->show());
echo '<div style="width:70%; float:left; padding:5px; boorder:1px solid red;">';
echo '<h3>' . $this->objLanguage->languageText('phrase_userinformation', 'userdetails') . ':</h3>';
$table = $this->newObject('htmltable', 'htmlelements');
// Title
$table->startRow();
$label = new label($this->objLanguage->languageText('word_title', 'system'), 'input_useradmin_title');
$objDropdown = new dropdown('useradmin_title');
$titles = array("title_mr", "title_miss", "title_mrs", "title_ms", "title_dr", "title_prof", "title_rev", "title_assocprof");
foreach ($titles as $title) {
    $_title = trim($objLanguage->languageText($title));
    $objDropdown->addOption($_title, $_title);
}
if ($mode == 'addfixup') {
    $objDropdown->setSelected($this->getParam('useradmin_title'));
} else {
    $objDropdown->setSelected($user['title']);
}
$table->addCell($label->show(), 140);
$table->addCell('&nbsp;');
$table->addCell($objDropdown->show());
$table->endRow();
// Firstname
 /**
  * Display form for service configuration
  *
  * @param $items_id integer ID
  * @param $options array
  *
  *@return bool true if form is ok
  *
  **/
 function showForm($items_id, $options = array())
 {
     $pMonitoringCommand = new PluginMonitoringCommand();
     if ($items_id == '0') {
         $this->getEmpty();
     } else {
         $this->getFromDB($items_id);
     }
     $this->showFormHeader($options);
     echo "<tr>";
     echo "<td>";
     echo __('Template name') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     echo "<input type='hidden' name='is_template' value='1' />";
     $objectName = autoName($this->fields["name"], "name", 1, $this->getType());
     Html::autocompletionTextField($this, 'name', array('value' => $objectName));
     echo "</td>";
     // * commande
     echo "<td>";
     echo __('Command', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td align='center'>";
     if ($this->fields['is_template'] == '1') {
         $pMonitoringCommand->getFromDB($this->fields['plugin_monitoring_commands_id']);
         echo $pMonitoringCommand->getLink(1);
     } else {
         $pMonitoringCommand->getFromDB($this->fields['plugin_monitoring_commands_id']);
         Dropdown::show("PluginMonitoringCommand", array('name' => 'plugin_monitoring_commands_id', 'value' => $this->fields['plugin_monitoring_commands_id']));
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     // * checks
     echo "<td>" . __('Check definition', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     if ($this->fields['is_template'] == '1') {
         $pMonitoringCheck = new PluginMonitoringCheck();
         $pMonitoringCheck->getFromDB($this->fields['plugin_monitoring_checks_id']);
         echo $pMonitoringCheck->getLink(1);
     } else {
         Dropdown::show("PluginMonitoringCheck", array('name' => 'plugin_monitoring_checks_id', 'value' => $this->fields['plugin_monitoring_checks_id']));
     }
     echo "</td>";
     // * active check
     echo "<td>";
     echo __('Active checks enable', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td align='center'>";
     if ($this->fields['is_template'] == '1') {
         echo Dropdown::getYesNo($this->fields['active_checks_enabled']);
     } else {
         Dropdown::showYesNo("active_checks_enabled", $this->fields['active_checks_enabled']);
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     // * passive check
     echo "<td>";
     echo __('Passive checks enable', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td align='center'>";
     if ($this->fields['is_template'] == '1') {
         echo Dropdown::getYesNo($this->fields['passive_checks_enabled']);
     } else {
         Dropdown::showYesNo("passive_checks_enabled", $this->fields['passive_checks_enabled']);
     }
     echo "</td>";
     // * calendar
     echo "<td>" . __('Check period', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     if ($this->fields['is_template'] == '1') {
         $calendar = new Calendar();
         $calendar->getFromDB($this->fields['calendars_id']);
         echo $calendar->getLink(1);
     } else {
         dropdown::show("Calendar", array('name' => 'calendars_id', 'value' => $this->fields['calendars_id']));
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<th colspan='4'>" . __('Remote check', 'monitoring') . "</th>";
     echo "</tr>";
     echo "<tr>";
     // * remotesystem
     echo "<td>";
     echo __('Utility used for remote check', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     $input = array();
     $input[''] = '------';
     $input['byssh'] = __('By ssh', 'monitoring');
     $input['nrpe'] = 'nrpe';
     $input['nsca'] = 'nsca';
     if ($this->fields['is_template'] == '1') {
         echo $input[$this->fields['remotesystem']];
     } else {
         Dropdown::showFromArray("remotesystem", $input, array('value' => $this->fields['remotesystem']));
     }
     echo "</td>";
     // * is_argument
     echo "<td>";
     echo __('Use arguments (Only for NRPE)', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     if ($this->fields['is_template'] == '1') {
         echo Dropdown::getYesNo($this->fields['is_arguments']);
     } else {
         Dropdown::showYesNo("is_arguments", $this->fields['is_arguments']);
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     // alias command
     echo "<td>";
     echo __('Alias command if required (Only for NRPE)', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     if ($this->fields['is_template'] == '1') {
         echo "<input type='text' name='alias_commandservice' value='" . $this->fields['alias_command'] . "' />";
     } else {
         echo "<input type='text' name='alias_command' value='" . $this->fields['alias_command'] . "' />";
     }
     echo "</td>";
     echo "<td>";
     echo __('Command link (used for graphs generation)', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     if ($this->fields['is_template'] == '1') {
         $pMonitoringCommand->getFromDB($this->fields['aliasperfdata_commands_id']);
         echo $pMonitoringCommand->getLink(1);
     } else {
         $pMonitoringCommand->getFromDB($this->fields['aliasperfdata_commands_id']);
         Dropdown::show("PluginMonitoringCommand", array('name' => 'aliasperfdata_commands_id', 'value' => $this->fields['aliasperfdata_commands_id']));
     }
     echo "</td>";
     echo "</tr>";
     // * Manage arguments
     $array = array();
     $a_displayarg = array();
     if (isset($pMonitoringCommand->fields['command_line'])) {
         preg_match_all("/\\\$(ARG\\d+)\\\$/", $pMonitoringCommand->fields['command_line'], $array);
         $a_arguments = importArrayFromDB($this->fields['arguments']);
         foreach ($array[0] as $arg) {
             if (strstr($arg, "ARG")) {
                 $arg = str_replace('$', '', $arg);
                 if (!isset($a_arguments[$arg])) {
                     $a_arguments[$arg] = '';
                 }
                 $a_displayarg[$arg] = $a_arguments[$arg];
             }
         }
     }
     if (count($a_displayarg) > 0) {
         $a_argtext = importArrayFromDB($pMonitoringCommand->fields['arguments']);
         echo "<tr>";
         echo "<th colspan='4'>" . __('Arguments', 'monitoring') . "&nbsp;</th>";
         echo "</tr>";
         foreach ($a_displayarg as $key => $value) {
             echo "<tr>";
             echo "<th>" . $key . "</th>";
             echo "<td colspan='2'>";
             if (isset($a_argtext[$key])) {
                 echo nl2br($a_argtext[$key]) . "&nbsp;:";
             } else {
                 echo __('Argument', 'monitoring') . "&nbsp;:";
             }
             echo "</td>";
             echo "<td>";
             echo "<input type='text' name='arg[" . $key . "]' value='" . $value . "'/><br/>";
             echo "</td>";
             echo "</tr>";
         }
     }
     $this->showFormButtons($options);
     return true;
 }
 /**
  * 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;
 }
示例#18
0
<?php

require "navigation.html";
require_once "functions.php";
require_once "dropdown.php";
if (!isset($_SESSION["logged_in_user_id"])) {
    header("Location: login.php");
}
$dropdown = new dropdown($mysqli, $_SESSION["logged_in_user_id"]);
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
$doctor_name = "";
$procedure_name = "";
$operation_name = "";
$operation_date = "";
$operation_difficulty = "";
$d_animal_name = "";
$doctor_name_error = "";
$procedure_name_error = "";
$operation_name_error = "";
$operation_date_error = "";
$operation_difficulty_error = "";
$d_animal_name_error = "";
if (isset($_POST["docto"])) {
    if (empty($_POST["doctor_name"])) {
        $owner_name_error = "See väli on kohustuslik";
    } else {
        $doctor_name = cleanInput($_POST["doctor_name"]);
    }
 function showForm($items_id, $options = array())
 {
     global $LANG;
     if ($items_id != '' and $items_id != '-1') {
         $this->getFromDB($items_id);
     } else {
         $this->getEmpty();
     }
     $this->showTabs($options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['common'][16] . " :</td>";
     echo "<td>";
     echo "<input type='text' name='name' value='" . $this->fields["name"] . "' size='30'/>";
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['check'][0] . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::show("PluginMonitoringCheck", array('name' => 'plugin_monitoring_checks_id', 'value' => $this->fields['plugin_monitoring_checks_id']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['common'][25] . "&nbsp;: </td>";
     echo "<td>";
     echo "<textarea cols='45' rows='2' name='comment'>" . $this->fields["comment"] . "</textarea>";
     echo "</td>";
     echo "<td>" . $LANG['plugin_monitoring']['host'][9] . "&nbsp;:</td>";
     echo "<td>";
     dropdown::show("Calendar", array('name' => 'calendars_id', 'value' => $this->fields['calendars_id']));
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     $this->addDivForTabs();
     return true;
 }
 /**
  * Standard block show method. 
  */
 public function show()
 {
     try {
         $objContext = $this->getObject('dbcontext', 'context');
         $courses = $objContext->getListOfPublicContext();
         if (count($courses) == 0) {
             $msg = $this->objLanguage->code2Txt('mod_context_nocontexts', 'context');
             return "<span class='noRecordsMessage'>{$msg}</span>";
         } else {
             $form = new form('joincontext', $this->uri(array('action' => 'joincontext'), 'context'));
             $dropdown = new dropdown('contextcode');
             foreach ($courses as $course) {
                 $dropdown->addOption($course['contextcode'], $course['menutext']);
             }
             $dropdown->setSelected($objContext->getContextCode());
             $button = new button('submitform', ucwords($this->objLanguage->code2Txt('mod_context_entercourse', 'context', NULL, 'Enter [-context-]')));
             $button->setToSubmit();
             $form->addToForm($dropdown->show() . '<br />' . $button->show());
             return $form->show();
         }
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
示例#21
0
<?php

include "../../libraries/start.php";
require $dir_libraries . "form.php";
$form = new form();
require $dir_libraries . "date.php";
$date = new date();
require $dir_libraries . "dropdown.php";
$dropdown = new dropdown();
$id = $_GET['id'];
$sql = "SELECT A.*, P.nama, P.nippos FROM absensi A JOIN pegawai P ON A.pegawai_id=P.id WHERE A.id='{$id}'";
$item = $database->fetch_data($sql);
$jam_dtg1 = substr($item['jam_datang'], 0, 2);
$jam_dtg2 = substr($item['jam_datang'], 3, 2);
$jam_dtg3 = substr($item['jam_datang'], 6, 2);
$jam_plg1 = substr($item['jam_pulang'], 0, 2);
$jam_plg2 = substr($item['jam_pulang'], 3, 2);
$jam_plg3 = substr($item['jam_pulang'], 6, 2);
?>
  

<!DOCTYPE html>
<html lang="en">
    <head>
        <?php 
include $dir_subviews . "bs_meta.php";
?>
        <?php 
include $dir_subviews . "bs_css.php";
?>
    </head>
 /**
  * Display form for agent configuration
  *
  * @param $items_id integer ID 
  * @param $options array
  *
  *@return bool true if form is ok
  *
  **/
 function showForm($items_id, $options = array())
 {
     global $DB, $CFG_GLPI;
     if ($items_id == '') {
         if (isset($_POST['id'])) {
             $a_list = $this->find("`users_id`='" . $_POST['id'] . "'", '', 1);
             if (count($a_list)) {
                 $array = current($a_list);
                 $items_id = $array['id'];
             }
         }
     }
     if ($items_id != '') {
         $this->getFromDB($items_id);
     } else {
         $this->getEmpty();
     }
     $this->showFormHeader($options);
     $this->getFromDB($items_id);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "&nbsp;:</td>";
     echo "<td align='center'>";
     $objectName = autoName($this->fields["name"], "name", false, $this->getType());
     Html::autocompletionTextField($this, 'name', array('value' => $objectName));
     echo "</td>";
     echo "<td>" . __('Default template', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo("is_default", $this->fields['is_default']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='2'>" . __('Hosts', 'monitoring') . "</th>";
     echo "<th colspan='2'>" . __('Services', 'monitoring') . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notifications', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notifications_enabled', $this->fields['host_notifications_enabled']);
     echo "</td>";
     echo "<td>" . __('Notifications', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notifications_enabled', $this->fields['service_notifications_enabled']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notification command', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("PluginMonitoringNotificationcommand", array('name' => 'host_notification_commands', 'value' => $this->fields['host_notification_commands']));
     echo "</td>";
     echo "<td>" . __('Notification command', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("PluginMonitoringNotificationcommand", array('name' => 'service_notification_commands', 'value' => $this->fields['service_notification_commands']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Period', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("Calendar", array('name' => 'host_notification_period', 'value' => $this->fields['host_notification_period']));
     echo "</td>";
     echo "<td>" . __('Period', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     dropdown::show("Calendar", array('name' => 'service_notification_period', 'value' => $this->fields['service_notification_period']));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notify on DOWN host states', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_d', $this->fields['host_notification_options_d']);
     echo "</td>";
     echo "<td>" . __('Notify on WARNING service states', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_w', $this->fields['service_notification_options_w']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notify on UNREACHABLE host states', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_u', $this->fields['host_notification_options_u']);
     echo "</td>";
     echo "<td>" . __('Notify on UNKNOWN service states', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_u', $this->fields['service_notification_options_u']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notify on host recoveries (UP states)', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_r', $this->fields['host_notification_options_r']);
     echo "</td>";
     echo "<td>" . __('Notify on CRITICAL service states', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_c', $this->fields['service_notification_options_c']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Notify when the host starts and stops flapping', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_f', $this->fields['host_notification_options_f']);
     echo "</td>";
     echo "<td>" . __('Notify on service recoveries (OK states)', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_r', $this->fields['service_notification_options_r']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Send notifications when host or service scheduled downtime starts and ends', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_s', $this->fields['host_notification_options_s']);
     echo "</td>";
     echo "<td>" . __('Notify when the service starts and stops flapping', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_f', $this->fields['service_notification_options_f']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('The contact will not receive any type of host notifications', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('host_notification_options_n', $this->fields['host_notification_options_n']);
     echo "</td>";
     echo "<td>" . __('The contact will not receive any type of service notifications', 'monitoring') . "&nbsp;:</td>";
     echo "<td align='center'>";
     Dropdown::showYesNo('service_notification_options_n', $this->fields['service_notification_options_n']);
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
示例#23
0
 /**
  * Print the config form for display
  *
  * @return Nothing (display)
  **/
 function showFormDisplay()
 {
     global $CFG_GLPI;
     if (!self::canView()) {
         return false;
     }
     $canedit = Session::haveRight(self::$rightname, UPDATE);
     if ($canedit) {
         echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
     }
     echo "<div class='center' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4'>" . __('General setup') . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('URL of the application') . "</td>";
     echo "<td colspan='3'><input type='text' name='url_base' size='80' value='" . $CFG_GLPI["url_base"] . "'>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td> " . __('Text in the login box') . "</td>";
     echo "<td colspan='3'>";
     echo "<textarea cols='70' rows='4' name='text_login'>" . $CFG_GLPI["text_login"] . "</textarea>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td width='30%'> " . __('Allow FAQ anonymous access') . "</td><td  width='20%'>";
     Dropdown::showYesNo("use_public_faq", $CFG_GLPI["use_public_faq"]);
     echo "</td><td width='30%'>" . __('Simplified interface help link') . "</td>";
     echo "<td><input size='22' type='text' name='helpdesk_doc_url' value='" . $CFG_GLPI["helpdesk_doc_url"] . "'></td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Default search results limit (page)') . "</td><td>";
     Dropdown::showNumber("list_limit_max", array('value' => $CFG_GLPI["list_limit_max"], 'min' => 5, 'max' => 200, 'step' => 5));
     echo "</td><td>" . __('Standard interface help link') . "</td>";
     echo "<td><input size='22' type='text' name='central_doc_url' value='" . $CFG_GLPI["central_doc_url"] . "'></td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Default characters limit (summary text boxes)') . "</td><td>";
     Dropdown::showNumber('cut', array('value' => $CFG_GLPI["cut"], 'min' => 50, 'max' => 500, 'step' => 50));
     echo "</td><td>" . __('Default url length limit') . "</td><td>";
     Dropdown::showNumber('url_maxlength', array('value' => $CFG_GLPI["url_maxlength"], 'min' => 20, 'max' => 80, 'step' => 5));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'><td>" . __('Default decimals limit') . "</td><td>";
     Dropdown::showNumber("decimal_number", array('value' => $CFG_GLPI["decimal_number"], 'min' => 1, 'max' => 4));
     echo "</td><td>" . __('Default chart format') . "</td><td>";
     Dropdown::showFromArray("default_graphtype", array('png' => 'PNG', 'svg' => 'SVG'), array('value' => $CFG_GLPI["default_graphtype"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Translation of dropdowns") . "</td><td>";
     Dropdown::showYesNo("translate_dropdowns", $CFG_GLPI["translate_dropdowns"]);
     echo "</td>";
     echo "<td>" . __("Knowledge base translation") . "</td><td>";
     Dropdown::showYesNo("translate_kb", $CFG_GLPI["translate_kb"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td colspan='4' class='center b'>" . __('Dynamic display') . "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Page size for dropdown (paging using scroll)') . "</td><td>";
     Dropdown::showNumber('dropdown_max', array('value' => $CFG_GLPI["dropdown_max"], 'min' => 0, 'max' => 200));
     echo "</td>";
     echo "<td>" . __('Autocompletion of text fields') . "</td><td>";
     Dropdown::showYesNo("use_ajax_autocompletion", $CFG_GLPI["use_ajax_autocompletion"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Don't show search engine in dropdowns if the number of items is less than") . "</td><td>";
     Dropdown::showNumber('ajax_limit_count', array('value' => $CFG_GLPI["ajax_limit_count"], 'min' => 1, 'max' => 200, 'step' => 1, 'toadd' => array(0 => __('Never'))));
     echo "<td colspan='2'></td>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td colspan='4' class='center b'>" . __('Search engine') . "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Items seen') . "</td><td>";
     $values = array(0 => __('No'), 1 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('last criterion')), 2 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('default criterion')));
     Dropdown::showFromArray('allow_search_view', $values, array('value' => $CFG_GLPI['allow_search_view']));
     echo "</td><td>" . __('Global search') . "</td><td>";
     if ($CFG_GLPI['allow_search_view']) {
         Dropdown::showYesNo('allow_search_global', $CFG_GLPI['allow_search_global']);
     } else {
         echo Dropdown::getYesNo(0);
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('All') . "</td><td>";
     $values = array(0 => __('No'), 1 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('last criterion')));
     Dropdown::showFromArray('allow_search_all', $values, array('value' => $CFG_GLPI['allow_search_all']));
     echo "</td><td colspan='2'></td></tr>";
     echo "<tr class='tab_bg_1'><td colspan='4' class='center b'>" . __('Item locks') . "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Use locks') . "</td><td>";
     Dropdown::showYesNo("lock_use_lock_item", $CFG_GLPI["lock_use_lock_item"]);
     echo "</td><td>" . __('Profile to be used when locking items') . "</td><td>";
     if ($CFG_GLPI["lock_use_lock_item"]) {
         Profile::dropdown(array('name' => 'lock_lockprofile_id', 'display_emptychoice' => true, 'value' => $CFG_GLPI['lock_lockprofile_id']));
     } else {
         echo dropdown::getDropdownName(Profile::getTable(), $CFG_GLPI['lock_lockprofile_id']);
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('List of items to lock') . "</td>";
     echo "<td  colspan=3>";
     Dropdown::showFromArray('lock_item_list', ObjectLock::getLockableObjects(), array('values' => $CFG_GLPI['lock_item_list'], 'width' => '100%', 'multiple' => true, 'readonly' => !$CFG_GLPI["lock_use_lock_item"]));
     echo "</td></tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_2'>";
         echo "<td colspan='4' class='center'>";
         echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">";
         echo "</td></tr>";
     }
     echo "</table></div>";
     Html::closeForm();
 }
示例#24
0
<?php

require "../../../libraries/start.php";
require $dir_libraries . "dropdown.php";
$dropdown = new dropdown();
require $dir_libraries . "date.php";
$date = new date();
require $dir_libraries . "form.php";
$form = new form();
$id = $_GET['id'];
$sql = "SELECT * FROM anggota WHERE id='{$id}'";
$item = $database->fetch_data($sql);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <?php 
include $dir_subviews . "bs_meta.php";
?>
        <?php 
include $dir_subviews . "bs_css.php";
?>
    </head>
    
    <body>
        <?php 
include $dir_subviews . "menu.php";
?>
       
        <div class="container-fluid">
            <div class="row-fluid">
Session::checkCentralAccess();
// Make a select box
if ($_POST['items_id'] && $_POST['itemtype'] && class_exists($_POST['itemtype'])) {
    $devicetype = $_POST['itemtype'];
    $linktype = $devicetype::getItem_DeviceType();
    if (count($linktype::getSpecificities())) {
        $name_field = "CONCAT_WS(' - ', `" . implode('`, `', array_keys($linktype::getSpecificities())) . "`)";
    } else {
        $name_field = "`id`";
    }
    $query = "SELECT `id`, {$name_field} AS name\n             FROM `" . $linktype::getTable() . "`\n             WHERE `" . $devicetype::getForeignKeyField() . "` = '" . $_POST['items_id'] . "'\n                    AND `itemtype` = ''";
    $result = $DB->request($query);
    echo "<table width='100%'><tr><td>" . __('Choose an existing device') . "</td><td rowspan='2'>" . __('and/or') . "</td><td>" . __('Add new devices') . '</td></tr>';
    echo "<tr><td>";
    if ($result->numrows() == 0) {
        echo __('No unaffected device !');
    } else {
        $devices = array();
        foreach ($result as $row) {
            $name = $row['name'];
            if (empty($name)) {
                $name = $row['id'];
            }
            $devices[$row['id']] = $name;
        }
        dropdown::showFromArray($linktype::getForeignKeyField(), $devices, array('multiple' => true));
    }
    echo "</td><td>";
    Dropdown::showNumber('new_devices', array('min' => 0, 'max' => 10));
    echo "</td></tr></table>";
}
示例#26
0
   function showForm($items_id, $options=array(), $services_id='') {
      $pMonitoringCommand = new PluginMonitoringCommand();
      $pMonitoringServicedef = new PluginMonitoringServicedef();

      if (isset($_GET['withtemplate']) AND ($_GET['withtemplate'] == '1')) {
         $options['withtemplate'] = 1;
      } else {
         $options['withtemplate'] = 0;
      }

      if ($services_id!='') {
         $this->getEmpty();
      } else {
         $this->getFromDB($items_id);
      }
      $this->showTabs($options);
      $this->showFormHeader($options);
      if (!isset($this->fields['plugin_monitoring_servicedefs_id'])
              OR empty($this->fields['plugin_monitoring_servicedefs_id'])) {
         $pMonitoringServicedef->getEmpty();
      } else {
         $pMonitoringServicedef->getFromDB($this->fields['plugin_monitoring_servicedefs_id']);
      }
      $template = false;


      echo "<tr>";
      echo "<td>";
      if ($services_id!='') {
         echo "<input type='hidden' name='plugin_monitoring_services_id' value='".$services_id."' />";
      }
      echo __('Name')."&nbsp;:";
      echo "</td>";
      echo "<td>";
      $objectName = autoName($this->fields["name"], "name", ($template === "newcomp"),
                             $this->getType());
      Html::autocompletionTextField($this, 'name', array('value' => $objectName));
      echo "</td>";
      echo "<td>";
      echo __('Template')."&nbsp;:";
      echo "</td>";
      echo "<td>";
      if ($items_id != '0') {
         echo "<input type='hidden' name='update' value='update'>\n";
      }
      echo "<input type='hidden' name='plugin_monitoring_servicedefs_id_s' value='".$this->fields['plugin_monitoring_servicedefs_id']."'>\n";
      if ($pMonitoringServicedef->fields['is_template'] == '0') {
         $this->fields['plugin_monitoring_servicedefs_id'] = 0;
      }
      Dropdown::show("PluginMonitoringServicetemplate", array(
            'name' => 'plugin_monitoring_servicetemplates_id',
            'value' => $this->fields['plugin_monitoring_servicetemplates_id'],
            'auto_submit' => true
      ));
      echo "</td>";
      echo "<td>";
      if ($this->fields["items_id"] == '') {

      } else {
         echo "<input type='hidden' name='items_id' value='".$this->fields["items_id"]."'>\n";
         echo "<input type='hidden' name='itemtype' value='".$this->fields["itemtype"]."'>\n";
      }
      echo "</td>";
      echo "</tr>";

      echo "<tr>";
      echo "<th colspan='4'>&nbsp;</th>";
      echo "</tr>";

      echo "<tr>";
      // * itemtype link
      if ($this->fields['itemtype'] != '') {
         $itemtype = $this->fields['itemtype'];
         $item = new $itemtype();
         $item->getFromDB($this->fields['items_id']);
         echo "<td>";
         echo __('Item Type')." <i>".$item->getTypeName()."</i>";
         echo "&nbsp;:</td>";
         echo "<td>";
         echo $item->getLink(1);
         echo "</td>";
      } else {
         echo "<td colspan='2' align='center'>";
         echo __('No type associated', 'monitoring');
         echo "</td>";
      }
      // * command
      echo "<td>";
      echo __('Command', 'monitoring')."&nbsp;:";
      echo "</td>";
      echo "<td align='center'>";
      if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
         $pMonitoringServicetemplate = new PluginMonitoringServicetemplate();
         $pMonitoringServicetemplate->getFromDB($this->fields['plugin_monitoring_servicetemplates_id']);
         $pMonitoringCommand->getFromDB($pMonitoringServicetemplate->fields['plugin_monitoring_commands_id']);
         echo $pMonitoringCommand->getLink(1);
      } else {
         $pMonitoringCommand->getFromDB($pMonitoringServicedef->fields['plugin_monitoring_commands_id']);
         Dropdown::show("PluginMonitoringCommand", array(
                              'name' =>'plugin_monitoring_commands_id',
                              'value'=>$pMonitoringServicedef->fields['plugin_monitoring_commands_id']
                              ));
      }
      echo "</td>";
      echo "</tr>";

      echo "<tr>";
      // * checks
      echo "<td>".__('Check definition', 'monitoring')."&nbsp;:</td>";
      echo "<td align='center'>";
      if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
         $pMonitoringCheck = new PluginMonitoringCheck();
         $pMonitoringCheck->getFromDB($pMonitoringServicetemplate->fields['plugin_monitoring_checks_id']);
         echo $pMonitoringCheck->getLink(1);
      } else {
         Dropdown::show("PluginMonitoringCheck",
                        array('name'=>'plugin_monitoring_checks_id',
                              'value'=>$pMonitoringServicedef->fields['plugin_monitoring_checks_id']));
      }
      echo "</td>";
      // * active check
      echo "<td>";
      echo __('Active check', 'monitoring')."&nbsp;:";
      echo "</td>";
      echo "<td align='center'>";
      if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
         echo Dropdown::getYesNo($pMonitoringServicetemplate->fields['active_checks_enabled']);
      } else {
         Dropdown::showYesNo("active_checks_enabled", $pMonitoringServicedef->fields['active_checks_enabled']);
      }
      echo "</td>";
      echo "</tr>";

      echo "<tr>";
      // * passive check
      echo "<td>";
      echo __('Passive check', 'monitoring')."&nbsp;:";
      echo "</td>";
      echo "<td align='center'>";
      if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
         echo Dropdown::getYesNo($pMonitoringServicetemplate->fields['passive_checks_enabled']);
      } else {
         Dropdown::showYesNo("passive_checks_enabled", $pMonitoringServicedef->fields['passive_checks_enabled']);
      }
      echo "</td>";
      // * calendar
      echo "<td>".__('Check period', 'monitoring')."&nbsp;:</td>";
      echo "<td align='center'>";
      if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
         $calendar = new Calendar();
         $calendar->getFromDB($pMonitoringServicetemplate->fields['calendars_id']);
         echo $calendar->getLink(1);
      } else {
         dropdown::show("Calendar", array('name'=>'calendars_id',
                                 'value'=>$pMonitoringServicedef->fields['calendars_id']));
      }
      echo "</td>";
      echo "</tr>";

      if (!($this->fields['plugin_monitoring_servicetemplates_id'] > 0
              AND $pMonitoringServicetemplate->fields['remotesystem'] == '')) {

         echo "<tr>";
         echo "<th colspan='4'>".__('Remote check', 'monitoring')."</th>";
         echo "</tr>";

         echo "<tr>";
         // * remotesystem
         echo "<td>";
         echo __('Utility used for remote check', 'monitoring')."&nbsp;:";
         echo "</td>";
         echo "<td>";
         $input = array();
         $input[''] = '------';
         $input['byssh'] = 'byssh';
         $input['nrpe'] = 'nrpe';
         $input['nsca'] = 'nsca';
         if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
            echo $input[$pMonitoringServicetemplate->fields['remotesystem']];
         } else {
            Dropdown::showFromArray("remotesystem",
                                 $input,
                                 array('value'=>$pMonitoringServicedef->fields['remotesystem']));
         }
         echo "</td>";
         // * is_argument
         echo "<td>";
         echo __('Use arguments (NRPE only)', 'monitoring')."&nbsp;:";
         echo "</td>";
         echo "<td>";
         if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
            echo Dropdown::getYesNo($pMonitoringServicetemplate->fields['is_arguments']);
         } else {
            Dropdown::showYesNo("is_arguments", $pMonitoringServicedef->fields['is_arguments']);
         }
         echo "</td>";
         echo "</tr>";

         echo "<tr>";
         // alias command
         echo "<td>";
         echo __('Alias command if required (NRPE only)', 'monitoring')."&nbsp;:";
         echo "</td>";
         echo "<td>";
         if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
            echo "<input type='text' name='alias_commandservice' value='".$this->fields['alias_command']."' />";
         } else {
            echo "<input type='text' name='alias_command' value='".$pMonitoringServicedef->fields['alias_command']."' />";
         }
         echo "</td>";

         echo "<td>";
         echo __('Template (for graphs generation)', 'monitoring')."&nbsp;:GHJKL";
         echo "</td>";
         echo "<td>";
         if ($this->fields['plugin_monitoring_servicetemplates_id'] > 0) {
            $pMonitoringCommand->getEmpty();
            $pMonitoringCommand->getFromDB($pMonitoringServicetemplate->fields['aliasperfdata_commands_id']);
            echo $pMonitoringCommand->getLink(1);
         } else {
            $pMonitoringCommand->getFromDB($pMonitoringServicedef->fields['aliasperfdata_commands_id']);
            Dropdown::show("PluginMonitoringCommand", array(
                                 'name' =>'aliasperfdata_commands_id',
                                 'value'=>$pMonitoringServicedef->fields['aliasperfdata_commands_id']
                                 ));
         }
         echo "</td>";
         echo "</tr>";
      }

      // * Manage arguments
      $array = array();
      $a_displayarg = array();
      if (isset($pMonitoringCommand->fields['command_line'])) {
         preg_match_all("/\\$(ARG\d+)\\$/", $pMonitoringCommand->fields['command_line'], $array);
         $a_arguments = importArrayFromDB($this->fields['arguments']);
         foreach ($array[0] as $arg) {
            if (strstr($arg, "ARG")) {
               $arg = str_replace('$', '', $arg);
               if (!isset($a_arguments[$arg])) {
                  $a_arguments[$arg] = '';
               }
               $a_displayarg[$arg] = $a_arguments[$arg];

            }
         }
      }
      if (count($a_displayarg) > 0) {
         $a_argtext = importArrayFromDB($pMonitoringCommand->fields['arguments']);
         echo "<tr>";
         echo "<th colspan='4'>".__('Argument ([text:text] is used to get values dynamically)', 'monitoring')."&nbsp;</th>";
         echo "</tr>";

         foreach ($a_displayarg as $key=>$value) {
         echo "<tr>";
         echo "<th>".$key."</th>";
         echo "<td colspan='2'>";
            if (isset($a_argtext[$key])) {
               echo nl2br($a_argtext[$key])."&nbsp;:";
            } else {
               echo __('Argument', 'monitoring')."&nbsp;:";
            }

            if ($value == '') {
               $matches = array();
               preg_match('/(\[\w+\:\w+\])/',
                              nl2br($a_argtext[$key]), $matches);
               if (isset($matches[0])) {
                  $value = $matches[0];
               }
            }

            echo "</td>";
            echo "<td>";
            echo "<input type='text' name='arg[".$key."]' value='".$value."'/><br/>";
            echo "</td>";
            echo "</tr>";
         }
      }

      $this->showFormButtons($options);
      return true;
   }
示例#27
0
?>
         </td>
         <td>
            <label for="dropdown_show_empty<?php 
echo $rand;
?>
" id="label_show_empty">
               <?php 
echo __('Show empty', 'formcreator');
?>
            </label>
         </td>
         <td>
            <div id="show_empty">
               <?php 
dropdown::showYesNo('show_empty', $question->fields['show_empty'], -1, array('rand' => $rand));
?>
            </div>
         </td>
      </tr>

      <tr class="line1" id="values_tr">
         <td>
            <label for="dropdown_default_values<?php 
echo $rand;
?>
" id="label_default_values">
               <?php 
echo __('Default values');
?>
<br />
 /**
  *
  * Render the dropdown skin chooser so that it is processed
  * by the skinselect module, for use with Ajax
  *
  * @return string Form with dropdown
  * @access public
  *
  */
 public function show()
 {
     $script = $this->uri(array('action' => 'save'), 'skinselect');
     $objNewForm = new form('selectskin', $script);
     $objDropdown = new dropdown('skinlocation');
     $objDropdown->extra = "onchange =\"document.forms['selectskin'].submit();\"";
     $skins = array();
     $curPage = $this->curPageURL();
     $objSelf = new textinput('returnUri', $curPage);
     $objSelf->fldType = "hidden";
     // Get all the skins as an array
     $dirList = $this->getAllSkins();
     // Sort the array of skins alphabetically
     asort($dirList);
     // Loop and add them to the dropdown
     foreach ($dirList as $element => $value) {
         $objDropdown->addOption($element, $value);
     }
     $objNewForm->addToForm($this->objLanguage->languageText('phrase_selectskin') . ":<br />\n");
     // Set the current skin as the default selected skin
     $objDropdown->setSelected($this->getSession('skin'));
     $objDropdown->cssClass = 'coursechooser';
     $objNewForm->addToForm($objDropdown->show());
     $objNewForm->addToForm($objSelf->show());
     return $objNewForm->show();
 }
 /**
  *
  * Method to parse the string
  * @param  String $str The string to parse
  * @return The    parsed string
  *                
  */
 public function parse($txt)
 {
     preg_match_all('/\\[LIBRARYSEARCH\\](.*)\\[\\/LIBRARYSEARCH\\]/U', $txt, $results, PREG_PATTERN_ORDER);
     preg_match_all('/\\[LIBRARYSEARCH:(.*?)\\]/', $txt, $results2, PREG_PATTERN_ORDER);
     $counter = 0;
     foreach ($results[1] as $item) {
         $objForm = new form('library_search_form', $this->uri(array('action' => 'search'), 'librarysearch'));
         $searchInput = new textinput('search_key');
         $selectCluster = new dropdown('subject_cluster');
         $selectCluster->addOption('database', 'Database');
         $selectCluster->addOption('books', 'Books');
         $selectCluster->addOption('websites', 'Websites');
         $selectCluster->selected = 'websites';
         // Submit Button
         $button = new button('submit_search', $this->objLanguage->languageText('word_search'));
         $button->setToSubmit();
         $objForm->addToForm($searchInput->show() . ' ');
         $objForm->addToForm($selectCluster->show() . ' ');
         $objForm->addToForm($button->show());
         $replacement = $objForm->show();
         $txt = str_replace($results[0][$counter], $replacement, $txt);
         $counter++;
     }
     return $txt;
 }
/**
 * Display fields for massive actions
 *
 * @param array $options Massive Actions options
 * @return bool Success
 */
function plugin_customfields_MassiveActionsFieldsDisplay($options = array())
{
    global $DB;
    $type = $options['itemtype'];
    $table = $options['options']['table'];
    $field = $options['options']['field'];
    $linkfield = $options['options']['linkfield'];
    // Get configuration of the custom field
    $query = "SELECT *\n             FROM `glpi_plugin_customfields_fields`\n             WHERE `itemtype` = '{$type}'\n                   AND `system_name` = '{$field}'";
    $result = $DB->query($query);
    if ($data = $DB->fetch_assoc($result)) {
        switch ($data['data_type']) {
            case 'dropdown':
                $dropdown_obj = new PluginCustomfieldsDropdown();
                $tmp = $dropdown_obj->find("system_name = '" . $data['system_name'] . "'");
                $dropdown = array_shift($tmp);
                Dropdown::show('PluginCustomfieldsDropdownsItem', array('condition' => $dropdown['id'] . " = plugin_customfields_dropdowns_id", 'name' => $data['system_name'], 'entity' => $_SESSION['glpiactive_entity']));
                break;
            case 'yesno':
                dropdown::showYesNo($field, 0);
                break;
            case 'date':
                Html::showDateFormItem($field, '', true, true);
                break;
            case 'money':
                echo '<input type="text" size="16" value="' . Html::formatNumber(0, true) . '" name="' . $field . '"/>';
                break;
            default:
                $item = new $type();
                Html::autocompletionTextField($item, $field);
                break;
        }
        return true;
    }
    return false;
}