Example #1
0
if (!empty($_GET['view'])) {
    $_SESSION['view'] = $_GET['view'];
}
// 3. showing or hiding the send-to-specific-groups-or-users form
$setting_allow_individual_calendar = true;
if (empty($_POST['To']) and empty($_SESSION['allow_individual_calendar'])) {
    $_SESSION['allow_individual_calendar'] = "hide";
}
$allow_individual_calendar_status = $_SESSION['allow_individual_calendar'];
if (!empty($_POST['To']) and $allow_individual_calendar_status == "hide") {
    $_SESSION['allow_individual_calendar'] = "show";
}
if (!empty($_GET['sort']) and $allow_individual_calendar_status == "show") {
    $_SESSION['allow_individual_calendar'] = "hide";
}
$htmlHeadXtra[] = to_javascript();
// this loads the javascript that is needed for the date popup selection
$htmlHeadXtra[] = "<script src=\"calendar_tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
// setting the name of the tool
$nameTools = get_lang('GlobalAgenda');
// language variable in trad4all.inc.php
// showing the header if we are not in the learning path, if we are in
// the learning path, we do not include the banner so we have to explicitly
// include the stylesheet, which is normally done in the header
Display::display_header($nameTools, 'Agenda');
/* SETTING SOME VARIABLES */
// Variable definitions
// Defining the shorts for the days. We use camelcase because these are arrays of language variables
$DaysShort = api_get_week_days_short();
// Defining the days of the week to allow translation of the days. We use camelcase because these are arrays of language variables
$DaysLong = api_get_week_days_long();
Example #2
0
<?php 
echo to_javascript(['Platform.data' => $group]);
?>

<?php 
echo Form::open(['url' => $action, 'method' => $method, 'class' => 'form', 'ng-controller' => 'Platform.GroupController']);
?>

	<div class="form-group row">
		<div class="col-md-12">
			<label for="name">Name</label>

			<input type="text" name="name" class="form-control" placeholder="Name of the group" value="<?php 
echo $group->name;
?>
">

			<?php 
echo show_message_when('name', $errors);
?>
		</div>
	</div>

	<h4>Permissions <small>(<a href="#" ng-click="addPermission()"><i class="fa fa-plus"></i></a>)</small></h4>

	<div class="form-group row">
		<div class="col-md-6">
			<div class="input-group permissions-region" ng-repeat="permission in permissions track by $index">
				<input type="text" name="permissions[]" class="form-control" placeholder="Permission name" value="{{permission}}">
				<span ng-click="removePermission($index)" class="input-group-addon"><i class="fa fa-times"></i></span>
Example #3
0
/**
 * Show the form for adding a new agenda item. This is the same function that is used whenever we are editing an
 * agenda item. When the id parameter is empty (default behaviour), then we show an empty form, else we are editing and
 * we have to retrieve the information that is in the database and use this information in the forms.
 * @author Patrick Cool <*****@*****.**>, Ghent University
 * @param integer id, the id of the agenda item we are editing. By default this is empty which means that we are adding an
 * 		 agenda item.
 * @deprecated
 */
