本文整理汇总了PHP中AppModel::beforeAction方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::beforeAction方法的具体用法?PHP AppModel::beforeAction怎么用?PHP AppModel::beforeAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::beforeAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('general.timetable'));
$this->fields['class_id']['type'] = 'hidden';
$this->fields['class_id']['value'] = $this->Session->read('SClass.id');
}
示例2: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel($this->alias . '.title'));
$this->setVar('selectedPage', get_class($this));
$this->setVar('header', $this->Message->getLabel($this->alias . '.title'));
}
示例3: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->setVar('header', $this->Message->getLabel('ClassAssignment.title'));
$this->Navigation->addCrumb($this->Message->getLabel('ClassAssignment.title'));
$classId = $this->Session->read('SClass.id');
$this->fields['education_grade_id']['visible'] = false;
$this->fields['education_grade_id']['labelKey'] = 'AssessmentItemType';
$this->fields['visible']['type'] = 'select';
$this->fields['visible']['options'] = $this->getStatusOptions();
$this->fields['order']['type'] = 'hidden';
$this->fields['order']['value'] = 0;
$this->fields['order']['visible'] = array('edit' => true);
$this->fields['school_year_id']['type'] = 'hidden';
$this->fields['school_year_id']['value'] = $this->SClass->field('school_year_id', array('id' => $classId));
$this->fields['class_id']['type'] = 'hidden';
$this->fields['class_id']['value'] = $classId;
$gradeOptions = $this->EducationGrade->getProgrammeGradeOptions();
if ($this->action == 'add') {
$this->fields['education_grade_id']['visible'] = false;
$this->fields['visible']['type'] = 'hidden';
$this->fields['visible']['value'] = 1;
} else {
if ($this->action == 'view') {
$this->fields['education_grade_id']['visible'] = array('view' => true);
$this->fields['education_grade_id']['type'] = 'select';
$this->fields['education_grade_id']['options'] = $gradeOptions;
} else {
$this->fields['education_grade_id']['visible'] = array('edit' => true);
$this->fields['education_grade_id']['type'] = 'disabled';
$this->fields['education_grade_id']['options'] = $gradeOptions;
}
}
}
示例4: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->setVar('header', $this->Message->getLabel($this->alias . '.title'));
$this->Navigation->addCrumb($this->Message->getLabel($this->alias . '.title'));
$this->EducationGrade = $this->AssessmentItem->EducationGradesSubject->EducationGrade;
$this->EducationSubject = $this->AssessmentItem->EducationGradesSubject->EducationSubject;
}
示例5: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('admin.rcTemplates'), array('controller' => $this->params['controller'], 'action' => $this->indexPage));
$this->setVar('model', get_class($this));
$this->setVar('portletHeader', $this->Message->getLabel('admin.rcTemplates'));
$this->setVar('tabHeader', $this->Message->getLabel('admin.rcTemplates'));
$this->setVar('fields', $this->getDisplayFields());
}
示例6: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('StaffAttachment.name'));
$this->fields['staff_id']['type'] = 'hidden';
$this->fields['staff_id']['value'] = $this->Session->read('Staff.id');
$this->fields['description']['type'] = 'text';
$this->fields['file_content']['type'] = 'file_upload';
$this->setVar('tabHeader', $this->Message->getLabel('StaffAttachment.name'));
}
示例7: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('StudentBehaviour.name'));
$this->fields['student_id']['type'] = 'hidden';
$this->fields['student_id']['value'] = $this->Session->read('Student.id');
$this->fields['behaviour_category_id']['type'] = 'select';
$this->fields['behaviour_category_id']['options'] = $this->BehaviourCategory->getOptions();
$this->setFieldOrder('behaviour_category_id', 1);
$this->setVar('tabHeader', $this->Message->getLabel('StudentBehaviour.name'));
}
示例8: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('general.attachment'));
$className = $this->Session->read('SClass.data.name');
$classId = $this->Session->read('SClass.id');
$this->fields['class_id']['type'] = 'hidden';
$this->fields['class_id']['value'] = $this->Session->read('SClass.id');
$this->fields['description']['type'] = 'text';
$this->fields['file_content']['type'] = 'file_upload';
}
示例9: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('StaffEmployment.name'));
$this->fields['staff_id']['type'] = 'hidden';
$this->fields['staff_id']['value'] = $this->Session->read('Staff.id');
$this->fields['staff_employment_type_id']['type'] = 'select';
$this->fields['staff_employment_type_id']['options'] = $this->StaffEmploymentType->getOptions();
$this->setFieldOrder('staff_employment_type_id', 1);
$this->setVar('tabHeader', $this->Message->getLabel('StaffEmployment.name'));
}
示例10: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->setVar('tabHeader', $this->Message->getLabel('guardian.title'));
$this->Navigation->addCrumb($this->Message->getLabel('general.guardians'));
$this->fields['student_id']['type'] = 'hidden';
$this->fields['student_id']['value'] = $this->Session->read('Student.id');
$this->fields['security_user_id']['type'] = 'hidden';
$this->fields['relationship_category_id']['type'] = 'select';
$this->fields['relationship_category_id']['options'] = $this->RelationshipCategory->getOptions();
}
示例11: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel($this->alias . '.title'));
$this->fields['order']['visible'] = false;
$this->fields['visible']['labelKey'] = 'general';
$this->fields['visible']['type'] = 'select';
$this->fields['visible']['default'] = 1;
$this->fields['visible']['options'] = array(1 => __('Active'), 0 => __('Inactive'));
$this->setVar('selectedPage', get_class($this));
$this->setVar('header', $this->Message->getLabel($this->alias . '.title'));
}
示例12: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->setVar('tabHeader', $this->Message->getLabel($this->alias . '.name'));
$this->Navigation->addCrumb($this->Message->getLabel($this->alias . '.name'));
$this->fields['staff_id']['type'] = 'hidden';
$this->fields['staff_id']['value'] = $this->Session->read('Staff.id');
$this->fields['identity_type_id']['type'] = 'select';
$this->fields['identity_type_id']['options'] = $this->IdentityType->getOptions();
$this->fields['country_id']['type'] = 'select';
$this->fields['country_id']['options'] = $this->Country->getOptions();
}
示例13: beforeAction
function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('ClassLesson.title'));
/** EVENTUALLY MUST PUT THIS ENTIRE CHUNK IN GETFIELDS() **/
$id = $this->controller->Session->read('SClass.id');
$this->fields['class_id']['type'] = 'hidden';
$this->fields['class_id']['value'] = $this->controller->Session->read('SClass.id');
$this->fields['timetable_entry_id']['type'] = 'hidden';
$this->fields['timetable_entry_id']['value'] = 0;
$this->fields['start_date']['model'] = 'ClassLesson';
$this->fields['start_date']['visible'] = true;
$this->fields['start_date']['type'] = 'date';
$this->fields['start_time']['type'] = 'time';
$this->fields['end_time']['type'] = 'time';
$ClassGrade = ClassRegistry::init('ClassSubject');
$this->fields['education_grade_subject_id']['type'] = 'select';
$subjectByClass = $ClassGrade->getSubjectByClass($id);
$educationGradeSubjectOptions = array();
foreach ($subjectByClass as $key => $value) {
$educationGradeSubjectOptions[$value['ClassSubject']['education_grade_subject_id']] = $value['EducationSubject']['code'] . ' - ' . $value['EducationSubject']['name'];
}
$this->fields['education_grade_subject_id']['options'] = $educationGradeSubjectOptions;
$ClassTeacher = ClassRegistry::init('ClassTeacher');
$staffByClass = $ClassTeacher->getTeacherByClass($id);
$staffOptions = array();
foreach ($staffByClass as $key => $value) {
$staffOptions[$value['Staff']['id']] = $this->Message->getFullName($value);
}
$this->fields['staff_id']['type'] = 'select';
$this->fields['staff_id']['options'] = $staffOptions;
$Room = ClassRegistry::init('Room');
$roomOptions = $Room->getRoomList();
$this->fields['room_id']['type'] = 'select';
$this->fields['room_id']['options'] = $roomOptions;
$LessonStatus = ClassRegistry::init('LessonStatus');
$statusOptions = $LessonStatus->getOptions('name', 'order', 'asc', array('visible' => 1));
$this->fields['lesson_status_id']['type'] = 'select';
$this->fields['lesson_status_id']['options'] = $statusOptions;
$order = 1;
$this->setFieldOrder('start_date', $order++);
$this->setFieldOrder('start_time', $order++);
$this->setFieldOrder('end_time', $order++);
$this->setFieldOrder('education_grade_subject_id', $order++);
$this->setFieldOrder('staff_id', $order++);
$this->setFieldOrder('room_id', $order++);
$this->setFieldOrder('lesson_status_id', $order++);
}
示例14: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->Navigation->addCrumb($this->Message->getLabel('general.contacts'));
$this->fields['security_user_id']['type'] = 'hidden';
$this->fields['security_user_id']['value'] = $this->Session->read('Student.data.SecurityUser.id');
$this->fields['contact_type_id']['type'] = 'select';
$this->fields['contact_type_id']['options'] = $this->ContactType->getOptions();
$this->fields['main']['type'] = 'select';
$this->fields['main']['options'] = $this->getYesnoOptions();
$this->setFieldOrder('contact_type_id', 1);
$this->fields['contact_type_id']['labelKey'] = 'Contact';
$this->fields['name']['labelKey'] = 'Contact';
$this->fields['value']['labelKey'] = 'Contact';
$this->fields['main']['labelKey'] = 'Contact';
$this->setVar('tabHeader', $this->Message->getLabel('Contact.title'));
}
示例15: beforeAction
public function beforeAction()
{
parent::beforeAction();
$this->setVar('portletHeader', $this->Message->getLabel('EducationFee.title'));
$this->setVar('tabHeader', $this->Message->getLabel('EducationFee.title'));
$this->fields['source']['visible'] = false;
$this->fields['school_year_id']['type'] = 'hidden';
$this->fields['school_year_id']['value'] = $this->Session->read('EducationFee.school_year_id');
$this->fields['education_grade_id']['type'] = 'hidden';
$this->fields['education_grade_id']['value'] = $this->Session->read('EducationFee.education_grade_id');
$this->fields['fee_type_id']['type'] = 'select';
$this->fields['fee_type_id']['options'] = $this->FeeType->getOptions();
// for breadcrumb of internal methods after listing
$actions = array('view', 'add', 'edit');
if (in_array($this->action, $actions)) {
$this->Navigation->addCrumb($this->Session->read('EducationFee.crumbName'));
}
}