本文整理汇总了PHP中DateField::set_default_config方法的典型用法代码示例。如果您正苦于以下问题:PHP DateField::set_default_config方法的具体用法?PHP DateField::set_default_config怎么用?PHP DateField::set_default_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateField
的用法示例。
在下文中一共展示了DateField::set_default_config方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
DateField::set_default_config('showcalendar', true);
$f = new FieldList(new DateField('StartDate', _t('CalendarDateTime.STARTDATE', 'Start date')), new DateField('EndDate', _t('CalendarDateTime.ENDDATE', 'End date')), new TimeField('StartTime', _t('CalendarDateTime.STARTTIME', 'Start time')), new TimeField('EndTime', _t('CalendarDateTime.ENDTIME', 'End time')), new CheckboxField('AllDay', _t('CalendarDateTime.ALLDAY', 'This event lasts all day')));
$this->extend('updateCMSFields', $f);
return $f;
}
示例2: getCMSFields
public function getCMSFields()
{
DateField::set_default_config('showcalendar', true);
$f = new FieldList(new DateField('ExceptionDate', _t('CalendarDateTime.EXCEPTIONDATE', 'Exception Date')));
$this->extend('updateCMSFields', $f);
return $f;
}
示例3: addtaskForm
public function addtaskForm()
{
$project = Project::get()->map('ID', 'Title');
DateField::set_default_config('showcalendar', true);
DateField::set_default_config('dateformat', 'dd/MM/YYYY');
$fields = new FieldList(new DropDownField('ProjectID', 'Project', $project), new TextField('Title'), new TextAreaField('Description'), new DropDownField("Status", "Status", singleton('Task')->dbObject('Status')->enumValues()), new DateField('DueDate', 'Due Date'), new NumericField('OriginalHourEstimate', 'Est. in Hours'));
$actions = new FieldList(new FormAction('dotaskadd', 'Submit'));
return new Form($this, 'addtaskForm', $fields, $actions);
}
示例4: addWorkForm
public function addWorkForm()
{
$project = Task::get()->map('ID', 'Title');
DateField::set_default_config('showcalendar', true);
DateField::set_default_config('dateformat', 'dd/MM/YYYY');
$fields = new FieldList(new DropDownField('TaskID', 'Project', $project), new TextField('Title'), new DropDownField("Status", "Status", singleton('Task')->dbObject('Status')->enumValues()), new DateField('Date', 'Date'), new NumericField('HourSpent', 'Time Spent in Hours'));
$actions = new FieldList(new FormAction('doworkadd', 'Submit'));
return new Form($this, 'addWorkForm', $fields, $actions);
}
示例5: editTaskForm
function editTaskForm()
{
$task = $this->getTask();
DateField::set_default_config('showcalendar', true);
DateField::set_default_config('dateformat', 'dd/MM/YYYY');
$fields = new FieldList(new HiddenField('ID', 'aID'), new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formleft'>"), new TextField('Title'), new DateField('DueDate', 'Due Date'), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formright'>"), new TextAreaField('Description', 'Description'), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formleft'>"), new LiteralField("LiteralField", "<div class='checkboxes'>"), new OptionSetField('Status', 'Status', singleton('Task')->dbObject('Status')->enumValues()), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"));
$actions = new FieldList(new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formright'>"), new FormAction("dosave", "Save"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"));
$form = new Form($this, 'editTaskForm', $fields, $actions);
$Params = $this->getURLParams();
if (is_numeric($Params['ID']) && ($edittask = DataObject::get_by_id('Task', $Params['ID']))) {
$form->loadDataFrom($edittask->data());
}
return $form;
}
示例6: addTaskForm
public function addTaskForm()
{
$theproj = $this->getProjectID();
DateField::set_default_config('showcalendar', true);
DateField::set_default_config('dateformat', 'dd/MM/YYYY');
$fields = new FieldList(new LiteralField("LiteralField", "<h3>Add a Task</h3>"), new HiddenField('ProjectID', '', $theproj), new LiteralField("LiteralField", "<table class='standard'>"), new LiteralField("LiteralField", "<thead>"), new LiteralField("LiteralField", "<tr>"), new LiteralField("LiteralField", "<th class='form450'>Title</th>"), new LiteralField("LiteralField", "<th class='form90'>Due Date</th>"), new LiteralField("LiteralField", "<th class='form450'>Description</th>"), new LiteralField("LiteralField", "<th class='form90'>Hours Est.</th>"), new LiteralField("LiteralField", "<th> </th>"), new LiteralField("LiteralField", "</tr>"), new LiteralField("LiteralField", "</thead>"), new LiteralField("LiteralField", "<tbody>"), new LiteralField("LiteralField", "<tr>"), new LiteralField("LiteralField", "<td>"), new TextField('Title', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td>"), new DateField('DueDate', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td>"), new TextAreaField('Description', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td class='hours'>"), new NumericField('OriginalHourEstimate', '', '0'), new LiteralField("LiteralField", "</td>"));
$actions = new FieldList(new LiteralField("LiteralField", "<td>"), new FormAction('doTaskadd', 'Submit'), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "</tr>"), new LiteralField("LiteralField", "<tbody>"), new LiteralField("LiteralField", "</table>"));
return new Form($this, 'addTaskForm', $fields, $actions);
}