function show_add_form($id = '', $type = null)
{
    $htmlHeadXtra[] = to_javascript();
    $course_info = null;
    $agendaObj = new Agenda();
    // if the id is set then we are editing an agenda item
    if (!empty($id)) {
        $course_info = api_get_course_info();
        if (!empty($course_info)) {
            $agendaObj->set_course($course_info);
            $agendaObj->type = 'course';
        } else {
            if (api_is_platform_admin() && $type == 'platform') {
                $agendaObj->type = 'admin';
            } else {
                $agendaObj->type = 'personal';
            }
        }
        $agendaItem = $agendaObj->get_event($id);
        $title = $agendaItem['title'];
        $content = $agendaItem['description'];
        // start date
        if ($agendaItem['start_date'] != '0000-00-00 00:00:00') {
            $agendaItem['start_date'] = api_get_local_time($agendaItem['start_date']);
            list($datepart, $timepart) = explode(" ", $agendaItem['start_date']);
            list($year, $month, $day) = explode("-", $datepart);
            list($hours, $minutes, $seconds) = explode(":", $timepart);
        }
        // end date
        if (!empty($agendaItem['end_date']) && $agendaItem['end_date'] != '0000-00-00 00:00:00') {
            $agendaItem['end_date'] = api_get_local_time($agendaItem['end_date']);
            list($datepart, $timepart) = explode(" ", $agendaItem['end_date']);
            list($end_year, $end_month, $end_day) = explode("-", $datepart);
            list($end_hours, $end_minutes, $end_seconds) = explode(":", $timepart);
        } else {
            if ($agendaItem['all_day']) {
                $end_year = $year;
                $end_month = $month;
                $end_day = $day;
                $end_hours = $hours;
                $end_minutes = $minutes;
                $end_seconds = $seconds;
            }
        }
        // attachments
        //edit_added_resources("Agenda", $id);
        //$to = $item_2_edit['to'];
    } else {
        $to = load_edit_users(TOOL_CALENDAR_EVENT, $id);
    }
    // we start a completely new item, we do not come from the resource linker
    if (isset($_GET['originalresource']) && $_GET['originalresource'] !== "no" and $_GET['action'] == "add") {
        $_SESSION["formelements"] = null;
        unset_session_resources();
    }
    $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
    $action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : null;
    $idAttach = isset($_GET['id_attach']) ? Security::remove_XSS($_GET['id_attach']) : null;
    $course_url = empty($course_info) ? null : api_get_cidreq();
    $id = isset($id) ? intval($id) : null;
    $url = api_get_self() . '?type=' . Security::remove_XSS($type) . '&origin=' . $origin . '&' . $course_url . '&sort=asc&toolgroup=' . api_get_group_id() . '&action=' . Security::remove_XSS($_GET['action']);
    $form = new FormValidator('new_calendar_item', 'post', $url, null, array('enctype' => 'multipart/form-data'));
    $form->addElement('hidden', 'id', $id);
    $form->addElement('hidden', 'action', $action);
    $form->addElement('hidden', 'id_attach', $idAttach);
    $form->addElement('hidden', 'sort', 'asc');
    $form->addElement('hidden', 'submit_event', 'ok');
    // The form title
    if (isset($id) and $id != '') {
        $form_title = get_lang('ModifyCalendarItem');
    } else {
        $form_title = get_lang('AddCalendarItem');
    }
    $form->addElement('header', $form_title);
    $form->addElement('text', 'title', get_lang('ItemTitle'));
    // selecting the users / groups
    $group_id = api_get_group_id();
    if (empty($id)) {
        if (isset($group_id) && !empty($group_id)) {
            $form->addElement('hidden', 'selected_form[0]', "GROUP:'.{$group_id}.'");
            $form->addElement('hidden', 'To', 'true');
            //$form .= '<input type="hidden" name="selected_form[0]" value="GROUP:'.$group_id.'"/>';
            //$form .= '<input type="hidden" name="To" value="true"/>';
        } else {
            $agendaObj->show_to_form($form, $to);
        }
    }
    // start date and time
    $form->addElement('text', 'start_date', get_lang('StartDate'));
    $form->addElement('text', 'end_date', get_lang('EndDate'));
    // Repeating the calendar item
    if (empty($id)) {
        $form->addElement('label', null, '<a href="javascript://" onclick="return plus_repeated_event();"><span id="plus2">
             <img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;' . get_lang('RepeatEvent') . '</span>
            </a>');
        $form->addElement('html', '<div id="options2" style="display: none;">');
        $form->addElement('checkbox', 'repeat', get_lang('RepeatEvent'));
        $form->addElement('select', 'repeat_type', get_lang('RepeatType'), $agendaObj->getRepeatTypes());
        $form->addElement('text', 'repeat_end_day', get_lang('RepeatEnd'));
        $form->addElement('html', '</div>');
    }
    if (isset($agendaItem['all_day'])) {
        $checked = null;
        if ($agendaItem['all_day']) {
            $checked = 'checked';
        }
        $form->addElement('checkbox', 'all_day', get_lang('AllDay'));
    }
    $form->addElement('html_editor', 'content', get_lang('Description'));
    $form->addElement('checkbox', 'add_announcement', get_lang('AddAnnouncement') . '&nbsp(' . get_lang('SendMail') . ')');
    if ($agendaObj->type == 'course') {
        // File attachment
        $form->addElement('file', 'user_upload', get_lang('AddAnAttachment'));
        $form->addElement('textarea', 'file_comment', get_lang('Comment'));
        $form->add_progress_bar();
    }
    if (isset($_GET['id'])) {
        $text = get_lang('ModifyEvent');
    } else {
        $text = get_lang('AgendaAdd');
    }
    $form->addElement('button', 'submit', $text);
    return $form->return_form();
}
Example #4
0
/**
 * Show the form for adding a new agenda item. This is the same function that is used whenever we are editing an
 * agenda item. When the id parameter is empty (default behaviour), then we show an empty form, else we are editing and
 * we have to retrieve the information that is in the database and use this information in the forms.
 * @author Patrick Cool <*****@*****.**>, Ghent University
 * @param integer id, the id of the agenda item we are editing. By default this is empty which means that we are adding an
 * 		 agenda item.
 */
function show_add_form($id = '', $type = null)
{
    $showImg = Display::return_icon('div_show.gif');
    $hideImg = Display::return_icon('div_hide.gif');
    $MonthsLong = api_get_months_long();
    $htmlHeadXtra[] = to_javascript();
    // the default values for the forms
    if (!isset($_GET['originalresource'])) {
        $day = date('d');
        $month = date('m');
        $year = date('Y');
        $hours = 9;
        $minutes = '00';
        $title = null;
        $content = null;
        $repeat = false;
    } else {
        // we are coming from the resource linker so there might already have been some information in the form.
        // When we clicked on the button to add resources we stored every form information into a session and now we
        // are doing the opposite thing: getting the information out of the session and putting it into variables to
        // display it in the forms.
        $title = $form_elements['title'];
        $content = $form_elements['content'];
        $id = $form_elements['id'];
        $to = $form_elements['to'];
        $repeat = $form_elements['repeat'];
    }
    //	switching the send to all/send to groups/send to users
    if (isset($_POST['To']) && $_POST['To']) {
        $day = $_POST['fday'];
        $month = $_POST['fmonth'];
        $year = $_POST['fyear'];
        $hours = $_POST['fhour'];
        $minutes = $_POST['fminute'];
        $end_day = $_POST['end_fday'];
        $end_month = $_POST['end_fmonth'];
        $end_year = $_POST['end_fyear'];
        $end_hours = $_POST['end_fhour'];
        $end_minutes = $_POST['end_fminute'];
        $title = $_POST['title'];
        $content = $_POST['content'];
        // the invisible fields
        $action = $_POST['action'];
        $id = $_POST['id'];
        $repeat = !empty($_POST['repeat']) ? true : false;
    }
    $default_no_empty_end_date = 0;
    $course_info = null;
    // if the id is set then we are editing an agenda item
    if (!empty($id)) {
        $course_info = api_get_course_info();
        $agendaObj = new Agenda();
        if (!empty($course_info)) {
            $agendaObj->set_course($course_info);
            $agendaObj->type = 'course';
        } else {
            if (api_is_platform_admin() && $type == 'platform') {
                $agendaObj->type = 'admin';
            } else {
                $agendaObj->type = 'personal';
            }
        }
        $agendaItem = $agendaObj->get_event($id);
        $title = $agendaItem['title'];
        $content = $agendaItem['description'];
        // start date
        if ($agendaItem['start_date'] != '0000-00-00 00:00:00') {
            $agendaItem['start_date'] = api_get_local_time($agendaItem['start_date']);
            list($datepart, $timepart) = explode(" ", $agendaItem['start_date']);
            list($year, $month, $day) = explode("-", $datepart);
            list($hours, $minutes, $seconds) = explode(":", $timepart);
        }
        // end date
        if (!empty($agendaItem['end_date']) && $agendaItem['end_date'] != '0000-00-00 00:00:00') {
            $agendaItem['end_date'] = api_get_local_time($agendaItem['end_date']);
            list($datepart, $timepart) = explode(" ", $agendaItem['end_date']);
            list($end_year, $end_month, $end_day) = explode("-", $datepart);
            list($end_hours, $end_minutes, $end_seconds) = explode(":", $timepart);
        }
    } else {
        $to = load_edit_users(TOOL_CALENDAR_EVENT, $id);
    }
    $content = stripslashes($content);
    $title = stripslashes($title);
    $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
    $course_url = empty($course_info) ? null : api_get_cidreq();
    // The form title
    if (isset($id) and $id != '') {
        $form_title = get_lang('ModifyCalendarItem');
    } else {
        $form_title = get_lang('AddCalendarItem');
    }
    $url = api_get_self() . '?type=' . Security::remove_XSS($type) . '&origin=' . $origin . '&' . $course_url . "&sort=asc&toolgroup=" . api_get_group_id() . '&action=' . Security::remove_XSS($_GET['action']);
    $idAttach = isset($_REQUEST['id_attach']) ? intval($_REQUEST['id_attach']) : null;
    $form = new FormValidator('new_calendar_item', 'post', $url, array('enctype' => 'multipart/form-data'));
    $form->addElement('header', $form_title);
    $form->addElement('hidden', 'id', $id);
    $form->addElement('hidden', 'action', Security::remove_XSS($_GET['action']));
    $form->addElement('hidden', 'id_attach', $idAttach);
    $form->addElement('hidden', 'sort', 'asc');
    $form->addElement('hidden', 'submit_event', 'ok');
    $form->addElement('text', 'title', get_lang('ItemTitle'));
    // selecting the users / groups
    $group_id = api_get_group_id();
    if (empty($id)) {
        CourseManager::addUserGroupMultiSelect($form, array());
    }
    $form->addElement('datepicker', 'start_date', get_lang('StartDate'), array('form_name' => $form->getAttribute('name')));
    $form->addElement('datepicker', 'end_date', get_lang('EndDate'), array('form_name' => $form->getAttribute('name')));
    // Repeating the calendar item
    if (empty($id)) {
        $form->addElement('label', null, '
            <a href="javascript://" onclick="return plus_repeated_event();">
            <span id="plus2">
            ' . $showImg . '&nbsp;' . get_lang('RepeatEvent') . '
            </span></a>');
        $form->addElement('html', '<div id="options2" style="display:none">');
        $form->addElement('checkbox', 'repeat', null, get_lang('RepeatEvent'));
        $options = array('daily' => get_lang('RepeatDaily'), 'weekly' => get_lang('RepeatWeekly'), 'monthlyByDate' => get_lang('RepeatMonthlyByDate'), 'yearly' => get_lang('RepeatYearly'));
        $form->addElement('select', 'repeat_type', get_lang('RepeatType'), $options);
        $form->addElement('datepicker', 'repeat_end_day', get_lang('RepeatEnd'));
        $form->addElement('html', '</div>');
        if (isset($agendaItem['all_day'])) {
            $checked = null;
            if ($agendaItem['all_day']) {
                $checked = 'checked';
            }
            $form->addElement('checkbox', 'all_day', null, get_lang('AllDay'));
        }
        $form->addElement('html_editor', 'content', get_lang('Description'));
        if (isset($agendaObj) && $agendaObj->type == 'course') {
            $form->addElement('file', 'user_upload', null, get_lang('AddAnAttachment'));
            $form->addElement('text', 'file_comment', null, get_lang('Comment'));
        }
        if (isset($_GET['id'])) {
            $class = 'save';
            $text = get_lang('ModifyEvent');
        } else {
            $class = 'add';
            $text = get_lang('AgendaAdd');
        }
        $form->addElement('button', 'submit', $text);
        $form->display();
    }
}
Example #5
0
function show_add_form($id = '')
{
    global $MonthsLong;
    $htmlHeadXtra[] = to_javascript();
    // the default values for the forms
    if ($_GET['originalresource'] !== 'no') {
        $day = date('d');
        $month = date('m');
        $year = date('Y');
        $hours = 9;
        $minutes = '00';
        $end_day = date('d');
        $end_month = date('m');
        $end_year = date('Y');
        $end_hours = 17;
        $end_minutes = '00';
        $repeat = false;
    } else {
        // we are coming from the resource linker so there might already have been some information in the form.
        // When we clicked on the button to add resources we stored every form information into a session and now we
        // are doing the opposite thing: getting the information out of the session and putting it into variables to
        // display it in the forms.
        $form_elements = $_SESSION['formelements'];
        $day = $form_elements['day'];
        $month = $form_elements['month'];
        $year = $form_elements['year'];
        $hours = $form_elements['hour'];
        $minutes = $form_elements['minutes'];
        $end_day = $form_elements['end_day'];
        $end_month = $form_elements['end_month'];
        $end_year = $form_elements['end_year'];
        $end_hours = $form_elements['end_hours'];
        $end_minutes = $form_elements['end_minutes'];
        $title = $form_elements['title'];
        $content = $form_elements['content'];
        $id = $form_elements['id'];
        $to = $form_elements['to'];
        $repeat = $form_elements['repeat'];
    }
    //	switching the send to all/send to groups/send to users
    if ($_POST['To']) {
        $day = $_POST['fday'];
        $month = $_POST['fmonth'];
        $year = $_POST['fyear'];
        $hours = $_POST['fhour'];
        $minutes = $_POST['fminute'];
        $end_day = $_POST['end_fday'];
        $end_month = $_POST['end_fmonth'];
        $end_year = $_POST['end_fyear'];
        $end_hours = $_POST['end_fhour'];
        $end_minutes = $_POST['end_fminute'];
        $title = $_POST['title'];
        $content = $_POST['content'];
        // the invisible fields
        $action = $_POST['action'];
        $id = $_POST['id'];
        $repeat = !empty($_POST['repeat']) ? true : false;
    }
    // if the id is set then we are editing an agenda item
    if (is_int($id)) {
        //echo "before get_agenda_item".$_SESSION['allow_individual_calendar'];
        $item_2_edit = get_agenda_item($id);
        $title = $item_2_edit['title'];
        $content = $item_2_edit['content'];
        // start date
        $item_2_edit['start_date'] = api_get_local_time($item_2_edit['start_date']);
        // start date
        list($datepart, $timepart) = split(" ", $item_2_edit['start_date']);
        list($year, $month, $day) = explode("-", $datepart);
        list($hours, $minutes, $seconds) = explode(":", $timepart);
        // end date
        $item_2_edit['end_date'] = api_get_local_time($item_2_edit['end_date']);
        list($datepart, $timepart) = split(" ", $item_2_edit['end_date']);
        list($end_year, $end_month, $end_day) = explode("-", $datepart);
        list($end_hours, $end_minutes, $end_seconds) = explode(":", $timepart);
        // attachments
        //edit_added_resources("Agenda", $id);
        $to = $item_2_edit['to'];
        //echo "<br />after get_agenda_item".$_SESSION['allow_individual_calendar'];
    }
    $content = stripslashes($content);
    $title = stripslashes($title);
    // we start a completely new item, we do not come from the resource linker
    if ($_GET['originalresource'] !== "no" and $_GET['action'] == "add") {
        $_SESSION["formelements"] = null;
    }
    ?>

<!-- START OF THE FORM  -->
<form enctype="multipart/form-data"  action="<?php 
    echo api_get_self() . '?origin=' . Security::remove_XSS($_GET['origin']) . '&amp;action=' . Security::remove_XSS($_GET['action']);
    ?>
" method="post" name="new_calendar_item">
<input type="hidden" name="id" value="<?php 
    if (isset($id)) {
        echo $id;
    }
    ?>
" />
<input type="hidden" name="action" value="<?php 
    if (isset($_GET['action'])) {
        echo Security::remove_XSS($_GET['action']);
    }
    ?>
" />
<input type="hidden" name="sort" value="asc" />
<input type="hidden" name="submit_event" value="ok" />
<?php 
    echo '<legend>';
    echo (isset($id) and $id != '') ? get_lang('ModifyCalendarItem') : get_lang("AddCalendarItem");
    echo '<legend>';
    ?>
<table border="0" cellpadding="5" cellspacing="0" width="80%" id="newedit_form">
	<!-- START date and time -->
<tr>
<div>
<table border="0" width="100%">
				<tr><td colspan="4">
					<div id="err_date" style="display:none;color:red"></div>
					<div id="err_start_date" style="display:none;color:red"></div>
				</td></tr>
				<td width="10%">
					<!-- date: 1 -> 31 -->
					<nobr><?php 
    echo get_lang('StartDate') . ": ";
    ?>
</nobr>
				</td>
				<td width="35%">
					<select name="fday" onchange="javascript:document.new_calendar_item.end_fday.value=this.value;">
							<?php 
    // small loop for filling all the dates
    // 2do: the available dates should be those of the selected month => february is from 1 to 28 (or 29) and not to 31
    foreach (range(1, 31) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        // the current day is indicated with [] around the date
        if ($value == $day) {
            echo " <option value=\"" . $value . "\" selected> " . $i . " </option>";
        } else {
            echo "<option value=\"{$value}\">{$i}</option>";
        }
    }
    ?>
					</select>
					<!-- month: january -> december -->
					<select name="fmonth" onchange="javascript:document.new_calendar_item.end_fmonth.value=this.value;">
					<?php 
    for ($i = 1; $i <= 12; $i++) {
        // values have to have double digits
        if ($i <= 9) {
            $value = "0" . $i;
        } else {
            $value = $i;
        }
        if ($value == $month) {
            echo " <option value=\"" . $value . "\" selected>" . $MonthsLong[$i - 1] . "</option>\n";
        } else {
            echo " <option value=\"" . $value . "\">" . $MonthsLong[$i - 1] . "</option>\n";
        }
    }
    ?>
					</select>
					<select name="fyear" onchange="javascript:document.new_calendar_item.end_fyear.value=this.value;">
										<option value="<?php 
    echo $year - 1;
    ?>
"><?php 
    echo $year - 1;
    ?>
</option>
											<option value="<?php 
    echo $year;
    ?>
" selected="selected"><?php 
    echo $year;
    ?>
</option>
											<?php 
    echo "\n";
    for ($i = 1; $i <= 5; $i++) {
        $value = $year + $i;
        echo "<option value=\"{$value}\">{$value}</option>\n";
    }
    ?>
					</select>
					<a href="javascript:openCalendar('new_calendar_item','f')"><?php 
    Display::display_icon('calendar_select.gif', get_lang('Select'), array('style' => 'vertical-align: middle;'));
    ?>
</a>
					</td>
					<td width="10%">
						<nobr><?php 
    echo get_lang('StartTime') . ": \n";
    ?>
</nobr>
					</td>
					<td>
						<select name="fhour" onchange="javascript:document.new_calendar_item.end_fhour.value=this.value;">
							<!-- <option value="--">--</option> -->
							<?php 
    echo "\n";
    foreach (range(0, 23) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        // the current hour is indicated with [] around the hour
        if ($hours == $value) {
            echo "<option value=\"" . $value . "\" selected> " . $value . " </option>\n";
        } else {
            echo "<option value=\"{$value}\">{$value}</option>\n";
        }
    }
    ?>
						</select>

						<select name="fminute" onchange="javascript:document.new_calendar_item.end_fminute.value=this.value;">
							<!-- <option value="<?php 
    echo $minutes;
    ?>
"><?php 
    echo $minutes;
    ?>
</option> -->
							<!-- <option value="--">--</option> -->
							<?php 
    foreach (range(0, 59) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        if ($minutes == $value) {
            echo "<option value=\"" . $value . "\" selected> " . $value . " </option>";
        } else {
            echo "<option value=\"{$value}\">{$value}</option>";
        }
    }
    ?>
						</select>
					</td>

</div>
</tr>
			<!-- END date and time -->
<tr>
<div>
					<tr><td colspan="4"><div id="err_end_date" style="display:none;color:red"></div></td></tr>
					<td >
							<!-- date: 1 -> 31 -->
							<nobr><?php 
    echo get_lang('EndDate') . ": ";
    ?>
</nobr>
					</td>
					<td  >
						<select name="end_fday">
							<?php 
    // small loop for filling all the dates
    // 2do: the available dates should be those of the selected month => february is from 1 to 28 (or 29) and not to 31
    echo "\n";
    foreach (range(1, 31) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        // the current day is indicated with [] around the date
        if ($value == $end_day) {
            echo " <option value=\"" . $value . "\" selected> " . $i . " </option>\n";
        } else {
            echo " <option value=\"" . $value . "\">" . $i . "</option>\n";
        }
    }
    ?>
						</select>
							<!-- month: january -> december -->
						<select name="end_fmonth">
                            <?php 
    echo "\n";
    foreach (range(1, 12) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        if ($value == $end_month) {
            echo " <option value=\"" . $value . "\" selected>" . $MonthsLong[$i - 1] . "</option>\n";
        } else {
            echo " <option value=\"" . $value . "\">" . $MonthsLong[$i - 1] . "</option>\n";
        }
    }
    ?>
						</select>
						<select name="end_fyear">
                            <option value="<?php 
    echo $end_year - 1;
    ?>
"><?php 
    echo $end_year - 1;
    ?>
</option>
                            <option value="<?php 
    echo $end_year;
    ?>
" selected> <?php 
    echo $end_year;
    ?>
 </option>
                            <?php 
    echo "\n";
    for ($i = 1; $i <= 5; $i++) {
        $value = $end_year + $i;
        echo "<option value=\"{$value}\">{$value}</option>\n";
    }
    ?>
						</select>
						<a href="javascript:openCalendar('new_calendar_item', 'end_f')"><?php 
    Display::display_icon('calendar_select.gif', get_lang('Select'), array('style' => 'vertical-align: middle;'));
    ?>
</a>
					</td>
					<td >
						<nobr><?php 
    echo get_lang('EndTime') . ": \n";
    ?>
</nobr>
					</td>
					<td >
						<select name="end_fhour">
							<!-- <option value="--">--</option> -->
							<?php 
    echo "\n";
    foreach (range(0, 23) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        // the current hour is indicated with [] around the hour
        if ($end_hours == $value) {
            echo "<option value=\"" . $value . "\" selected> " . $value . " </option>\n";
        } else {
            echo "<option value=\"" . $value . "\"> " . $value . " </option>\n";
        }
    }
    ?>
						</select>

						<select name="end_fminute">
							<!-- <option value="<?php 
    echo $end_minutes;
    ?>
"><?php 
    echo $end_minutes;
    ?>
</option> -->
							<!-- <option value="--">--</option> -->
							<?php 
    foreach (range(0, 59) as $i) {
        // values have to have double digits
        $value = $i <= 9 ? '0' . $i : $i;
        if ($minutes == $value) {
            echo "<option value=\"" . $value . "\" selected> " . $value . " </option>";
        } else {
            echo "<option value=\"{$value}\">{$value}</option>";
        }
    }
    ?>
						</select>
						<br>
				</td>
</div>
</tr>
<tr><td colspan="4">
<hr noshade="noshade" color="#cccccc" />
	<div id="err_title" style="display:none;color:red"></div>
</td></tr>
<tr class="subtitle">
		<td colspan="4" valign="top"><?php 
    echo get_lang('ItemTitle');
    ?>
 :
			<!--<div style='margin-left: 80px'><textarea name="title" cols="50" rows="2" wrap="virtual" style="vertical-align:top; width:75%; height:50px;"><?php 
    if (isset($title)) {
        echo $title;
    }
    ?>
</textarea></div>-->
			<input type="text" size="60" name="title" value="<?php 
    if (isset($title)) {
        echo $title;
    }
    ?>
" />
		</td>
	</tr>

	<tr>
		<td colspan="4">

			<?php 
    require_once api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php";
    $oFCKeditor = new FCKeditor('content');
    $oFCKeditor->ToolbarSet = 'GlobalAgenda';
    $oFCKeditor->Width = '100%';
    $oFCKeditor->Height = '175';
    $oFCKeditor->Value = $content;
    $return = $oFCKeditor->CreateHtml();
    echo $return;
    ?>
		</td>
	</tr>
	<!--<?php 
    /* ADDED BY UGENT, Patrick Cool, march 2004 */
    ?>
	<tr>
		<td colspan="4">
	    <?php 
    //onclick="selectAll(this.form.elements[6],true)"
    //				show_addresource_button('onclick="selectAll(this.form.elements[6],true)"');
    ?>
		</td>
	</tr>-->
	<?php 
    //if ($_SESSION['addedresource'])
    echo "<tr>\n";
    echo "<td colspan=\"4\">\n";
    //echo display_resources(0);//--------------------------------------------------------
    $test = $_SESSION['addedresource'];
    echo "</td>\n</tr>\n";
    /* END ADDED BY UGENT, Patrick Cool, march 2004 */
    if (empty($id)) {
        ?>

    <tr>
      <td colspan="4" />
    </tr>
    <?php 
    }
    //only show repeat fields if adding, not if editing
    ?>
	<tr>
		<td colspan="4">
		<?php 
    if ($_GET['action'] == 'edit') {
        $class = 'save';
        $text = get_lang('ModifyEvent');
    } else {
        $class = 'add';
        $text = get_lang('AddEvent');
    }
    ?>
		<button type="button" class="add" value="<?php 
    echo get_lang('Ok');
    ?>
" onclick="validate_date()" ><?php 
    echo $text;
    ?>
</button>

		</td>
	</tr>
</table>
</form>
<?php 
}
Example #6
0
<?php

echo to_javascript(['Platform.data' => $menu]);
?>

<?php 
echo Form::model($menu, ['url' => $url, 'method' => $method, 'class' => 'form', 'ng-controller' => 'Platform.MenulinkController']);
?>

	<div class="form-group">
		<label for="title">Title</label>

		<?php 
echo Form::text('title', null, ['class' => 'form-control']);
?>

		<?php 
echo show_message_when('title', $errors);
?>
	</div>

	<h4>Menu Links <small>(<a href="#" ng-click="add()"><i class="fa fa-plus"></i></a>)</small></h4>

	<div class="form-group row" ng-repeat="menulink in menulinks track by $index">
		<input type="hidden" name="menulinks[{{$index}}][id]" value="{{menulink.id}}">
		<div class="col-md-3">
			<input type="text" name="menulinks[{{$index}}][title]" class="form-control" placeholder="Link title" value="{{menulink.title}}">
		</div>
		<div class="col-md-9">
			<div class="input-group">
				<input type="text" name="menulinks[{{$index}}][url]" class="form-control" placeholder="Link url (http://...)" value="{{menulink.url}}">