本文整理汇总了PHP中ilUtil::makeDateSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::makeDateSelect方法的具体用法?PHP ilUtil::makeDateSelect怎么用?PHP ilUtil::makeDateSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::makeDateSelect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __renderItem
function __renderItem($item, $level)
{
global $ilUser, $ilAccess;
include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
include_once './Services/Link/classes/class.ilLink.php';
include_once './Services/MetaData/classes/class.ilMDEducational.php';
if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) {
return false;
}
$this->lng->loadLanguageModule('meta');
$usr_planed = new ilTimingPlaned($item['ref_id'], $ilUser->getId());
for ($i = 0; $i < $level; $i++) {
$this->tpl->touchBlock('start_indent');
$this->tpl->touchBlock('end_indent');
}
if (strlen($item['description'])) {
$this->tpl->setCurrentBlock("item_description");
$this->tpl->setVariable("DESC", $item['description']);
$this->tpl->parseCurrentBlock();
}
if ($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id'])) {
$this->tpl->setCurrentBlock("tlt");
$this->tpl->setVariable("TXT_TLT", $this->lng->txt('meta_typical_learning_time'));
$this->tpl->setVariable("TLT_VAL", ilFormat::_secondsToString($tlt));
$this->tpl->parseCurrentBlock();
}
if ($ilAccess->checkAccess('read', '', $item['ref_id'])) {
$this->tpl->setCurrentBlock("title_as_link");
$this->tpl->setVariable("TITLE_LINK", ilLink::_getLink($item['ref_id'], $item['type']));
$this->tpl->setVariable("TITLE_NAME", $item['title']);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("title_plain");
$this->tpl->setVariable("TITLE", $item['title']);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("container_standard_row");
if (isset($this->invalid["{$item['ref_id']}"])) {
$this->tpl->setVariable("ROWCLASS", 'tblrowmarked');
} else {
$this->tpl->setVariable("ROWCLASS", ilUtil::switchColor($this->counter++, 'tblrow1', 'tblrow2'));
}
#$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
$this->tpl->setVariable('TYPE_IMG', ilUtil::getTypeIconPath($item['type'], $item['obj_id'], 'small'));
$this->tpl->setVariable("TYPE_ALT_IMG", $this->lng->txt('obj_' . $item['type']));
if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
$this->tpl->setVariable('SUG_START', ilDatePresentation::formatDate(new ilDate($item['suggestion_start'], IL_CAL_UNIX)));
$this->tpl->setVariable('SUG_END', ilDatePresentation::formatDate(new ilDate($item['suggestion_end'], IL_CAL_UNIX)));
}
if ($item['changeable']) {
$item_prefix = "item[" . $item['ref_id'] . ']';
if (is_array($_POST['item']["{$item['ref_id']}"]['own_start'])) {
#echo "Start post<br>";
$start = $this->__toUnix($_POST['item']["{$item['ref_id']}"]['own_start']);
} elseif ($usr_planed->getPlanedStartingTime()) {
#echo "Own start<br>";
$start = $usr_planed->getPlanedStartingTime();
} else {
#echo "Empfehlung start<br>";
$start = $item['suggestion_start'];
}
$date = $this->__prepareDateSelect($start);
$this->tpl->setVariable("OWN_START", ilUtil::makeDateSelect($item_prefix . "[own_start]", $date['y'], $date['m'], $date['d'], date('Y', time()), false));
if ($usr_planed->getPlanedEndingTime()) {
#echo "Own End<br>";
$end = $usr_planed->getPlanedEndingTime();
} else {
#echo "Empfehlung end<br>";
$end = $item['suggestion_end'];
}
$this->tpl->setVariable('OWN_END', ilDatePresentation::formatDate(new ilDate($end, IL_CAL_UNIX)));
$this->tpl->setVariable("NAME_DURATION", $item_prefix . "[duration]");
// Duration
if (isset($_POST['item']["{$item['ref_id']}"]['duration'])) {
$this->tpl->setVariable("VAL_DURATION", $_POST['item']["{$item['ref_id']}"]['duration']);
} else {
$this->tpl->setVariable("VAL_DURATION", intval(($end - $start) / (60 * 60 * 24)));
}
$this->tpl->setVariable('LIM_START', ilDatePresentation::formatDate(new ilDate($item['earliest_start'], IL_CAL_UNIX)));
$this->tpl->setVariable('LIM_END', ilDatePresentation::formatDate(new ilDate($item['latest_end'], IL_CAL_UNIX)));
}
$this->tpl->parseCurrentBlock();
if (!$_SESSION['crs_timings_user_hidden']) {
return true;
}
foreach (ilObjectActivation::getTimingsItems($item['ref_id']) as $item_data) {
$this->__renderItem($item_data, $level + 1);
}
}
示例2: render
/**
* Insert property html
*
*/
function render()
{
global $lng, $ilUser;
$tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
if (is_object($this->getDate())) {
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', 'UTC');
} else {
$date_info = array('year' => $_POST[$this->getPostVar()]['date']['y'], 'mon' => $_POST[$this->getPostVar()]['date']['m'], 'mday' => $_POST[$this->getPostVar()]['date']['d']);
}
$lng->loadLanguageModule("jscalendar");
require_once "./Services/Calendar/classes/class.ilCalendarUtil.php";
ilCalendarUtil::initJSCalendar();
if (strlen($this->getActivationPostVar())) {
$tpl->setCurrentBlock('prop_date_activation');
$tpl->setVariable('CHECK_ENABLED_DATE', $this->getActivationPostVar());
$tpl->setVariable('TXT_DATE_ENABLED', $this->activation_title);
$tpl->setVariable('CHECKED_ENABLED', $this->activation_checked ? 'checked="checked"' : '');
$tpl->setVariable('CHECKED_DISABLED', $this->getDisabled() ? 'disabled="disabled" ' : '');
$tpl->parseCurrentBlock();
}
if ($this->getShowDate()) {
$tpl->setCurrentBlock("prop_date");
$tpl->setVariable("IMG_DATE_CALENDAR", ilUtil::getImagePath("calendar.png"));
$tpl->setVariable("TXT_DATE_CALENDAR", $lng->txt("open_calendar"));
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("INPUT_FIELDS_DATE", $this->getPostVar() . "[date]");
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
$tpl->setVariable('DATE_FIRST_DAY', ilCalendarUserSettings::_getInstance()->getWeekStart());
$tpl->setVariable("DATE_SELECT", ilUtil::makeDateSelect($this->getPostVar() . "[date]", $date_info['year'], $date_info['mon'], $date_info['mday'], $this->startyear, true, array('disabled' => $this->getDisabled()), $this->getShowEmpty()));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}
示例3: render
/**
* Insert property html
*
*/
public function render()
{
global $lng, $ilUser;
$tpl = new ilTemplate("tpl.prop_datetime_duration.html", true, true, "Services/Form");
// Init start
if (is_a($this->getStart(), 'ilDate')) {
$start_info = $this->getStart()->get(IL_CAL_FKT_GETDATE, '', 'UTC');
} elseif (is_a($this->getStart(), 'ilDateTime')) {
$start_info = $this->getStart()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
} else {
$this->setStart(new ilDateTime(time(), IL_CAL_UNIX));
$start_info = $this->getStart()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
}
// display invalid input again
if (is_array($this->invalid_input['start'])) {
$start_info['year'] = $this->invalid_input['start']['y'];
$start_info['mon'] = $this->invalid_input['start']['m'];
$start_info['mday'] = $this->invalid_input['start']['d'];
}
// Init end
if (is_a($this->getEnd(), 'ilDate')) {
$end_info = $this->getEnd()->get(IL_CAL_FKT_GETDATE, '', 'UTC');
} elseif (is_a($this->getEnd(), 'ilDateTime')) {
$end_info = $this->getEnd()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
} else {
$this->setEnd(new ilDateTime(time(), IL_CAL_UNIX));
$end_info = $this->getEnd()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
}
// display invalid input again
if (is_array($this->invalid_input['end'])) {
$end_info['year'] = $this->invalid_input['end']['y'];
$end_info['mon'] = $this->invalid_input['end']['m'];
$end_info['mday'] = $this->invalid_input['end']['d'];
}
$lng->loadLanguageModule("jscalendar");
require_once "./Services/Calendar/classes/class.ilCalendarUtil.php";
ilCalendarUtil::initJSCalendar();
if (strlen($this->getActivationPostVar())) {
$tpl->setCurrentBlock('prop_date_activation');
$tpl->setVariable('CHECK_ENABLED_DATE', $this->getActivationPostVar());
$tpl->setVariable('TXT_DATE_ENABLED', $this->activation_title);
$tpl->setVariable('CHECKED_ENABLED', $this->activation_checked ? 'checked="checked"' : '');
$tpl->setVariable('CHECKED_DISABLED', $this->getDisabled() ? 'disabled="disabled" ' : '');
$tpl->parseCurrentBlock();
}
if (strlen($this->getStartText())) {
$tpl->setVariable('TXT_START', $this->getStartText());
}
if (strlen($this->getEndText())) {
$tpl->setVariable('TXT_END', $this->getEndText());
}
// Toggle fullday
if ($this->enabledToggleFullTime()) {
$tpl->setCurrentBlock('toggle_fullday');
$tpl->setVariable('FULLDAY_POSTVAR', $this->getPostVar());
$tpl->setVariable('FULLDAY_TOGGLE_NAME', $this->getPostVar() . '[fulltime]');
$tpl->setVariable('FULLDAY_TOGGLE_CHECKED', $this->toggle_fulltime_checked ? 'checked="checked"' : '');
$tpl->setVariable('FULLDAY_TOGGLE_DISABLED', $this->getDisabled() ? 'disabled="disabled"' : '');
$tpl->setVariable('TXT_TOGGLE_FULLDAY', $this->toggle_fulltime_txt);
$tpl->parseCurrentBlock();
}
$tpl->setVariable('POST_VAR', $this->getPostVar());
include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
$tpl->setVariable("IMG_START_CALENDAR", ilGlyphGUI::get(ilGlyphGUI::CALENDAR, $lng->txt("open_calendar")));
$tpl->setVariable("START_ID", $this->getPostVar());
$tpl->setVariable("DATE_ID_START", $this->getPostVar());
$tpl->setVariable("INPUT_FIELDS_START", $this->getPostVar() . "[start][date]");
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
$tpl->setVariable('DATE_FIRST_DAY', ilCalendarUserSettings::_getInstance()->getWeekStart());
$tpl->setVariable("START_SELECT", ilUtil::makeDateSelect($this->getPostVar() . "[start][date]", $start_info['year'], $start_info['mon'], $start_info['mday'], $this->getStartYear(), true, array('disabled' => $this->getDisabled(), 'select_attributes' => array('onchange' => 'ilUpdateEndDate();')), $this->getShowEmpty()));
include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
$tpl->setVariable("IMG_END_CALENDAR", ilGlyphGUI::get(ilGlyphGUI::CALENDAR, $lng->txt("open_calendar")));
$tpl->setVariable("END_ID", $this->getPostVar());
$tpl->setVariable("DATE_ID_END", $this->getPostVar());
$tpl->setVariable("INPUT_FIELDS_END", $this->getPostVar() . "[end][date]");
$tpl->setVariable("END_SELECT", ilUtil::makeDateSelect($this->getPostVar() . "[end][date]", $end_info['year'], $end_info['mon'], $end_info['mday'], $this->getStartYear(), true, array('disabled' => $this->getDisabled()), $this->getShowEmpty()));
if ($this->getShowTime()) {
$tpl->setCurrentBlock("show_start_time");
$tpl->setVariable("START_TIME_SELECT", ilUtil::makeTimeSelect($this->getPostVar() . "[start][time]", !$this->getShowSeconds(), $start_info['hours'], $start_info['minutes'], $start_info['seconds'], true, array('minute_steps' => $this->getMinuteStepSize(), 'disabled' => $this->getDisabled(), 'select_attributes' => array('onchange' => 'ilUpdateEndDate();'))));
$tpl->setVariable("TXT_START_TIME", $this->getShowSeconds() ? "(" . $lng->txt("hh_mm_ss") . ")" : "(" . $lng->txt("hh_mm") . ")");
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("show_end_time");
$tpl->setVariable("END_TIME_SELECT", ilUtil::makeTimeSelect($this->getPostVar() . "[end][time]", !$this->getShowSeconds(), $end_info['hours'], $end_info['minutes'], $end_info['seconds'], true, array('minute_steps' => $this->getMinuteStepSize(), 'disabled' => $this->getDisabled())));
$tpl->setVariable("TXT_END_TIME", $this->getShowSeconds() ? "(" . $lng->txt("hh_mm_ss") . ")" : "(" . $lng->txt("hh_mm") . ")");
$tpl->parseCurrentBlock();
}
if ($this->getShowTime()) {
$tpl->setVariable("DELIM", "<br />");
}
return $tpl->get();
}
示例4: render
/**
* Insert property html
*
*/
function render()
{
global $lng, $ilUser;
$tpl = new ilTemplate("tpl.prop_datetime.html", true, true, "Services/Form");
$lng->loadLanguageModule("jscalendar");
require_once "./Services/Calendar/classes/class.ilCalendarUtil.php";
ilCalendarUtil::initJSCalendar();
if (strlen($this->getActivationPostVar())) {
$tpl->setCurrentBlock('prop_date_activation');
$tpl->setVariable('CHECK_ENABLED_DATE', $this->getActivationPostVar());
$tpl->setVariable('TXT_DATE_ENABLED', $this->activation_title);
$tpl->setVariable('CHECKED_ENABLED', $this->activation_checked ? 'checked="checked"' : '');
$tpl->setVariable('CHECKED_DISABLED', $this->getDisabled() ? 'disabled="disabled" ' : '');
$tpl->parseCurrentBlock();
}
if ($this->getMode() == self::MODE_SELECT) {
if (is_a($this->getDate(), 'ilDate')) {
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', 'UTC');
} elseif (is_a($this->getDate(), 'ilDateTime')) {
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
} else {
$this->setDate(new ilDateTime(time(), IL_CAL_UNIX));
$date_info = $this->getDate()->get(IL_CAL_FKT_GETDATE, '', $ilUser->getTimeZone());
}
// display invalid input again
if (is_array($this->invalid_input)) {
$date_info['year'] = $this->invalid_input['y'];
$date_info['mon'] = $this->invalid_input['m'];
$date_info['mday'] = $this->invalid_input['d'];
}
}
if ($this->getMode() == self::MODE_SELECT) {
$tpl->setCurrentBlock("prop_date_input_select_setup");
$tpl->setVariable("INPUT_FIELDS_DATE", $this->getPostVar() . "[date]");
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date");
$tpl->setVariable("DATE_SELECT", ilUtil::makeDateSelect($this->getPostVar() . "[date]", $date_info['year'], $date_info['mon'], $date_info['mday'], $this->startyear, true, array('disabled' => $this->getDisabled()), $this->getShowEmpty()));
} else {
$value = $this->getDate();
if ($value) {
$value = substr($this->getDate()->get(IL_CAL_DATETIME), 0, 10);
$day = substr($value, 8, 2);
$month = substr($value, 5, 2);
$year = substr($value, 0, 4);
}
switch ($ilUser->getDateFormat()) {
case ilCalendarSettings::DATE_FORMAT_DMY:
if ($value) {
$value = date("d.m.Y", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%d.%m.%Y";
$input_hint = $lng->txt("dd_mm_yyyy");
break;
case ilCalendarSettings::DATE_FORMAT_YMD:
if ($value) {
$value = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%Y-%m-%d";
$input_hint = $lng->txt("yyyy_mm_dd");
break;
case ilCalendarSettings::DATE_FORMAT_MDY:
if ($value) {
$value = date("m/d/Y", mktime(0, 0, 0, $month, $day, $year));
}
$format = "%m/%d/%Y";
$input_hint = $lng->txt("mm_dd_yyyy");
break;
}
$tpl->setCurrentBlock("prop_date_input_field");
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("DATE_VALUE", $value);
$tpl->setVariable("DISABLED", $this->getDisabled() ? " disabled=\"disabled\"" : "");
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date_input_field_info");
$tpl->setVariable("TXT_INPUT_FORMAT", $input_hint);
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_date_input_field_setup");
$tpl->setVariable("DATE_ID", $this->getPostVar());
$tpl->setVariable("DATE_FIELD_FORMAT", $format);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("prop_date");
include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
$tpl->setVariable("IMG_DATE_CALENDAR", ilGlyphGUI::get(ilGlyphGUI::CALENDAR, $lng->txt("open_calendar")));
$tpl->setVariable("DATE_ID", $this->getPostVar());
include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
$tpl->setVariable('DATE_FIRST_DAY', ilCalendarUserSettings::_getInstance()->getWeekStart());
$tpl->parseCurrentBlock();
if ($this->getShowTime()) {
if ($this->getMode() == self::MODE_INPUT) {
$value = $this->getDate();
if ($value) {
if (!$this->getShowSeconds()) {
$value = substr($value->get(IL_CAL_DATETIME), 11, 5);
if ($ilUser->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_12) {
$value = date("g:ia", mktime(substr($value, 0, 2), substr($value, 3, 2)));
//.........这里部分代码省略.........
示例5: editRoleAccessLimitations
function editRoleAccessLimitations()
{
global $lng, $ilAccess, $ilErr, $rbacreview;
if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
$ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
}
$this->__initRoleAccessLimitations();
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.reg_role_access_limitations.html', 'Services/Registration');
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_REG_ROLE_ACCESS_LIMITATIONS", $lng->txt('reg_role_access_limitations'));
$this->tpl->setVariable("TXT_ROLE", $lng->txt('obj_role'));
$this->tpl->setVariable("TXT_ACCESS_LIMITATION_MODE", $lng->txt('reg_access_limitation_mode'));
$this->tpl->setVariable("BTN_SAVE", $lng->txt('save'));
$this->tpl->setVariable("BTN_CANCEL", $lng->txt('cancel'));
$counter = 0;
include_once './Services/AccessControl/classes/class.ilObjRole.php';
foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
$this->tpl->setCurrentBlock("roles");
$this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
$this->tpl->setVariable("ROLE_ID", $role['id']);
$this->tpl->setVariable("ROLE_TITLE", $role['title']);
$this->tpl->setVariable("SEL_ACCESS_LIMITATION", $this->__buildAccessLimitationSelection($role['id']));
$this->tpl->setVariable("CSS_DISPLAY_ABSOLUTE", $this->access_limitations_obj->getMode($role['id']) == 'absolute' ? 'inline' : 'none');
$this->tpl->setVariable("CSS_DISPLAY_RELATIVE", $this->access_limitations_obj->getMode($role['id']) == 'relative' ? 'inline' : 'none');
$this->tpl->setVariable("CSS_DISPLAY_UNLIMITED", $this->access_limitations_obj->getMode($role['id']) == 'unlimited' ? 'inline' : 'none');
$this->tpl->setVariable("TXT_ACCESS_LIMITATION_UNLIMITED", $lng->txt('reg_access_limitation_none'));
$date = $this->__prepareDateSelect($this->access_limitations_obj->getAbsolute($role['id']));
$this->tpl->setVariable("SEL_ACCESS_LIMITATION_ABSOLUTE", ilUtil::makeDateSelect('access_limitation_absolute_' . $role['id'], $date['y'], $date['m'], $date['d'], '2007'));
$this->tpl->setVariable("TXT_DAYS", $lng->txt('days'));
$this->tpl->setVariable("TXT_MONTHS", $lng->txt('months'));
$this->tpl->setVariable("TXT_YEARS", $lng->txt('years'));
$this->tpl->setVariable("DAYS", $this->access_limitations_obj->getRelative($role['id'], 'd'));
$this->tpl->setVariable("MONTHS", $this->access_limitations_obj->getRelative($role['id'], 'm'));
$this->tpl->setVariable("YEARS", $this->access_limitations_obj->getRelative($role['id'], 'y'));
$this->tpl->parseCurrentBlock();
}
}